From a7f51e3444974dc00b207bd75674e9de938f3503 Mon Sep 17 00:00:00 2001 From: chiayin Date: Thu, 5 Oct 2023 17:20:35 +0800 Subject: [PATCH] Issue #144: Done. --- src/components/Discover/Map/Filter/Funnel.vue | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/Discover/Map/Filter/Funnel.vue b/src/components/Discover/Map/Filter/Funnel.vue index d1c4141..c98eb39 100644 --- a/src/components/Discover/Map/Filter/Funnel.vue +++ b/src/components/Discover/Map/Filter/Funnel.vue @@ -48,9 +48,9 @@ export default { const loadingStore = LoadingStore(); const allMapDataStore = AllMapDataStore(); const { isLoading } = storeToRefs(loadingStore); - const { hasResultRule, temporaryData, postRuleData, ruleData, isRuleData} = storeToRefs(allMapDataStore); + const { hasResultRule, temporaryData, postRuleData, ruleData, isRuleData, tempFilterId } = storeToRefs(allMapDataStore); - return { isLoading, hasResultRule, temporaryData, postRuleData, ruleData, isRuleData, allMapDataStore } + return { isLoading, hasResultRule, temporaryData, postRuleData, ruleData, isRuleData, allMapDataStore, tempFilterId, allMapDataStore } }, methods: { /** @@ -67,11 +67,19 @@ export default { /** * header:Funnel 刪除全部的 Funnel */ - deleteRule(index) { + async deleteRule(index) { if(index === 'all') { this.temporaryData = []; this.isRuleData = []; this.ruleData = []; + if(this.tempFilterId) { + this.isLoading = true; + this.tempFilterId = await null; + await this.allMapDataStore.getAllMapData(); + await this.allMapDataStore.getAllTrace(); // SidebarTrace 要連動 + await this.$emit('submit-all'); + this.isLoading = false; + } this.$toast.success('All deleted.'); }else{ this.$toast.success(`Delete ${this.ruleData[index].label}.`); @@ -104,7 +112,7 @@ export default { this.$toast.warning('No Data.'); }; }, - }, + } }