From 7fc39e1acd7e8e436eae76250399a64179428620 Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Thu, 21 Nov 2024 12:21:02 +0800
Subject: [PATCH] 应急空间点击显示图片
---
src/pages/layout/components/scomponents/layersControl.vue | 178 +++++++++++++++++++++++++++--
src/views/companyInfo/components/box/unitContent.vue | 10
src/views/companyInfo/components/box/dataContent.vue | 10
src/views/companyInfo/components/box/fireTrend.vue | 43 ++++--
src/styles/base/dc-base.scss | 44 +++++++
src/views/space/components/leftContainer.vue | 4
src/components/global/GlobalSearch.vue | 16 --
7 files changed, 251 insertions(+), 54 deletions(-)
diff --git a/src/components/global/GlobalSearch.vue b/src/components/global/GlobalSearch.vue
index bdb3165..c5209d2 100644
--- a/src/components/global/GlobalSearch.vue
+++ b/src/components/global/GlobalSearch.vue
@@ -494,20 +494,6 @@
}
-.search-bar .search-cont-btn[data-v-4fa3a782] .el-button {
- background: none;
-}
-
-::v-deep .el-button {
- background-color: transparent;
- border-color: none;
- border: none;
- cursor: pointer;
- color: #edffff;
- background: rgba(135, 158, 199, 0.3);
- box-shadow: inset 0px 3px 7px 0px rgba(42, 138, 236, 0.95);
-}
-
::v-deep .el-date-editor {
width: 100%;
@@ -599,4 +585,4 @@
}
}
}
-</style>
\ No newline at end of file
+</style>
diff --git a/src/pages/layout/components/scomponents/layersControl.vue b/src/pages/layout/components/scomponents/layersControl.vue
index 9891b25..9bbf702 100644
--- a/src/pages/layout/components/scomponents/layersControl.vue
+++ b/src/pages/layout/components/scomponents/layersControl.vue
@@ -90,6 +90,7 @@
const closePanoramaPopup = () => {
panoramaShow.value = false
}
+let addPupoLayers = {}
const data = [
{
@@ -154,7 +155,31 @@
backgroundIcon: VITE_APP_BASE + 'img/mapicon/yjc.png',
className: 'yjc-box',
showPanel: false,
- layerName: 'yjc'
+ layerName: 'yjc',
+ incident: (e) => {
+ const { attrParams } = e.overlay
+ // 删除
+ destroy()
+ if (!attrParams.imageUrl) {
+ return
+ }
+ addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
+ window.$viewer.addLayer(addPupoLayers[attrParams.name])
+ let iconEl = `<div class="marsBlueGradientPnl">
+ <img src="${attrParams.imageUrl}" width="160" height="160" />
+ </div>`
+ let divIcon = new DC.DivIcon(
+ new DC.Position(attrParams.lng, attrParams.lat, 64),
+ `<div class="public-map-popup-two">
+ ${iconEl}
+ </div>`
+ )
+ let incident = () => {
+ destroy()
+ }
+ divIcon.on(DC.MouseEventType.CLICK, incident)
+ addPupoLayers[attrParams.name].addOverlay(divIcon)
+ }
},
{
id: '3-2',
@@ -169,7 +194,31 @@
backgroundIcon: VITE_APP_BASE + 'img/mapicon/ysf.png',
className: 'ysf-box',
showPanel: false,
- layerName: 'fm'
+ layerName: 'fm',
+ incident: (e) => {
+ const { attrParams } = e.overlay
+ // 删除
+ destroy()
+ if (!attrParams.imageUrl) {
+ return
+ }
+ addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
+ window.$viewer.addLayer(addPupoLayers[attrParams.name])
+ let iconEl = `<div class="marsBlueGradientPnl">
+ <img src="${attrParams.imageUrl}" width="160" height="160" />
+ </div>`
+ let divIcon = new DC.DivIcon(
+ new DC.Position(attrParams.lng, attrParams.lat, 64),
+ `<div class="public-map-popup-two">
+ ${iconEl}
+ </div>`
+ )
+ let incident = () => {
+ destroy()
+ }
+ divIcon.on(DC.MouseEventType.CLICK, incident)
+ addPupoLayers[attrParams.name].addOverlay(divIcon)
+ }
},
{
@@ -230,7 +279,31 @@
type: 4,
size: 1000
},
- layerName: 'wstsbz'
+ layerName: 'wstsbz',
+ incident: (e) => {
+ const { attrParams } = e.overlay
+ // 删除
+ destroy()
+ if (!attrParams.imageUrl) {
+ return
+ }
+ addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
+ window.$viewer.addLayer(addPupoLayers[attrParams.name])
+ let iconEl = `<div class="marsBlueGradientPnl">
+ <img src="${attrParams.imageUrl}" width="160" height="160" />
+ </div>`
+ let divIcon = new DC.DivIcon(
+ new DC.Position(attrParams.lng, attrParams.lat, 64),
+ `<div class="public-map-popup-two">
+ ${iconEl}
+ </div>`
+ )
+ let incident = () => {
+ destroy()
+ }
+ divIcon.on(DC.MouseEventType.CLICK, incident)
+ addPupoLayers[attrParams.name].addOverlay(divIcon)
+ }
},
{
@@ -246,7 +319,31 @@
backgroundIcon: VITE_APP_BASE + 'img/mapicon/sk.png',
className: 'sk-box',
showPanel: false,
- layerName: 'sk'
+ layerName: 'sk',
+ incident: (e) => {
+ const { attrParams } = e.overlay
+ // 删除
+ destroy()
+ if (!attrParams.imageUrl) {
+ return
+ }
+ addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
+ window.$viewer.addLayer(addPupoLayers[attrParams.name])
+ let iconEl = `<div class="marsBlueGradientPnl">
+ <img src="${attrParams.imageUrl}" width="160" height="160" />
+ </div>`
+ let divIcon = new DC.DivIcon(
+ new DC.Position(attrParams.lng, attrParams.lat, 64),
+ `<div class="public-map-popup-two">
+ ${iconEl}
+ </div>`
+ )
+ let incident = () => {
+ destroy()
+ }
+ divIcon.on(DC.MouseEventType.CLICK, incident)
+ addPupoLayers[attrParams.name].addOverlay(divIcon)
+ }
},
{
@@ -262,7 +359,31 @@
backgroundIcon: VITE_APP_BASE + 'img/mapicon/yjb.png',
className: 'yjb-box',
showPanel: false,
- layerName: 'yjb'
+ layerName: 'yjb',
+ incident: (e) => {
+ const { attrParams } = e.overlay
+ // 删除
+ destroy()
+ if (!attrParams.imageUrl) {
+ return
+ }
+ addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
+ window.$viewer.addLayer(addPupoLayers[attrParams.name])
+ let iconEl = `<div class="marsBlueGradientPnl">
+ <img src="${attrParams.imageUrl}" width="160" height="160" />
+ </div>`
+ let divIcon = new DC.DivIcon(
+ new DC.Position(attrParams.lng, attrParams.lat, 64),
+ `<div class="public-map-popup-two">
+ ${iconEl}
+ </div>`
+ )
+ let incident = () => {
+ destroy()
+ }
+ divIcon.on(DC.MouseEventType.CLICK, incident)
+ addPupoLayers[attrParams.name].addOverlay(divIcon)
+ }
},
{
@@ -278,7 +399,31 @@
backgroundIcon: VITE_APP_BASE + 'img/mapicon/xfs.png',
className: 'xfs-box',
showPanel: false,
- layerName: 'xfs'
+ layerName: 'xfs',
+ incident: (e) => {
+ const { attrParams } = e.overlay
+ // 删除
+ destroy()
+ if (!attrParams.imageUrl) {
+ return
+ }
+ addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
+ window.$viewer.addLayer(addPupoLayers[attrParams.name])
+ let iconEl = `<div class="marsBlueGradientPnl">
+ <img src="${attrParams.imageUrl}" width="160" height="160" />
+ </div>`
+ let divIcon = new DC.DivIcon(
+ new DC.Position(attrParams.lng, attrParams.lat, 64),
+ `<div class="public-map-popup-two">
+ ${iconEl}
+ </div>`
+ )
+ let incident = () => {
+ destroy()
+ }
+ divIcon.on(DC.MouseEventType.CLICK, incident)
+ addPupoLayers[attrParams.name].addOverlay(divIcon)
+ }
}
]
},
@@ -346,7 +491,6 @@
incident: (e) => {
const { attrParams } = e.overlay
panoramaTitle.value = attrParams.name
-
if (
attrParams.url.indexOf("http://vr.jxpskj.com:180") != -1
) {
@@ -355,7 +499,6 @@
"/panorama"
)
}
-
panoramaUrl.value = attrParams.url
panoramaShow.value = true
}
@@ -463,7 +606,8 @@
divIcon.attrParams = i
- let incident = () => { }
+ let incident = () => {
+ }
if (item.incident) incident = item.incident
@@ -501,7 +645,7 @@
addTileLayers[item.layerName] = new DC.VectorLayer(item.layerName)
window.$viewer.addLayer(addTileLayers[item.layerName])
- function computeCircle (radius) {
+ function computeCircle(radius) {
var positions = []
for (var i = 0; i < 360; i++) {
var radians = DC.Math.toRadians(i)
@@ -544,7 +688,7 @@
})
}
-function findObjectById (data, id) {
+function findObjectById(data, id) {
// 遍历数据数组
for (let i = 0; i < data.length; i++) {
const item = data[i]
@@ -602,7 +746,15 @@
// watch(sharedData, (newValue) => {
// });
-
+// 销毁
+function destroy() {
+ tileLayers && window.$viewer.removeLayer(tileLayers)
+ let arr = Object.keys(addPupoLayers)
+ arr.filter(i => i != 'hgyq').forEach(i => {
+ addPupoLayers[i] && window.$viewer.removeLayer(addPupoLayers[i])
+ })
+ addPupoLayers = {}
+}
onUnmounted(() => {
tileLayers && window.$viewer.removeLayer(tileLayers)
@@ -610,6 +762,8 @@
arr.filter(i => i != 'hgyq').forEach(i => {
addTileLayers[i] && window.$viewer.removeLayer(addTileLayers[i])
})
+ // 弹窗销毁
+ destroy()
EventBus.off('restHandleCheckChange', restHandleCheckChange)
EventBus.off('restHandleDelChange', restHandleDelChange)
diff --git a/src/styles/base/dc-base.scss b/src/styles/base/dc-base.scss
index ccac8f1..768eda5 100644
--- a/src/styles/base/dc-base.scss
+++ b/src/styles/base/dc-base.scss
@@ -72,6 +72,50 @@
}
}
+.public-map-popup-two {
+ position: absolute;
+ bottom: 160px;
+ pointer-events: all;
+ display: block;
+ transform-origin: left bottom;
+ transform: translate(-50%, 0px);
+ border-radius: 5px;
+ z-index: auto;
+
+ &::after {
+ content: "";
+ position: absolute;
+ bottom: -5px;
+ left: calc(50% - 3px);
+ display: block;
+ width: 10px;
+ height: 10px;
+ transform: rotate(45deg);
+ z-index: -1;
+ background-color: #3b96ff;
+ // background: linear-gradient(to bottom, rgba(255, 0, 21, 0.8), rgb(255, 179, 0, 0.2));
+ }
+
+ .marsBlueGradientPnl {
+ padding: 2px 2px;
+ text-align: center;
+ margin: 0;
+ color: #fff;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+ // line-height: 32px;
+ // width: 112px;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ word-wrap: break-word;
+ font-size: 14px;
+ background: linear-gradient(rgb(7 10 203 / 75%), rgb(16 238 220));
+ }
+}
+
.fxy-ordinary {
&::after {
background: linear-gradient(to bottom, rgba(255, 201, 0, 0.8), rgba(255, 201, 0, 0.2));
diff --git a/src/views/companyInfo/components/box/dataContent.vue b/src/views/companyInfo/components/box/dataContent.vue
index 8b0791e..f795b1c 100644
--- a/src/views/companyInfo/components/box/dataContent.vue
+++ b/src/views/companyInfo/components/box/dataContent.vue
@@ -4,9 +4,9 @@
* @LastEditors: shuishen 1109946754@qq.com
* @LastEditTime: 2024-11-12 18:10:32
* @FilePath: \bigScreen\src\views\space\components\leftContainer.vue
- * @Description:
- *
- * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
+ * @Description:
+ *
+ * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
-->
<script setup>
import { getFacilityList } from "@/api/facility"
@@ -69,7 +69,7 @@
iconEl = `<div class="marsBlueGradientPnl"> <div>${i.name}</div> </div>`
}
let divIcon = new DC.DivIcon(
- new DC.Position(i.lng, i.lat, 0), `<div class="public-map-popup ${'qyfb-box'}"> ${iconEl} </div>`
+ new DC.Position(i.lng, i.lat, 0), `<div class="public-map-popup ${'yjc-box'}"> ${iconEl} </div>`
)
divIcon.attrParams = i
@@ -160,4 +160,4 @@
}
}
}
-</style>
\ No newline at end of file
+</style>
diff --git a/src/views/companyInfo/components/box/fireTrend.vue b/src/views/companyInfo/components/box/fireTrend.vue
index 9ed5440..a761459 100644
--- a/src/views/companyInfo/components/box/fireTrend.vue
+++ b/src/views/companyInfo/components/box/fireTrend.vue
@@ -4,9 +4,9 @@
* @LastEditors: shuishen 1109946754@qq.com
* @LastEditTime: 2023-03-13 15:00:55
* @FilePath: \forest-fire\src\views\statistics\components\box\dataContent.vue
- * @Description:
- *
- * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
+ * @Description:
+ *
+ * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
-->
<script setup>
import publicContent from "./publicContent.vue"
@@ -130,7 +130,7 @@
</div>
`
// }
- // } else
+ // } else
// {
// iconEl = `<div class="marsBlueGradientPnl">
// <div>${row.name}</div>
@@ -164,12 +164,14 @@
arr.forEach(i => {
addTileLayers[i] && window.$viewer.removeLayer(addTileLayers[i])
})
+ addTileLayers = {}
}
onUnmounted(() => {
console.log('销毁***************************')
destroy()
})
+import { Search, Refresh } from '@element-plus/icons-vue'
</script>
<template>
@@ -178,11 +180,12 @@
<el-form-item label="" class="form-item-input">
<el-input v-model="formInline.name" placeholder="请输入名称" clearable style="width: 120px" />
</el-form-item>
- <el-form-item class="search-btn">
- <el-button type="primary" @click="onSubmit">查询</el-button>
- <el-button type="primary" @click="clearBtn">重置</el-button>
+ <el-form-item>
+ <el-button type="primary" :icon="Search" @click="onSubmit">查 询</el-button>
+ <el-button class="reset-btn" :icon="Refresh" @click="clearBtn">重 置</el-button>
</el-form-item>
</el-form>
+ <!-- <global-search :options="options" @searchBtn="searchBtn" @resetBtn="resetBtn" ref="SeachBarCondition"></global-search> -->
<div class="table-box">
<el-table :data="tableData" empty-text="" style="width: 100%" :header-cell-style="headerCellStyle"
:cell-style="tableCellStyle" element-loading-background="rgba(122, 122, 122, 0.1)">
@@ -213,6 +216,12 @@
}
}
+.reset-btn {
+ color: #D4E8F8;
+ background: #43779B;
+ border-color: #43779B;
+}
+
.search-box .table-box {
height: 700px;
overflow: scroll;
@@ -236,7 +245,7 @@
.el-input__wrapper {
font-size: 16px;
font-weight: 400;
- border-radius: 0;
+ border-radius: 5px;
background: rgba(135, 158, 199, 0.3);
box-shadow: inset 0px 3px 7px 0px rgba(42, 138, 236, 0.95);
@@ -249,14 +258,14 @@
}
.search-btn {
- ::v-deep .el-button--primary {
- background-color: transparent;
- border-color: none;
- border: none;
- cursor: pointer;
- color: #edffff;
- background: rgba(135, 158, 199, 0.3);
- box-shadow: inset 0px 3px 7px 0px rgba(42, 138, 236, 0.95);
- }
+ // ::v-deep .el-button--primary {
+ // background-color: transparent;
+ // border-color: none;
+ // border: none;
+ // cursor: pointer;
+ // color: #edffff;
+ // background: rgba(135, 158, 199, 0.3);
+ // box-shadow: inset 0px 3px 7px 0px rgba(42, 138, 236, 0.95);
+ // }
}
</style>
diff --git a/src/views/companyInfo/components/box/unitContent.vue b/src/views/companyInfo/components/box/unitContent.vue
index 0daaeef..5b2b492 100644
--- a/src/views/companyInfo/components/box/unitContent.vue
+++ b/src/views/companyInfo/components/box/unitContent.vue
@@ -4,9 +4,9 @@
* @LastEditors: shuishen 1109946754@qq.com
* @LastEditTime: 2024-11-12 18:10:32
* @FilePath: \bigScreen\src\views\space\components\leftContainer.vue
- * @Description:
- *
- * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
+ * @Description:
+ *
+ * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
-->
<script setup>
import EventBus from 'utils/bus'
@@ -59,7 +59,7 @@
let divIcon = new DC.DivIcon(
new DC.Position(i.lng, i.lat, 0),
- `<div class="public-map-popup ${'qyfb-box'}">
+ `<div class="public-map-popup ${'yjc-box'}">
${iconEl}
</div>`
)
@@ -167,4 +167,4 @@
}
}
}
-</style>
\ No newline at end of file
+</style>
diff --git a/src/views/space/components/leftContainer.vue b/src/views/space/components/leftContainer.vue
index 394af46..a75818f 100644
--- a/src/views/space/components/leftContainer.vue
+++ b/src/views/space/components/leftContainer.vue
@@ -71,6 +71,10 @@
</template>
<style lang="scss" scoped>
+.left-container {
+ width: 64px;
+}
+
.cur-container {
background: transparent;
pointer-events: none;
--
Gitblit v1.9.3