From 603a545f17b90b73c631c7fdc5a0d2b2ad24485e Mon Sep 17 00:00:00 2001 From: luojie <125330818@qq.com> Date: Wed, 11 Feb 2026 22:36:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86][?= =?UTF-8?q?=E7=83=A6=E4=BA=BA=E7=9A=84=E6=B5=93=E5=BA=A6=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E5=92=8C=E5=8D=95=E4=BD=8D=E6=8D=A2=E7=AE=97]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Template/CustomTable.vue | 21 ++++--- .../Template/mixins/formPackageMixins.js | 2 +- .../business/comps/template/comps/sp/SP003.vue | 29 ++++++++- .../business/comps/template/comps/sp/SP00456.vue | 73 +++++++++++++++++++--- .../template/formConfig/paralleAndLadderConfig.js | 2 +- .../comps/template/mixins/templateMixin.js | 63 ++++++++++++++----- 6 files changed, 152 insertions(+), 38 deletions(-) diff --git a/src/components/Template/CustomTable.vue b/src/components/Template/CustomTable.vue index bd63a94..3ac969c 100644 --- a/src/components/Template/CustomTable.vue +++ b/src/components/Template/CustomTable.vue @@ -73,7 +73,7 @@ :fieldItemLabel="fieldItemLabel" type="select" class="body-select" @blur="onBlur(rowIndex, col.prop, $event)" :item="getBodyItem(col, rowIndex)" v-model="row[col.prop]" - @change="onBodyValueChange(rowIndex, colIndex, $event)" + @change="onBodyValueChange(rowIndex, colIndex, $event,row,'select')" :error="hasError(rowIndex, colIndex, col.prop)" @update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)" :orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" /> @@ -135,7 +135,7 @@ @blur="onSubBlur(rowIndex, col.bodySubKey, $event)" @copy="onCopy(rowIndex, col)" :item="getBodySubItem(col)" v-model="row[col.bodySubKey]" - @change="onBodySubValueChange(rowIndex, colIndex, $event)" + @change="onBodySubValueChange(rowIndex, colIndex,$event,)" :error="hasError(rowIndex, colIndex, col.bodySubKey)" @update:error="onErrorUpdate(rowIndex, colIndex, col.bodySubKey, $event)" :orange-bg="hasOrangeBg(rowIndex, colIndex, col.bodySubKey)" /> @@ -145,7 +145,7 @@ :fieldItemLabel="fieldItemLabel" type="select" class="body-select" @blur="onSubBlur(rowIndex, col.bodySubKey, $event)" :item="getBodySubItem(col, rowIndex)" v-model="row[col.bodySubKey]" - @change="onBodySubValueChange(rowIndex, colIndex, $event)" + @change="onBodySubValueChange(rowIndex, colIndex, $event,row,'select')" :error="hasError(rowIndex, colIndex, col.bodySubKey)" @update:error="onErrorUpdate(rowIndex, colIndex, col.bodySubKey, $event)" :orange-bg="hasOrangeBg(rowIndex, colIndex, col.bodySubKey)" /> @@ -506,12 +506,11 @@ export default { }, // 表头选择器变化 onHeaderSelectChange(col, value) { - console.log(col,"ccc") if (col.headerSelectTo) { this.headerSelectFields[col.headerSelectTo] = value; } this.headerSelectFields[col.headerSelectKey] = value; - console.log(this.headerSelectFields, "this.headerSelectFields") + this.$emit('headerSelectChange', {key:col.headerSelectKey, headerSelectFields:this.headerSelectFields,dataSource:this.localDataSource}); // 输入时清除对应表单项的错误状态 this.formErrors = this.formErrors.filter(error => !(error.rowIndex === -1 && @@ -573,7 +572,7 @@ export default { }, // 表体值变化 - onBodyValueChange(rowIndex, colIndex, value) { + onBodyValueChange(rowIndex, colIndex, value,row,type) { const col = this.columns[colIndex]; this.localDataSource[rowIndex][col.prop] = value; @@ -586,10 +585,12 @@ export default { error.colIndex === colIndex && error.field === col.prop) ); - this.$emit('body-value-change', rowIndex, colIndex, value); + if(type === "select"){ + this.$emit('bodySelectChange', {rowIndex,item:row, colIndex, value,key:col.prop,dataSource:this.localDataSource,headerSelectFields:this.headerSelectFields}); + } }, // 表体子值变化 - onBodySubValueChange(rowIndex, colIndex, value) { + onBodySubValueChange(rowIndex, colIndex, value,row,type) { const col = this.columns[colIndex]; this.localDataSource[rowIndex][col.bodySubKey] = value; @@ -612,7 +613,9 @@ export default { error.colIndex === colIndex && error.field === col.bodySubKey) ); - this.$emit('body-sub-value-change', rowIndex, colIndex, value); + if(type === "select"){ + this.$emit('bodySelectChange', {rowIndex,item:row, colIndex, value,key:col.bodySubKey,dataSource:this.localDataSource,headerSelectFields:this.headerSelectFields}); + } }, getHeaderItem(col) { return { diff --git a/src/components/Template/mixins/formPackageMixins.js b/src/components/Template/mixins/formPackageMixins.js index 410fd05..d30f4e7 100644 --- a/src/components/Template/mixins/formPackageMixins.js +++ b/src/components/Template/mixins/formPackageMixins.js @@ -54,7 +54,7 @@ export default { } this.onValueChangeCompareTo(key, val); this.formFields[key] = val; - this.$emit("select", { key, value: val, type }); + this.$emit("select", { key, value: val, type,...this.formFields }); // 清除该表单项的错误状态 if (this.errors[key]) { this.$set(this.errors, key, false); diff --git a/src/views/business/comps/template/comps/sp/SP003.vue b/src/views/business/comps/template/comps/sp/SP003.vue index e449508..cdb2e56 100644 --- a/src/views/business/comps/template/comps/sp/SP003.vue +++ b/src/views/business/comps/template/comps/sp/SP003.vue @@ -18,10 +18,13 @@ -