From fa5f4348eae222525330b42da043883562e27a29 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Fri, 14 Mar 2025 19:08:14 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=20(#4808)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: ibuler --- src/components/Cards/SummaryCard/index.vue | 10 +- .../ListTable/TableAction/QuickFilter.vue | 267 ++++++++++-------- src/components/Table/TreeTable/index.vue | 4 +- 3 files changed, 152 insertions(+), 129 deletions(-) diff --git a/src/components/Cards/SummaryCard/index.vue b/src/components/Cards/SummaryCard/index.vue index 2c80101a0..b85b3ce55 100644 --- a/src/components/Cards/SummaryCard/index.vue +++ b/src/components/Cards/SummaryCard/index.vue @@ -1,19 +1,19 @@ @@ -76,10 +70,11 @@ export default { }, data() { return { - iFilters: this.cleanFilters(), - iSummary: this.cleanSummary(), + iFilters: [], + iSummary: [], filtered: {}, - activeFilters: [] + activeFilters: [], + reCount: false } }, computed: { @@ -92,7 +87,32 @@ export default { } } }, + watch: { + tableUrl() { + this.generateCount() + } + }, + mounted() { + this.iFilters = this.cleanFilters() + this.iSummary = this.cleanSummary() + this.generateCount() + }, methods: { + async generateCount() { + this.iFilters.forEach(category => { + category.options.forEach(option => { + if (option.hasCount) { + option.count = null + this.getCount(option) + } + }) + }) + + this.iSummary.forEach(item => { + item.count = null + this.getCount(item) + }) + }, async getCount(item) { if (item.count || item.count === 0) { return item.count @@ -117,6 +137,7 @@ export default { category: 'summary', label: item.title, ...item, + count: null, filter: item.filter || {}, active: false } @@ -170,138 +191,138 @@ export default { } diff --git a/src/components/Table/TreeTable/index.vue b/src/components/Table/TreeTable/index.vue index e97879b1b..63458212b 100644 --- a/src/components/Table/TreeTable/index.vue +++ b/src/components/Table/TreeTable/index.vue @@ -7,7 +7,9 @@ :style="{width: treeWidth}" class="left" > - {{ $t('AssetTree') }} + + {{ $t('AssetTree') }} +