From d598404c814ad8556159c0922c90dccbb7ee649f Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期三, 20 三月 2024 15:36:09 +0800 Subject: [PATCH] 固定表单 --- Source/ProjectWeb/src/components/dynamic-components/dynamic-button.vue | 70 +++++++++++++++++++++------------- 1 files changed, 43 insertions(+), 27 deletions(-) diff --git a/Source/ProjectWeb/src/components/dynamic-components/dynamic-button.vue b/Source/ProjectWeb/src/components/dynamic-components/dynamic-button.vue index 6d57f5d..3ec92d0 100644 --- a/Source/ProjectWeb/src/components/dynamic-components/dynamic-button.vue +++ b/Source/ProjectWeb/src/components/dynamic-components/dynamic-button.vue @@ -1,25 +1,37 @@ <template> - <!--琛ㄦ牸鍩虹鎸夐挳--> - <div v-if="type === 'table'"> - <!--top灞曠ず琛ㄦ牸涓婃柟鍖哄煙 menu灞曠ず琛ㄦ牸鎿嶄綔鏍忓尯鍩� --> - <el-button v-for="item in basicButtonList.top" - v-if="LocationType === 'top'" - :key="item.oid" :icon="item.icon" - :type="item.paramVOS.buttonType || 'primary'" plain - size="small" - @click="buttonClick(item)"> - {{ item.name }} - </el-button> + <div> + <!--琛ㄦ牸鍩虹鎸夐挳--> + <div v-if="type === 'table'"> + <!--top灞曠ず琛ㄦ牸涓婃柟鍖哄煙 menu灞曠ず琛ㄦ牸鎿嶄綔鏍忓尯鍩� --> + <el-button v-for="item in basicButtonList.top" + v-if="LocationType === 'top'" + :key="item.oid" :icon="item.icon" + :type="item.paramVOS.buttonType || 'primary'" plain + size="small" + @click="buttonClick(item)"> + {{ item.name }} + </el-button> - <el-button v-for="item in basicButtonList.menu" - v-if="LocationType === 'menu'" - :key="item.oid" :icon="item.paramVOS.icon" - :type="item.paramVOS.buttonType || 'primary'" plain - size="small" - @click="buttonClick(item,scope)"> - {{ item.name }} - </el-button> -<!-- <dynamic-form :title="formName" :visible.sync="visible"></dynamic-form>--> + <el-button v-for="item in basicButtonList.menu" + v-if="LocationType === 'menu'" + :key="item.oid" + :icon="item.paramVOS.icon ? item.paramVOS.icon : (item.paramVOS.buttonMethods === 'edit' ? 'el-icon-edit' : (item.paramVOS.buttonMethods === 'delete' ? 'el-icon-delete' : ''))" + :type="item.paramVOS.buttonType || 'text'" plain + size="small" + @click="buttonClick(item,scope)"> + {{ item.name }} + </el-button> + </div> + <div v-if="type === 'form'"> + <el-button v-for="item in basicButtonList" + :key="item.oid" + :type="(item.paramVOS.buttonType !== 'text' ? item.paramVOS.buttonType : 'primary') || 'primary'" plain + size="small" + :icon="item.icon" + @click="buttonClick(item)"> + {{item.name}} + </el-button> + </div> </div> </template> @@ -36,11 +48,11 @@ LocationType: { type: String, }, - scope:{ - type:Object, + scope: { + type: Object, }, - butttonList:{ - type:Array + butttonList: { + type: Array } }, data() { @@ -53,19 +65,23 @@ basicButtonList() { // const basicColumn = this.butttonList.filter(item => item.id !== 'launchworkflow'); // 棣栧厛杩囨护鍑烘潵鍩虹琛ㄥ崟浜嬩欢鐨勬寜閽� const basicColumn = this.butttonList; - if (this.type === 'table') { + + if (this.type === 'form') { + console.log('basicColumn',basicColumn) + return basicColumn; + } else if (this.type === 'table') { const top = basicColumn.filter(item => item.paramVOS.location === 'top' || func.isEmpty(item.paramVOS.location)); // 杩囨护鍑烘潵琛ㄦ牸涓婇潰鍖哄煙灞曠ず鐨勬寜閽� const menu = basicColumn.filter(item => item.paramVOS.location === 'menu'); // 杩囨护鍑烘潵鎿嶄綔鏍忓睍绀虹殑鎸夐挳 return { top: top, menu: menu - } + }; } } }, methods: { buttonClick(item) { - this.$emit('buttonClick',this.scope,item) + this.$emit('buttonClick', this.scope, item) } } } -- Gitblit v1.9.3