refactor: Conformance Router - FILES page to Confomance page router done.
This commit is contained in:
@@ -57,29 +57,32 @@ const routes = [
|
||||
name: "Discover",
|
||||
children: [
|
||||
{
|
||||
// type: log | filter | rule(名稱待討論) | log-check | filter-check
|
||||
// 如果 type === rule 則轉 log-check | filter-check
|
||||
path: "/discover/map/:type/:fileId",
|
||||
name: "Map",
|
||||
component: Map,
|
||||
},
|
||||
{
|
||||
// type: log | filter | rule(名稱待討論)
|
||||
path: "/discover/conformance/:type/:fileId",
|
||||
name: "Conformance",
|
||||
component: Conformance,
|
||||
},
|
||||
{
|
||||
// type: rule(名稱待討論)
|
||||
// checkType: log | filter
|
||||
path: "/:type/:checkType/:checkId/map/:checkFileId",
|
||||
name: "CheckMap",
|
||||
component: Map,
|
||||
props: true,
|
||||
},
|
||||
{
|
||||
path: "/:type/:checkType/:checkId/conformance/:checkFileId",
|
||||
name: "CheckConformance",
|
||||
component: Conformance,
|
||||
props: true,
|
||||
},
|
||||
// {
|
||||
// // type: rule(名稱待討論)
|
||||
// // checkType: log | filter
|
||||
// path: "/:type/:checkType/:checkId/map/:checkFileId",
|
||||
// name: "CheckMap",
|
||||
// component: Map,
|
||||
// props: true,
|
||||
// },
|
||||
// {
|
||||
// path: "/:type/:checkType/:checkId/conformance/:checkFileId",
|
||||
// name: "CheckConformance",
|
||||
// component: Conformance,
|
||||
// props: true,
|
||||
// },
|
||||
{
|
||||
path: "/discover/performance/:type/:fileId",
|
||||
name: "Performance",
|
||||
|
||||
@@ -10,8 +10,10 @@ export default defineStore('conformanceStore', {
|
||||
conformanceFilterId: null, // filter 檔
|
||||
conformanceLogTempCheckId: null, // log 檔存檔前的 check Id
|
||||
conformanceFilterTempCheckId: null, // Filter 檔存檔前的 check Id
|
||||
conformanceLogCreateCheckId: null, // log 檔存檔後的 check Id
|
||||
conformanceFilterCreateCheckId: null, // Filter 檔存檔後的 check Id
|
||||
conformanceLogCreateCheckId: null, // log 檔存檔後的 check Id(rule)
|
||||
conformanceFilterCreateCheckId: null, // Filter 檔存檔後的 check Id(rule)
|
||||
conformanceType: null, // log-check | filter-check 已存檔的 rule
|
||||
conformanceParent: null, // parent log or parent filter
|
||||
allConformanceTask: [],
|
||||
allCfmSeqStart: [],
|
||||
allCfmSeqEnd: [],
|
||||
|
||||
@@ -23,9 +23,9 @@ export default {
|
||||
const conformanceStore = ConformanceStore();
|
||||
const { isLoading } = storeToRefs(loadingStore);
|
||||
const { allFiles } = storeToRefs(filesStore);
|
||||
const { conformanceLogId, conformanceFilterId, conformanceLogCreateCheckId, conformanceFilterCreateCheckId, conformanceLogTempCheckId, conformanceFilterTempCheckId, selectedRuleType, selectedActivitySequence, selectedMode, selectedProcessScope, selectedActSeqMore, selectedActSeqFromTo, conformanceRuleData, conformanceTempReportData, conformanceFileName } = storeToRefs(conformanceStore);
|
||||
const { conformanceLogId, conformanceFilterId, conformanceLogCreateCheckId, conformanceFilterCreateCheckId, conformanceLogTempCheckId, conformanceFilterTempCheckId, selectedRuleType, selectedActivitySequence, selectedMode, selectedProcessScope, selectedActSeqMore, selectedActSeqFromTo, conformanceRuleData, conformanceTempReportData, conformanceFileName, conformanceParent } = storeToRefs(conformanceStore);
|
||||
|
||||
return { filesStore, allFiles, isLoading, conformanceLogId, conformanceFilterId, conformanceLogCreateCheckId, conformanceFilterCreateCheckId, conformanceLogTempCheckId, conformanceFilterTempCheckId, conformanceStore, selectedRuleType, selectedActivitySequence, selectedMode, selectedProcessScope, selectedActSeqMore, selectedActSeqFromTo, conformanceRuleData, conformanceTempReportData, conformanceFileName }
|
||||
return { filesStore, allFiles, isLoading, conformanceLogId, conformanceFilterId, conformanceLogCreateCheckId, conformanceFilterCreateCheckId, conformanceLogTempCheckId, conformanceFilterTempCheckId, conformanceStore, selectedRuleType, selectedActivitySequence, selectedMode, selectedProcessScope, selectedActSeqMore, selectedActSeqFromTo, conformanceRuleData, conformanceTempReportData, conformanceFileName, conformanceParent }
|
||||
},
|
||||
components: {
|
||||
StatusBar,
|
||||
@@ -34,38 +34,69 @@ export default {
|
||||
},
|
||||
async created() {
|
||||
let params = this.$route.params;
|
||||
let parent;
|
||||
|
||||
this.isLoading = true;
|
||||
await this.filesStore.fetchAllFiles();
|
||||
await this.allFiles.forEach(file => {
|
||||
if(file.id == params.fileId) {
|
||||
parent = file.parent;
|
||||
this.conformanceParent = file.parent;
|
||||
}
|
||||
});
|
||||
// type: log | filter | rule(名稱待討論) | log-check(MAP page 來的已存檔 rule) | filter-check(MAP page 來的已存檔 rule)
|
||||
switch (params.type) {
|
||||
case 'log':
|
||||
case 'log': // FILES page 來的 log
|
||||
this.conformanceLogId = params.fileId;
|
||||
break;
|
||||
case 'filter':
|
||||
case 'filter': // FILES page 來的 filter
|
||||
this.conformanceFilterId = params.fileId;
|
||||
break;
|
||||
case 'rule':
|
||||
// path: "/:type/:checkType/:checkId/conformance/:checkFileId"
|
||||
switch (params.checkType) {
|
||||
// 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.fetchAllFiles();
|
||||
// await this.allFiles.forEach(file => {
|
||||
// if(file.id == this.conformanceLogCreateCheckId) return this.conformanceFileName = file.name;
|
||||
// });
|
||||
// break;
|
||||
// case 'filter':
|
||||
// this.conformanceFilterId = params.checkFileId;
|
||||
// this.conformanceFilterCreateCheckId = params.checkId;
|
||||
// // 為複寫 Modal 取得 fileName
|
||||
// await this.filesStore.fetchAllFiles();
|
||||
// await this.allFiles.forEach(file => {
|
||||
// if(file.id == this.conformanceFilterCreateCheckId) return this.conformanceFileName = file.name;
|
||||
// });
|
||||
// }
|
||||
// await this.conformanceStore.getConformanceReport();
|
||||
// break;
|
||||
case 'rule': // FILES page 來的已存檔 rule
|
||||
switch (parent.type) {
|
||||
case 'log':
|
||||
this.conformanceLogId = params.checkFileId;
|
||||
this.conformanceLogCreateCheckId = params.checkId;
|
||||
// 為複寫 Modal 取得 fileName
|
||||
await this.filesStore.fetchAllFiles();
|
||||
await this.allFiles.forEach(file => {
|
||||
if(file.id == this.conformanceLogCreateCheckId) return this.conformanceFileName = file.name;
|
||||
});
|
||||
this.conformanceLogId = parent.id;
|
||||
this.conformanceLogCreateCheckId = params.fileId;
|
||||
break;
|
||||
case 'filter':
|
||||
this.conformanceFilterId = params.checkFileId;
|
||||
this.conformanceFilterCreateCheckId = params.checkId;
|
||||
// 為複寫 Modal 取得 fileName
|
||||
await this.filesStore.fetchAllFiles();
|
||||
await this.allFiles.forEach(file => {
|
||||
if(file.id == this.conformanceFilterCreateCheckId) return this.conformanceFileName = file.name;
|
||||
});
|
||||
this.conformanceFilterId = parent.id;
|
||||
this.conformanceFilterCreateCheckId = params.fileId;
|
||||
}
|
||||
// 為複寫 Modal 取得 fileName
|
||||
this.conformanceFileName = parent.name;
|
||||
await this.conformanceStore.getConformanceReport();
|
||||
break;
|
||||
case 'log-check': // MAP page 來的已存檔 rule
|
||||
console.log('c p:', params);
|
||||
// 為複寫 Modal 取得 fileName
|
||||
this.conformanceLogCreateCheckId = params.fileId;
|
||||
this.conformanceFileName = parent.name;
|
||||
break;
|
||||
case 'filter-check': // MAP page 來的已存檔 rule
|
||||
break;
|
||||
}
|
||||
await this.conformanceStore.getConformanceParams();
|
||||
// 給 rule 檔取得 ShowBar 一些時間
|
||||
|
||||
@@ -226,6 +226,8 @@
|
||||
import IconGrid from '@/components/icons/IconGrid.vue';
|
||||
import { renameModal, deleteFileModal } from '@/module/alertModal.js';
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -366,7 +368,6 @@
|
||||
type = 'log';
|
||||
params = { type: type, fileId: fileId };
|
||||
this.$router.push({name: 'Map', params: params});
|
||||
// this.$router.push({name: 'Map', params: params, query: params});
|
||||
break;
|
||||
case 'filter':
|
||||
this.createFilterId = file.id;
|
||||
@@ -375,19 +376,31 @@
|
||||
type = 'filter';
|
||||
params = { type: type, fileId: fileId };
|
||||
this.$router.push({name: 'Map', params: params});
|
||||
// this.$router.push({name: 'Map', params: params, query: params});
|
||||
break;
|
||||
// 先不考慮 MAP 只做 CONFORMANCE
|
||||
// case 'log-check':
|
||||
// // path: "/:type/:checkType/:checkId/conformance/:checkFileId"
|
||||
// type = 'rule';
|
||||
// params = { type: type, checkType: 'log', checkId: file.id, checkFileId: file.parent.id };
|
||||
// this.$router.push({name: 'CheckConformance', params: params});
|
||||
// break
|
||||
// case 'filter-check':
|
||||
// type = 'rule';
|
||||
// params = { type: type, checkType: 'filter', checkId: file.id, checkFileId: file.parent.id };
|
||||
// this.$router.push({name: 'CheckConformance', params: params});
|
||||
// break;
|
||||
// conformanceLogId, conformanceFilterId, conformanceType
|
||||
case 'log-check':
|
||||
// path: "/:type/:checkType/:checkId/conformance/:checkFileId"
|
||||
// path: "/discover/conformance/rule/:fileId"
|
||||
fileId = file.id;
|
||||
type = 'rule';
|
||||
params = { type: type, checkType: 'log', checkId: file.id, checkFileId: file.parent.id };
|
||||
this.$router.push({name: 'CheckConformance', params: params});
|
||||
params = { type: type, fileId: fileId };
|
||||
this.$router.push({name: 'Conformance', params: params});
|
||||
break
|
||||
case 'filter-check':
|
||||
fileId = file.id;
|
||||
type = 'rule';
|
||||
params = { type: type, checkType: 'filter', checkId: file.id, checkFileId: file.parent.id };
|
||||
this.$router.push({name: 'CheckConformance', params: params});
|
||||
params = { type: type, fileId: fileId };
|
||||
this.$router.push({name: 'Conformance', params: params});
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user