From 2a216142487e3a02fd67c60523b76f84d735a39e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?= <963808678@qq.com> Date: Fri, 18 Nov 2022 11:22:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=9F=E6=88=B7=E5=8F=82=E6=95=B0=E7=B1=BB?= =?UTF-8?q?=E5=88=AB=20=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/main/DJYTenantParam/indexItem.vue | 25 ++++++++++----------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/views/main/DJYTenantParam/indexItem.vue b/src/views/main/DJYTenantParam/indexItem.vue index 7d1ea3d..eea09a9 100644 --- a/src/views/main/DJYTenantParam/indexItem.vue +++ b/src/views/main/DJYTenantParam/indexItem.vue @@ -251,24 +251,23 @@ export default { DJYTenantParamGet({ pageNo: 1, pageSize: 999 }).then(res => { this.TypeData = res.data let data = [] - let type = '' - let num = -1 res.data.forEach(item => { - if (type != item.type) { - num = num + 1 - type = item.type - } - // if (data.length == 0) { - if (data[num]) { - data[num].push(item) + if (data.length) { + let type2 = false + data.forEach((item2, index2) => { + if (item.type == item2[0].type) { + item2.push(item) + type2 = true + } + }) + if (!type2) { + data[data.length] = [item] + } } else { - data[num] = [] - data[num].push(item) + data[0] = [item] } - // } }) this.WTypeData = data - console.log(data) }) SysTenantPage({ pageNo: 1, pageSize: 9999, name: '' }).then(res => { this.TenantData = res.data.rows