feat: Conformance Save switchNavItem done.

This commit is contained in:
chiayin
2023-11-30 12:19:46 +08:00
parent 95c429ef00
commit c26a1dfee7
4 changed files with 48 additions and 21 deletions

View File

@@ -608,7 +608,7 @@ export default {
break;
}
}
}, 200);
}, 300);
}
}
},

View File

@@ -114,16 +114,21 @@ export default {
let type;
let fileId;
if(this.navViewName === 'FILES') {
this.store.filesTag = event.target.innerText;
} else if(this.navViewName === 'DISCOVER') {
type = this.$route.params.type;
fileId = this.$route.params.fileId;
if(event.target.innerText === 'MAP') {
this.$router.push({name: 'Map', params: { type: type, fileId: fileId }})
} else if(event.target.innerText === 'CONFORMANCE') {
this.$router.push({name: 'Conformance', params: { type: type, fileId: fileId }})
}
switch (this.navViewName) {
case 'FILES':
this.store.filesTag = event.target.innerText;
break;
case 'DISCOVER':
type = this.$route.params.type;
fileId = this.$route.params.fileId;
if(event.target.innerText === 'MAP') {
if(type === 'rule') this.$router.push({name: 'CheckMap'});
else this.$router.push({name: 'Map', params: { type: type, fileId: fileId }});
} else if(event.target.innerText === 'CONFORMANCE') {
if(type === 'rule') this.$router.push({name: 'CheckConformance'});
else this.$router.push({name: 'Conformance', params: { type: type, fileId: fileId }});
}
break;
}
},
getNavViewName() {

View File

@@ -70,7 +70,8 @@ export default {
break;
}
await this.conformanceStore.getConformanceParams();
this.isLoading = false;
// 給 rule 檔取得 ShowBar 一些時間
setTimeout(() => this.isLoading = false, 500);
},
mounted() {
this.selectedRuleType = 'Have activity';

View File

@@ -71,6 +71,7 @@ export default {
return { isLoading, processMap, bpmn, stats, insights, traceId, traces, baseTraces, baseTraceId, filterTasks, filterStartToEnd, filterEndToStart, filterTimeframe, filterTrace, logId, baseLogId, createFilterId, temporaryData, isRuleData, ruleData, allMapDataStore, cases }
},
props:['type', 'checkType', 'checkId', 'checkFileId'], // 來自 router 的 props
components: {
SidebarView,
SidebarState,
@@ -327,18 +328,38 @@ export default {
},
},
async created() {
const routeParams = this.$route.params;
// 先 loading 再執行以下程式
this.isLoading = true;
// Log 檔前往 Map Log 頁, Filter 檔前往 Map Filter 頁
if(this.$route.params.type === 'log'){
this.logId = this.$route.params.fileId;
this.baseLogId = this.$route.params.fileId;
}else if(this.$route.params.type === 'filter') {
this.createFilterId = this.$route.params.fileId;
// 取得 logID 和上次儲存的 Funnel
await this.allMapDataStore.fetchFunnel(this.createFilterId);
this.isRuleData = await Array.from(this.temporaryData);
this.ruleData = await this.isRuleData.map(e => this.$refs.sidevarFilterRef.setRule(e));
switch (routeParams.type) {
case 'log':
this.logId = routeParams.fileId;
this.baseLogId = routeParams.fileId;
break;
case 'filter':
this.createFilterId = routeParams.fileId;
// 取得 logID 和上次儲存的 Funnel
await this.allMapDataStore.fetchFunnel(this.createFilterId);
this.isRuleData = await Array.from(this.temporaryData);
this.ruleData = await this.isRuleData.map(e => this.$refs.sidevarFilterRef.setRule(e));
break;
case 'rule':
switch (this.checkType) {
case 'log':
this.logId = this.checkFileId;
this.baseLogId = this.checkFileId;
break;
case 'filter':
this.createFilterId = this.checkFileId;
// 取得 logID 和上次儲存的 Funnel
await this.allMapDataStore.fetchFunnel(this.createFilterId);
this.isRuleData = await Array.from(this.temporaryData);
this.ruleData = await this.isRuleData.map(e => this.$refs.sidevarFilterRef.setRule(e));
break;
}
break;
}
// 取得 logId 後才 call api
await this.allMapDataStore.getAllMapData();