licp
2024-04-23 91b0174402dc5c993a3fc506d89bae7ba1e0ce99
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>