docs: update readme
Signed-off-by: yovinchen <gzh298255@gmail.com> Signed-off-by: YoVinchen <gzh298255@gmail.com>
This commit is contained in:
parent
e73f313786
commit
16a23785e4
41
src/api/process/processTemplate.js
Normal file
41
src/api/process/processTemplate.js
Normal file
@ -0,0 +1,41 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
const api_name = '/admin/process/processTemplate'
|
||||
|
||||
export default {
|
||||
|
||||
getPageList(page, limit) {
|
||||
return request({
|
||||
url: `${api_name}/${page}/${limit}`,
|
||||
method: 'get'
|
||||
})
|
||||
},
|
||||
getById(id) {
|
||||
return request({
|
||||
url: `${api_name}/get/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
},
|
||||
|
||||
save(role) {
|
||||
return request({
|
||||
url: `${api_name}/save`,
|
||||
method: 'post',
|
||||
data: role
|
||||
})
|
||||
},
|
||||
|
||||
updateById(role) {
|
||||
return request({
|
||||
url: `${api_name}/update`,
|
||||
method: 'put',
|
||||
data: role
|
||||
})
|
||||
},
|
||||
removeById(id) {
|
||||
return request({
|
||||
url: `${api_name}/remove/${id}`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
}
|
39
src/api/process/processType.js
Normal file
39
src/api/process/processType.js
Normal file
@ -0,0 +1,39 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
const api_name = '/admin/process/processType'
|
||||
|
||||
export default {
|
||||
|
||||
getPageList(page, limit) {
|
||||
return request({
|
||||
url: `${api_name}/${page}/${limit}`,
|
||||
method: 'get'
|
||||
})
|
||||
},
|
||||
getById(id) {
|
||||
return request({
|
||||
url: `${api_name}/get/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
},
|
||||
save(role) {
|
||||
return request({
|
||||
url: `${api_name}/save`,
|
||||
method: 'post',
|
||||
data: role
|
||||
})
|
||||
},
|
||||
updateById(role) {
|
||||
return request({
|
||||
url: `${api_name}/update`,
|
||||
method: 'put',
|
||||
data: role
|
||||
})
|
||||
},
|
||||
removeById(id) {
|
||||
return request({
|
||||
url: `${api_name}/remove/${id}`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
}
|
@ -23,7 +23,7 @@ export default {
|
||||
removeById(id) {
|
||||
return request({
|
||||
url: `${api_name}/remove/${id}`,
|
||||
method: "delete"
|
||||
method: 'delete'
|
||||
})
|
||||
},
|
||||
|
||||
@ -33,7 +33,7 @@ export default {
|
||||
save(sysMenu) {
|
||||
return request({
|
||||
url: `${api_name}/save`,
|
||||
method: "post",
|
||||
method: 'post',
|
||||
data: sysMenu
|
||||
})
|
||||
},
|
||||
@ -44,7 +44,7 @@ export default {
|
||||
updateById(sysMenu) {
|
||||
return request({
|
||||
url: `${api_name}/update`,
|
||||
method: "put",
|
||||
method: 'put',
|
||||
data: sysMenu
|
||||
})
|
||||
},
|
||||
@ -65,7 +65,7 @@ export default {
|
||||
doAssign(assginMenuVo) {
|
||||
return request({
|
||||
url: `${api_name}/doAssign`,
|
||||
method: "post",
|
||||
method: 'post',
|
||||
data: assginMenuVo
|
||||
})
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import 'nprogress/nprogress.css' // 水平进度条样式
|
||||
import getPageTitle from '@/utils/get-page-title' // 获取应用头部标题的函数
|
||||
import Layout from '@/layout'
|
||||
import ParentView from '@/components/ParentView'
|
||||
|
||||
const _import = require('./router/_import_' + process.env.NODE_ENV) // 获取组件的方法
|
||||
|
||||
NProgress.configure({ showSpinner: false }) // NProgress Configuration
|
||||
@ -37,7 +38,7 @@ router.beforeEach(async(to, from, next) => {
|
||||
const menus = filterAsyncRouter(store.getters.menus)// 1.过滤路由
|
||||
console.log(menus)
|
||||
router.addRoutes(menus) // 2.动态添加路由
|
||||
let lastRou = [{ path: '*', redirect: '/404', hidden: true }]
|
||||
const lastRou = [{ path: '*', redirect: '/404', hidden: true }]
|
||||
router.addRoutes(lastRou)
|
||||
global.antRouter = menus // 3.将路由数据传递给全局变量,做侧边栏菜单渲染工作
|
||||
next({
|
||||
@ -81,7 +82,6 @@ function filterAsyncRouter(asyncRouterMap) {
|
||||
try {
|
||||
route.component = _import(route.component)// 导入组件
|
||||
} catch (error) {
|
||||
debugger
|
||||
console.log(error)
|
||||
route.component = _import('dashboard/index')// 导入组件
|
||||
}
|
||||
|
143
src/views/processSet/processTemplate/list.vue
Normal file
143
src/views/processSet/processTemplate/list.vue
Normal file
@ -0,0 +1,143 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 工具条 -->
|
||||
<div class="tools-div">
|
||||
<el-button
|
||||
:disabled="$hasBP('bnt.processTemplate.templateSet') === false"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
type="success"
|
||||
@click="add()"
|
||||
>添加审批设置
|
||||
</el-button>
|
||||
</div>
|
||||
<!-- 列表 -->
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="list"
|
||||
border
|
||||
stripe
|
||||
style="width: 100%;margin-top: 10px;"
|
||||
>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="序号"
|
||||
width="70"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ (page - 1) * limit + scope.$index + 1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
iconPath
|
||||
<el-table-column label="审批名称" prop="name" />
|
||||
<el-table-column label="图标">
|
||||
<template slot-scope="scope">
|
||||
<img :src="scope.row.iconUrl" style="width: 30px;height: 30px;vertical-align: text-bottom;">
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审批类型" prop="processTypeName" />
|
||||
<el-table-column label="描述" prop="description" />
|
||||
<el-table-column label="创建时间" prop="createTime" />
|
||||
<el-table-column label="更新时间" prop="updateTime" />
|
||||
<el-table-column align="center" label="操作" width="250">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
:disabled="$hasBP('bnt.processTemplate.templateSet') === false"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="edit(scope.row.id)"
|
||||
>修改审批设置
|
||||
</el-button>
|
||||
<el-button
|
||||
:disabled="$hasBP('bnt.processTemplate.remove') === false"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="removeDataById(scope.row.id)"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页组件 -->
|
||||
<el-pagination
|
||||
:current-page="page"
|
||||
:page-size="limit"
|
||||
:page-sizes="[5, 10, 20, 30, 40, 50, 100]"
|
||||
:total="total"
|
||||
layout="sizes, prev, pager, next, jumper, ->, total, slot"
|
||||
style="padding: 30px 0; text-align: center;"
|
||||
@current-change="fetchData"
|
||||
@size-change="changeSize"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import api from '@/api/process/processTemplate'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
listLoading: true, // 数据是否正在加载
|
||||
list: null, // banner列表
|
||||
total: 0, // 数据库中的总记录数
|
||||
page: 1, // 默认页码
|
||||
limit: 10, // 每页记录数
|
||||
searchObj: {} // 查询表单对象
|
||||
}
|
||||
},
|
||||
// 生命周期函数:内存准备完毕,页面尚未渲染
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
// 生命周期函数:内存准备完毕,页面渲染成功
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
// 当页码发生改变的时候
|
||||
changeSize(size) {
|
||||
this.limit = size
|
||||
this.fetchData(1)
|
||||
},
|
||||
// 加载banner列表数据
|
||||
fetchData(page = 1) {
|
||||
// 异步获取远程数据(ajax)
|
||||
this.page = page
|
||||
api.getPageList(this.page, this.limit, this.searchObj).then(
|
||||
response => {
|
||||
this.list = response.data.records
|
||||
this.total = response.data.total
|
||||
// 数据加载并绑定成功
|
||||
this.listLoading = false
|
||||
}
|
||||
)
|
||||
},
|
||||
// 重置查询表单
|
||||
resetData() {
|
||||
this.searchObj = {}
|
||||
this.fetchData()
|
||||
},
|
||||
// 根据id删除数据
|
||||
removeDataById(id) {
|
||||
this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => { // promise
|
||||
// 点击确定,远程调用ajax
|
||||
return api.removeById(id)
|
||||
}).then((response) => {
|
||||
this.fetchData(this.page)
|
||||
this.$message.success(response.message)
|
||||
}).catch(() => {
|
||||
this.$message.info('取消删除')
|
||||
})
|
||||
},
|
||||
add() {
|
||||
this.$router.push('/processSet/templateSet')
|
||||
},
|
||||
edit(id) {
|
||||
this.$router.push('/processSet/templateSet?id=' + id)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
192
src/views/processSet/processType/list.vue
Normal file
192
src/views/processSet/processType/list.vue
Normal file
@ -0,0 +1,192 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 工具条 -->
|
||||
<div class="tools-div">
|
||||
<el-button
|
||||
:disabled="$hasBP('bnt.processType.add') === false"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
type="success"
|
||||
@click="add"
|
||||
>添 加
|
||||
</el-button>
|
||||
</div>
|
||||
<!-- banner列表 -->
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="list"
|
||||
border
|
||||
stripe
|
||||
style="width: 100%;margin-top: 10px;"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="序号"
|
||||
width="70"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ (page - 1) * limit + scope.$index + 1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类型名称" prop="name" />
|
||||
<el-table-column label="描述" prop="description" />
|
||||
<el-table-column label="创建时间" prop="createTime" />
|
||||
<el-table-column label="更新时间" prop="updateTime" />
|
||||
<el-table-column align="center" label="操作" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
:disabled="$hasBP('bnt.processType.update') === false"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="edit(scope.row.id)"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
:disabled="$hasBP('bnt.processType.remove') === false"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="removeDataById(scope.row.id)"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页组件 -->
|
||||
<el-pagination
|
||||
:current-page="page"
|
||||
:page-size="limit"
|
||||
:page-sizes="[5, 10, 20, 30, 40, 50, 100]"
|
||||
:total="total"
|
||||
layout="sizes, prev, pager, next, jumper, ->, total, slot"
|
||||
style="padding: 30px 0; text-align: center;"
|
||||
@current-change="fetchData"
|
||||
@size-change="changeSize"
|
||||
/>
|
||||
<el-dialog :visible.sync="dialogVisible" title="添加/修改" width="40%">
|
||||
<el-form ref="flashPromotionForm" label-width="150px" size="small" style="padding-right: 40px;">
|
||||
<el-form-item label="类型名称">
|
||||
<el-input v-model="processType.name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="描述">
|
||||
<el-input v-model="processType.description" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button size="small" type="primary" @click="saveOrUpdate()">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import api from '@/api/process/processType'
|
||||
|
||||
const defaultForm = {
|
||||
id: '',
|
||||
name: '',
|
||||
description: ''
|
||||
}
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
listLoading: true, // 数据是否正在加载
|
||||
list: null, // banner列表
|
||||
total: 0, // 数据库中的总记录数
|
||||
page: 1, // 默认页码
|
||||
limit: 10, // 每页记录数
|
||||
searchObj: {}, // 查询表单对象
|
||||
dialogVisible: false,
|
||||
processType: defaultForm,
|
||||
saveBtnDisabled: false
|
||||
}
|
||||
},
|
||||
// 生命周期函数:内存准备完毕,页面尚未渲染
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
// 生命周期函数:内存准备完毕,页面渲染成功
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
// 当页码发生改变的时候
|
||||
changeSize(size) {
|
||||
console.log(size)
|
||||
this.limit = size
|
||||
this.fetchData(1)
|
||||
},
|
||||
// 加载列表数据
|
||||
fetchData(page = 1) {
|
||||
this.page = page
|
||||
api.getPageList(this.page, this.limit, this.searchObj).then(response => {
|
||||
this.list = response.data.records
|
||||
this.total = response.data.total
|
||||
// 数据加载并绑定成功
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
// 重置查询表单
|
||||
resetData() {
|
||||
console.log('重置查询表单')
|
||||
this.searchObj = {}
|
||||
this.fetchData()
|
||||
},
|
||||
// 根据id删除数据
|
||||
removeDataById(id) {
|
||||
this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => { // promise
|
||||
// 点击确定,远程调用ajax
|
||||
return api.removeById(id)
|
||||
}).then((response) => {
|
||||
this.fetchData(this.page)
|
||||
this.$message.success(response.message)
|
||||
}).catch(() => {
|
||||
this.$message.info('取消删除')
|
||||
})
|
||||
},
|
||||
add() {
|
||||
this.dialogVisible = true
|
||||
this.processType = Object.assign({}, defaultForm)
|
||||
},
|
||||
edit(id) {
|
||||
this.dialogVisible = true
|
||||
this.fetchDataById(id)
|
||||
},
|
||||
fetchDataById(id) {
|
||||
api.getById(id).then(response => {
|
||||
this.processType = response.data
|
||||
})
|
||||
},
|
||||
saveOrUpdate() {
|
||||
this.saveBtnDisabled = true // 防止表单重复提交
|
||||
if (!this.processType.id) {
|
||||
this.saveData()
|
||||
} else {
|
||||
this.updateData()
|
||||
}
|
||||
},
|
||||
// 新增
|
||||
saveData() {
|
||||
api.save(this.processType).then(response => {
|
||||
this.$message.success(response.message || '操作成功')
|
||||
this.dialogVisible = false
|
||||
this.fetchData(this.page)
|
||||
})
|
||||
},
|
||||
// 根据id更新记录
|
||||
updateData() {
|
||||
api.updateById(this.processType).then(response => {
|
||||
this.$message.success(response.message || '操作成功')
|
||||
this.dialogVisible = false
|
||||
this.fetchData(this.page)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -248,7 +248,6 @@ export default {
|
||||
|
||||
// 根据id删除数据
|
||||
removeDataById(id) {
|
||||
// debugger
|
||||
this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
@ -269,7 +268,6 @@ export default {
|
||||
|
||||
// -------------
|
||||
add(row) {
|
||||
debugger
|
||||
this.typeDisabled = false
|
||||
this.dialogTitle = '添加下级节点'
|
||||
this.dialogVisible = true
|
||||
@ -300,7 +298,6 @@ export default {
|
||||
},
|
||||
|
||||
edit(row) {
|
||||
debugger
|
||||
this.dialogTitle = '修改节点'
|
||||
this.dialogVisible = true
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
授权角色:{{ $route.query.roleName }}
|
||||
</div>
|
||||
<el-tree
|
||||
style="margin: 20px 0"
|
||||
ref="tree"
|
||||
style="margin: 20px 0"
|
||||
:data="sysMenuList"
|
||||
node-key="id"
|
||||
show-checkbox
|
||||
@ -14,14 +14,14 @@
|
||||
/>
|
||||
<div style="padding: 20px 20px;">
|
||||
<el-button :loading="loading" type="primary" icon="el-icon-check" size="mini" @click="save">保存</el-button>
|
||||
<el-button @click="$router.push('/system/sysRole')" size="mini" icon="el-icon-refresh-right">返回</el-button>
|
||||
<el-button icon="el-icon-refresh-right" size="mini" @click="$router.push('/system/sysRole')">返回</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import api from '@/api/system/sysMenu'
|
||||
export default {
|
||||
name: 'roleAuth',
|
||||
name: 'RoleAuth',
|
||||
|
||||
data() {
|
||||
return {
|
||||
@ -30,8 +30,8 @@ export default {
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
@ -71,14 +71,13 @@ export default {
|
||||
保存权限列表
|
||||
*/
|
||||
save() {
|
||||
debugger
|
||||
// 获取到当前子节点
|
||||
// const checkedNodes = this.$refs.tree.getCheckedNodes()
|
||||
// 获取到当前子节点及父节点
|
||||
const allCheckedNodes = this.$refs.tree.getCheckedNodes(false, true);
|
||||
let idList = allCheckedNodes.map(node => node.id);
|
||||
const allCheckedNodes = this.$refs.tree.getCheckedNodes(false, true)
|
||||
const idList = allCheckedNodes.map(node => node.id)
|
||||
console.log(idList)
|
||||
let assginMenuVo = {
|
||||
const assginMenuVo = {
|
||||
roleId: this.$route.query.id,
|
||||
menuIdList: idList
|
||||
}
|
||||
@ -86,9 +85,9 @@ export default {
|
||||
api.doAssign(assginMenuVo).then(result => {
|
||||
this.loading = false
|
||||
this.$message.success(result.$message || '分配权限成功')
|
||||
this.$router.push('/system/sysRole');
|
||||
this.$router.push('/system/sysRole')
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
@ -220,7 +220,6 @@ export default {
|
||||
},
|
||||
// 根据id删除数据
|
||||
removeDataById(id) {
|
||||
// debugger
|
||||
this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
|
@ -230,11 +230,10 @@ export default {
|
||||
|
||||
// 加载banner列表数据
|
||||
fetchData(page = 1) {
|
||||
debugger
|
||||
this.page = page
|
||||
console.log('翻页。。。' + this.page)
|
||||
|
||||
if (this.createTimes && this.createTimes.length == 2) {
|
||||
if (this.createTimes && this.createTimes.length === 2) {
|
||||
this.searchObj.createTimeBegin = this.createTimes[0]
|
||||
this.searchObj.createTimeEnd = this.createTimes[1]
|
||||
}
|
||||
@ -261,7 +260,6 @@ export default {
|
||||
|
||||
// 根据id删除数据
|
||||
removeDataById(id) {
|
||||
// debugger
|
||||
this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
|
Loading…
Reference in New Issue
Block a user