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