From ee0145c748745ae572b685775efcae142cd5e683 Mon Sep 17 00:00:00 2001 From: lilu Date: Fri, 24 Mar 2023 14:59:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=B0=E8=B4=A6=E8=87=AA=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/main/BookingLedger/list/index.vue | 22 +++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/views/main/BookingLedger/list/index.vue b/src/views/main/BookingLedger/list/index.vue index 9d40baa..7dd2167 100644 --- a/src/views/main/BookingLedger/list/index.vue +++ b/src/views/main/BookingLedger/list/index.vue @@ -787,19 +787,33 @@ export default { typeArr: ['booking_list_cond', 'booking_list_column'] } DjyUserConfigMulti(this.$qs.stringify(query, { arrayFormat: 'repeat' })).then(res => { + const $data = {} res.data.map((item, index) => { switch (item.type) { case 'booking_list_cond': - this.setFormData(item, false, true) + this.$set($data, 'booking_list_cond', item) + // this.setFormData(item, false, true) break case 'booking_list_column': - this.setTableList(item) + this.$set($data, 'booking_list_column', item) + // this.setTableList(item) break // case 'booking_list_page': // this.setPageSize(item) // break } }) + console.log('获取到自定义数据', $data) + if (Object.keys($data).includes('booking_list_cond')) { + this.setFormData($data.booking_list_cond, false, true) + } else { + this.setFormData({}, false, true) + } + if (Object.keys($data).includes('booking_list_column')) { + this.setTableList($data.booking_list_column) + } else { + this.setTableList({}) + } }) }, // 船公司 - start @@ -863,7 +877,7 @@ export default { }) }, setFormData (data, isReset = false, isInit = false) { - if (data && JSON.parse(data.configJson).length) { + if (Object.keys(data).length > 0 && JSON.parse(data.configJson).length) { const arr = JSON.parse(data.configJson) const nowData = [] const moreData = [] @@ -917,7 +931,7 @@ export default { this.$forceUpdate() }, setTableList (data) { - if (data && JSON.parse(data.configJson).length) { + if (Object.keys(data).length > 0 && JSON.parse(data.configJson).length) { this.formTableData = JSON.parse(data.configJson) const nowTableArr = this.formTableData.map((item, index) => { if (item.field === 'operate') {