feat: Conformance Save Logout done.

This commit is contained in:
chiayin
2023-12-01 14:24:05 +08:00
parent c26a1dfee7
commit 8b502e67f4
8 changed files with 78 additions and 49 deletions

View File

@@ -31,17 +31,6 @@ export default {
return { checkLogin, loadingStore, temporaryData, tempFilterId, createFilterId, postRuleData, ruleData, allMapDataStore };
},
watch: {
$route: function(to, from) {
// 離開 Map Log 頁要將 Funnel 的規則刪除, Map Filter 會帶上次儲存的 Funnel, 所以不用做
if(from.name === 'Map' && from.params.type === 'log') {
this.tempFilterId = null;
this.temporaryData = [];
this.postRuleData = [];
this.ruleData = [];
}
}
},
components: {
Header,
Navbar,
@@ -58,14 +47,14 @@ export default {
this.checkLogin();
},
beforeRouteUpdate(to, from, next) {
// 離開 Discover 頁時判斷是否有無資料和需要存檔
if ((from.name === 'Map') && this.tempFilterId) {
// 離開 Map 頁時判斷是否有無資料和需要存檔
if ((from.name === 'Map' || from.name === 'CheckMap') && this.tempFilterId) {
// 傳給 Map通知 Sidebar 要關閉。
this.$emitter.emit('leaveFilter', false);
leaveFilter(next, this.allMapDataStore.addFilterId, to.path)
} else {
next();
}
} else if((this.$route.name === 'Conformance' || this.$route.name === 'CheckConformance') && (this.conformanceLogTempCheckId || this.conformanceFilterTempCheckId)) {
leaveFilter(false, this.conformanceStore.addConformanceCreateCheckId, false, this.logOut)
} else next();
},
};
</script>