Remove pure passthrough getters from conformance store
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RaRBJFZKSTA7naHGuQHfnQ
This commit is contained in:
@@ -358,8 +358,8 @@
|
||||
<MoreModal
|
||||
:listModal="issuesModal"
|
||||
@closeModal="issuesModal = $event"
|
||||
:listTraces="issueTraces"
|
||||
:taskSeq="taskSeq"
|
||||
:listTraces="allIssueTraces"
|
||||
:taskSeq="allTaskSeq"
|
||||
:cases="cases"
|
||||
:listNo="issuesNo"
|
||||
:traceId="traceId"
|
||||
@@ -369,8 +369,8 @@
|
||||
<MoreModal
|
||||
:listModal="loopModal"
|
||||
@closeModal="loopModal = $event"
|
||||
:listTraces="loopTraces"
|
||||
:taskSeq="loopTaskSeq"
|
||||
:listTraces="allLoopTraces"
|
||||
:taskSeq="allLoopTaskSeq"
|
||||
:cases="loopCases"
|
||||
:listNo="loopNo"
|
||||
:traceId="looptraceId"
|
||||
@@ -413,12 +413,12 @@ import emitter from "@/utils/emitter";
|
||||
|
||||
const conformanceStore = useConformanceStore();
|
||||
const {
|
||||
conformanceTempReportData,
|
||||
issueTraces,
|
||||
taskSeq,
|
||||
allConformanceTempReportData,
|
||||
allIssueTraces,
|
||||
allTaskSeq,
|
||||
cases,
|
||||
loopTraces,
|
||||
loopTaskSeq,
|
||||
allLoopTraces,
|
||||
allLoopTaskSeq,
|
||||
loopCases,
|
||||
} = storeToRefs(conformanceStore);
|
||||
|
||||
@@ -525,11 +525,11 @@ const openMore = async (no) => {
|
||||
// Use async/await to prevent errors caused by asynchronous data not being available yet
|
||||
issuesNo.value = no;
|
||||
await conformanceStore.getConformanceIssue(no);
|
||||
if (issueTraces.value.length === 0) return;
|
||||
traceId.value = issueTraces.value[0].id;
|
||||
if (allIssueTraces.value.length === 0) return;
|
||||
traceId.value = allIssueTraces.value[0].id;
|
||||
firstCases.value = await conformanceStore.getConformanceTraceDetail(
|
||||
no,
|
||||
issueTraces.value[0].id,
|
||||
allIssueTraces.value[0].id,
|
||||
0,
|
||||
);
|
||||
issuesModal.value = true;
|
||||
@@ -543,11 +543,11 @@ const openLoopMore = async (no) => {
|
||||
// Use async/await to prevent errors caused by asynchronous data not being available yet
|
||||
loopNo.value = no;
|
||||
await conformanceStore.getConformanceLoop(no);
|
||||
if (loopTraces.value.length === 0) return;
|
||||
looptraceId.value = loopTraces.value[0].id;
|
||||
if (allLoopTraces.value.length === 0) return;
|
||||
looptraceId.value = allLoopTraces.value[0].id;
|
||||
loopFirstCases.value = await conformanceStore.getConformanceLoopsTraceDetail(
|
||||
no,
|
||||
loopTraces.value[0].id,
|
||||
allLoopTraces.value[0].id,
|
||||
0,
|
||||
);
|
||||
loopModal.value = true;
|
||||
@@ -959,7 +959,7 @@ const setTimeChartData = (chartData, xMax, xMin, yMax, yMin) => {
|
||||
};
|
||||
|
||||
// watch
|
||||
watch(conformanceTempReportData, (newValue) => {
|
||||
watch(allConformanceTempReportData, (newValue) => {
|
||||
if (newValue?.rule && newValue.rule.min !== null) {
|
||||
selectDurationTime.value = {
|
||||
min: newValue.rule.min,
|
||||
|
||||
@@ -180,7 +180,7 @@ const {
|
||||
selectedProcessScope,
|
||||
selectedActSeqMore,
|
||||
selectedActSeqFromTo,
|
||||
conformanceAllTasks,
|
||||
allConformanceTask,
|
||||
cfmPtEteWhole,
|
||||
cfmPtEteStart: cfmPtEteStartStore,
|
||||
cfmPtEteEnd: cfmPtEteEndStore,
|
||||
@@ -204,7 +204,7 @@ const {
|
||||
conformanceRuleData,
|
||||
conformanceLogCreateCheckId,
|
||||
conformanceFilterCreateCheckId,
|
||||
conformanceTempReportData,
|
||||
allConformanceTempReportData,
|
||||
} = storeToRefs(conformanceStore);
|
||||
const { activityRadioData } = storeToRefs(conformanceInputStore);
|
||||
|
||||
@@ -391,7 +391,7 @@ const isApplyBtnDisabled = computed(() => {
|
||||
|
||||
// When opening a rule file, display the saved options, rules, and time
|
||||
let reportWatchTimerId = null;
|
||||
watch(conformanceTempReportData, (newValue) => {
|
||||
watch(allConformanceTempReportData, (newValue) => {
|
||||
if (reportWatchTimerId) clearTimeout(reportWatchTimerId);
|
||||
reportWatchTimerId = setTimeout(() => {
|
||||
if (newValue !== null) {
|
||||
|
||||
@@ -376,8 +376,8 @@ const {
|
||||
selectedActSeqMore,
|
||||
selectedActSeqFromTo,
|
||||
conformanceTask,
|
||||
cfmSeqStart,
|
||||
cfmSeqEnd,
|
||||
allCfmSeqStart,
|
||||
allCfmSeqEnd,
|
||||
cfmPtEteStart,
|
||||
cfmPtEteEnd,
|
||||
cfmPtEteSE,
|
||||
@@ -435,14 +435,14 @@ const taskEnd = ref(null);
|
||||
const cfmSeqStartData = computed(() => {
|
||||
const selectedTask = task.value ?? props.isSubmitShowDataSeq?.task ?? null;
|
||||
return isEndSelected.value
|
||||
? setSeqStartAndEndData(cfmSeqEnd.value, "sources", selectedTask)
|
||||
: cfmSeqStart.value.map((i) => i.label);
|
||||
? setSeqStartAndEndData(allCfmSeqEnd.value, "sources", selectedTask)
|
||||
: allCfmSeqStart.value.map((i) => i.label);
|
||||
});
|
||||
const cfmSeqEndData = computed(() => {
|
||||
const selectedTask = task.value ?? props.isSubmitShowDataSeq?.task ?? null;
|
||||
return isStartSelected.value
|
||||
? setSeqStartAndEndData(cfmSeqStart.value, "sinks", selectedTask)
|
||||
: cfmSeqEnd.value.map((i) => i.label);
|
||||
? setSeqStartAndEndData(allCfmSeqStart.value, "sinks", selectedTask)
|
||||
: allCfmSeqEnd.value.map((i) => i.label);
|
||||
});
|
||||
// Processing time
|
||||
const cfmPtEteStartData = computed(() => {
|
||||
@@ -584,7 +584,7 @@ watch(
|
||||
|
||||
/**
|
||||
* Sets the start and end radio data.
|
||||
* @param {object} data - Activities list data from the backend (cfmSeqStart, cfmSeqEnd, cfmPtEteSE, etc.).
|
||||
* @param {object} data - Activities list data from the backend (allCfmSeqStart, allCfmSeqEnd, cfmPtEteSE, etc.).
|
||||
* @param {string} category - 'start' or 'end'.
|
||||
* @returns {array}
|
||||
*/
|
||||
@@ -615,7 +615,7 @@ function setStartAndEndData(data, category, taskVal) {
|
||||
}
|
||||
/**
|
||||
* Resets the activity sequence linked start and end radio data.
|
||||
* @param {object} data - Activities list data from the backend (cfmSeqStart or cfmSeqEnd).
|
||||
* @param {object} data - Activities list data from the backend (allCfmSeqStart or allCfmSeqEnd).
|
||||
* @param {string} category - 'sources' or 'sinks'.
|
||||
* @param {string} task - The selected activity task.
|
||||
* @returns {array}
|
||||
|
||||
@@ -250,10 +250,10 @@ const {
|
||||
selectedProcessScope,
|
||||
selectedActSeqMore,
|
||||
selectedActSeqFromTo,
|
||||
conformanceAllTasks,
|
||||
allConformanceTask,
|
||||
conformanceTask,
|
||||
cfmSeqStart,
|
||||
cfmSeqEnd,
|
||||
allCfmSeqStart,
|
||||
allCfmSeqEnd,
|
||||
cfmPtEteStart,
|
||||
cfmPtEteEnd,
|
||||
cfmPtEteSE,
|
||||
@@ -471,7 +471,7 @@ emitter.on("actRadioData", (data) => {
|
||||
// Activity duration
|
||||
case "cfmDur":
|
||||
state.timeDuration = getDurationTime(
|
||||
conformanceAllTasks.value,
|
||||
allConformanceTask.value,
|
||||
"act",
|
||||
task,
|
||||
);
|
||||
|
||||
@@ -91,18 +91,9 @@ export const useConformanceStore = defineStore("conformanceStore", {
|
||||
conformanceFileName: null, // File name displayed in the save success modal
|
||||
}),
|
||||
getters: {
|
||||
conformanceAllTasks: (state) => {
|
||||
return state.allConformanceTask;
|
||||
},
|
||||
conformanceTask: (state) => {
|
||||
return state.allConformanceTask.map((i) => i.label);
|
||||
},
|
||||
cfmSeqStart: (state) => {
|
||||
return state.allCfmSeqStart;
|
||||
},
|
||||
cfmSeqEnd: (state) => {
|
||||
return state.allCfmSeqEnd;
|
||||
},
|
||||
cfmPtEteWhole: (state) => {
|
||||
return state.allProcessingTime.end_to_end.whole;
|
||||
},
|
||||
@@ -157,18 +148,6 @@ export const useConformanceStore = defineStore("conformanceStore", {
|
||||
cfmCtEteSE: (state) => {
|
||||
return state.allCycleTime.end_to_end.start_end;
|
||||
},
|
||||
conformanceTempReportData: (state) => {
|
||||
return state.allConformanceTempReportData;
|
||||
},
|
||||
routeFile: (state) => {
|
||||
return state.allRouteFile;
|
||||
},
|
||||
issueTraces: (state) => {
|
||||
return state.allIssueTraces;
|
||||
},
|
||||
taskSeq: (state) => {
|
||||
return state.allTaskSeq;
|
||||
},
|
||||
cases: (state) => {
|
||||
if (state.allCases !== null) {
|
||||
return state.allCases.map((c) => {
|
||||
@@ -220,12 +199,6 @@ export const useConformanceStore = defineStore("conformanceStore", {
|
||||
}
|
||||
return [];
|
||||
},
|
||||
loopTraces: (state) => {
|
||||
return state.allLoopTraces;
|
||||
},
|
||||
loopTaskSeq: (state) => {
|
||||
return state.allLoopTaskSeq;
|
||||
},
|
||||
loopCases: (state) => {
|
||||
if (state.allLoopCases !== null) {
|
||||
return state.allLoopCases.map((c) => {
|
||||
|
||||
@@ -138,7 +138,7 @@ export default {
|
||||
break;
|
||||
}
|
||||
await conformanceStore.getConformanceReport(true);
|
||||
to.meta.file = conformanceStore.routeFile;
|
||||
to.meta.file = conformanceStore.allRouteFile;
|
||||
}
|
||||
next();
|
||||
},
|
||||
|
||||
@@ -42,7 +42,7 @@ defineOptions({
|
||||
break;
|
||||
}
|
||||
await conformanceStore.getConformanceReport();
|
||||
to.meta.file = await conformanceStore.conformanceTempReportData?.file;
|
||||
to.meta.file = await conformanceStore.allConformanceTempReportData?.file;
|
||||
}
|
||||
next();
|
||||
},
|
||||
@@ -68,7 +68,7 @@ const {
|
||||
selectedActSeqMore,
|
||||
selectedActSeqFromTo,
|
||||
conformanceRuleData,
|
||||
conformanceTempReportData,
|
||||
allConformanceTempReportData,
|
||||
conformanceFileName,
|
||||
} = storeToRefs(conformanceStore);
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ export default {
|
||||
break;
|
||||
}
|
||||
await conformanceStore.getConformanceReport(true);
|
||||
to.meta.file = conformanceStore.routeFile;
|
||||
to.meta.file = conformanceStore.allRouteFile;
|
||||
}
|
||||
next();
|
||||
},
|
||||
|
||||
@@ -263,7 +263,7 @@ export default {
|
||||
break;
|
||||
}
|
||||
await conformanceStore.getConformanceReport(true);
|
||||
to.meta.file = conformanceStore.routeFile;
|
||||
to.meta.file = conformanceStore.allRouteFile;
|
||||
}
|
||||
next();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user