refactor submitConformance
This commit is contained in:
@@ -759,371 +759,40 @@ export default {
|
||||
* Apply button 發送選項,取得 Check Id.
|
||||
*/
|
||||
async submitConformance() {
|
||||
let dataToSave ;
|
||||
let dataToSave;
|
||||
|
||||
this.selectDurationTime = await {
|
||||
min: this.selectTimeRangeMin,
|
||||
max: this.selectTimeRangeMax
|
||||
min: this.selectTimeRangeMin,
|
||||
max: this.selectTimeRangeMax
|
||||
};
|
||||
this.$emitter.emit('timeRangeMaxMin', this.selectDurationTime);
|
||||
|
||||
switch (this.selectedRuleType) {
|
||||
case 'Have activity': // Rule Type 選 Have activity 的行為
|
||||
dataToSave = {
|
||||
type: 'contains-tasks',
|
||||
tasks: this.selectConformanceTask,
|
||||
};
|
||||
// 其他 isSubmittedData 為 null
|
||||
this.isSubmitReset();
|
||||
this.isSubmitTask = this.selectConformanceTask;
|
||||
break;
|
||||
case 'Activity sequence': // Rule Type 選 Activity sequence 的行為
|
||||
switch (this.selectedActivitySequence) {
|
||||
case 'Start & End': // Activity Sequence 選 Start & End 的行為
|
||||
dataToSave = {
|
||||
type: 'start-end',
|
||||
starts_with: this.selectCfmSeqStart,
|
||||
ends_with: this.selectCfmSeqEnd,
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitStartAndEnd = [
|
||||
{category: 'Start', task: this.selectCfmSeqStart},
|
||||
{category: 'End', task: this.selectCfmSeqEnd},
|
||||
];
|
||||
this.isSubmitShowDataSeq = this.setSubmitShowDataByStartEnd(this.selectCfmSeqStart, this.selectCfmSeqEnd);
|
||||
case 'Have activity': // Rule Type 選 Have activity 的行為
|
||||
dataToSave = this.getHaveActivityData();
|
||||
break;
|
||||
case 'Sequence': // Activity Sequence 選 Sequence 的行為
|
||||
switch (this.selectedMode) {
|
||||
case 'Directly follows':
|
||||
dataToSave = {
|
||||
type: 'directly-follows',
|
||||
task_seq: this.selectCfmSeqDirectly,
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmSeqDirectly = JSON.parse(JSON.stringify(this.selectCfmSeqDirectly));
|
||||
break;
|
||||
case 'Eventually follows':
|
||||
dataToSave = {
|
||||
type: 'eventually-follows',
|
||||
task_seq: this.selectCfmSeqEventually,
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmSeqEventually = JSON.parse(JSON.stringify(this.selectCfmSeqEventually));
|
||||
break;
|
||||
case 'Short loop(s)':
|
||||
dataToSave = {
|
||||
type: 'short-loops',
|
||||
};
|
||||
break;
|
||||
case 'Self loop(s)':
|
||||
dataToSave = {
|
||||
type: 'self-loops',
|
||||
};
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
default:
|
||||
case 'Activity sequence': // Rule Type 選 Activity sequence 的行為
|
||||
dataToSave = this.getActivitySequenceData();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'Activity duration': // Rule Type 選 Activity duration 的行為
|
||||
dataToSave = {
|
||||
type: 'task-duration',
|
||||
task: this.selectDurationData[0],
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitDurationData = this.selectDurationData;
|
||||
this.isSubmitDurationTime.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'Processing time': // Rule Type 選 Processing time 的行為
|
||||
switch (this.selectedProcessScope) {
|
||||
case 'End to end':
|
||||
switch (this.selectedActSeqMore) {
|
||||
case 'All':
|
||||
dataToSave = {
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'processing-time-end-to-end-whole',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitTimeCfmPtEteAll.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'Start':
|
||||
dataToSave = {
|
||||
task: this.selectCfmPtEteStart,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'processing-time-end-to-end-starts-with',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmPtEteStart = [
|
||||
{category: 'Start', task: this.selectCfmPtEteStart},
|
||||
];
|
||||
this.isSubmitTimeCfmPtEteStart.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'End':
|
||||
dataToSave = {
|
||||
task: this.selectCfmPtEteEnd,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'processing-time-end-to-end-ends-with',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmPtEteEnd = [
|
||||
{category: 'End', task: this.selectCfmPtEteEnd},
|
||||
];
|
||||
this.isSubmitTimeCfmPtEteEnd.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'Start & End':
|
||||
dataToSave = {
|
||||
start: this.selectCfmPtEteSEStart,
|
||||
end: this.selectCfmPtEteSEEnd,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'processing-time-end-to-end-start-end',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmPtEteSE = [
|
||||
{category: 'Start', task: this.selectCfmPtEteSEStart},
|
||||
{category: 'End', task: this.selectCfmPtEteSEEnd},
|
||||
];
|
||||
this.isSubmitTimeCfmPtEteSE.rule = this.selectDurationTime;
|
||||
this.isSubmitShowDataPtEte = this.setSubmitShowDataByStartEnd(this.selectCfmPtEteSEStart, this.selectCfmPtEteSEEnd);
|
||||
break;
|
||||
};
|
||||
case 'Activity duration': // Rule Type 選 Activity duration 的行為
|
||||
dataToSave = this.getActivityDurationData();
|
||||
break;
|
||||
case 'Partial':
|
||||
switch (this.selectedActSeqFromTo) {
|
||||
case 'From':
|
||||
dataToSave = {
|
||||
task: this.selectCfmPtPStart,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'processing-time-partial-starts-with',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmPtPStart = [
|
||||
{category: 'From', task: this.selectCfmPtPStart},
|
||||
];
|
||||
this.isSubmitTimeCfmPtPStart.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'To':
|
||||
dataToSave = {
|
||||
task: this.selectCfmPtPEnd,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'processing-time-partial-ends-with',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmPtPEnd = [
|
||||
{category: 'To', task: this.selectCfmPtPEnd},
|
||||
];
|
||||
this.isSubmitTimeCfmPtPEnd.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'From & To':
|
||||
// If user didn't click any start-end radio button this time,
|
||||
// the start, end value might be null as their initial values are.
|
||||
// So we need to use the earliest value stored in pinia.
|
||||
dataToSave = {
|
||||
start: this.selectCfmPtPSEStart ? this.selectCfmPtPSEStart : this.activityRadioData.task[0],
|
||||
end: this.selectCfmPtPSEEnd ? this.selectCfmPtPSEEnd : this.activityRadioData.task[this.activityRadioData.task.length - 1],
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'processing-time-partial-start-end',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmPtPSE = [
|
||||
{category: 'From', task: this.selectCfmPtPSEStart},
|
||||
{category: 'To', task: this.selectCfmPtPSEEnd},
|
||||
];
|
||||
this.isSubmitTimeCfmPtPSE.rule = this.selectDurationTime;
|
||||
this.isSubmitShowDataPtP = this.setSubmitShowDataByStartEnd(this.selectCfmPtPSEStart, this.selectCfmPtPSEEnd);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
case 'Processing time': // Rule Type 選 Processing time 的行為
|
||||
dataToSave = this.getProcessingTimeData();
|
||||
break;
|
||||
default:
|
||||
case 'Waiting time': // Rule Type 選 Waiting time 的行為
|
||||
dataToSave = this.getWaitingTimeData();
|
||||
break;
|
||||
};
|
||||
break;
|
||||
case 'Waiting time': // Rule Type 選 Waiting time 的行為
|
||||
switch (this.selectedProcessScope) {
|
||||
case 'End to end':
|
||||
switch (this.selectedActSeqMore) {
|
||||
case 'All':
|
||||
dataToSave = {
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'waiting-time-end-to-end-whole',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitTimeCfmWtEteAll.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'Start':
|
||||
dataToSave = {
|
||||
task: this.selectCfmWtEteStart,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'waiting-time-end-to-end-starts-with',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmWtEteStart = [
|
||||
{category: 'Start', task: this.selectCfmWtEteStart},
|
||||
];
|
||||
this.isSubmitTimeCfmWtEteStart.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'End':
|
||||
dataToSave = {
|
||||
task: this.selectCfmWtEteEnd,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'waiting-time-end-to-end-ends-with',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmWtEteEnd = [
|
||||
{category: 'End', task: this.selectCfmWtEteEnd},
|
||||
];
|
||||
this.isSubmitTimeCfmWtEteEnd.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'Start & End':
|
||||
dataToSave = {
|
||||
start: this.selectCfmWtEteSEStart,
|
||||
end: this.selectCfmWtEteSEEnd,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'waiting-time-end-to-end-start-end',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmWtEteSE = [
|
||||
{category: 'Start', task: this.selectCfmWtEteSEStart},
|
||||
{category: 'End', task: this.selectCfmWtEteSEEnd},
|
||||
];
|
||||
this.isSubmitTimeCfmWtEteSE.rule = this.selectDurationTime;
|
||||
this.isSubmitShowDataWtEte = this.setSubmitShowDataByStartEnd(this.selectCfmWtEteSEStart, this.selectCfmWtEteSEEnd);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
case 'Cycle time': // Rule Type 選 Cycle time 的行為
|
||||
dataToSave = this.getCycleTimeData();
|
||||
break;
|
||||
case 'Partial':
|
||||
switch (this.selectedActSeqFromTo) {
|
||||
case 'From':
|
||||
dataToSave = {
|
||||
task: this.selectCfmWtPStart,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'waiting-time-partial-starts-with',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmWtPStart = [
|
||||
{category: 'From', task: this.selectCfmWtPStart},
|
||||
];
|
||||
this.isSubmitTimeCfmWtPStart.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'To':
|
||||
dataToSave = {
|
||||
task: this.selectCfmWtPEnd,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'waiting-time-partial-ends-with',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmWtPEnd = [
|
||||
{category: 'To', task: this.selectCfmWtPEnd},
|
||||
];
|
||||
this.isSubmitTimeCfmWtPEnd.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'From & To':
|
||||
dataToSave = {
|
||||
start: this.selectCfmWtPSEStart,
|
||||
end: this.selectCfmWtPSEEnd,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'waiting-time-partial-start-end',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmWtPSE = [
|
||||
{category: 'From', task: this.selectCfmWtPSEStart},
|
||||
{category: 'To', task: this.selectCfmWtPSEEnd},
|
||||
];
|
||||
this.isSubmitTimeCfmWtPSE.rule = this.selectDurationTime;
|
||||
this.isSubmitShowDataWtP = this.setSubmitShowDataByStartEnd(this.selectCfmWtPSEStart, this.selectCfmWtPSEEnd);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
case 'Cycle time': // Rule Type 選 Cycle time 的行為
|
||||
switch (this.selectedActSeqMore) {
|
||||
case 'All':
|
||||
dataToSave = {
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'cycle-time-end-to-end-whole',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitTimeCfmCtEteAll.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'Start':
|
||||
dataToSave = {
|
||||
task: this.selectCfmCtEteStart,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'cycle-time-end-to-end-starts-with',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmCtEteStart = [
|
||||
{category: 'Start', task: this.selectCfmCtEteStart},
|
||||
];
|
||||
this.isSubmitTimeCfmCtEteStart.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'End':
|
||||
dataToSave = {
|
||||
task: this.selectCfmCtEteEnd,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'cycle-time-end-to-end-ends-with',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmCtEteEnd = [
|
||||
{category: 'End', task: this.selectCfmCtEteEnd},
|
||||
];
|
||||
this.isSubmitTimeCfmCtEteEnd.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'Start & End':
|
||||
dataToSave = {
|
||||
start: this.selectCfmCtEteSEStart,
|
||||
end: this.selectCfmCtEteSEEnd,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'cycle-time-end-to-end-start-end',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmCtEteSE = [
|
||||
{category: 'Start', task: this.selectCfmCtEteSEStart},
|
||||
{category: 'End', task: this.selectCfmCtEteSEEnd},
|
||||
];
|
||||
this.isSubmitTimeCfmCtEteSE.rule = this.selectDurationTime;
|
||||
this.isSubmitShowDataCt = this.setSubmitShowDataByStartEnd(this.selectCfmCtEteSEStart, this.selectCfmCtEteSEEnd);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
};
|
||||
if(dataToSave.min > dataToSave.max) {
|
||||
return this.$toast.error(i18next.t("Conformance.PleaseCheckTimeRange"));
|
||||
}
|
||||
if(JSON.stringify(dataToSave) === JSON.stringify(this.isSubmittedData)) {
|
||||
return this.$toast.error(i18next.t("Conformance.PleaseSetNewRule"));
|
||||
|
||||
if (dataToSave.min > dataToSave.max) {
|
||||
return this.$toast.error(i18next.t("Conformance.PleaseCheckTimeRange"));
|
||||
}
|
||||
if (JSON.stringify(dataToSave) === JSON.stringify(this.isSubmittedData)) {
|
||||
return this.$toast.error(i18next.t("Conformance.PleaseSetNewRule"));
|
||||
}
|
||||
|
||||
this.isLoading = true;
|
||||
@@ -1138,6 +807,358 @@ export default {
|
||||
this.$emitter.emit('coverPlate', false);
|
||||
this.$toast.success(i18next.t("Conformance.RuleApplied"));
|
||||
},
|
||||
getHaveActivityData() {
|
||||
const dataToSave = {
|
||||
type: 'contains-tasks',
|
||||
tasks: this.selectConformanceTask,
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitTask = this.selectConformanceTask;
|
||||
return dataToSave;
|
||||
},
|
||||
|
||||
getActivitySequenceData() {
|
||||
let dataToSave;
|
||||
switch (this.selectedActivitySequence) {
|
||||
case 'Start & End':
|
||||
dataToSave = {
|
||||
type: 'start-end',
|
||||
starts_with: this.selectCfmSeqStart,
|
||||
ends_with: this.selectCfmSeqEnd,
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitStartAndEnd = [
|
||||
{ category: 'Start', task: this.selectCfmSeqStart },
|
||||
{ category: 'End', task: this.selectCfmSeqEnd },
|
||||
];
|
||||
this.isSubmitShowDataSeq = this.setSubmitShowDataByStartEnd(this.selectCfmSeqStart, this.selectCfmSeqEnd);
|
||||
break;
|
||||
case 'Sequence':
|
||||
dataToSave = this.getSequenceData();
|
||||
break;
|
||||
}
|
||||
return dataToSave;
|
||||
},
|
||||
|
||||
getSequenceData() {
|
||||
let dataToSave;
|
||||
switch (this.selectedMode) {
|
||||
case 'Directly follows':
|
||||
dataToSave = {
|
||||
type: 'directly-follows',
|
||||
task_seq: this.selectCfmSeqDirectly,
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmSeqDirectly = JSON.parse(JSON.stringify(this.selectCfmSeqDirectly));
|
||||
break;
|
||||
case 'Eventually follows':
|
||||
dataToSave = {
|
||||
type: 'eventually-follows',
|
||||
task_seq: this.selectCfmSeqEventually,
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmSeqEventually = JSON.parse(JSON.stringify(this.selectCfmSeqEventually));
|
||||
break;
|
||||
case 'Short loop(s)':
|
||||
dataToSave = { type: 'short-loops' };
|
||||
break;
|
||||
case 'Self loop(s)':
|
||||
dataToSave = { type: 'self-loops' };
|
||||
break;
|
||||
}
|
||||
return dataToSave;
|
||||
},
|
||||
|
||||
getActivityDurationData() {
|
||||
const dataToSave = {
|
||||
type: 'task-duration',
|
||||
task: this.selectDurationData[0],
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitDurationData = this.selectDurationData;
|
||||
this.isSubmitDurationTime.rule = this.selectDurationTime;
|
||||
return dataToSave;
|
||||
},
|
||||
|
||||
getProcessingTimeData() {
|
||||
let dataToSave;
|
||||
switch (this.selectedProcessScope) {
|
||||
case 'End to end':
|
||||
dataToSave = this.getEndToEndProcessingTimeData();
|
||||
break;
|
||||
case 'Partial':
|
||||
dataToSave = this.getPartialProcessingTimeData();
|
||||
break;
|
||||
}
|
||||
return dataToSave;
|
||||
},
|
||||
|
||||
getEndToEndProcessingTimeData() {
|
||||
let dataToSave;
|
||||
switch (this.selectedActSeqMore) {
|
||||
case 'All':
|
||||
dataToSave = {
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'processing-time-end-to-end-whole',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitTimeCfmPtEteAll.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'Start':
|
||||
dataToSave = {
|
||||
task: this.selectCfmPtEteStart,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'processing-time-end-to-end-starts-with',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmPtEteStart = [{ category: 'Start', task: this.selectCfmPtEteStart }];
|
||||
this.isSubmitTimeCfmPtEteStart.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'End':
|
||||
dataToSave = {
|
||||
task: this.selectCfmPtEteEnd,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'processing-time-end-to-end-ends-with',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmPtEteEnd = [{ category: 'End', task: this.selectCfmPtEteEnd }];
|
||||
this.isSubmitTimeCfmPtEteEnd.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'Start & End':
|
||||
dataToSave = {
|
||||
start: this.selectCfmPtEteSEStart,
|
||||
end: this.selectCfmPtEteSEEnd,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'processing-time-end-to-end-start-end',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmPtEteSE = [
|
||||
{ category: 'Start', task: this.selectCfmPtEteSEStart },
|
||||
{ category: 'End', task: this.selectCfmPtEteSEEnd },
|
||||
];
|
||||
this.isSubmitTimeCfmPtEteSE.rule = this.selectDurationTime;
|
||||
this.isSubmitShowDataPtEte = this.setSubmitShowDataByStartEnd(this.selectCfmPtEteSEStart, this.selectCfmPtEteSEEnd);
|
||||
break;
|
||||
}
|
||||
return dataToSave;
|
||||
},
|
||||
|
||||
getPartialProcessingTimeData() {
|
||||
let dataToSave;
|
||||
switch (this.selectedActSeqFromTo) {
|
||||
case 'From':
|
||||
dataToSave = {
|
||||
task: this.selectCfmPtPStart,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'processing-time-partial-starts-with',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmPtPStart = [{ category: 'From', task: this.selectCfmPtPStart }];
|
||||
this.isSubmitTimeCfmPtPStart.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'To':
|
||||
dataToSave = {
|
||||
task: this.selectCfmPtPEnd,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'processing-time-partial-ends-with',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmPtPEnd = [{ category: 'To', task: this.selectCfmPtPEnd }];
|
||||
this.isSubmitTimeCfmPtPEnd.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'From & To':
|
||||
dataToSave = {
|
||||
start: this.selectCfmPtPSEStart ? this.selectCfmPtPSEStart : this.activityRadioData.task[0],
|
||||
end: this.selectCfmPtPSEEnd ? this.selectCfmPtPSEEnd : this.activityRadioData.task[this.activityRadioData.task.length - 1],
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'processing-time-partial-start-end',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmPtPSE = [
|
||||
{ category: 'From', task: this.selectCfmPtPSEStart },
|
||||
{ category: 'To', task: this.selectCfmPtPSEEnd },
|
||||
];
|
||||
this.isSubmitTimeCfmPtPSE.rule = this.selectDurationTime;
|
||||
this.isSubmitShowDataPtP = this.setSubmitShowDataByStartEnd(this.selectCfmPtPSEStart, this.selectCfmPtPSEEnd);
|
||||
break;
|
||||
}
|
||||
return dataToSave;
|
||||
},
|
||||
|
||||
getWaitingTimeData() {
|
||||
let dataToSave;
|
||||
switch (this.selectedProcessScope) {
|
||||
case 'End to end':
|
||||
dataToSave = this.getEndToEndWaitingTimeData();
|
||||
break;
|
||||
case 'Partial':
|
||||
dataToSave = this.getPartialWaitingTimeData();
|
||||
break;
|
||||
}
|
||||
return dataToSave;
|
||||
},
|
||||
|
||||
getEndToEndWaitingTimeData() {
|
||||
let dataToSave;
|
||||
switch (this.selectedActSeqMore) {
|
||||
case 'All':
|
||||
dataToSave = {
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'waiting-time-end-to-end-whole',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitTimeCfmWtEteAll.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'Start':
|
||||
dataToSave = {
|
||||
task: this.selectCfmWtEteStart,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'waiting-time-end-to-end-starts-with',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmWtEteStart = [{ category: 'Start', task: this.selectCfmWtEteStart }];
|
||||
this.isSubmitTimeCfmWtEteStart.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'End':
|
||||
dataToSave = {
|
||||
task: this.selectCfmWtEteEnd,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'waiting-time-end-to-end-ends-with',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmWtEteEnd = [{ category: 'End', task: this.selectCfmWtEteEnd }];
|
||||
this.isSubmitTimeCfmWtEteEnd.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'Start & End':
|
||||
dataToSave = {
|
||||
start: this.selectCfmWtEteSEStart,
|
||||
end: this.selectCfmWtEteSEEnd,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'waiting-time-end-to-end-start-end',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmWtEteSE = [
|
||||
{ category: 'Start', task: this.selectCfmWtEteSEStart },
|
||||
{ category: 'End', task: this.selectCfmWtEteSEEnd },
|
||||
];
|
||||
this.isSubmitTimeCfmWtEteSE.rule = this.selectDurationTime;
|
||||
this.isSubmitShowDataWtEte = this.setSubmitShowDataByStartEnd(this.selectCfmWtEteSEStart, this.selectCfmWtEteSEEnd);
|
||||
break;
|
||||
}
|
||||
return dataToSave;
|
||||
},
|
||||
|
||||
getPartialWaitingTimeData() {
|
||||
let dataToSave;
|
||||
switch (this.selectedActSeqFromTo) {
|
||||
case 'From':
|
||||
dataToSave = {
|
||||
task: this.selectCfmWtPStart,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'waiting-time-partial-starts-with',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmWtPStart = [{ category: 'From', task: this.selectCfmWtPStart }];
|
||||
this.isSubmitTimeCfmWtPStart.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'To':
|
||||
dataToSave = {
|
||||
task: this.selectCfmWtPEnd,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'waiting-time-partial-ends-with',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmWtPEnd = [{ category: 'To', task: this.selectCfmWtPEnd }];
|
||||
this.isSubmitTimeCfmWtPEnd.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'From & To':
|
||||
dataToSave = {
|
||||
start: this.selectCfmWtPSEStart,
|
||||
end: this.selectCfmWtPSEEnd,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'waiting-time-partial-start-end',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmWtPSE = [
|
||||
{ category: 'From', task: this.selectCfmWtPSEStart },
|
||||
{ category: 'To', task: this.selectCfmWtPSEEnd },
|
||||
];
|
||||
this.isSubmitTimeCfmWtPSE.rule = this.selectDurationTime;
|
||||
this.isSubmitShowDataWtP = this.setSubmitShowDataByStartEnd(this.selectCfmWtPSEStart, this.selectCfmWtPSEEnd);
|
||||
break;
|
||||
}
|
||||
return dataToSave;
|
||||
},
|
||||
|
||||
getCycleTimeData() {
|
||||
let dataToSave;
|
||||
switch (this.selectedActSeqMore) {
|
||||
case 'All':
|
||||
dataToSave = {
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'cycle-time-end-to-end-whole',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitTimeCfmCtEteAll.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'Start':
|
||||
dataToSave = {
|
||||
task: this.selectCfmCtEteStart,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'cycle-time-end-to-end-starts-with',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmCtEteStart = [{ category: 'Start', task: this.selectCfmCtEteStart }];
|
||||
this.isSubmitTimeCfmCtEteStart.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'End':
|
||||
dataToSave = {
|
||||
task: this.selectCfmCtEteEnd,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'cycle-time-end-to-end-ends-with',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmCtEteEnd = [{ category: 'End', task: this.selectCfmCtEteEnd }];
|
||||
this.isSubmitTimeCfmCtEteEnd.rule = this.selectDurationTime;
|
||||
break;
|
||||
case 'Start & End':
|
||||
dataToSave = {
|
||||
start: this.selectCfmCtEteSEStart,
|
||||
end: this.selectCfmCtEteSEEnd,
|
||||
min: this.selectDurationTime.min,
|
||||
max: this.selectDurationTime.max,
|
||||
type: 'cycle-time-end-to-end-start-end',
|
||||
};
|
||||
this.isSubmitReset();
|
||||
this.isSubmitCfmCtEteSE = [
|
||||
{ category: 'Start', task: this.selectCfmCtEteSEStart },
|
||||
{ category: 'End', task: this.selectCfmCtEteSEEnd },
|
||||
];
|
||||
this.isSubmitTimeCfmCtEteSE.rule = this.selectDurationTime;
|
||||
this.isSubmitShowDataCt = this.setSubmitShowDataByStartEnd(this.selectCfmCtEteSEStart, this.selectCfmCtEteSEEnd);
|
||||
break;
|
||||
}
|
||||
return dataToSave;
|
||||
},
|
||||
/**
|
||||
* 設置根據類別的任務選擇邏輯
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user