diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 12e63e3..2462425 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -39,7 +39,7 @@
-
+
@@ -123,6 +123,8 @@ const noticeStore = storeToRefs(useNoticeStore());
const newNotice = ref(0);
const { warningList, warningListTotal } = storeToRefs(warningListStore);
+const infoData = ref(warningListStore.warningListTotal ?? 0);
+
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const userId = ref(userStore.userId);
@@ -239,8 +241,22 @@ onMounted(() => {
});
});
onMounted(() => {
- warningListStore.getWarningList();
+ warningListStore.getWarningList({
+ status: 0,
+ pageNum: 1,
+ pageSize: 300
+ });
});
+
+//监听数据变化
+watch(
+ () => warningListStore.warningListTotal,
+ (newVal) => {
+ console.log('监听告警列表变化', newVal);
+ infoData.value = newVal;
+ },
+ { deep: true }
+);