Browse Source

fix: 预警切换,隐藏果园日志

lxf 2 months ago
parent
commit
71f5026d97

+ 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>
 

+ 2 - 2
src/views/warningHome/components/album.vue

@@ -72,7 +72,7 @@
                             :class="{ flashing: card.status === 1 && isFlashing }"
                         >
                             <div class="card-dom" :id="'section' + cardI"></div>
-                            <div v-if="card.status === 1" class="log-wrap">
+                            <!-- <div v-if="card.status === 1" class="log-wrap">
                                 <div class="log-box">
                                     <div class="log-title PangMenZhengDao-FONT">果园日志</div>
                                     <div class="log-content">
@@ -86,7 +86,7 @@
                                         ></indicatorChart>
                                     </div>
                                 </div>
-                            </div>
+                            </div> -->
                             <div class="card-wrap" :class="{ noCarousel: card.status !== 0 }">
                                 <div
                                     class="card-content"

+ 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;