Discover: Filters Save done.

This commit is contained in:
chiayin
2023-05-02 17:02:05 +08:00
parent 378d6ea550
commit c1df89fefb
7 changed files with 107 additions and 39 deletions

View File

@@ -33,7 +33,8 @@ export default {
},
watch: {
$route: function(to, from) {
if(to.name !== 'Discover') {
// 離開 DiscoverLog 頁要將 Funnel 的規則刪除, DiscoverFilter 會帶上次儲存的 Funnel, 所以不用錯做
if(to.name !== 'DiscoverLog') {
this.tempFilterId = null;
this.temporaryData = []
this.postRuleData = []
@@ -60,7 +61,7 @@ export default {
},
beforeRouteUpdate(to, from, next) {
// 離開 Discover 頁時判斷是否有無資料和需要存檔
if (from.name === 'Discover' && this.tempFilterId) {
if ((from.name === 'DiscoverLog' || from.name === 'DiscoverFilter') && this.tempFilterId) {
leaveFilter(next, this.allMapDataStore.addFilterId)
} else {
next();