fix(structuredclone): change

This commit is contained in:
2026-02-28 16:54:50 +08:00
parent 717b7237a2
commit cc9bea54e5
12 changed files with 101 additions and 103 deletions

View File

@@ -93,6 +93,7 @@ import { useIntervalStore } from "../useTimerStore"
import { useTopToolsStore } from "../useTopToolsStore"
import { getSubAttrStatus } from "../util"
import { labelTypeMap, TaskStatusEnum } from "../utils/constants"
import { safeClone } from "../utils/clone"
import { adjustAllPoints } from "../utils/paperjs"
import BackConfirmModal from "./BackConfirmModal"
import BackupModal from "./BackupModal"
@@ -562,7 +563,7 @@ const TopTools = (
}
// 处理QA数据
if (projectDetail?.label_type === 6) {
const currentQaData = structuredClone(
const currentQaData = safeClone(
useDescToolsStore.getState().qaData.get(name) || {}
)
let other_desc: any = {}
@@ -977,7 +978,7 @@ const TopTools = (
useDescToolsStore.getState().setMetaData(meta)
} else if (projectDetail?.label_type === 6) {
const { text } = data
const updateQaData = structuredClone(
const updateQaData = safeClone(
useDescToolsStore.getState().qaData
)
text.entries().forEach(([key, value]: any) => {
@@ -1542,7 +1543,7 @@ const TopTools = (
}}
c={showTagsConfigs.includes(config) ? "blue" : undefined}
onClick={() => {
let arr = structuredClone(showTagsConfigs)
let arr = safeClone(showTagsConfigs)
const index = arr.findIndex((item) => item === config)
if (index !== -1) {
arr.splice(index, 1)