refactor: Issues #177 change files API done.
This commit is contained in:
@@ -22,10 +22,10 @@ export default {
|
||||
const loadingStore = LoadingStore();
|
||||
const conformanceStore = ConformanceStore();
|
||||
const { isLoading } = storeToRefs(loadingStore);
|
||||
const { allConformanceLog, allConformanceFilter } = storeToRefs(filesStore);
|
||||
const { allFiles } = storeToRefs(filesStore);
|
||||
const { conformanceLogId, conformanceFilterId, conformanceLogCreateCheckId, conformanceFilterCreateCheckId, conformanceLogTempCheckId, conformanceFilterTempCheckId, selectedRuleType, selectedActivitySequence, selectedMode, selectedProcessScope, selectedActSeqMore, selectedActSeqFromTo, conformanceRuleData, conformanceTempReportData, conformanceFileName } = storeToRefs(conformanceStore);
|
||||
|
||||
return { filesStore, allConformanceLog, allConformanceFilter, 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 }
|
||||
},
|
||||
components: {
|
||||
StatusBar,
|
||||
@@ -50,8 +50,8 @@ export default {
|
||||
this.conformanceLogId = params.checkFileId;
|
||||
this.conformanceLogCreateCheckId = params.checkId;
|
||||
// 為複寫 Modal 取得 fileName
|
||||
await this.filesStore.fetchConformanceLog();
|
||||
await this.allConformanceLog.forEach(file => {
|
||||
await this.filesStore.fetchAllFiles();
|
||||
await this.allFiles.forEach(file => {
|
||||
if(file.id == this.conformanceLogCreateCheckId) return this.conformanceFileName = file.name;
|
||||
});
|
||||
break;
|
||||
@@ -59,8 +59,8 @@ export default {
|
||||
this.conformanceFilterId = params.checkFileId;
|
||||
this.conformanceFilterCreateCheckId = params.checkId;
|
||||
// 為複寫 Modal 取得 fileName
|
||||
await this.filesStore.fetchConformanceFilter();
|
||||
await this.allConformanceFilter.forEach(file => {
|
||||
await this.filesStore.fetchAllFiles();
|
||||
await this.allFiles.forEach(file => {
|
||||
if(file.id == this.conformanceFilterCreateCheckId) return this.conformanceFileName = file.name;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -138,8 +138,8 @@
|
||||
let fileId;
|
||||
let params;
|
||||
|
||||
switch (file.fileType) {
|
||||
case 'Log':
|
||||
switch (file.type) {
|
||||
case 'log':
|
||||
this.createFilterId = null;
|
||||
this.baseLogId = file.id;
|
||||
fileId = file.id;
|
||||
@@ -148,9 +148,9 @@
|
||||
this.$router.push({name: 'Map', params: params});
|
||||
// this.$router.push({name: 'Map', params: params, query: params});
|
||||
break;
|
||||
case 'Filter':
|
||||
case 'filter':
|
||||
this.createFilterId = file.id;
|
||||
this.baseLogId = file.log.id;
|
||||
this.baseLogId = file.parent.id;
|
||||
fileId = file.id;
|
||||
type = 'filter';
|
||||
params = { type: type, fileId: fileId };
|
||||
@@ -158,26 +158,23 @@
|
||||
// this.$router.push({name: 'Map', params: params, query: params});
|
||||
break;
|
||||
// 先不考慮 MAP 只做 CONFORMANCE
|
||||
case 'Rule':
|
||||
case 'log-check':
|
||||
// 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});
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.isLoading = true;
|
||||
this.store.fetchEventLog();
|
||||
this.store.fetchFilter();
|
||||
this.store.fetchConformanceLog();
|
||||
this.store.fetchConformanceFilter();
|
||||
this.store.fetchAllFiles();
|
||||
this.isLoading = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user