|
|
@ -73,7 +73,7 @@ |
|
|
:fieldItemLabel="fieldItemLabel" type="select" class="body-select" |
|
|
:fieldItemLabel="fieldItemLabel" type="select" class="body-select" |
|
|
@blur="onBlur(rowIndex, col.prop, $event)" |
|
|
@blur="onBlur(rowIndex, col.prop, $event)" |
|
|
:item="getBodyItem(col, rowIndex)" v-model="row[col.prop]" |
|
|
: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)" |
|
|
:error="hasError(rowIndex, colIndex, col.prop)" |
|
|
@update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)" |
|
|
@update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)" |
|
|
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" /> |
|
|
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" /> |
|
|
@ -135,7 +135,7 @@ |
|
|
@blur="onSubBlur(rowIndex, col.bodySubKey, $event)" |
|
|
@blur="onSubBlur(rowIndex, col.bodySubKey, $event)" |
|
|
@copy="onCopy(rowIndex, col)" :item="getBodySubItem(col)" |
|
|
@copy="onCopy(rowIndex, col)" :item="getBodySubItem(col)" |
|
|
v-model="row[col.bodySubKey]" |
|
|
v-model="row[col.bodySubKey]" |
|
|
@change="onBodySubValueChange(rowIndex, colIndex, $event)" |
|
|
|
|
|
|
|
|
@change="onBodySubValueChange(rowIndex, colIndex,$event,)" |
|
|
:error="hasError(rowIndex, colIndex, col.bodySubKey)" |
|
|
:error="hasError(rowIndex, colIndex, col.bodySubKey)" |
|
|
@update:error="onErrorUpdate(rowIndex, colIndex, col.bodySubKey, $event)" |
|
|
@update:error="onErrorUpdate(rowIndex, colIndex, col.bodySubKey, $event)" |
|
|
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.bodySubKey)" /> |
|
|
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.bodySubKey)" /> |
|
|
@ -145,7 +145,7 @@ |
|
|
:fieldItemLabel="fieldItemLabel" type="select" class="body-select" |
|
|
:fieldItemLabel="fieldItemLabel" type="select" class="body-select" |
|
|
@blur="onSubBlur(rowIndex, col.bodySubKey, $event)" |
|
|
@blur="onSubBlur(rowIndex, col.bodySubKey, $event)" |
|
|
:item="getBodySubItem(col, rowIndex)" v-model="row[col.bodySubKey]" |
|
|
: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)" |
|
|
:error="hasError(rowIndex, colIndex, col.bodySubKey)" |
|
|
@update:error="onErrorUpdate(rowIndex, colIndex, col.bodySubKey, $event)" |
|
|
@update:error="onErrorUpdate(rowIndex, colIndex, col.bodySubKey, $event)" |
|
|
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.bodySubKey)" /> |
|
|
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.bodySubKey)" /> |
|
|
@ -506,12 +506,11 @@ export default { |
|
|
}, |
|
|
}, |
|
|
// 表头选择器变化 |
|
|
// 表头选择器变化 |
|
|
onHeaderSelectChange(col, value) { |
|
|
onHeaderSelectChange(col, value) { |
|
|
console.log(col,"ccc") |
|
|
|
|
|
if (col.headerSelectTo) { |
|
|
if (col.headerSelectTo) { |
|
|
this.headerSelectFields[col.headerSelectTo] = value; |
|
|
this.headerSelectFields[col.headerSelectTo] = value; |
|
|
} |
|
|
} |
|
|
this.headerSelectFields[col.headerSelectKey] = 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 => |
|
|
this.formErrors = this.formErrors.filter(error => |
|
|
!(error.rowIndex === -1 && |
|
|
!(error.rowIndex === -1 && |
|
|
@ -573,7 +572,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 表体值变化 |
|
|
// 表体值变化 |
|
|
onBodyValueChange(rowIndex, colIndex, value) { |
|
|
|
|
|
|
|
|
onBodyValueChange(rowIndex, colIndex, value,row,type) { |
|
|
const col = this.columns[colIndex]; |
|
|
const col = this.columns[colIndex]; |
|
|
this.localDataSource[rowIndex][col.prop] = value; |
|
|
this.localDataSource[rowIndex][col.prop] = value; |
|
|
|
|
|
|
|
|
@ -586,10 +585,12 @@ export default { |
|
|
error.colIndex === colIndex && |
|
|
error.colIndex === colIndex && |
|
|
error.field === col.prop) |
|
|
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]; |
|
|
const col = this.columns[colIndex]; |
|
|
this.localDataSource[rowIndex][col.bodySubKey] = value; |
|
|
this.localDataSource[rowIndex][col.bodySubKey] = value; |
|
|
|
|
|
|
|
|
@ -612,7 +613,9 @@ export default { |
|
|
error.colIndex === colIndex && |
|
|
error.colIndex === colIndex && |
|
|
error.field === col.bodySubKey) |
|
|
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) { |
|
|
getHeaderItem(col) { |
|
|
return { |
|
|
return { |
|
|
|