From df1e33c9bf69e7c6d410615c76cff199b380a55e Mon Sep 17 00:00:00 2001 From: Esacpe <1113279529@qq.com> Date: Wed, 9 Jul 2025 20:00:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DeploymentArea/components/addForm.vue | 31 ++++++++++++++----- .../DeploymentArea/index.vue | 3 ++ 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/views/backOfficeSystem/IntelligentControl/DeploymentArea/components/addForm.vue b/src/views/backOfficeSystem/IntelligentControl/DeploymentArea/components/addForm.vue index 1fac568..c6222ec 100644 --- a/src/views/backOfficeSystem/IntelligentControl/DeploymentArea/components/addForm.vue +++ b/src/views/backOfficeSystem/IntelligentControl/DeploymentArea/components/addForm.vue @@ -13,9 +13,9 @@ - +
- + 选择地图范围 @@ -26,9 +26,7 @@
感知元信息 - - {{ it.sbmc }} - + {{ it.sbmc }}
@@ -62,7 +60,7 @@ const loading = ref(false) const modelShow = ref(false); const emit = defineEmits(["change"]); const title = ref("新增区域"); -const listQuery = ref({}); +const listQuery = ref({sxts:[],pgis:[]}); const formRef = ref(); const showMap = ref(false); const rules = { @@ -93,19 +91,38 @@ onMounted(()=>{ }) // 初始化 -const init = (type) => { +const init = (type,row) => { + listQuery.value = {sxts:[],pgis:[]}; title.value = type === "add" ? "新增区域" : "编辑区域"; modelShow.value = true; nextTick(() => { showMap.value = true; }); + if(type === "edit") getDateById(row.id) }; +// 更具id获取数据 +const getDateById = (id) =>{ + qcckGet({id},'/mosty-gsxt/tbGsxtBkQy/selectByid').then(res=>{ + res.pgis = res.pgis ? [res.pgis]:[[[]]] + let icon = require('@/assets/point/sp.png'); + nextTick(()=>{ + if(res.sxts && res.sxts.length > 0) emitter.emit('addPointArea',{flag:'gzy_ht',icon,coords:res.sxts}); + if(res.pgis){ + let obj = { position: res.pgis, text:'', id: res.id }; + emitter.emit("echoPlane", { coords: [obj], flag: "bkqy", type: "polygon" }); + } + }) + listQuery.value = res || {}; + }) +} + // 地图选择 const chooseMap = () =>{ listQuery.value.pgis = []; listQuery.value.sxts = []; emitter.emit('removeEara','bkqy_ht') + emitter.emit('deletePointArea','bkqy') emitter.emit('deletePointArea','gzy_ht') emitter.emit('drawShape',{type:'polygon',flag:'bkqy_ht'}) } diff --git a/src/views/backOfficeSystem/IntelligentControl/DeploymentArea/index.vue b/src/views/backOfficeSystem/IntelligentControl/DeploymentArea/index.vue index fe9d39a..33e721c 100644 --- a/src/views/backOfficeSystem/IntelligentControl/DeploymentArea/index.vue +++ b/src/views/backOfficeSystem/IntelligentControl/DeploymentArea/index.vue @@ -35,6 +35,9 @@ +