feat: Conformance Save Log Done.
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
<template>
|
||||
<!-- conformanceLogId: {{ conformanceLogId }} <br>
|
||||
conformanceFilterId: {{ conformanceFilterId }} <br>
|
||||
conformanceLogTempCheckId: {{ conformanceLogTempCheckId }} <br>
|
||||
conformanceFilterTempCheckId: {{ conformanceFilterTempCheckId }} <br>
|
||||
conformanceLogCreateCheckId: {{ conformanceLogCreateCheckId }} <br>
|
||||
conformanceFilterCreateCheckId: {{ conformanceFilterCreateCheckId }} <br> -->
|
||||
<main class="h-screen-main relative">
|
||||
<div class="h-full relative bg-neutral-50">
|
||||
<ConformanceSidebar></ConformanceSidebar>
|
||||
@@ -9,6 +15,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { storeToRefs } from 'pinia';
|
||||
import FilesStore from '@/stores/files.js';
|
||||
import LoadingStore from '@/stores/loading.js';
|
||||
import ConformanceStore from '@/stores/conformance.js';
|
||||
import StatusBar from '@/components/Discover/Conformance/StatusBar.vue';
|
||||
@@ -17,12 +24,14 @@ import ConformanceSidebar from '@/components/Discover/Conformance/ConformanceSid
|
||||
|
||||
export default {
|
||||
setup() {
|
||||
const filesStore = FilesStore();
|
||||
const loadingStore = LoadingStore();
|
||||
const conformanceStore = ConformanceStore();
|
||||
const { isLoading } = storeToRefs(loadingStore);
|
||||
const { conformanceLogId, conformanceFilterId, selectedRuleType, selectedActivitySequence, selectedMode, selectedProcessScope, selectedActSeqMore, selectedActSeqFromTo } = storeToRefs(conformanceStore);
|
||||
const { allConformanceLog, allConformanceFilter } = storeToRefs(filesStore);
|
||||
const { conformanceLogId, conformanceFilterId, conformanceLogCreateCheckId, conformanceFilterCreateCheckId, conformanceLogTempCheckId, conformanceFilterTempCheckId, selectedRuleType, selectedActivitySequence, selectedMode, selectedProcessScope, selectedActSeqMore, selectedActSeqFromTo, conformanceRuleData, conformanceTempReportData, conformanceFileName } = storeToRefs(conformanceStore);
|
||||
|
||||
return { isLoading, conformanceLogId, conformanceFilterId, conformanceStore, selectedRuleType, selectedActivitySequence, selectedMode, selectedProcessScope, selectedActSeqMore, selectedActSeqFromTo, }
|
||||
return { filesStore, allConformanceLog, allConformanceFilter, isLoading, conformanceLogId, conformanceFilterId, conformanceLogCreateCheckId, conformanceFilterCreateCheckId, conformanceLogTempCheckId, conformanceFilterTempCheckId, conformanceStore, selectedRuleType, selectedActivitySequence, selectedMode, selectedProcessScope, selectedActSeqMore, selectedActSeqFromTo, conformanceRuleData, conformanceTempReportData, conformanceFileName }
|
||||
},
|
||||
components: {
|
||||
StatusBar,
|
||||
@@ -30,13 +39,37 @@ export default {
|
||||
ConformanceSidebar,
|
||||
},
|
||||
async created() {
|
||||
// let logId;
|
||||
let params = this.$route.params;
|
||||
|
||||
this.isLoading = true;
|
||||
if(this.$route.params.type === 'log') this.conformanceLogId = this.$route.params.fileId;
|
||||
else if(this.$route.params.type === 'filter') this.conformanceFilterId = this.$route.params.fileId;
|
||||
|
||||
switch (params.type) {
|
||||
case 'log':
|
||||
this.conformanceLogId = params.fileId;
|
||||
break;
|
||||
case 'filter':
|
||||
this.conformanceFilterId = params.fileId;
|
||||
break;
|
||||
case 'rule':
|
||||
// path: "/:type/:checkType/:checkId/conformance/:checkFileId"
|
||||
switch (params.checkType) {
|
||||
case 'log':
|
||||
this.conformanceLogId = params.checkFileId;
|
||||
this.conformanceLogCreateCheckId = params.checkId;
|
||||
// 為複寫 Modal 取得 fileName
|
||||
await this.filesStore.fetchConformanceLog();
|
||||
await this.allConformanceLog.forEach(file => this.conformanceFileName = file.id == this.conformanceLogCreateCheckId ? file.name : null);
|
||||
break;
|
||||
case 'filter':
|
||||
this.conformanceFilterId = params.checkFileId;
|
||||
this.conformanceFilterCreateCheckId = params.checkId;
|
||||
// 為複寫 Modal 取得 fileName
|
||||
await this.filesStore.fetchConformanceFilter();
|
||||
await this.allConformanceFilter.forEach(file => this.conformanceFileName = file.id == this.conformanceLogCreateCheckId ? file.name : null);
|
||||
}
|
||||
await this.conformanceStore.getConformanceReport();
|
||||
break;
|
||||
}
|
||||
await this.conformanceStore.getConformanceParams();
|
||||
|
||||
this.isLoading = false;
|
||||
},
|
||||
mounted() {
|
||||
@@ -47,5 +80,14 @@ export default {
|
||||
this.selectedActSeqMore = 'All';
|
||||
this.selectedActSeqFromTo = 'From';
|
||||
},
|
||||
beforeUnmount() {
|
||||
// 離開 conformance 時將 id 為 null,避免污染其他檔案
|
||||
this.conformanceLogId = null;
|
||||
this.conformanceFilterId = null;
|
||||
this.conformanceLogCreateCheckId = null;
|
||||
this.conformanceFilterCreateCheckId = null;
|
||||
this.conformanceRuleData = null;
|
||||
this.conformanceFileName = null;
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -154,7 +154,17 @@
|
||||
this.$router.push({name: 'Map', params: params});
|
||||
// this.$router.push({name: 'Map', params: params, query: params});
|
||||
break;
|
||||
default:
|
||||
// 先不考慮 MAP 只做 CONFORMANCE
|
||||
case 'Rule':
|
||||
// path: "/:type/:checkType/:checkId/conformance/:checkFileId"
|
||||
type = 'rule';
|
||||
if(file.log){
|
||||
params = { type: type, checkType: 'log', checkId: file.id, checkFileId: file.log.id };
|
||||
this.$router.push({name: 'CheckConformance', params: params});
|
||||
} else if(file.filter) {
|
||||
params = { type: type, checkType: 'filter', checkId: file.id, checkFileId: file.filter.id };
|
||||
this.$router.push({name: 'CheckConformance', params: params});
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -162,6 +172,8 @@
|
||||
mounted() {
|
||||
this.store.fetchEventLog();
|
||||
this.store.fetchFilter();
|
||||
this.store.fetchConformanceLog();
|
||||
this.store.fetchConformanceFilter();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user