From d1d59913384ce70d30ae9f98b4c79a976611e9ad Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期三, 10 四月 2024 15:54:21 +0800
Subject: [PATCH] 路径解析

---
 Source/ProjectWeb/src/components/dynamic-components/dynamic-button.vue |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/Source/ProjectWeb/src/components/dynamic-components/dynamic-button.vue b/Source/ProjectWeb/src/components/dynamic-components/dynamic-button.vue
index 52bf1b5..2aa8c65 100644
--- a/Source/ProjectWeb/src/components/dynamic-components/dynamic-button.vue
+++ b/Source/ProjectWeb/src/components/dynamic-components/dynamic-button.vue
@@ -39,6 +39,17 @@
         {{ item.name }}
       </el-button>
     </div>
+    <div v-else-if="type === 'tree'" class="tree-buttons">
+      <el-button v-for="item in basicButtonList"
+                 :key="item.oid"
+                 :icon="item.paramVOS.webUiButtonIcon"
+                 :type="(item.paramVOS.webUiButtonType !== 'text' ? item.paramVOS.webUiButtonType : 'primary') || 'primary'"
+                 plain
+                 size="small"
+                 @click="buttonClick(item)">
+        {{ item.name }}
+      </el-button>
+    </div>
   </div>
 </template>
 
@@ -239,12 +250,19 @@
   computed: {
     basicButtonList() {
       const basicColumn = this.butttonList;
+      if (!basicColumn || !Array.isArray(basicColumn)) {
+        return []; // 濡傛灉 basicColumn 鏈畾涔夋垨鑰呬笉鏄暟缁勶紝杩斿洖绌烘暟缁�
+      }
 
-      if (this.type === 'form') {
+      if (this.type === 'form' || this.type === 'tree') {
         return basicColumn;
       } else if (this.type === 'table' || this.type === 'TreeTable') {
-        const top = basicColumn.filter(item => item.paramVOS.webUiButtonLocation === 'top' || func.isEmpty(item.paramVOS.webUiButtonLocation)); // 杩囨护鍑烘潵琛ㄦ牸涓婇潰鍖哄煙灞曠ず鐨勬寜閽�
-        const menu = basicColumn.filter(item => item.paramVOS.webUiButtonLocation === 'menu'); // 杩囨护鍑烘潵鎿嶄綔鏍忓睍绀虹殑鎸夐挳
+        const top = basicColumn.filter(item => {
+          return item.paramVOS && (item.paramVOS.webUiButtonLocation === 'top' || func.isEmpty(item.paramVOS.webUiButtonLocation));
+        });
+        const menu = basicColumn.filter(item => {
+          return item.paramVOS && item.paramVOS.webUiButtonLocation === 'menu';
+        });
         return {
           top: top,
           menu: menu,

--
Gitblit v1.9.3