diff --git a/src/views/components/resiSearch.vue b/src/views/components/resiSearch.vue index 53fc6314..2e31ee63 100644 --- a/src/views/components/resiSearch.vue +++ b/src/views/components/resiSearch.vue @@ -207,10 +207,14 @@ export default { formList: { type: Array, default: () => [] + }, + columnName: { + type: String, + default: '' } }, data() { - let initForm = (arr) => { + let initForm = (arr, columnName) => { let _form = {} // console.log('formInfo', obj) // if (Object.keys(obj).length > 0) { @@ -218,12 +222,19 @@ export default { // return _form // } arr.forEach((item) => { - _form[item.columnName] = '' + if (columnName && columnName === item.columnName) _form[item.columnName] = '1' + else _form[item.columnName] = '' }) return _form } - let form = initForm(this.formList) - let tempFormList = [...this.formList] + let form = initForm(this.formList, this.columnName) + let tempFormList = this.formList.map(item => { + + return { + ...item, + isChange: this.columnName && this.columnName === item.columnName ? true : false + } + }) let constForm = { ...form, GRID_ID: '', @@ -339,6 +350,7 @@ export default { // console.log('formcccc---', this.form) this.getGridList() this.getValiheList() + if (this.columnName) this.handleChangeForm(this.columnName) }, methods: { initForm() { diff --git a/src/views/modules/base/resi.vue b/src/views/modules/base/resi.vue index 9c1404ef..c07f90f6 100644 --- a/src/views/modules/base/resi.vue +++ b/src/views/modules/base/resi.vue @@ -1,9 +1,10 @@