diff --git a/src/views/modules/sys/role-add-or-update.vue b/src/views/modules/sys/role-add-or-update.vue index 6c83925..7c9a8a1 100644 --- a/src/views/modules/sys/role-add-or-update.vue +++ b/src/views/modules/sys/role-add-or-update.vue @@ -6,12 +6,11 @@ @@ -27,12 +26,10 @@ - + - + - + - + + + + + + + + + + + + + { if (this.dataForm.id) { @@ -164,6 +194,15 @@ export default { this.deptList = res.data }).catch(() => { }) }, + // 获取吹哨部门列表 + getWhistleDeptList () { + return this.$http.get('/sys/dept/list').then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } + this.whistleDeptList = res.data + }).catch(() => { }) + }, // 获取App菜单列表 getAppMenuList () { return this.$http.get('/sys/appmenu/select').then(({ data: res }) => { @@ -173,6 +212,15 @@ export default { this.appMenuList = res.data }).catch(() => { }) }, + // 获取项目处理类型授权 + getCategoryList () { + return this.$http.get('/events/handlecategory/getCategoryList').then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } + this.categoryList = res.data + }).catch(() => { }) + }, getAnalysisMenuList () { return this.$http.get('/sys/analysismenu/select').then(({ data: res }) => { if (res.code !== 0) { @@ -194,7 +242,9 @@ export default { this.dataForm.menuIdList.forEach(item => this.$refs.menuListTree.setChecked(item, true)) this.$refs.deptListTree.setCheckedKeys(this.dataForm.deptIdList) 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.$refs.whistleDeptListTree.setCheckedKeys(this.dataForm.whistleDeptIdList) }).catch(() => { }) }, // 表单提交 @@ -212,10 +262,15 @@ export default { ...this.$refs.appMenuListTree.getCheckedKeys(), ...this.$refs.appMenuListTree.getHalfCheckedKeys() ] + this.dataForm.categoryIdList = [ + ...this.$refs.categoryListTree.getCheckedKeys(), + ...this.$refs.categoryListTree.getHalfCheckedKeys() + ] this.dataForm.analysisMenuIdList = [ ...this.$refs.analysisMenuListTree.getCheckedKeys(), ...this.$refs.analysisMenuListTree.getHalfCheckedKeys() ] + this.dataForm.whistleDeptIdList = this.$refs.whistleDeptListTree.getCheckedKeys() this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/role', this.dataForm).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) @@ -243,8 +298,15 @@ export default { } } -