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-form.vue | 69 +++++++++++----------------------- 1 files changed, 23 insertions(+), 46 deletions(-) diff --git a/Source/ProjectWeb/src/components/dynamic-components/dynamic-form.vue b/Source/ProjectWeb/src/components/dynamic-components/dynamic-form.vue index 947b92d..3d555d7 100644 --- a/Source/ProjectWeb/src/components/dynamic-components/dynamic-form.vue +++ b/Source/ProjectWeb/src/components/dynamic-components/dynamic-form.vue @@ -1,8 +1,6 @@ <template> - <basic-container> - <el-dialog v-if="dialogFormVisible" :title="title" :visible.sync="dialogFormVisible" @close="closeHandler" append-to-body> - <avue-form v-model="form" :option="option" @submit="submitHandler" @reset-change="changeHandler"> - <template v-for="item in slotData" :slot="item.prop + 'Label'"> + <avue-form v-model="form" :option="option"> + <template v-for="item in slotData" :slot="item.prop + 'Label'"> <span> <span>{{ item.label }} </span> <el-tooltip @@ -15,10 +13,11 @@ <i class="el-icon-star-on" style="font-size: 17px !important; color: red;vertical-align: baseline;"></i> </el-tooltip> </span> - </template> - </avue-form> - </el-dialog> - </basic-container> + </template> + <template slot="menuForm"> + <dynamic-button type="form" :butttonList="componentVO.buttons" @buttonClick="buttonClick"></dynamic-button> + </template> + </avue-form> </template> <script> @@ -46,52 +45,30 @@ type: Object, default: {} }, - visible: { - type: Boolean, - default: false, - }, - title: { - type: String - }, - formList:{ - type:Array - }, }, data() { return { form: {}, } }, + mounted() { + // console.log('componentVO--',this.componentVO.tableDefineVO.cols[0]) + }, computed: { - dialogFormVisible: { - get() { - return this.visible; - }, - set(val) { - this.$emit("update:visible", val); - }, - }, option() { return { - column: this.formColumn(this.formList) + submitBtn: false, + emptyBtn: false, + height: 300, + column: this.formColumn(this.componentVO.tableDefineVO.cols[0]) } }, - slotData(){ - return this.formColumn(this.formList) + slotData() { + return this.formColumn(this.componentVO.tableDefineVO.cols[0]) } }, - methods:{ - //琛ㄥ崟鎻愪氦 - submitHandler(form,done){ - console.log(form) - console.log(this.slotData) - done() - }, - changeHandler(){ - this.form = {}; - // this.clearValidate() 娓呯┖鏍¢獙 - // this.resetFields() - }, + methods: { + //杞寲鏁版嵁 formColumn(formList) { return formList.map(item => { const typeValue = item.type === 'text' ? 'input' : item.type === 'combox' ? 'select' : item.type; @@ -106,8 +83,8 @@ disabled: item.disabled, labelSuffix: item.suffix, suffixIcon: item.prefix, - placeholder:item.placeholder, - clearable:item.clearable, + placeholder: item.placeholder, + clearable: item.clearable, tip: item.tooltips, keyAttr: item.keyAttr, rules: [{ @@ -118,13 +95,13 @@ } }) }, - closeHandler(){ - this.form = {}; + buttonClick(item) { + console.log(item.id) }, } } </script> -<style scoped lang="scss"> +<style scoped> </style> -- Gitblit v1.9.3