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