From fde1811b6805b6483ab765d5c8b22df046b38d2b Mon Sep 17 00:00:00 2001 From: luojie <125330818@qq.com> Date: Fri, 13 Mar 2026 11:27:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86][upd?= =?UTF-8?q?ate]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Template/CustomTable.vue | 15 +++++-- src/components/Template/HandleFormItem.vue | 7 +++- .../business/comps/template/comps/bl/BL001.vue | 48 +++++++++++++++++----- 3 files changed, 53 insertions(+), 17 deletions(-) diff --git a/src/components/Template/CustomTable.vue b/src/components/Template/CustomTable.vue index 8b512d9..7ddf799 100644 --- a/src/components/Template/CustomTable.vue +++ b/src/components/Template/CustomTable.vue @@ -108,11 +108,11 @@
+ :error="hasError(rowIndex, colIndex, col.prop)" @update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)" + :orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" />
@@ -939,6 +939,13 @@ export default { item.disabled = false; } } + if(col.noBorder){ + item.noBorder = true; + } + if(col.bodyLayout){ + item.layout = col.bodyLayout; + } + return item }, getBodyButtonItem(col,) { diff --git a/src/components/Template/HandleFormItem.vue b/src/components/Template/HandleFormItem.vue index 00ed563..995c957 100644 --- a/src/components/Template/HandleFormItem.vue +++ b/src/components/Template/HandleFormItem.vue @@ -37,7 +37,7 @@
+ :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '') + (error ? ' form-error-border' : '') + (item.noBorder ? ' no-border' : '') + (item.layout === 'horizontal' ? ' flex' : '')">
\ No newline at end of file diff --git a/src/views/business/comps/template/comps/bl/BL001.vue b/src/views/business/comps/template/comps/bl/BL001.vue index 77bdb90..418b1bf 100644 --- a/src/views/business/comps/template/comps/bl/BL001.vue +++ b/src/views/business/comps/template/comps/bl/BL001.vue @@ -235,23 +235,26 @@ export default { label: 'template.dj.dj003.cyd', prop: "cyd", bodyType: 'input', - bodyFillType: 'actFill' + bodyFillType: 'actFill', + width: 180, }, { label: 'template.dj.dj003.dwbh', prop: "dwbh", bodyType: 'input', - bodyFillType: 'actFill' + bodyFillType: 'actFill', + width: 180, }, { label: 'template.dj.dj003.ypmc', prop: "ypmcTa", bodyType: 'checkboxTree', bodyFillType: 'actFill', - bodyOptions: [ - {value:1,label:'正常'}, - {value:0,label:'偏离'}, - ], + width: 280, + bodyLayout: 'horizontal',//水平 + optionCode:"ypmcTaOptions", + noBorder: true, + bodyOptions: this.ypmcTaOptions, }, { label: 'template.dj.dj003.cysj', @@ -268,13 +271,15 @@ export default { {value:1,label:'正常'}, {value:0,label:'偏离'}, ], - bodyFillType: 'actFill' + bodyFillType: 'actFill', + width: 180, }, { label: 'template.dj.dj003.yps', prop: "yps", bodyType: 'inputNumber', - bodyFillType: 'actFill' + bodyFillType: 'actFill', + width: 180, }, ] @@ -308,7 +313,14 @@ export default { data() { return { formData: {}, - refConf + refConf, + ypmcTaOptions: [], + } + }, + mounted() { + if(this.fillType === "actFill"){ + console.log(this.formData, "this.formData") + this.ypmcTaOptions = this.formData.ypmcTaOptions || [] } }, methods: { @@ -319,11 +331,25 @@ export default { // 获取已填写的表单数据 getFilledFormData() { - return this.getFilledFormDataByRefs(refNames) + const filledData = this.getFilledFormDataByRefs(refNames); + if(this.formData.ypmcTaOptions){ + filledData.ypmcTaOptions = this.formData.ypmcTaOptions + } + return filledData }, // 获取填写完成的表单数据 async getFormData() { - return await this.validFormFields(refNames) + const formData = await this.validFields(); + if(this.fillType === "preFill" && !!formData){ + const filledData = this.getFilledFormData(); + const {stepTableFormData_1 = []} = filledData; + const options = stepTableFormData_1.map(item => ({ + value: item.ypmc, + label: item.ypmc, + })) + formData.ypmcTaOptions = options + } + return formData }, // 只做校验 async validFields() {