This commit is contained in:
Cindy Chang
2024-08-01 15:13:05 +08:00
parent 1eda4dfb80
commit 405dd7f992
2 changed files with 49 additions and 40 deletions

View File

@@ -396,60 +396,39 @@ export default {
'occurred-around' : 'active in'
};
switch(e.type){
switch(e.type) { //sonar-qube
case "contains-task":
label = `${includeStr}, ${e.task}`;
type = "Sequence";
break;
case "starts-with":
label = `${includeStr}, start with ${e.task}`;
type = "Sequence";
break;
case "ends-with":
label = `${includeStr}, end with ${e.task}`;
type = "Sequence";
break;
case "start-end":
label = `${includeStr}, start with ${e.starts_with}, end with ${e.ends_with}`;
type = "Sequence";
break;
case "directly-follows":
label = `${includeStr}, directly follows, ${e.task_seq.join(' -> ')}`;
type = "Sequence";
break;
case "eventually-follows":
label = `${includeStr}, eventually follows, ${e.task_seq.join(' -> ')}`;
type = "Sequence";
break;
label = `${includeStr}, ${getTaskLabel(e)}`;
type = "Sequence";
break;
case "start-end":
label = `${includeStr}, start with ${e.starts_with}, end with ${e.ends_with}`;
type = "Sequence";
break;
case "trace-freq":
label = `${includeStr}, from #${e.lower} to #${e.upper}`;
type = "Trace";
break;
label = `${includeStr}, from #${e.lower} to #${e.upper}`;
type = "Trace";
break;
case 'string-attr':
label = `${includeStr}, ${e.key}, ${e.value}`;
type = "Attributes";
break;
case 'boolean-attr':
label = `${includeStr}, ${e.key}, ${this.selectAttribute?.label}`;
type = "Attributes";
break;
case 'int-attr':
case 'float-attr':
label = `${includeStr}, ${e.key}, from ${e.min} to ${e.max}`;
type = "Attributes";
break;
case 'date-attr':
label = `${includeStr}, ${e.key}, from ${getMoment(e.min).format('YYYY-MM-DD HH:mm')} to ${getMoment(e.max).format('YYYY-MM-DD HH:mm')}`;
type = "Attributes";
break;
label = `${includeStr}, ${getAttributeLabel(e)}`;
type = "Attributes";
break;
case "occurred-in":
case "started-in":
case "completed-in":
case "occurred-around":
label = `${containmentMap[e.type]}, ${includeStr}, from ${getMoment(e.start).format("YYYY-MM-DD HH:mm")} to ${getMoment(e.end).format("YYYY-MM-DD HH:mm")} `
type = "Timeframe"
break;
};
label = `${containmentMap[e.type]}, ${includeStr}, from ${getMoment(e.start).format("YYYY-MM-DD HH:mm")} to ${getMoment(e.end).format("YYYY-MM-DD HH:mm")} `;
type = "Timeframe"
break;
};
return {
type,
label,
@@ -701,7 +680,33 @@ export default {
handleTimeframesSelection() {
return this.selectTimeFrame.length === 0;
},
getTaskLabel(e) {
switch (e.type) {
case "contains-task":
return `${e.task}`;
case "starts-with":
return `start with ${e.task}`;
case "ends-with":
return `end with ${e.task}`;
case "directly-follows":
case "eventually-follows":
return `${e.type.replace('-', ' ')}, ${e.task_seq.join(' -> ')}`;
}
},
getAttributeLabel(e) {
switch (e.type) {
case 'string-attr':
return `${e.key}, ${e.value}`;
case 'boolean-attr':
return `${e.key}, ${this.selectAttribute?.label}`;
case 'int-attr':
case 'float-attr':
return `${e.key}, from ${e.min} to ${e.max}`;
case 'date-attr':
return `${e.key}, from ${getMoment(e.min).format('YYYY-MM-DD HH:mm')} to ${getMoment(e.max).format('YYYY-MM-DD HH:mm')}`;
}
},
},
}
</script>