From 5c5ad7b217e0a0da24f039b0b7b8829b3e2ca130 Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Wed, 20 Nov 2024 16:01:31 +0800
Subject: [PATCH] 上图图标优化+搜索按钮优化

---
 src/views/companyInfo/components/box/unitContent.vue |   27 ++++++++++++++++++++-------
 1 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/src/views/companyInfo/components/box/unitContent.vue b/src/views/companyInfo/components/box/unitContent.vue
index 6070010..0daaeef 100644
--- a/src/views/companyInfo/components/box/unitContent.vue
+++ b/src/views/companyInfo/components/box/unitContent.vue
@@ -14,6 +14,13 @@
 import { getDictionary } from "@/api/dict/dict"
 import { onUnmounted, reactive } from 'vue'
 import { getList } from "@/api/space/space"
+const { VITE_APP_BASE } = import.meta.env
+let image = ref(
+    [{ label: '阀', value: VITE_APP_BASE + 'img/mapicon/ysf.png' }
+        , { label: '池', value: VITE_APP_BASE + 'img/mapicon/yjc.png' }
+        , { label: '泵', value: VITE_APP_BASE + 'img/mapicon/yjb.png' }]
+)
+
 const resData = reactive({
     data: []
 })
@@ -38,17 +45,23 @@
             let data = res.data.data.records
             data.filter(i => i.lng && i.lng != '' && i.lat && i.lat != '').forEach(i => {
                 let iconEl = ''
-                {
-                    iconEl = `<div class="marsBlueGradientPnl">
-                  <div>${i.name}</div>
-                </div>`
-                }
+                // {
+                //     iconEl = `<div class="marsBlueGradientPnl">
+                //   <div>${i.name}</div>
+                // </div>`
+                // }
+                let img = image.value.filter(l => i.name.includes(l.label))
+                img = img.length > 0 ? img : image
+                iconEl = `<div class="map-name">${i.name}</div>
+                            <div class="map-icon">
+                            <img src="${img[0].value}">
+                            </div>`
 
                 let divIcon = new DC.DivIcon(
                     new DC.Position(i.lng, i.lat, 0),
-                    `<div class="public-map-popup">
+                    `<div class="public-map-popup  ${'qyfb-box'}">
                     ${iconEl}
-                  </div>`
+                    </div>`
                 )
 
                 divIcon.attrParams = i

--
Gitblit v1.9.3