From b541e03cd3a1c7d73ed6b9dc55bd956f39e4108b Mon Sep 17 00:00:00 2001
From: wangting <wangting@vci-tech.com>
Date: 星期三, 08 一月 2025 15:44:16 +0800
Subject: [PATCH] 调整图标在树、列表中的显示,按钮配置修改样式

---
 Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/cloneDialog.vue |   51 ++++++++++++++++++++++++++++++++-------------------
 1 files changed, 32 insertions(+), 19 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/cloneDialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/cloneDialog.vue
index 6a96108..5b340ce 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/cloneDialog.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/cloneDialog.vue
@@ -11,7 +11,6 @@
     <el-container style="height: 580px">
       <el-aside style="width: 380px">
         <basic-container v-loading="leftLoading" style="height: 530px">
-          <h3 style="margin: 0 0 10px 0">涓氬姟绫诲瀷</h3>
           <div style="height: 435px">
             <avue-tree ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick">
               <span slot-scope="{ node, data }" class="el-tree-node__label">
@@ -66,6 +65,7 @@
       treeOption: {
         menu: false,
         addBtn: false,
+        defaultExpandAll:true,
         props: {
           label: 'text',
           value: 'oid',
@@ -78,7 +78,8 @@
       uiTreeOption: {
         nodeKey: 'oid',
         checkOnClickNode: true,
-        defaultExpandedKeys: [],
+        defaultExpandAll:true,
+        //defaultExpandedKeys: this.defaultExpandKeys,
         multiple: false,
         menu: false,
         addBtn: false,
@@ -104,7 +105,6 @@
     },
     submitDialog() {
       const node = this.$refs.uiTree.getCurrentNode();
-      console.log(node);
       if (!node.leaf) {
         this.$message.error('璇烽�夋嫨鏈�涓嬪眰瀛愯妭鐐硅繘琛屽厠闅�');
         return;
@@ -135,7 +135,17 @@
     getTreeList() {
       this.leftLoading = true;
       getBizTree().then(res => {
-        this.treeData = res.data.obj.children;
+        this.treeData = [{
+          attributes: {},
+          checked: false,
+          expanded: true,
+          data: "root",
+          level: res.data.obj.level,
+          icon: 'vci:home',
+          oid: res.data.obj.oid,
+          text: res.data.obj.text,
+          children: res.data.obj.children
+        }] ;
         this.leftLoading = false;
       }).catch(error => {
         this.leftLoading = false;
@@ -143,15 +153,22 @@
     },
     // 瑙掕壊鐐瑰嚮
     nodeClick(row, node) {
+      if(row.oid==''){
+        return false;
+      }
       this.nodeRow = row;
       this.rightLoading = true;
       const params = {
         btmName: this.nodeRow.attributes.name,
         level: this.paramsType
       }
-      this.defaultExpandKeys = ['root'];
+      //this.defaultExpandKeys = ['UILayout'];
       getAllLevelTreeByBtm(params).then(res => {
-        this.uiTreeOption.defaultExpandedKeys = [res.data.obj.oid];
+        //this.defaultExpandedKeys = [res.data.obj.oid];
+        res.data.obj.icon='el-icon-s-home';
+        let level=0;
+        this.processChildren(res.data.obj,level); // 澶勭悊姣忎釜鑺傜偣
+        //this.uiTreeOption.defaultExpandedKeys = this.defaultExpandKeys;
         this.uiTreeData = [res.data.obj];
         this.rightLoading = false;
       }).catch(error => {
@@ -160,29 +177,25 @@
     },
 
     //澶勭悊鏍�
-    processChildren(item) {
+    processChildren(item,level) {
       if (item.children && item.children.length > 0) {
+        level++;
         item.children = item.children.map(child => {
           if (child.level < 4) {
-            this.defaultExpandKeys.push(child.oid)
+            //this.defaultExpandKeys.push(child.oid)
           }
-          if (child.level == 1) {
+          if (level == 1) {
             child.icon = 'el-icon-s-promotion';
-            child.label = child.data.label + '(' + child.data.name + ')'
-          } else if (child.level == 2) {
+          } else if (level == 2) {
             child.icon = 'el-icon-s-order';
-            child.label = child.text
-          } else if (child.level == 3) {
+          } else if (level == 3) {
             child.icon = 'el-icon-office-building';
-            child.label = child.text
-          } else if (child.level == 4) {
+          } else if (level == 4) {
             child.icon = 'el-icon-document';
-            child.label = child.text
-          } else if (child.level == 5) {
+          } else if (level == 5) {
             child.icon = 'el-icon-s-tools';
-            child.label = child.text
           }
-          this.processChildren(child); // 閫掑綊澶勭悊姣忎釜瀛愯妭鐐�
+          this.processChildren(child,level); // 閫掑綊澶勭悊姣忎釜瀛愯妭鐐�
           return child; // 鍙繑鍥炲瓙鑺傜偣鐨� attributes
         });
       }

--
Gitblit v1.9.3