From 6c170b6b427f0882da35957e73f385d318970a06 Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期五, 25 十月 2024 17:59:19 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue | 37 ++++++++++++++++++++++++++++++++-----
1 files changed, 32 insertions(+), 5 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 d387f92..a77bb26 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
@@ -111,7 +111,6 @@
this.getTypeList();
},
methods: {
-
getTreeList() {
const loading = this.$loading({});
gridRoles().then(res => {
@@ -173,14 +172,12 @@
if (obj.checked === true) {
result.push(obj.oid);
}
-
// 濡傛灉鏈� children锛屽垯缁х画閬嶅巻
if (obj.children && obj.children.length > 0) {
obj.children.forEach(child => {
this.findCheckedOids(child, result);
});
}
-
return result;
},
@@ -188,7 +185,7 @@
processChildren(item) {
if (item.children && item.children.length > 0) {
item.children = item.children.map(child => {
- if (child.level < 2) {
+ if (child.level < 3) {
// 榛樿鏍戣妭鐐瑰睍寮�涓ゅ眰鏁堟灉
this.defaultExpandKeys.push(child.oid)
}
@@ -243,15 +240,45 @@
saveHandler() {
const selectTreeList = this.$refs.uiTree.getCheckedNodes();
+ const selectParentList = this.$refs.uiTree.getHalfCheckedNodes();
if (selectTreeList.length == 0) {
this.$message.error("璇烽�夋嫨鍔熻兘妯″潡");
return;
}
+ const selectTreeData = selectTreeList.map(item => {
+ return {
+ checked: true,
+ expanded: true,
+ data:item.data,
+ parentId:item.parentId,
+ level: item.level,
+ leaf:item.leaf,
+ oid: item.oid,
+ text: item.text
+ }
+ })
+
+ const parentData = selectParentList.map(item => {
+ return {
+ checked: false,
+ expanded: true,
+ data:item.data,
+ parentId:item.parentId,
+ level: item.level,
+ leaf:item.leaf,
+ oid: item.oid,
+ text: item.text
+ }
+ })
+ // 鍦ㄥ崐閫夌姸鎬佷腑杩囨护鎺夐《绾ц妭鐐� oid 涓� root
+ const filterSelectTreeData = parentData.filter(item => item.oid !== 'root');
+
+ const data = [...selectTreeData,...filterSelectTreeData];
const formData = {
roleId: this.nodeRow.oid,
type: this.type,
context: this.context,
- selectTreeList: selectTreeList
+ selectTreeList: data
}
authorizedUI(formData).then(res => {
if (res.data.success) {
--
Gitblit v1.9.3