From 850fbeddcd514476756acde45c3136eabe087240 Mon Sep 17 00:00:00 2001 From: gjj <Ganjj@probim.com.cn> Date: Tue, 18 Mar 2025 15:17:47 +0800 Subject: [PATCH] 标段筛选去重 --- src/views/ProjectView.vue | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/src/views/ProjectView.vue b/src/views/ProjectView.vue index 152b5f3..52f0b8c 100644 --- a/src/views/ProjectView.vue +++ b/src/views/ProjectView.vue @@ -269,7 +269,9 @@ newArray.push({ text: item.Bind, value: item.Bind }) } }) - this.bindFilters = newArray + this.bindFilters = this.arrayFilter(newArray, 'value') + console.log(newArray, this.bindFilters); + } else { this.tableData = [] } @@ -277,6 +279,12 @@ } }); }, + // 数组去重 + arrayFilter (arr, key) { + const res = new Map() + return arr.filter(arr => !res.has(arr[key]) && res.set(arr[key], 1)) + }, + getParticipatingNumber() { const data = { "organizeId": this.projectId -- Gitblit v1.9.3