From 5a00f7eec311c7b71b40df4beaded505eca5329c Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期四, 11 四月 2024 17:49:23 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/ProjectWeb/src/components/dynamic-components/dynamic-button.vue | 45 ++++++++++++++++++++++++++++++--------------- 1 files changed, 30 insertions(+), 15 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..7b8dee8 100644 --- a/Source/ProjectWeb/src/components/dynamic-components/dynamic-button.vue +++ b/Source/ProjectWeb/src/components/dynamic-components/dynamic-button.vue @@ -39,12 +39,24 @@ {{ 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> <script> import func from "@/util/func"; import {validatenull} from "@/util/validate"; +import {doAction} from '@/actions/base/BaseAction'; export default { name: "dynamic-button", @@ -239,12 +251,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, @@ -260,18 +279,14 @@ this.$refs.dynamicForm.form = row; }, buttonClick(item) { - // 鏍规嵁 type 鏉′欢鍔ㄦ�佸紩鍏ヤ笉鍚岀殑JS鏂囦欢锛屽苟浼犻�� item this 鍙傛暟 - if (this.type === 'table') { - import('@/views/base/buttonTable').then(module => { - const buttonClickTable = module.default; - buttonClickTable.buttonClick(item,this); - }) - } else if (this.type === 'form') { - import('@/views/base/buttonForm').then(module => { - const buttonClickForm = module.default; - buttonClickForm.buttonClick(item,this); - }) - } + doAction(item,{ + paramVOS: item.paramVOS, + dataStore: [], + sourceData: {}, + callback: function (){ + + } + }); } }, } -- Gitblit v1.9.3