From 02409bfbe15f22fc3b5dccadabfd860a660a49d9 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Sat, 11 Oct 2025 10:37:14 +0800
Subject: [PATCH] feat: 名称修改
---
src/views/resource/components/DrawPolygon.vue | 57 ++++++++++++++++++++++++++++-----------------------------
1 files changed, 28 insertions(+), 29 deletions(-)
diff --git a/src/views/resource/components/DrawPolygon.vue b/src/views/resource/components/DrawPolygon.vue
index e4d40d0..81728eb 100644
--- a/src/views/resource/components/DrawPolygon.vue
+++ b/src/views/resource/components/DrawPolygon.vue
@@ -23,7 +23,14 @@
const viewInstance = inject('viewInstance');
const homeViewer = inject('homeViewer');
-
+watch(
+ () => selectionIds.value,
+ (newValue, oldValue) => {
+ if (newValue && oldValue && newValue !== oldValue) {
+ cancel();
+ }
+ }
+);
function preventDefault(event) {
event.preventDefault();
@@ -170,7 +177,7 @@
curPolygonEntity.polyline = {
width: 2,
material: Cesium.Color.WHITE,
- clampToGround: false,
+ clampToGround: true,
};
curPolygonEntity.polyline.positions = new Cesium.CallbackProperty(function () {
@@ -216,40 +223,32 @@
}, []);
polygon.push(polygon[0]);
console.log('绘制', `POLYGON((${polygon.join(',')}))`);
- ElMessage.success('重新绘制图斑成功!!');
- if (selectionIds.value) {
- emit('upDateDrawState');
- selectionIds.value = null;
- clearSelect();
- }
-getTableList()
// 接口
- // sdfwUpdate({
- // ids: selectionIds.value,
- // sdfw: `POLYGON((${polygon.join(',')}))`,
- // })
- // .then(res => {
- // if (selectionIds.value) {
- // emit('upDateDrawState')
- // selectionIds.value = null
- // // clearSelect()
- // }
+ sdfwUpdate({
+ ids: selectionIds.value,
+ sdfw: `POLYGON((${polygon.join(',')}))`,
+ })
+ .then(res => {
+ if (selectionIds.value) {
+ emit('upDateDrawState')
+ selectionIds.value = null
+ clearSelect()
+ }
- // if (res.data.code !== 0) return ElMessage.error(res.message)
- // ElMessage.success('重新绘制图斑成功!!')
-
- // // getTableList()
- // })
- // .catch(e => {
- // cancel()
- // })
+ if (res.data.code !== 0) return ElMessage.error(res.message)
+ ElMessage.success('重新绘制图斑成功!!')
+ getTableList()
+ })
+ .catch(e => {
+ cancel()
+ })
}
function cancel() {
remove();
removeMenuPanel();
clearPlanar();
-
+ removeSaveMenuPanel();
init();
}
@@ -294,7 +293,7 @@
background: rgba(0, 0, 0, 0.6);
white-space: nowrap;
border-radius: 4px;
-
+pointer-events: none;
&::after {
content: '';
position: absolute;
--
Gitblit v1.9.3