Revert "Use structuredClone instead of JSON.parse(JSON.stringify()) (S7784)"
This reverts commit 2b0dadedd4.
This commit is contained in:
@@ -920,8 +920,8 @@ function getSequenceData() {
|
||||
task_seq: selectCfmSeqDirectly.value,
|
||||
};
|
||||
isSubmitReset();
|
||||
isSubmitCfmSeqDirectly.value = structuredClone(
|
||||
selectCfmSeqDirectly.value,
|
||||
isSubmitCfmSeqDirectly.value = JSON.parse(
|
||||
JSON.stringify(selectCfmSeqDirectly.value),
|
||||
);
|
||||
break;
|
||||
case "Eventually follows":
|
||||
@@ -930,8 +930,8 @@ function getSequenceData() {
|
||||
task_seq: selectCfmSeqEventually.value,
|
||||
};
|
||||
isSubmitReset();
|
||||
isSubmitCfmSeqEventually.value = structuredClone(
|
||||
selectCfmSeqEventually.value,
|
||||
isSubmitCfmSeqEventually.value = JSON.parse(
|
||||
JSON.stringify(selectCfmSeqEventually.value),
|
||||
);
|
||||
break;
|
||||
case "Short loop(s)":
|
||||
|
||||
@@ -129,7 +129,7 @@ const datadata = computed(() => {
|
||||
// Sort the Activity List
|
||||
let newData;
|
||||
if (props.data !== null) {
|
||||
newData = structuredClone(props.data);
|
||||
newData = JSON.parse(JSON.stringify(props.data));
|
||||
sortNumEngZhtw(newData);
|
||||
}
|
||||
return newData;
|
||||
@@ -195,7 +195,7 @@ function onEnd(evt) {
|
||||
}
|
||||
|
||||
// created
|
||||
const newlist = structuredClone(props.listSeq);
|
||||
const newlist = JSON.parse(JSON.stringify(props.listSeq));
|
||||
listSequence.value = props.isSubmit ? newlist : [];
|
||||
emitter.on("reset", (data) => {
|
||||
listSequence.value = [];
|
||||
|
||||
@@ -373,7 +373,7 @@ emitter.on("actListData", (data) => {
|
||||
state.containstTasksData = data;
|
||||
});
|
||||
emitter.on("actRadioData", (newData) => {
|
||||
const data = structuredClone(newData); // Deep copy the original cases data
|
||||
const data = JSON.parse(JSON.stringify(newData)); // Deep copy the original cases data
|
||||
|
||||
const categoryMapping = {
|
||||
cfmSeqStart: ["Start", "selectCfmSeqStart", "selectCfmSeqEnd"],
|
||||
|
||||
@@ -613,20 +613,20 @@ emitter.on("isRadioChange", (data) => {
|
||||
switch (selectedRuleType.value) {
|
||||
case "Processing time":
|
||||
state.timeCfmPtEteAll = getDurationTime(cfmPtEteWhole.value, "all");
|
||||
state.timeCfmPtEteAllDefault = structuredClone(
|
||||
state.timeCfmPtEteAll,
|
||||
state.timeCfmPtEteAllDefault = JSON.parse(
|
||||
JSON.stringify(state.timeCfmPtEteAll),
|
||||
);
|
||||
break;
|
||||
case "Waiting time":
|
||||
state.timeCfmWtEteAll = getDurationTime(cfmWtEteWhole.value, "all");
|
||||
state.timeCfmWtEteAllDefault = structuredClone(
|
||||
state.timeCfmWtEteAll,
|
||||
state.timeCfmWtEteAllDefault = JSON.parse(
|
||||
JSON.stringify(state.timeCfmWtEteAll),
|
||||
);
|
||||
break;
|
||||
case "Cycle time":
|
||||
state.timeCfmCtEteAll = getDurationTime(cfmCtEteWhole.value, "all");
|
||||
state.timeCfmCtEteAllDefault = structuredClone(
|
||||
state.timeCfmCtEteAll,
|
||||
state.timeCfmCtEteAllDefault = JSON.parse(
|
||||
JSON.stringify(state.timeCfmCtEteAll),
|
||||
);
|
||||
break;
|
||||
default:
|
||||
@@ -645,20 +645,20 @@ emitter.on("isRadioActSeqMoreChange", (data) => {
|
||||
switch (selectedRuleType.value) {
|
||||
case "Processing time":
|
||||
state.timeCfmPtEteAll = getDurationTime(cfmPtEteWhole.value, "all");
|
||||
state.timeCfmPtEteAllDefault = structuredClone(
|
||||
state.timeCfmPtEteAll,
|
||||
state.timeCfmPtEteAllDefault = JSON.parse(
|
||||
JSON.stringify(state.timeCfmPtEteAll),
|
||||
);
|
||||
break;
|
||||
case "Waiting time":
|
||||
state.timeCfmWtEteAll = getDurationTime(cfmWtEteWhole.value, "all");
|
||||
state.timeCfmWtEteAllDefault = structuredClone(
|
||||
state.timeCfmWtEteAll,
|
||||
state.timeCfmWtEteAllDefault = JSON.parse(
|
||||
JSON.stringify(state.timeCfmWtEteAll),
|
||||
);
|
||||
break;
|
||||
case "Cycle time":
|
||||
state.timeCfmCtEteAll = getDurationTime(cfmCtEteWhole.value, "all");
|
||||
state.timeCfmCtEteAllDefault = structuredClone(
|
||||
state.timeCfmCtEteAll,
|
||||
state.timeCfmCtEteAllDefault = JSON.parse(
|
||||
JSON.stringify(state.timeCfmCtEteAll),
|
||||
);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -55,10 +55,10 @@ const durationMax = ref(null);
|
||||
/** Deep-copies timeData min/max values to the Vue component boundaries. */
|
||||
function setTimeValue() {
|
||||
// Deep copy the original timeData values
|
||||
minVuemin.value = structuredClone(timeData.value.min);
|
||||
minVuemax.value = structuredClone(timeData.value.max);
|
||||
maxVuemin.value = structuredClone(timeData.value.min);
|
||||
maxVuemax.value = structuredClone(timeData.value.max);
|
||||
minVuemin.value = JSON.parse(JSON.stringify(timeData.value.min));
|
||||
minVuemax.value = JSON.parse(JSON.stringify(timeData.value.max));
|
||||
maxVuemin.value = JSON.parse(JSON.stringify(timeData.value.min));
|
||||
maxVuemax.value = JSON.parse(JSON.stringify(timeData.value.max));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -183,7 +183,7 @@ const traceList = computed(() => {
|
||||
|
||||
const caseData = computed(() => {
|
||||
if (infiniteData.value !== null) {
|
||||
const data = structuredClone(infiniteData.value); // Deep copy the original cases data
|
||||
const data = JSON.parse(JSON.stringify(infiniteData.value)); // Deep copy the original cases data
|
||||
data.forEach((item) => {
|
||||
item.facets.forEach((facet, index) => {
|
||||
item[`fac_${index}`] = facet.value; // Create a new key-value pair
|
||||
@@ -201,7 +201,7 @@ const caseData = computed(() => {
|
||||
});
|
||||
|
||||
const columnData = computed(() => {
|
||||
const data = structuredClone(props.cases); // Deep copy the original cases data
|
||||
const data = JSON.parse(JSON.stringify(props.cases)); // Deep copy the original cases data
|
||||
if (!data || data.length === 0) return [];
|
||||
const facetName = (facName) =>
|
||||
facName
|
||||
|
||||
@@ -228,7 +228,7 @@ const chartData = computed(() => {
|
||||
});
|
||||
|
||||
const caseData = computed(() => {
|
||||
const data = structuredClone(infiniteData.value); // Deep copy the original cases data
|
||||
const data = JSON.parse(JSON.stringify(infiniteData.value)); // Deep copy the original cases data
|
||||
data.forEach((item) => {
|
||||
item.attributes.forEach((attribute, index) => {
|
||||
item[`att_${index}`] = attribute.value; // Create a new key-value pair
|
||||
@@ -239,7 +239,7 @@ const caseData = computed(() => {
|
||||
});
|
||||
|
||||
const columnData = computed(() => {
|
||||
const data = structuredClone(baseCases.value); // Deep copy the original cases data
|
||||
const data = JSON.parse(JSON.stringify(baseCases.value)); // Deep copy the original cases data
|
||||
let result = [
|
||||
{ field: "id", header: "Case Id" },
|
||||
{ field: "started_at", header: "Start time" },
|
||||
|
||||
@@ -164,7 +164,7 @@ const traceList = computed(() => {
|
||||
});
|
||||
|
||||
const caseData = computed(() => {
|
||||
const data = structuredClone(infiniteData.value); // Deep copy the original cases data
|
||||
const data = JSON.parse(JSON.stringify(infiniteData.value)); // Deep copy the original cases data
|
||||
data.forEach((item) => {
|
||||
item.attributes.forEach((attribute, index) => {
|
||||
item[`att_${index}`] = attribute.value; // Create a new key-value pair
|
||||
@@ -175,7 +175,7 @@ const caseData = computed(() => {
|
||||
});
|
||||
|
||||
const columnData = computed(() => {
|
||||
const data = structuredClone(props.cases); // Deep copy the original cases data
|
||||
const data = JSON.parse(JSON.stringify(props.cases)); // Deep copy the original cases data
|
||||
let result = [
|
||||
{ field: "id", header: "Case Id" },
|
||||
{ field: "started_at", header: "Start time" },
|
||||
@@ -215,7 +215,7 @@ watch(showTraceId, (newValue, oldValue) => {
|
||||
|
||||
watch(infiniteFirstCases, (newValue) => {
|
||||
if (infiniteFirstCases.value)
|
||||
infiniteData.value = structuredClone(newValue);
|
||||
infiniteData.value = JSON.parse(JSON.stringify(newValue));
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
@@ -586,7 +586,7 @@ const isCompareDisabledButton = computed(() => {
|
||||
const reallyDeleteData = computed(() => {
|
||||
let result = [];
|
||||
if (store.allFiles.length !== 0) {
|
||||
result = structuredClone(store.allFiles);
|
||||
result = JSON.parse(JSON.stringify(store.allFiles));
|
||||
result = result.filter((file) => file.is_deleted === true);
|
||||
}
|
||||
return result;
|
||||
@@ -602,7 +602,7 @@ watch(filesTag, (newValue) => {
|
||||
|
||||
watch(allFiles, (newValue) => {
|
||||
if (newValue !== null)
|
||||
compareData.value = structuredClone(newValue);
|
||||
compareData.value = JSON.parse(JSON.stringify(newValue));
|
||||
});
|
||||
|
||||
watch(
|
||||
|
||||
Reference in New Issue
Block a user