fix(store): fix
This commit is contained in:
@@ -20,6 +20,9 @@ const RecoverModal = ({ open, handleCancel, handleOk }: ComponentProps) => {
|
||||
initialValues: {
|
||||
name: "",
|
||||
},
|
||||
validate: {
|
||||
name: (value) => (value.length < 1 ? "请选择备份" : null),
|
||||
},
|
||||
})
|
||||
|
||||
const [options, setOptions] = useState<any[]>([])
|
||||
@@ -59,8 +62,8 @@ const RecoverModal = ({ open, handleCancel, handleOk }: ComponentProps) => {
|
||||
data={options}
|
||||
searchable
|
||||
label="备份名称"
|
||||
key="backup_name"
|
||||
{...form.getInputProps("backup_name")}
|
||||
key="name"
|
||||
{...form.getInputProps("name")}
|
||||
/>
|
||||
</CustomModal>
|
||||
)
|
||||
|
||||
@@ -967,8 +967,16 @@ const TopTools = (
|
||||
if (!renderPolygons) return
|
||||
let taskLabelData = await storage.getItem(taskDetail!.id.toString())
|
||||
if (taskLabelData) {
|
||||
const backupData = taskLabelData.state?.[name]
|
||||
if (!name || !backupData) {
|
||||
notifications.show({
|
||||
color: "yellow",
|
||||
message: "备份不存在或尚未选择备份",
|
||||
})
|
||||
return
|
||||
}
|
||||
const finalData = adjustAllPoints(
|
||||
taskLabelData.state[name],
|
||||
backupData,
|
||||
usePaperStore.getState().rasterScale
|
||||
)
|
||||
for (const entry of finalData.entries()) {
|
||||
|
||||
@@ -118,6 +118,9 @@ export const adjustAllPoints: (
|
||||
string,
|
||||
Map<string, [number, any[], any, any[]][]>
|
||||
>()
|
||||
if (!(nestedMap instanceof Map)) {
|
||||
return adjustedMap
|
||||
}
|
||||
nestedMap.forEach((innerMap, outerKey) => {
|
||||
const scale = allScale[outerKey]
|
||||
if (scale) {
|
||||
|
||||
Reference in New Issue
Block a user