Issue #2: Done.

This commit is contained in:
chiayin
2023-10-04 15:00:42 +08:00
parent a41a43e688
commit c845d0674a
2 changed files with 14 additions and 14 deletions

View File

@@ -109,7 +109,7 @@ export default {
.slice(this.selectArea[0], this.selectArea[1]); .slice(this.selectArea[0], this.selectArea[1]);
}, },
caseTotalPercent: function() { caseTotalPercent: function() {
let ratioSum = this.traceList.map(trace => trace.count).reduce((acc, cur) => acc + cur, 0) / this.traceCountTotal; let ratioSum = this.traceList.map(trace => trace.base_count).reduce((acc, cur) => acc + cur, 0) / this.traceCountTotal;
return this.getPercentLabel(ratioSum) return this.getPercentLabel(ratioSum)
}, },
chartData: function() { chartData: function() {

View File

@@ -359,48 +359,48 @@ export default {
*/ */
setRule(e) { setRule(e) {
let label, type; let label, type;
const includeStr = e.is_exclude?" Exclude ":" Include "; const includeStr = e.is_exclude? "exclude" : "include";
let containmentMap = { let containmentMap = {
'occurred-in' : 'Contained in', 'occurred-in' : 'contained in',
'started-in' : 'Started in', 'started-in' : 'started in',
'completed-in' : 'Ended in', 'completed-in' : 'ended in',
'occurred-around' : 'Active in' 'occurred-around' : 'active in'
}; };
switch(e.type){ switch(e.type){
case "contains-task": case "contains-task":
label = `${includeStr} ${e.task}` label = `${includeStr}, ${e.task}`
type = "Sequence" type = "Sequence"
break break
case "starts-with": case "starts-with":
label = `Start with ${e.task} ${includeStr}` label = `${includeStr}, start with ${e.task} `
type = "Sequence" type = "Sequence"
break break
case "ends-with": case "ends-with":
label = `End with ${e.task} ${includeStr}` label = `${includeStr}, end with ${e.task} `
type = "Sequence" type = "Sequence"
break break
case "start-end": case "start-end":
label = `Start with ${e.starts_with}, End with ${e.ends_with} ${includeStr}` label = `${includeStr}, start with ${e.starts_with}, end with ${e.ends_with}`
type = "Sequence" type = "Sequence"
break break
case "directly-follows": case "directly-follows":
label = `Directly-follows ${e.task_seq.join(' -> ')}${includeStr}` label = `${includeStr}, directly follows, ${e.task_seq.join(' -> ')}`
type = "Sequence" type = "Sequence"
break break
case "eventually-follows": case "eventually-follows":
label = `Eventually-follows ${e.task_seq.join(' -> ')}${includeStr}` label = `${includeStr}, eventually follows, ${e.task_seq.join(' -> ')}`
type = "Sequence" type = "Sequence"
break break
case "occurred-in": case "occurred-in":
case "started-in": case "started-in":
case "completed-in": case "completed-in":
case "occurred-around": case "occurred-around":
label = `${containmentMap[e.type]} from ${getMoment(e.start).format("YYYY-MM-DD HH:mm:ss")} to ${getMoment(e.end).format("YYYY-MM-DD HH:mm:ss")} ${includeStr}` label = `${containmentMap[e.type]}, ${includeStr}, from ${getMoment(e.start).format("YYYY-MM-DD HH:mm:ss")} to ${getMoment(e.end).format("YYYY-MM-DD HH:mm:ss")} `
type = "Timeframe" type = "Timeframe"
break break
case "trace-freq": case "trace-freq":
label = `from #${e.lower} to #${e.upper} ${includeStr}` label = `${includeStr}, from #${e.lower} to #${e.upper}`
type = "Trace" type = "Trace"
break break
}; };