|
@@ -1,5 +1,5 @@
|
|
|
<script setup>
|
|
|
-import { ref, onMounted } from 'vue';
|
|
|
+import { ref, onMounted, onUnmounted } from 'vue';
|
|
|
import { RouterView } from 'vue-router';
|
|
|
import { NScrollbar } from 'naive-ui';
|
|
|
import { SvgIcon, TheLogo, TheMenu } from '@/components';
|
|
@@ -7,11 +7,18 @@ import { waterApi } from '@/api/water';
|
|
|
|
|
|
const warningCountMseeage = ref([]);
|
|
|
|
|
|
-onMounted(async () => {
|
|
|
+const initWraingListData = async () => {
|
|
|
const { data } = await waterApi.getWarningCount();
|
|
|
warningCountMseeage.value = data;
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ setInterval(_ => initWraingListData(), 60 * 60 * 1000)
|
|
|
})
|
|
|
|
|
|
+onUnmounted(() => clearInterval(initWraingListData))
|
|
|
+
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -26,7 +33,7 @@ onMounted(async () => {
|
|
|
</NScrollbar>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="aside-main_bottom w-full px-[20px]">
|
|
|
+ <div class="aside-main_bottom w-full px-[20px]" v-if="warningCountMseeage.length">
|
|
|
<dl class="warn-content px-[12px] py-[12px]">
|
|
|
<dt class="w-[64px] h-[20px] mb-[12px] text-[16px] flex items-center justify-center">
|
|
|
<img src="@/assets/images/menu/bg-warn-text.png" alt="">
|