فهرست منبع

Merge branch 'master' of http://www.sysuimars.cn:3000/feiniao/feiniao-pc-vue

wangsisi 2 ماه پیش
والد
کامیت
0585bd959d
2فایلهای تغییر یافته به همراه9 افزوده شده و 3 حذف شده
  1. 4 1
      src/views/warningHome/components/alarmList.vue
  2. 5 2
      src/views/warningHome/index.vue

+ 4 - 1
src/views/warningHome/components/alarmList.vue

@@ -71,13 +71,16 @@ onMounted(() => {
         eventBus.emit("alarmList:warningLayers", data)
         toggleAlarm(alarmList.value[0], 1)
     })
+    eventBus.on("warningHome:toggleArea", (id) => {
+        activeAlarm.value = null
+    })
 });
 
 const activeAlarm = ref(1);
 const toggleAlarm = (item, type) => {
     activeAlarm.value = item.id;
     // eventBus.emit("alarmList:changeMapLayer", {name: item.name, url: mapLayerList.value[item.name]})
-    eventBus.emit("alarmList:changeMapLayer", {url: mapLayerList.value[item.name], type})
+    eventBus.emit("alarmList:changeMapLayer", {url: mapLayerList.value[item.name], type, name: item.name})
 };
 </script>
 

+ 5 - 2
src/views/warningHome/index.vue

@@ -127,6 +127,10 @@ onMounted(() => {
     eventBus.on("alarmList:warningLayers", (data) => {
         warningLayers.value = data
     });
+
+    eventBus.on("alarmList:changeMapLayer", ({name}) => {
+        legendImg.value = warningLayers.value[`${name}图例`];
+    });
 });
 
 const destroyPopup = () => {
@@ -284,8 +288,7 @@ const toggleBox = (name) => {
                 .data-box {
                     cursor: pointer;
                     margin-left: 20px;
-                    // width: 200px;
-                    width: 242px;
+                    width: 200px;
                     height: 104px;
                     background: url("@/assets/images/warningHome/box-bg.png") no-repeat center center / 100% 100%;
                     display: flex;