WIP #295 not yet keep previous page
This commit is contained in:
@@ -89,7 +89,9 @@ export default {
|
||||
*/
|
||||
changeHandler(event) {
|
||||
let inputValue = event.target.value;
|
||||
if(inputValue !== '') this.isInvalid = false;
|
||||
if(inputValue !== '') {
|
||||
this.isInvalid = false;
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { storeToRefs, mapActions, } from 'pinia';
|
||||
import LoadingStore from '@/stores/loading.js';
|
||||
import AllMapDataStore from '@/stores/allMapData.js';
|
||||
import ConformanceStore from '@/stores/conformance.js';
|
||||
@@ -18,6 +18,7 @@ import Header from "@/components/Header.vue";
|
||||
import Navbar from "@/components/Navbar.vue";
|
||||
import Loading from '@/components/Loading.vue';
|
||||
import { leaveFilter, leaveConformance } from '@/module/alertModal.js';
|
||||
import PageAdminStore from '@/stores/pageAdmin.js';
|
||||
|
||||
export default {
|
||||
name: 'MainContainer',
|
||||
@@ -28,13 +29,21 @@ export default {
|
||||
const { tempFilterId, createFilterId, temporaryData, postRuleData, ruleData } = storeToRefs(allMapDataStore);
|
||||
const { conformanceLogTempCheckId, conformanceFilterTempCheckId } = storeToRefs(conformanceStore);
|
||||
|
||||
return { loadingStore, temporaryData, tempFilterId, createFilterId, postRuleData, ruleData, conformanceLogTempCheckId, conformanceFilterTempCheckId, allMapDataStore, conformanceStore };
|
||||
return {
|
||||
loadingStore, temporaryData, tempFilterId,
|
||||
createFilterId, postRuleData, ruleData,
|
||||
conformanceLogTempCheckId, conformanceFilterTempCheckId,
|
||||
allMapDataStore, conformanceStore,
|
||||
};
|
||||
},
|
||||
components: {
|
||||
Header,
|
||||
Navbar,
|
||||
Loading
|
||||
},
|
||||
methods: {
|
||||
...mapActions(PageAdminStore, ['copyPendingPageToActivePage',],),
|
||||
},
|
||||
created() {
|
||||
// Save token in Headers.
|
||||
const token = document.cookie.replace(/(?:(?:^|.*;\s*)luciaToken\s*\=\s*([^;]*).*$)|^.*$/, "$1");
|
||||
@@ -46,9 +55,17 @@ export default {
|
||||
// 傳給 Map,通知 Sidebar 要關閉。
|
||||
this.$emitter.emit('leaveFilter', false);
|
||||
leaveFilter(next, this.allMapDataStore.addFilterId, to.path)
|
||||
} else if((this.$route.name === 'Conformance' || this.$route.name === 'CheckConformance') && (this.conformanceLogTempCheckId || this.conformanceFilterTempCheckId)) {
|
||||
} else if((this.$route.name === 'Conformance' || this.$route.name === 'CheckConformance')
|
||||
&& (this.conformanceLogTempCheckId || this.conformanceFilterTempCheckId)) {
|
||||
leaveConformance(next, this.conformanceStore.addConformanceCreateCheckId, to.path)
|
||||
} else next();
|
||||
} else {
|
||||
// In this else block:
|
||||
// for those pages who don't need popup modals, we handle page administration right now.
|
||||
// By calling the following code, we decide the next visiting page.
|
||||
this.copyPendingPageToActivePage();
|
||||
|
||||
next();
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user