From 2241222bb7450a51508e13f4cecfbdb4d73e5574 Mon Sep 17 00:00:00 2001 From: Esacpe <1113279529@qq.com> Date: Thu, 18 Dec 2025 18:24:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=A2=84=E8=AD=A6=E7=A7=AF?= =?UTF-8?q?=E5=88=86=E6=8E=92=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 30 ++++++++- src/components/GdMap/mapUtil.js | 82 +++++++++++++++++------- src/views/home/index.vue | 18 ++++-- src/views/home/model/warningPoints.vue | 88 ++++++++++++++++++++++++++ 4 files changed, 191 insertions(+), 27 deletions(-) create mode 100644 src/views/home/model/warningPoints.vue diff --git a/src/App.vue b/src/App.vue index c23bf34..d787d7d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -150,5 +150,33 @@ v-deep .el-loading-mask { left: -10px; transform: translateY(-50%) translateX(-50%); } - +.popupCustomBox{ + position: relative; + padding: 4px 10px; + box-sizing: border-box; + background: #06254282; + color: #fff; + border-radius: 4px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); + .popupCustomTitle_title{ + font-size: 12px; + line-height: 24px; + text-transform: none; + margin-bottom: 0; + border-bottom: 1px dashed #ececec; + margin-bottom: 2px; + } + &::after{ + content: ''; + position: absolute; + bottom: -10px; + left: 50%; + transform: translateX(-50%); + width: 0; + height: 0; + border-left: 10px solid transparent; + border-right: 10px solid transparent; + border-top: 10px solid #06254282; + } +} diff --git a/src/components/GdMap/mapUtil.js b/src/components/GdMap/mapUtil.js index 0ea3f6b..1a9b63f 100644 --- a/src/components/GdMap/mapUtil.js +++ b/src/components/GdMap/mapUtil.js @@ -1,4 +1,5 @@ import emitter from "@/utils/eventBus.js"; +import { ElContainer } from "element-plus"; export function MapUtil(map) { let _that = this; @@ -84,6 +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') //展示气泡框 // 确保坐标格式正确,使用对象格式传递坐标 const marker = map.Marker(el, { lng: item.jd, lat: item.wd }, { anchor: 'bottom', offset: [0, 0] }) el.addEventListener("click", () => { @@ -141,24 +143,63 @@ export function MapUtil(map) { }); } - - - - - - - - - - - - - - - - - - + // 展示气泡框 + MapUtil.prototype.makerPopup = (item,flag,style = 'Dark')=>{ + // Dark Light Custom + if(style == 'Dark' || style == 'Light') { + let list = zdyContent(flag,item);// 默认的样式 + map.createPopup([item.jd,item.wd],{ + style:style, // 气泡框样式: + data:list, + title:item.ssbm, + closeButton:false, + anchor:'bottom', + pixelOffset:[0,-50] + }) + }else { + map.createPopup([item.jd,item.wd],{ + style:'Custom', // // 自定义样式 + attrs:{ + class:'popupCustom' + }, + container: zdyContentHtml(flag,item), + closeButton:false, + anchor:'bottom', + pixelOffset:[0,-30] + }) + } + } + // 弹窗自定义默认内容 + function zdyContent(flag,item){ + switch (flag) { + case 'hm': + return [ + { label:'临安码线索数量',value:item.lamsx }, + { label:'布控预警数量',value:item.bkyj }, + { label:'红色预警数量',value:item.hsyj }, + { label:'信息采集数量',value:item.xxcjsl }, + ] + } + } + // 弹窗自定义标签内容 + function zdyContentHtml(flag,item){ + let html = '' + switch (flag) { + case 'hm': + html = ` +