From 91b0174402dc5c993a3fc506d89bae7ba1e0ce99 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 23 四月 2024 18:04:52 +0800
Subject: [PATCH] 完成消息列表接口对接

---
 src/view/index.vue |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/src/view/index.vue b/src/view/index.vue
index 77afae7..e444d61 100644
--- a/src/view/index.vue
+++ b/src/view/index.vue
@@ -295,7 +295,7 @@
 			</div>
 			<div class="label">LIMS瀹為獙瀹ょ鐞嗙郴缁�</div>
 			<div class="user">
-        <el-badge is-dot style="cursor: pointer;margin-right: 10px;">
+        <el-badge :is-dot="newMsg" style="cursor: pointer;margin-right: 10px;">
           <i class="el-icon-bell" style="font-size: 20px;" @click="openNotice"></i>
         </el-badge>
         <el-dropdown trigger="click" @command="handleCommand">
@@ -427,7 +427,9 @@
 				activeIndex: 0,
 				power: [],
         editVisible:false,
-        query:{}
+        query:{},
+        newMsg:false,
+        timer:null,
 			};
 		},
 		created() {
@@ -458,6 +460,10 @@
 				this.activeBox = 0
 			}
 			this.getPower()
+      this.timer&&clearInterval(this.timer);
+      this.timer = setInterval(()=>{
+        this.checkForUnreadData()
+      },10000)
 		},
 		methods: {
 			saveClick(){
@@ -616,7 +622,19 @@
       },
       openNotice(){
         this.$refs.notice.open()
+        this.$refs.notice.handleType()
+      },
+      checkForUnreadData(){
+        this.$axios.get(this.$api.informationNotification.checkForUnreadData).then(res => {
+          if (res.code == 201) {
+            return
+          }
+          this.newMsg = res.data
+        })
       }
-		}
+		},
+    destroyed() {
+      this.timer&&clearInterval(this.timer);
+    }
 	};
 </script>

--
Gitblit v1.9.3