From 945a4ea02215e40e6e9de65385e2c5d1ad70087c Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期三, 23 十月 2024 17:07:37 +0800 Subject: [PATCH] 表单定义 预览 应用 表格穿梭框删除重复数据 --- Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue | 33 ++++++++++++++++++++++++++++----- 1 files changed, 28 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..9e71cbf 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,41 @@ 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, + level: item.level, + oid: item.oid, + text: item.text + } + }) + + // const parentData = selectParentList.map(item => { + // return { + // checked: false, + // expanded: true, + // data:item.data, + // level: item.level, + // oid: item.oid, + // text: item.text + // } + // }) + // // 鍦ㄥ崐閫夌姸鎬佷腑杩囨护鎺夐《绾ц妭鐐� oid 涓� root + // const filterSelectTreeData = parentData.filter(item => item.oid !== 'root'); + + const data = [...selectTreeData]; 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