From 69425e4b837598c2463662726ae3b4d25eceae66 Mon Sep 17 00:00:00 2001
From: yuxc <yuxc@vci-tech.com>
Date: 星期二, 31 十二月 2024 16:24:44 +0800
Subject: [PATCH] 1、修改多转一次list的问题
---
Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue | 49 ++++++++++++++++++++++++++++---------------------
1 files changed, 28 insertions(+), 21 deletions(-)
diff --git a/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue b/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue
index accfede..47483e0 100644
--- a/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue
@@ -1,13 +1,13 @@
<template>
<el-container>
<el-aside>
- <basic-container>
+ <basic-container v-loading="treeLoading">
<div ref="TreeBox" style="height: calc(100vh - 154px);!important;">
<!-- 宸︿晶鏍� -->
<div style="height: calc(100vh - 195px);">
<avue-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>
@@ -19,11 +19,11 @@
</el-aside>
<el-main>
- <basic-container v-loading="treeLoading">
+ <basic-container v-loading="mainLoading">
<h3 style="margin: 0 0 10px 0">UI鏉冮檺閰嶇疆</h3>
<div>
- <el-button icon="el-icon-place" plain size="small" type="primary" @click="saveHandler">鎺堟潈</el-button>
- <el-button icon="el-icon-close" plain size="small" style="margin-right: 40px;" type="primary"
+ <el-button v-if="permissionList.rightBtn" icon="el-icon-place" plain size="small" type="primary" @click="saveHandler">鎺堟潈</el-button>
+ <el-button v-if="permissionList.resetBtn" icon="el-icon-close" plain size="small" style="margin-right: 40px;" type="primary"
@click="clearValue">閲嶇疆
</el-button>
涓氬姟绫诲瀷锛�
@@ -51,7 +51,7 @@
<div style="height: calc(100vh - 232px);margin-top: 10px;">
<avue-tree ref="uiTree" :data="uiTreeData" :node-key="oid" :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>
@@ -68,12 +68,14 @@
import {gridRoles, getRightListByRoleId} from "@/api/system/role/api";
import {getUIAuthor, authorizedUI} from "@/api/authority/ui/uiAuthor";
import {getBizTree, gridUIContextData} from "@/api/UI/uiDefine";
+import {mapGetters} from "vuex";
export default {
name: "index",
data() {
return {
treeLoading: false,
+ mainLoading:false,
type: '',//涓氬姟绫诲瀷
context: '',//UI涓婁笅鏂嘽ode
treeOption: {
@@ -105,6 +107,15 @@
contextData: []
}
},
+ computed:{
+ ...mapGetters(["permission"]),
+ permissionList() {
+ return {
+ rightBtn: this.vaildData(this.permission[this.$route.query.id].RIGHT, false),
+ resetBtn: this.vaildData(this.permission[this.$route.query.id].reset, false),
+ };
+ },
+ },
created() {
this.getTreeList();
// this.getUITree();
@@ -112,12 +123,12 @@
},
methods: {
getTreeList() {
- const loading = this.$loading({});
+ this.treeLoading = true;
gridRoles().then(res => {
this.treeData = res.data.data;
- loading.close();
+ this.treeLoading = false;
}).catch(error => {
- loading.close();
+ this.treeLoading = false;
})
},
@@ -125,18 +136,10 @@
nodeClick(row) {
this.nodeRow = row;
this.getUITree();
- // const params = {
- // roleId: row.oid
- // }
- // getRightListByRoleId(params).then(res => {
- // const data = res.data.data.map(item => item.funcId);
- // console.log(data);
- // this.$refs.uiTree.setCheckedKeys(data);
- // })
},
getUITree() {
- this.treeLoading = true;
+ this.mainLoading = true;
const params = {
'conditionMap[roleId]': this.nodeRow.oid,
'conditionMap[type]': this.type,
@@ -161,9 +164,9 @@
const checkedData = this.findCheckedOids(res.data.data[0]);
this.$refs.uiTree.setCheckedKeys(checkedData);
- this.treeLoading = false;
+ this.mainLoading = false;
}).catch(error => {
- this.treeLoading = false;
+ this.mainLoading = false;
})
},
@@ -250,7 +253,9 @@
checked: true,
expanded: true,
data:item.data,
+ parentId:item.parentId,
level: item.level,
+ leaf:item.leaf,
oid: item.oid,
text: item.text
}
@@ -261,7 +266,9 @@
checked: false,
expanded: true,
data:item.data,
+ parentId:item.parentId,
level: item.level,
+ leaf:item.leaf,
oid: item.oid,
text: item.text
}
@@ -269,7 +276,7 @@
// 鍦ㄥ崐閫夌姸鎬佷腑杩囨护鎺夐《绾ц妭鐐� oid 涓� root
const filterSelectTreeData = parentData.filter(item => item.oid !== 'root');
- const data = [...filterSelectTreeData,...selectTreeData];
+ const data = [...selectTreeData,...filterSelectTreeData];
const formData = {
roleId: this.nodeRow.oid,
type: this.type,
--
Gitblit v1.9.3