From 5ae5dc7224eabd60425cc3a06f7a98721ea21f69 Mon Sep 17 00:00:00 2001 From: Esacpe <1113279529@qq.com> Date: Tue, 23 Dec 2025 18:58:47 +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 --- src/App.vue | 24 +- src/components/GdMap/index.vue | 5 + src/components/GdMap/indexww.vue | 6 + src/components/GdMap/mapUtil.js | 48 +- .../IntelligentControl/DeploymentArea/xzqh.js | 7 + src/views/home/index copy.vue | 446 ++++++++++++++++++ src/views/home/index.vue | 44 +- 7 files changed, 548 insertions(+), 32 deletions(-) create mode 100644 src/views/home/index copy.vue diff --git a/src/App.vue b/src/App.vue index d787d7d..817c4c5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -152,19 +152,22 @@ v-deep .el-loading-mask { } .popupCustomBox{ position: relative; - padding: 4px 10px; - box-sizing: border-box; - background: #06254282; + background: #2a88e082; color: #fff; border-radius: 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); .popupCustomTitle_title{ + padding: 4px; + box-sizing: border-box; font-size: 12px; - line-height: 24px; text-transform: none; margin-bottom: 0; border-bottom: 1px dashed #ececec; margin-bottom: 2px; + display: flex; + justify-content: space-between; + align-items: center; + flex-wrap: nowrap; } &::after{ content: ''; @@ -176,7 +179,18 @@ v-deep .el-loading-mask { height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; - border-top: 10px solid #06254282; + border-top: 10px solid #2a88e082; + } + .popupCustomTitle_li{ + font-size: 12px; + line-height: 22px; + text-transform: none; + margin-bottom: 0; + span{ + display: inline-block; + width: 45px; + text-align: center; + } } } diff --git a/src/components/GdMap/index.vue b/src/components/GdMap/index.vue index 0eb27de..cd05015 100644 --- a/src/components/GdMap/index.vue +++ b/src/components/GdMap/index.vue @@ -154,6 +154,10 @@ onMounted(() => { emitter.on("showSquire", (obj) => { mapUtil.value.zdySquire(obj); }); + // 展示气泡框 + emitter.on("makerPopup", (obj) => { + mapUtil.value.makerPopup(obj); + }); // 绘制图形 - 回显区域 emitter.on("drawShape", (res) => { @@ -288,6 +292,7 @@ onUnmounted(() => { emitter.off("showPoint"); emitter.off("deletePointArea"); emitter.off("deletePointAreaOne"); + emitter.off("makerPopup"); emitter.off("drawShape"); emitter.off("echoPlane"); emitter.off("removeEara"); diff --git a/src/components/GdMap/indexww.vue b/src/components/GdMap/indexww.vue index 0349009..144bfec 100644 --- a/src/components/GdMap/indexww.vue +++ b/src/components/GdMap/indexww.vue @@ -167,6 +167,11 @@ onMounted(() => { mapUtil.value.showPoint(obj); }); + // 展示气泡框 + emitter.on("makerPopup", (obj) => { + mapUtil.value.makerPopup(obj); + }); + // 清除覆盖物 emitter.on("deletePointArea", (res) => { // 只清除与当前地图相关的覆盖物 @@ -325,6 +330,7 @@ onUnmounted(() => { emitter.off("setMapCenter"); emitter.off("addPointArea"); emitter.off("showPoint"); + emitter.off("makerPopup"); emitter.off("deletePointArea"); emitter.off("deletePointAreaOne"); emitter.off("drawShape"); diff --git a/src/components/GdMap/mapUtil.js b/src/components/GdMap/mapUtil.js index f073670..146241b 100644 --- a/src/components/GdMap/mapUtil.js +++ b/src/components/GdMap/mapUtil.js @@ -85,7 +85,7 @@ export function MapUtil(map) { el.style.width = size ? size : "25px"; if (flag.includes('jczMap_')) el.style.width = '45px'; if (showTitle) _that.makerShowTitle(item, [item.jd, item.wd], flag, '', offset) //展示标题 - if (flag == 'hm') _that.makerPopup(item, flag, 'Custom') //展示气泡框 + // if (flag == 'hm') _that.makerPopup({data:item,flag:'hm_pop',type:'Custom'}) //展示气泡框 // 确保坐标格式正确,使用对象格式传递坐标 const marker = map.Marker(el, { lng: item.jd, lat: item.wd }, { anchor: 'bottom', offset: [0, 0] }) el.addEventListener("click", () => { @@ -144,34 +144,35 @@ export function MapUtil(map) { } // 展示气泡框 - MapUtil.prototype.makerPopup = (item,flag,style = 'Dark')=>{ + MapUtil.prototype.makerPopup = (val)=>{ + + let { data,flag,type = 'Dark'} = val // Dark Light Custom let marker; - let flagPop = flag+'_pop' - if(!_that._self[flagPop]) _that._self[flagPop] = []; - if(style == 'Dark' || style == 'Light') { - let list = zdyContent(flag,item);// 默认的样式 - marker = map.createPopup([item.jd,item.wd],{ + if(!_that._self[flag]) _that._self[flag] = []; + if(type == 'Dark' || type == 'Light') { + let list = zdyContent(flag,data);// 默认的样式 + marker = map.createPopup([data.jd,data.wd],{ style:style, // 气泡框样式: data:list, - title:item.ssbm, + title:data.ssbm, closeButton:false, anchor:'bottom', pixelOffset:[0,-50] }) }else { - marker = map.createPopup([item.jd,item.wd],{ + marker = map.createPopup([data.jd,data.wd],{ style:'Custom', // // 自定义样式 attrs:{ class:'popupCustom' }, - container: zdyContentHtml(flag,item), + container: zdyContentHtml(flag,data), closeButton:false, anchor:'bottom', pixelOffset:[0,-30] }) } - _that._self[flagPop].push(marker) + _that._self[flag].push(marker) } // 弹窗自定义默认内容 function zdyContent(flag,item){ @@ -187,16 +188,25 @@ export function MapUtil(map) { } // 弹窗自定义标签内容 function zdyContentHtml(flag,item){ + const list = [ + { jb: "一级",sl:'5',ypl:'100%' }, + { jb: "一级",sl:'5',ypl:'100%' }, + { jb: "一级",sl:'5',ypl:'100%' }, + { jb: "一级",sl:'5',ypl:'100%' } + ]; let html = '' switch (flag) { - case 'hm': + case 'hm_pop': html = `