fix(top): fix
This commit is contained in:
@@ -4,6 +4,7 @@ import { persist } from "zustand/middleware"
|
||||
import { usePaperStore } from "./usePaperStore"
|
||||
import { useObjectStore } from "./store"
|
||||
import { useBottomToolsStore } from "./useBottomToolsStore"
|
||||
import { safeClone } from "./utils/clone"
|
||||
|
||||
interface TopToolsState {
|
||||
// 标注页面是否仅查看
|
||||
@@ -59,10 +60,13 @@ interface TopToolsState {
|
||||
subAttributes: {
|
||||
// key: label_class
|
||||
[key: string]: {
|
||||
[key: string]: string
|
||||
[key: string]: string | string[]
|
||||
}
|
||||
}
|
||||
setsubAttributes: (key: string, val: { [key: string]: string }) => void
|
||||
setsubAttributes: (
|
||||
key: string,
|
||||
val: { [key: string]: string | string[] }
|
||||
) => void
|
||||
objectOperations: Project.LabelSchemaList[]
|
||||
setObjectOperations: (val: Project.LabelSchemaList[]) => void
|
||||
needBackup: boolean
|
||||
@@ -219,10 +223,10 @@ export const useTopToolsStore = create<TopToolsState>()(
|
||||
setsubAttributes: (key, val) =>
|
||||
set((state: TopToolsState) => ({
|
||||
...state,
|
||||
subAttributes: Object.assign(
|
||||
useTopToolsStore.getState().subAttributes,
|
||||
{ [key]: val }
|
||||
),
|
||||
subAttributes: {
|
||||
...state.subAttributes,
|
||||
[key]: safeClone(val),
|
||||
},
|
||||
})),
|
||||
objectOperations: initialTopToolsState.objectOperations,
|
||||
setObjectOperations: (val) =>
|
||||
|
||||
Reference in New Issue
Block a user