Conformance: processing time, waiting time, cycle time, get apply report don.

This commit is contained in:
chiayin
2023-08-24 15:13:14 +08:00
parent 70b4193275
commit 0850aa0771

View File

@@ -211,7 +211,8 @@ export default {
break; break;
}; };
if(this.selectedRuleType === 'Have activity') { // Rule Type 選 Have activity 的行為 switch (this.selectedRuleType) {
case 'Have activity': // Rule Type 選 Have activity 的行為
if(!this.selectConformanceTask?.length) return this.$toast.error('Not selected.'); if(!this.selectConformanceTask?.length) return this.$toast.error('Not selected.');
else { else {
data = { data = {
@@ -224,8 +225,10 @@ export default {
this.isSubmitListSeq = []; this.isSubmitListSeq = [];
this.isSubmitDurationData = null; this.isSubmitDurationData = null;
} }
}else if(this.selectedRuleType === 'Activity sequence') { // Activity Sequence 選 Start & End 的行為 break;
if(this.selectedActivitySequence === 'Start & End'){ case 'Activity sequence': // Rule Type 選 Activity sequence 的行為
switch (this.selectedActivitySequence) {
case 'Start & End': // Activity Sequence 選 Start & End 的行為
if(this.selectConformanceStartAndEnd === null || this.selectConformanceStartAndEnd.length === 0) return this.$toast.error('Both Start and End must be selected.'); if(this.selectConformanceStartAndEnd === null || this.selectConformanceStartAndEnd.length === 0) return this.$toast.error('Both Start and End must be selected.');
else { else {
data = { data = {
@@ -241,8 +244,9 @@ export default {
this.isSubmitTask = null; this.isSubmitTask = null;
this.isSubmitListSeq = []; this.isSubmitListSeq = [];
this.isSubmitDurationData = null; this.isSubmitDurationData = null;
} };
}else if(this.selectedActivitySequence === 'Sequence'){ // Activity Sequence 選 Sequence 的行為 break;
case 'Sequence': // Activity Sequence 選 Sequence 的行為
if(this.listSeq.length < 2) return this.$toast.error('Select two or more.'); if(this.listSeq.length < 2) return this.$toast.error('Select two or more.');
else { else {
data = { data = {
@@ -253,9 +257,12 @@ export default {
this.isSubmitTask = null; this.isSubmitTask = null;
this.isSubmitStartAndEnd = null; this.isSubmitStartAndEnd = null;
this.isSubmitDurationData = null; this.isSubmitDurationData = null;
};
default:
break;
} }
} break;
}else if(this.selectedRuleType === 'Activity duration') { // Rule Type 選 Activity duration 的行為 case 'Activity duration': // Rule Type 選 Activity duration 的行為
if(!this.selectDurationData?.length) return this.$toast.error('Not selected.'); if(!this.selectDurationData?.length) return this.$toast.error('Not selected.');
else { else {
data = { data = {
@@ -269,33 +276,336 @@ export default {
this.isSubmitTask = null; this.isSubmitTask = null;
this.isSubmitStartAndEnd = null; this.isSubmitStartAndEnd = null;
this.isSubmitListSeq = []; this.isSubmitListSeq = [];
} };
}else if(this.selectedRuleType === 'Processing time') { // Rule Type 選 Processing time 的行為 break;
if(this.selectedProcessScope === 'selectedProcessScope') { case 'Processing time': // Rule Type 選 Processing time 的行為
switch (this.selectedProcessScope) {
case 'End to end':
switch (this.selectedActSeqMore) { switch (this.selectedActSeqMore) {
case 'All': case 'All':
data = { data = {
min: this.selectDurationTime.min, min: this.selectDurationTime.min,
max: this.selectDurationTime.max, max: this.selectDurationTime.max,
type: 'processing-time-end-to-end-whole', type: 'processing-time-end-to-end-whole',
} };
break; break;
case 'Start': case 'Start':
data = {
task: this.selectCfmPtEteStart,
min: this.selectDurationTime.min,
max: this.selectDurationTime.max,
type: 'processing-time-end-to-end-starts-with',
};
break; break;
case 'End': case 'End':
data = {
task: this.selectCfmPtEteEnd,
min: this.selectDurationTime.min,
max: this.selectDurationTime.max,
type: 'processing-time-end-to-end-ends-with',
};
break; break;
case 'Start & End': case 'Start & End':
data = {
start: this.selectCfmPtEteSEStart,
end: this.selectCfmPtEteSEEnd,
min: this.selectDurationTime.min,
max: this.selectDurationTime.max,
type: 'processing-time-end-to-end-start-end',
};
break; break;
default: default:
break; break;
}
}
}; };
break;
case 'Partial':
switch (this.selectedActSeqFromTo) {
case 'From':
data = {
task: this.selectCfmPtPStart,
min: this.selectDurationTime.min,
max: this.selectDurationTime.max,
type: 'processing-time-partial-starts-with',
};
break;
case 'To':
data = {
task: this.selectCfmPtPEnd,
min: this.selectDurationTime.min,
max: this.selectDurationTime.max,
type: 'processing-time-partial-ends-with',
};
break;
case 'From & To':
data = {
start: this.selectCfmPtPSEStart,
end: this.selectCfmPtPSEEnd,
min: this.selectDurationTime.min,
max: this.selectDurationTime.max,
type: 'processing-time-partial-start-end',
};
break;
default:
break;
};
break;
default:
break;
};
break;
case 'Waiting time': // Rule Type 選 Waiting time 的行為
switch (this.selectedProcessScope) {
case 'End to end':
switch (this.selectedActSeqMore) {
case 'All':
data = {
min: this.selectDurationTime.min,
max: this.selectDurationTime.max,
type: 'waiting-time-end-to-end-whole',
};
break;
case 'Start':
data = {
task: this.selectCfmWtEteStart,
min: this.selectDurationTime.min,
max: this.selectDurationTime.max,
type: 'waiting-time-end-to-end-starts-with',
};
break;
case 'End':
data = {
task: this.selectCfmWtEteEnd,
min: this.selectDurationTime.min,
max: this.selectDurationTime.max,
type: 'waiting-time-end-to-end-ends-with',
};
break;
case 'Start & End':
data = {
start: this.selectCfmWtEteSEStart,
end: this.selectCfmWtEteSEEnd,
min: this.selectDurationTime.min,
max: this.selectDurationTime.max,
type: 'waiting-time-end-to-end-start-end',
};
break;
default:
break;
};
break;
case 'Partial':
switch (this.selectedActSeqFromTo) {
case 'From':
data = {
task: this.selectCfmWtPStart,
min: this.selectDurationTime.min,
max: this.selectDurationTime.max,
type: 'waiting-time-partial-starts-with',
};
break;
case 'To':
data = {
task: this.selectCfmWtPEnd,
min: this.selectDurationTime.min,
max: this.selectDurationTime.max,
type: 'waiting-time-partial-ends-with',
};
break;
case 'From & To':
data = {
start: this.selectCfmWtPSEStart,
end: this.selectCfmWtPSEEnd,
min: this.selectDurationTime.min,
max: this.selectDurationTime.max,
type: 'waiting-time-partial-start-end',
};
break;
default:
break;
};
break;
default:
break;
};
break;
case 'Cycle time': // Rule Type 選 Cycle time 的行為
switch (this.selectedActSeqMore) {
case 'All':
data = {
min: this.selectDurationTime.min,
max: this.selectDurationTime.max,
type: 'cycle-time-end-to-end-whole',
};
break;
case 'Start':
data = {
task: this.selectCfmCtEteStart,
min: this.selectDurationTime.min,
max: this.selectDurationTime.max,
type: 'cycle-time-end-to-end-starts-with',
};
break;
case 'End':
data = {
task: this.selectCfmCtEteEnd,
min: this.selectDurationTime.min,
max: this.selectDurationTime.max,
type: 'cycle-time-end-to-end-ends-with',
};
break;
case 'Start & End':
data = {
start: this.selectCfmCtEteSEStart,
end: this.selectCfmCtEteSEEnd,
min: this.selectDurationTime.min,
max: this.selectDurationTime.max,
type: 'cycle-time-end-to-end-start-end',
};
break;
default:
break;
};
break;
default:
break;
};
// if(this.selectedRuleType === 'Have activity') { // Rule Type 選 Have activity 的行為
// if(!this.selectConformanceTask?.length) return this.$toast.error('Not selected.');
// else {
// data = {
// type: 'contains-tasks',
// tasks: this.selectConformanceTask,
// };
// this.isSubmitTask = this.selectConformanceTask;
// // 其他 isSubmitData 為 null
// this.isSubmitStartAndEnd = null;
// this.isSubmitListSeq = [];
// this.isSubmitDurationData = null;
// }
// }else if(this.selectedRuleType === 'Activity sequence') { // Activity Sequence 選 Start & End 的行為
// if(this.selectedActivitySequence === 'Start & End'){
// if(this.selectConformanceStartAndEnd === null || this.selectConformanceStartAndEnd.length === 0) return this.$toast.error('Both Start and End must be selected.');
// else {
// data = {
// type: 'start-end',
// starts_with: this.selectConformanceStartAndEnd[0],
// ends_with: this.selectConformanceStartAndEnd[1],
// };
// this.isSubmitStartAndEnd = [
// {category: 'Start', task: this.selectConformanceStartAndEnd[0]},
// {category: 'End', task: this.selectConformanceStartAndEnd[1]},
// ];
// // 其他 isSubmitData 為 null
// this.isSubmitTask = null;
// this.isSubmitListSeq = [];
// this.isSubmitDurationData = null;
// }
// }else if(this.selectedActivitySequence === 'Sequence'){ // Activity Sequence 選 Sequence 的行為
// if(this.listSeq.length < 2) return this.$toast.error('Select two or more.');
// else {
// data = {
// type: isMode,
// task_seq: this.listSeq,
// };
// this.isSubmitListSeq = this.listSeq;
// this.isSubmitTask = null;
// this.isSubmitStartAndEnd = null;
// this.isSubmitDurationData = null;
// }
// }
// }else if(this.selectedRuleType === 'Activity duration') { // Rule Type 選 Activity duration 的行為
// if(!this.selectDurationData?.length) return this.$toast.error('Not selected.');
// else {
// data = {
// type: 'task-duration',
// task: this.selectDurationData[0],
// min: this.selectDurationTime.min,
// max: this.selectDurationTime.max,
// };
// this.isSubmitDurationData = this.selectDurationData;
// // 其他 isSubmitData 為 null
// this.isSubmitTask = null;
// this.isSubmitStartAndEnd = null;
// this.isSubmitListSeq = [];
// }
// }else if(this.selectedRuleType === 'Processing time') { // Rule Type 選 Processing time 的行為
// switch (this.selectedProcessScope) {
// case 'End to end':
// switch (this.selectedActSeqMore) {
// case 'All':
// data = {
// min: this.selectDurationTime.min,
// max: this.selectDurationTime.max,
// type: 'processing-time-end-to-end-whole',
// };
// break;
// case 'Start':
// data = {
// task: this.selectCfmPtEteStart,
// min: this.selectDurationTime.min,
// max: this.selectDurationTime.max,
// type: 'processing-time-end-to-end-starts-with',
// };
// break;
// case 'End':
// data = {
// task: this.selectCfmPtEteEnd,
// min: this.selectDurationTime.min,
// max: this.selectDurationTime.max,
// type: 'processing-time-end-to-end-ends-with',
// };
// break;
// case 'Start & End':
// data = {
// start: this.selectCfmPtEteSEStart,
// end: this.selectCfmPtEteSEEnd,
// min: this.selectDurationTime.min,
// max: this.selectDurationTime.max,
// type: 'processing-time-end-to-end-start-end',
// };
// break;
// default:
// break;
// };
// break;
// case 'Partial':
// switch (this.selectedActSeqFromTo) {
// case 'From':
// data = {
// task: this.selectCfmPtPStart,
// min: this.selectDurationTime.min,
// max: this.selectDurationTime.max,
// type: 'processing-time-partial-starts-with',
// };
// break;
// case 'To':
// data = {
// task: this.selectCfmPtPEnd,
// min: this.selectDurationTime.min,
// max: this.selectDurationTime.max,
// type: 'processing-time-partial-ends-with',
// };
// break;
// case 'From & To':
// data = {
// start: this.selectCfmPtPSEStart,
// end: this.selectCfmPtPSEEnd,
// min: this.selectDurationTime.min,
// max: this.selectDurationTime.max,
// type: 'processing-time-partial-start-end',
// };
// break;
// default:
// break;
// };
// break;
// default:
// break;
// }
// };
// selectedActSeqMore, selectedActSeqFromTo, // selectedActSeqMore, selectedActSeqFromTo,
this.isLoading = true; this.isLoading = true;
@@ -441,11 +751,9 @@ export default {
}; };
switch (this.selectedRuleType) { switch (this.selectedRuleType) {
case 'Processing time': case 'Processing time':
console.log(this.cfmPtEteWhole);
this.getDurationTime(this.cfmPtEteWhole, 'all'); this.getDurationTime(this.cfmPtEteWhole, 'all');
break; break;
case 'Waiting time': case 'Waiting time':
console.log(this.cfmWtEteWhole);
this.getDurationTime(this.cfmWtEteWhole, 'all'); this.getDurationTime(this.cfmWtEteWhole, 'all');
break; break;
case 'Cycle time': case 'Cycle time':
@@ -467,7 +775,6 @@ export default {
}; };
}); });
this.$emitter.on('isRadioActSeqMoreChange', (data) => { this.$emitter.on('isRadioActSeqMoreChange', (data) => {
if(data) { if(data) {
if(this.selectedActSeqMore === 'All') { if(this.selectedActSeqMore === 'All') {
switch (this.selectedRuleType) { switch (this.selectedRuleType) {
@@ -489,7 +796,6 @@ export default {
this.selectDurationTime = null; this.selectDurationTime = null;
}; };
}; };
}); });
this.$emitter.on('isRadioActSeqFromToChange', (data) => { this.$emitter.on('isRadioActSeqFromToChange', (data) => {
if(data) { if(data) {