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