From 73845ec73a802528fdeb718da781b1d0fa2f9eb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?= <963808678@qq.com> Date: Tue, 22 Nov 2022 11:12:44 +0800 Subject: [PATCH] 11/22 --- src/views/main/Customer/index.vue | 57 +++++++++++++++---------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/src/views/main/Customer/index.vue b/src/views/main/Customer/index.vue index c92bc00..1e5f8fa 100644 --- a/src/views/main/Customer/index.vue +++ b/src/views/main/Customer/index.vue @@ -4,11 +4,7 @@ -
+
@@ -448,34 +444,37 @@ export default { this.$forceUpdate() }) DjyCustomerGet({ type: 'customer_cond_cfg' }).then(res => { - this.ColumnsQueryL = JSON.parse(res.data.configJson).length - if (JSON.parse(res.data.configJson).length) { - this.ColumnsQuery = [] - columns.forEach(item => { - this.ColumnsQuery.push({ ...item, checked: false }) - }) - let Arr = [] - JSON.parse(res.data.configJson).forEach(item => { - this.ColumnsQuery.forEach(item2 => { - if (item == item2.dataIndex) { - item2.checked = true - Arr.push(item2) - } + if (res.data) { + this.ColumnsQueryL = JSON.parse(res.data.configJson).length + if (JSON.parse(res.data.configJson).length) { + this.ColumnsQuery = [] + columns.forEach(item => { + this.ColumnsQuery.push({ ...item, checked: false }) }) - }) - this.ColumnsQuery.forEach(item => { - let type = true - Arr.forEach(item2 => { - if (item.dataIndex == item2.dataIndex) { - type = false + let Arr = [] + JSON.parse(res.data.configJson).forEach(item => { + this.ColumnsQuery.forEach(item2 => { + if (item == item2.dataIndex) { + item2.checked = true + Arr.push(item2) + } + }) + }) + this.ColumnsQuery.forEach(item => { + let type = true + Arr.forEach(item2 => { + if (item.dataIndex == item2.dataIndex) { + type = false + } + }) + if (type) { + Arr.push(item) } }) - if (type) { - Arr.push(item) - } - }) - this.ColumnsQuery = Arr + this.ColumnsQuery = Arr + } } + this.$forceUpdate() }) },