From 8b19ecdb7b8f688e88d680262edbb00908e531b0 Mon Sep 17 00:00:00 2001
From: lct123456 <lucht>
Date: 星期二, 19 四月 2022 20:36:58 +0800
Subject: [PATCH] 巡检任务细节
---
src/views/systemManage/roleManage/index.vue | 36 ++++++++++++++++++++++++++++++------
1 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/src/views/systemManage/roleManage/index.vue b/src/views/systemManage/roleManage/index.vue
index cadc1be..c425921 100644
--- a/src/views/systemManage/roleManage/index.vue
+++ b/src/views/systemManage/roleManage/index.vue
@@ -313,14 +313,15 @@
}
})
},
- sethasMenuTree(roleId) {
+ async sethasMenuTree(roleId) {
const _this = this
+ _this.defaultCheckKeys = []
_this.checkStrictly=true
const params = {}
params['roleId'] = roleId;
- getRole(params).then(response => {
- const res = response.data
- if (res.code == 200) {
+ let response = await getRole(params)
+ const res = response.data
+ if (res.code === '200') {
const hasMenuTree = res.result
if (hasMenuTree && hasMenuTree.length > 0) {
const checkKeys = []
@@ -328,15 +329,38 @@
checkKeys.push(menu.id)
}
_this.defaultCheckKeys = checkKeys
+ setTimeout( ()=>{
+ this.$refs.menuTree.setCheckedKeys(checkKeys)
+ })
} else {
_this.defaultCheckKeys = []
}
- _this.checkStrictly=false
+ _this.checkStrictly=true
} else {
parseError({ error: res.message, vm: _this })
_this.checkStrictly=false
}
- })
+ // getRole(params).then(response => {
+ // const res = response.data
+ // if (res.code == 200) {
+ // debugger
+ // const hasMenuTree = res.result
+ // if (hasMenuTree && hasMenuTree.length > 0) {
+ // const checkKeys = []
+ // for (const menu of hasMenuTree) {
+ // checkKeys.push(menu.id)
+ // }
+ // _this.defaultCheckKeys = checkKeys
+ // } else {
+ // _this.defaultCheckKeys = []
+ // }
+ // _this.checkStrictly=false
+ // } else {
+ // parseError({ error: res.message, vm: _this })
+ // _this.checkStrictly=false
+ // }
+ // })
+ console.log(_this.defaultCheckKeys);
},
cancelPermEdit() {
this.permModalVisible = false
--
Gitblit v1.9.2