From 9423f2936340d82b046ec615381c1c5e03698557 Mon Sep 17 00:00:00 2001
From: yuxc <yuxc@vci-tech.com>
Date: 星期五, 27 九月 2024 17:56:53 +0800
Subject: [PATCH] 1、主要完成对获取UI上下文的定义接口的优化,优化的方向为对多次获取业务类型对象进行转换而导致耗时较久的问题继续修改,还有对多次获取属性对象进行转换对象导致耗时过长问题进行修改。 2、对树的数据查询接口的优化,对多次获取属性对象进行转换对象导致耗时过长问题进行修改。

---
 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue |   25 +++++++++++++++++++------
 1 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue
index 441a5c2..1463262 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue
@@ -170,8 +170,9 @@
         if (newval ==0) {
           getBizTypes().then(res => {
             const data = res.data.data.map(item => {
-              item.label=item.attributes.id;
-              return item;
+              this.processChildren(item); // 澶勭悊姣忎釜鑺傜偣
+              item.attributes.label = item.attributes.id;
+              return item.attributes;
             });
             this.treeData = data;
             loading.close();
@@ -195,14 +196,26 @@
       const loading = this.$loading({});
       getBizTypes().then(res => {
         const data = res.data.data.map(item => {
-          item.label=item.attributes.id;
-          return item;
+          this.processChildren(item); // 澶勭悊姣忎釜鑺傜偣
+          item.attributes.label = item.attributes.id;
+          return item.attributes;
         });
         this.treeData = data;
         loading.close();
+      }).catch(error=>{
+        loading.close();
       })
     },
-
+    // 澶勭悊涓氬姟绫诲瀷鏍戝舰缁撴瀯
+    processChildren(item) {
+      if (item.children && item.children.length > 0) {
+        item.attributes.children = item.children.map(child => {
+          child.attributes.label = child.attributes.id;
+          this.processChildren(child); // 閫掑綊澶勭悊姣忎釜瀛愯妭鐐�
+          return child.attributes; // 鍙繑鍥炲瓙鑺傜偣鐨� attributes
+        });
+      }
+    },
     // 鏍戠偣鍑�
     nodeClick(row) {
       this.nodeRow = row;
@@ -238,7 +251,7 @@
         this.tableLoading = false;
       })
     },
-    selectHandler(selection, row){debugger;
+    selectHandler(selection, row){
       this.dialogSelectionRow=selection
     },
     changeTemp(data) {

--
Gitblit v1.9.3