|
@@ -41,7 +41,7 @@
|
|
|
</el-input>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="newRole-content-left-bottom">
|
|
|
+ <div v-loading="loading1" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)" class="newRole-content-left-bottom">
|
|
|
<el-scrollbar ref="scroll" style="height: 100%">
|
|
|
<div class="newRole-content-left-bottom-tree">
|
|
|
<el-tree ref="tree" show-checkbox :data="treeData" :props="defaultProps" highlight-current :filter-node-method="filterNode" default-expand-all node-key="auth_id" @check="checkChange" @node-click="handleNodeClick" :expand-on-click-node="false">
|
|
@@ -164,7 +164,8 @@ export default {
|
|
|
msgUserId: '',
|
|
|
userId: '',
|
|
|
userGroupArr: [],
|
|
|
- userArr: []
|
|
|
+ userArr: [],
|
|
|
+ loading1: false
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -205,11 +206,13 @@ export default {
|
|
|
methods: {
|
|
|
//获取tree数据
|
|
|
async setTreeData () {
|
|
|
+ this.loading1 = true
|
|
|
const { code, returnData } = await this.getQueryList(SERVICE_ID.sysAuthId, { user_id: getToken('userid') })
|
|
|
if (code == 0) {
|
|
|
const treeMenu = listToTree(returnData, 'up_auth_id', 'auth_id')
|
|
|
this.treeData[0].children = treeMenu
|
|
|
}
|
|
|
+ this.loading1 = false
|
|
|
},
|
|
|
filterNode (value, data) {
|
|
|
if (!value) return true;
|
|
@@ -269,6 +272,7 @@ export default {
|
|
|
},
|
|
|
//获取角色已有权限
|
|
|
async getRoleQuth (item) {
|
|
|
+ this.loading1 = true
|
|
|
this.$refs.tree.setCheckedKeys([])
|
|
|
const newItem = _.cloneDeep(item)
|
|
|
const newObj = {}
|
|
@@ -308,21 +312,31 @@ export default {
|
|
|
}, 70);
|
|
|
}
|
|
|
}
|
|
|
+ this.loading1 = false
|
|
|
},
|
|
|
removeClass (elements) {
|
|
|
elements.className = '';
|
|
|
},
|
|
|
disRemoveArr (arr, key) {
|
|
|
- arr.forEach(item => {
|
|
|
- if (item.children) {
|
|
|
- item.children = _.uniqBy(item.children, key)
|
|
|
- this.disRemoveArr(item.children, key)
|
|
|
- }
|
|
|
- })
|
|
|
+ if (arr && arr.length) {
|
|
|
+ arr.forEach(item => {
|
|
|
+ if (item.children && item.children.length) {
|
|
|
+ item.children = _.uniqBy(item.children, key)
|
|
|
+ if (item.user_id) {
|
|
|
+ delete item.children
|
|
|
+ }
|
|
|
+ this.disRemoveArr(item.children, key)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
return arr
|
|
|
},
|
|
|
//服务列表-点击
|
|
|
handleClick (item) {
|
|
|
+ //treeArr
|
|
|
+ if (item.children) {
|
|
|
+ delete item.children
|
|
|
+ }
|
|
|
this.dataType = 'edit'
|
|
|
this.dataObj = _.cloneDeep(item)
|
|
|
this.formInline = _.cloneDeep(item)
|