From 4267283eae4682abde48c0924e0c8ca9539889ba Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Wed, 27 Aug 2025 09:54:53 +0800
Subject: [PATCH] feat:清空绘制
---
src/views/resource/components/spotDetails.vue | 19 +++++++++++++------
src/views/resource/components/FunButton.vue | 2 +-
src/views/resource/components/DrawPolygon.vue | 13 +++++++++++--
3 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/src/views/resource/components/DrawPolygon.vue b/src/views/resource/components/DrawPolygon.vue
index e4d40d0..d2ff08e 100644
--- a/src/views/resource/components/DrawPolygon.vue
+++ b/src/views/resource/components/DrawPolygon.vue
@@ -23,7 +23,15 @@
const viewInstance = inject('viewInstance');
const homeViewer = inject('homeViewer');
-
+watch(
+ () => selectionIds.value,
+ (newValue, oldValue) => {
+ if (newValue && oldValue && newValue !== oldValue) {
+ console.log('selectionIds',newValue);
+ cancel();
+ }
+ }
+);
function preventDefault(event) {
event.preventDefault();
@@ -223,6 +231,7 @@
clearSelect();
}
getTableList()
+cancel()
// 接口
// sdfwUpdate({
// ids: selectionIds.value,
@@ -249,7 +258,7 @@
remove();
removeMenuPanel();
clearPlanar();
-
+removeSaveMenuPanel();
init();
}
diff --git a/src/views/resource/components/FunButton.vue b/src/views/resource/components/FunButton.vue
index 5484226..4a4c38e 100644
--- a/src/views/resource/components/FunButton.vue
+++ b/src/views/resource/components/FunButton.vue
@@ -120,7 +120,7 @@
.fun-button-container {
position: absolute;
top: 50px;
- left: 30%;
+ left: 23%;
transform: translate(100%, 0);
}
diff --git a/src/views/resource/components/spotDetails.vue b/src/views/resource/components/spotDetails.vue
index 0aa3f58..3cca73e 100644
--- a/src/views/resource/components/spotDetails.vue
+++ b/src/views/resource/components/spotDetails.vue
@@ -131,6 +131,7 @@
const isDrawPolygon = ref(false);
// 选中了哪些图斑
const selectionIds = ref(null);
+const selectionList = ref([])
// 当前在编辑状态的异常图斑
let curCustomPolygon = null;
const spotTypeOptions = ref([
@@ -193,9 +194,10 @@
}
publicCesiumInstance = new PublicCesium({
dom: 'spotMap',
- terrain: true,
- flatMode: false,
- layerMode: 4,
+ flatMode: false,
+ terrain: true,
+ layerMode: 4,
+ contour: false,
});
homeViewer.value = publicCesiumInstance.getViewer();
viewer = publicCesiumInstance.getViewer();
@@ -261,7 +263,6 @@
clearSelect();
return;
}
-
// 保存当前选中图斑
// 取出当中经纬度
const numbersWithCommas = data.dkfw.match(/\d+(\.\d+)?/g);
@@ -302,13 +303,15 @@
// 清空选中的数据
const clearSelect = () => {
lastHighlightRow = null;
- selectionIds.value = null;
+ // selectionIds.value = null;
+ selectionList.value = []
};
// 编辑
const handleSelectionChange = row => {
- console.log('编辑', row);
+ console.log('编辑', row.id);
let curRowIsSelect = row;
selectionIds.value = row.id;
+ selectionList.value = row
curRowIsSelect && handleLocationPolygon(row);
if (row.is_exception == 2 && curRowIsSelect) {
isDrawPolygon.value = true;
@@ -342,6 +345,10 @@
getTableList();
}, 0);
} else {
+ if (funButtonEle.value) {
+ isBoxSelect.value = false;
+ isDrawPolygon.value = false;
+ }
destroyMap();
}
});
--
Gitblit v1.9.3