Browse Source

内容管理角色权限开发

origin/feature/monitoring
Jackwang 4 years ago
parent
commit
84caf7f7b8
  1. 1
      src/i18n/zh-CN.js
  2. 31
      src/views/modules/sys/role-add-or-update.vue

1
src/i18n/zh-CN.js

@ -372,6 +372,7 @@ t.role.analysisMenuList = '数据端菜单授权'
t.role.appMenuList = '工作端菜单授权'
t.role.categoryList = '项目处理类型授权'
t.role.whistleDeptList = '吹哨部门授权'
t.role.moduleList = '内容栏目授权'
t.user = {}
t.user.username = '用户名'

31
src/views/modules/sys/role-add-or-update.vue

@ -102,6 +102,18 @@
</el-tree>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item size="mini"
:label="$t('role.moduleList')">
<el-tree :data="moduleList"
:props="{ label: 'label', children: 'children' }"
node-key="value"
ref="moduleListTree"
accordion
show-checkbox>
</el-tree>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template slot="footer">
@ -125,6 +137,7 @@ export default {
categoryList: [],
roleTypeList: [],
analysisMenuList: [],
moduleList: [],
dataForm: {
id: '',
name: '',
@ -134,6 +147,7 @@ export default {
categoryIdList: [],
whistleDeptIdList: [],
analysisMenuIdList: [],
moduleMenuIdList: [],
remark: '',
typeKey: ''
}
@ -162,10 +176,12 @@ export default {
this.$refs.categoryListTree.setCheckedKeys([])
this.$refs.whistleDeptListTree.setCheckedKeys([])
this.$refs.analysisMenuListTree.setCheckedKeys([])
this.$refs.moduleListTree.setCheckedKeys([])
Promise.all([
this.getMenuList(),
this.getDeptList(),
this.getAppMenuList(),
this.getModuleList(),
this.getCategoryList()
// this.getWhistleDeptList()
// this.getAnalysisMenuList()
@ -215,6 +231,15 @@ export default {
this.analysisMenuList = res.data.analysisMenu
}).catch(() => { })
},
//
getModuleList () {
return this.$http.get('/news/moduletype/getAllModuleList').then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.moduleList = res.data.moduleOptions
}).catch(() => { })
},
//
getCategoryList () {
return this.$http.get('/events/handlecategory/getCategoryList').then(({ data: res }) => {
@ -247,6 +272,8 @@ export default {
this.dataForm.appMenuIdList.forEach(item => this.$refs.appMenuListTree.setChecked(item, true))
this.dataForm.categoryIdList.forEach(item => this.$refs.categoryListTree.setChecked(item, true))
this.dataForm.analysisMenuIdList.forEach(item => this.$refs.analysisMenuListTree.setChecked(item, true))
this.dataForm.moduleMenuIdList.forEach(item => this.$refs.moduleListTree.setChecked(item, true))
this.$refs.whistleDeptListTree.setCheckedKeys(this.dataForm.whistleDeptIdList)
}).catch(() => { })
},
@ -273,6 +300,10 @@ export default {
...this.$refs.analysisMenuListTree.getCheckedKeys(),
...this.$refs.analysisMenuListTree.getHalfCheckedKeys()
]
this.dataForm.moduleMenuIdList = [
...this.$refs.moduleListTree.getCheckedKeys(),
...this.$refs.moduleListTree.getHalfCheckedKeys()
]
this.dataForm.whistleDeptIdList = this.$refs.whistleDeptListTree.getCheckedKeys()
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/role/v2', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {

Loading…
Cancel
Save