refactor: Issues #177 change files API done.

This commit is contained in:
chiayin
2023-12-14 15:36:50 +08:00
parent 9c7fd4a202
commit 911abc2139
3 changed files with 72 additions and 32 deletions

View File

@@ -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;
}
}