From 5221bb4832912e7e494b76e4fdf64eb0c98fce50 Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Fri, 22 Nov 2024 17:12:59 +0800
Subject: [PATCH] 代码优化
---
src/views/companyInfo/components/box/fireTrend.vue | 51 ++++++++++++++++++++++++++-------------------------
1 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/src/views/companyInfo/components/box/fireTrend.vue b/src/views/companyInfo/components/box/fireTrend.vue
index b9d68bc..ebf8e73 100644
--- a/src/views/companyInfo/components/box/fireTrend.vue
+++ b/src/views/companyInfo/components/box/fireTrend.vue
@@ -96,6 +96,7 @@
picList.value = data.picList
pages.total = data.total
loading.value = false
+ rowClick(tableData.value[0], '', '')
})
.catch((err) => {
loading.value = false
@@ -117,7 +118,7 @@
addTileLayers[row.name] = new DC.HtmlLayer(row.name)
window.$viewer.addLayer(addTileLayers[row.name])
let iconEl = `
- <div class="map-name">${row.name}</div>
+ <div class="map-name">${'应急物资'}</div>
<div class="map-icon">
<img src="${image.value}">
</div>
@@ -130,30 +131,30 @@
)
divIcon.attrParams = row
let incident = (e) => {
- // const { attrParams } = e.overlay
- // // 删除
- // destroyPupoLayers()
- // if (picList.value.length == 0) {
- // return
- // }
- // console.log('点击了', picList.value.length)
- // addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
- // window.$viewer.addLayer(addPupoLayers[attrParams.name])
- // let iconEl = `<div class="marsBlueGradientPnl">
- // <div>${attrParams.fullName}</div>
- // <img src="${picList.value[0].link}" />
- // </div>`
- // let divIcon = new DC.DivIcon(
- // new DC.Position(attrParams.lng, attrParams.lat, 64),
- // `<div class="public-map-popup-two">
- // ${iconEl}
- // </div>`
- // )
- // let incident = () => {
- // destroyPupoLayers()
- // }
- // divIcon.on(DC.MouseEventType.CLICK, incident)
- // addPupoLayers[attrParams.name].addOverlay(divIcon)
+ const { attrParams } = e.overlay
+ // 删除
+ destroyPupoLayers()
+ if (picList.value.length == 0) {
+ return
+ }
+ console.log('点击了', picList.value.length)
+ addPupoLayers['企业应急物资'] = new DC.HtmlLayer('企业应急物资')
+ window.$viewer.addLayer(addPupoLayers['企业应急物资'])
+ let iconEl = `<div class="marsBlueGradientPnl">
+ <div>${attrParams.firmName}</div>
+ <img src="${picList.value[0].link}" />
+ </div>`
+ let divIcon = new DC.DivIcon(
+ new DC.Position(attrParams.lng, attrParams.lat, 64),
+ `<div class="public-map-popup-two">
+ ${iconEl}
+ </div>`
+ )
+ let incident = () => {
+ destroyPupoLayers()
+ }
+ divIcon.on(DC.MouseEventType.CLICK, incident)
+ addPupoLayers['企业应急物资'].addOverlay(divIcon)
}
divIcon.on(DC.MouseEventType.CLICK, incident)
--
Gitblit v1.9.3