From e2ddf84cce119757b3f6d63e9f68b0d1a78aa27b Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期三, 23 四月 2025 09:57:22 +0800
Subject: [PATCH] 修改大屏

---
 src/views/hazardousChemicals/bigScreen/components/midTop.vue |   39 ++++++++++++++++-----------------------
 1 files changed, 16 insertions(+), 23 deletions(-)

diff --git a/src/views/hazardousChemicals/bigScreen/components/midTop.vue b/src/views/hazardousChemicals/bigScreen/components/midTop.vue
index 4a26014..1c3d309 100644
--- a/src/views/hazardousChemicals/bigScreen/components/midTop.vue
+++ b/src/views/hazardousChemicals/bigScreen/components/midTop.vue
@@ -112,8 +112,19 @@
 const getList = async () => {
   const res = await getCompanyMessage(companyType.value)
   if(res.code == 200){
-    companyData.value = res.data
-    // console.log(companyData.value,555)
+    if(res.data && Array.isArray(res.data) && res.data.length>0){
+      companyData.value = res.data
+      console.log(companyData.value,555)
+      const mapData = companyData.value.map(i=>{
+        return {
+          name: i.companyName + '(' + i.warningCount + ')',
+          value: [i.longitude,i.latitude]
+        }
+      })
+      console.log(mapData,'mapData')
+      initChart(mapData)
+    }
+
   }else{
     ElMessage.warning(res.message)
   }
@@ -144,24 +155,10 @@
   animationFrame = requestAnimationFrame(scrollAnimation)
 }
 
-const initChart =()=>{
+const initChart =(mapData)=>{
   //获取echart对象
   let dom = document.getElementById('areaMap')
   if (dom) {
-    let data = [
-      {
-        name: "姑苏区",
-        value: Math.round(Math.random() * 100)
-      },
-      {
-        name: "虎丘区",
-        value: Math.round(Math.random() * 100)
-      },
-      {
-        name: "吴中区",
-        value: Math.round(Math.random() * 100)
-      },
-    ]
     //初始化
     let myEchart = echarts.init(dom)
     //注册地图
@@ -233,7 +230,6 @@
               }
             }
           },
-          data: data
         },
         // 区域散点图
         {
@@ -254,11 +250,7 @@
               fontSize: 12
             }
           },
-          data: [
-              { name: '斜塘街道 11', value: [120.697614, 31.288664] },
-            { name: '桑田岛 12', value: [120.807510, 31.350300] },
-            { name: '车坊 2', value: [120.627614, 31.338664] }
-          ],
+          data: mapData,
           itemStyle: {
             //坐标点颜色
             normal: {
@@ -300,6 +292,7 @@
 
 .filter{
   width: 300px;
+  margin-top: 50px;
 }
 :deep(.el-input__wrapper){
   height: 28px;

--
Gitblit v1.9.2