Issue #144: Done.

This commit is contained in:
chiayin
2023-10-05 17:20:35 +08:00
parent 897f8d0a41
commit a7f51e3444

View File

@@ -48,9 +48,9 @@ export default {
const loadingStore = LoadingStore(); const loadingStore = LoadingStore();
const allMapDataStore = AllMapDataStore(); const allMapDataStore = AllMapDataStore();
const { isLoading } = storeToRefs(loadingStore); 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: { methods: {
/** /**
@@ -67,11 +67,19 @@ export default {
/** /**
* header:Funnel 刪除全部的 Funnel * header:Funnel 刪除全部的 Funnel
*/ */
deleteRule(index) { async deleteRule(index) {
if(index === 'all') { if(index === 'all') {
this.temporaryData = []; this.temporaryData = [];
this.isRuleData = []; this.isRuleData = [];
this.ruleData = []; 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.'); this.$toast.success('All deleted.');
}else{ }else{
this.$toast.success(`Delete ${this.ruleData[index].label}.`); this.$toast.success(`Delete ${this.ruleData[index].label}.`);
@@ -104,7 +112,7 @@ export default {
this.$toast.warning('No Data.'); this.$toast.warning('No Data.');
}; };
}, },
}, }
} }
</script> </script>