From 5c92482122feec7376d1974befca2f1a83c29919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= Date: Tue, 1 Apr 2025 14:32:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E7=AB=99=E7=82=B9=E9=80=BB=E8=BE=91=EF=BC=8C=E7=A1=AE=E4=BF=9D?= =?UTF-8?q?=E4=BB=8E=E9=80=89=E4=B8=AD=E9=A1=B9=E4=B8=AD=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=B7=B2=E5=88=A0=E9=99=A4=E7=9A=84=E7=AB=99?= =?UTF-8?q?=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/cesium-viewer.page.vue | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/pages/cesium-viewer.page.vue b/src/pages/cesium-viewer.page.vue index 3656f1d..78d8ac9 100644 --- a/src/pages/cesium-viewer.page.vue +++ b/src/pages/cesium-viewer.page.vue @@ -40,14 +40,21 @@ const addRandomStation = () => { // 移除最后一个站点 const removeLastStation = () => { - if (selectedIds.value.length > 0) { - selectedIds.value.pop(); // 移除选中项 + if (groundStations.value.length > 0) { + const removedStation = groundStations.value.pop(); + if (removedStation) { + consola.info('移除站点:', removedStation); + // 同时从选中项中移除 + selectedIds.value = selectedIds.value.filter((id) => id !== removedStation.id); + } } }; // 清空所有选中项 const clearAllStations = () => { - selectedIds.value = []; // 同时清空选中项 + groundStations.value = []; + selectedIds.value = []; // 清空选中项 + consola.info('清空所有站点'); };