Your Name
2022-04-08 1f2a259f8cbb7eb0b12d12895116c309eb8cd609
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