From 82c474f8e2983f719f523df91d8793f78639ed27 Mon Sep 17 00:00:00 2001 From: xudan Date: Tue, 9 Sep 2025 10:04:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E5=BA=93=E4=BD=8D?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=80=BB=E8=BE=91=EF=BC=8C=E7=A1=AE=E4=BF=9D?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E3=80=81=E5=88=A0=E9=99=A4=E5=92=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=BA=93=E4=BD=8D=E6=97=B6=E9=87=8D=E6=96=B0=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E5=BA=93=E4=BD=8Dpen=E5=AF=B9=E8=B1=A1=E4=BB=A5?= =?UTF-8?q?=E5=8F=8D=E6=98=A0=E6=9C=80=E6=96=B0=E7=9A=84=E5=BA=93=E4=BD=8D?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/card/point-edit-card.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/card/point-edit-card.vue b/src/components/card/point-edit-card.vue index 9b05c0b..9716612 100644 --- a/src/components/card/point-edit-card.vue +++ b/src/components/card/point-edit-card.vue @@ -104,6 +104,9 @@ function onAddLocation() { const defaultName = generateDefaultLocationName(); p.associatedStorageLocations.push(defaultName); editor.value.updatePen(props.id!, { point: { ...p } }, false); + + // 重新创建库位pen对象以反映最新的库位列表 + editor.value.createStorageLocationPens(props.id!, p.associatedStorageLocations); } function onRemoveLocation(i: number) { const p = point.value!; @@ -128,6 +131,9 @@ function onRemoveLocation(i: number) { p.associatedStorageLocations.splice(i, 1); editor.value.updatePen(props.id!, { point: { ...p } }, false); + // 重新创建库位pen对象以反映最新的库位列表 + editor.value.createStorageLocationPens(props.id!, p.associatedStorageLocations); + // 同步更新地图文件中的binLocationList(删除库位) if (pointName && removedLocationName) { editor.value.removeBinLocation(pointName, removedLocationName); @@ -141,6 +147,9 @@ function onRemoveLocation(i: number) { p.associatedStorageLocations.splice(i, 1); editor.value.updatePen(props.id!, { point: { ...p } }, false); + // 重新创建库位pen对象以反映最新的库位列表 + editor.value.createStorageLocationPens(props.id!, p.associatedStorageLocations); + // 同步更新地图文件中的binLocationList(删除库位) if (pointName && removedLocationName) { editor.value.removeBinLocation(pointName, removedLocationName); @@ -159,6 +168,9 @@ function onChangeLocation(i: number, v: string) { p.associatedStorageLocations[i] = newLocationName; editor.value.updatePen(props.id!, { point: { ...p } }, false); + // 重新创建库位pen对象以反映最新的库位列表 + editor.value.createStorageLocationPens(props.id!, p.associatedStorageLocations); + // 同步更新地图文件中的binLocationList const pointName = pen.value?.label || pen.value?.id || ''; if (pointName && oldLocationName !== newLocationName) {