From f81e4925e870ab9cc080181280046d0338e1842c Mon Sep 17 00:00:00 2001 From: 田源 <tianyuan@vci-tech.com> Date: 星期三, 08 一月 2025 15:22:19 +0800 Subject: [PATCH] UI授权角色没显示完整&&UI授权切换角色闪烁 --- Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/UIDialog.vue | 42 +++++++++++++++++++++++------------------- 1 files changed, 23 insertions(+), 19 deletions(-) diff --git a/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/UIDialog.vue b/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/UIDialog.vue index 8347c23..130cdaf 100644 --- a/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/UIDialog.vue +++ b/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/UIDialog.vue @@ -9,26 +9,28 @@ :close-on-click-modal="false" @close="cancelDialog"> <el-container style="height: 550px"> - <el-aside> - <basic-container style="height: 500px"> - <avue-tree ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick"> + <el-aside style="height: 500px"> + <basic-container v-loading="leftLoading"> + <div style="height: 425px"> + <avue-tree ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick"> <span slot-scope="{ node, data }" class="el-tree-node__label"> - <span style="font-size: 15px"> + <span> <i class="el-icon-user-solid"></i> {{ (node || {}).label }} </span> </span> - </avue-tree> + </avue-tree> + </div> </basic-container> </el-aside> - <el-main> - <basic-container style="height: 500px"> + <el-main style="height: 500px"> + <basic-container v-loading="rightLoading"> <h3 style="margin: 0">妯″潡鏉冮檺閰嶇疆</h3> <div style="height: 445px;"> <avue-tree ref="uiTree" :data="uiTreeData" :option="uiTreeOption"> <span slot-scope="{ node, data }" class="el-tree-node__label"> - <span style="font-size: 15px"> + <span> <i :class="data.icon"></i> {{ (node || {}).label }} </span> @@ -54,6 +56,8 @@ name: "UIDialog", data() { return { + leftLoading:false, + rightLoading:false, dialog: { showDialog: false, title: "UI鎺堟潈", @@ -77,7 +81,7 @@ uiTreeOption: { nodeKey:'oid', checkOnClickNode:true, - defaultExpandKeys:[], + defaultExpandedKeys:this.defaultExpandKeys, multiple: true, menu: false, addBtn: false, @@ -104,18 +108,18 @@ this.dialog.showDialog = false; }, getTreeList() { - const loading = this.$loading({}); + this.leftLoading = true; gridRoles().then(res => { this.treeData = res.data.data; - loading.close(); + this.leftLoading = false; }).catch(error=>{ - loading.close(); + this.leftLoading = false; }) }, // 瑙掕壊鐐瑰嚮 nodeClick(row,node) { this.nodeRow = row; - const loading = this.$loading({}); + this.rightLoading = true; const params = { 'conditionMap[roleId]': this.nodeRow.oid, 'conditionMap[type]': this.type, @@ -124,7 +128,7 @@ this.defaultExpandKeys=['root']; getUIAuthor(params).then(res => { this.processChildren(res.data.data[0]); // 澶勭悊姣忎釜鑺傜偣 - this.uiTreeOption.defaultExpandKeys=this.defaultExpandKeys; + this.uiTreeOption.defaultExpandedKeys=this.defaultExpandKeys; this.uiTreeData = [{ attributes: {}, checked: false, @@ -136,21 +140,21 @@ label: res.data.data[0].text, children: res.data.data[0].children }]; - loading.close(); + this.rightLoading = false; }).catch(error => { - loading.close(); + this.rightLoading = false; }) }, //澶勭悊鏍� processChildren(item) { if (item.children && item.children.length > 0) { item.children = item.children.map(child => { - if(child.level<5){ + if(child.level<4){ this.defaultExpandKeys.push(child.oid) } if(child.level==1){ child.icon='el-icon-s-promotion'; - child.label=child.data.label+'锛�'+child.data.name+'锛�' + child.label=child.data.label+'('+child.data.name+')' }else if(child.level==2){ child.icon='el-icon-s-order'; child.label=child.text @@ -161,7 +165,7 @@ child.icon='el-icon-document'; child.label=child.text }else if(child.level==5){ - child.icon='el-icon-s-ticket'; + child.icon='el-icon-s-tools'; child.label=child.text } this.processChildren(child); // 閫掑綊澶勭悊姣忎釜瀛愯妭鐐� -- Gitblit v1.9.3