|
@@ -5,6 +5,7 @@
|
|
</div>
|
|
</div>
|
|
<div v-for="item in headList" :key="item.path" class="nav-tag" @click="changeNavTag(item)">
|
|
<div v-for="item in headList" :key="item.path" class="nav-tag" @click="changeNavTag(item)">
|
|
<div v-if="item.icon" class="icon">
|
|
<div v-if="item.icon" class="icon">
|
|
|
|
+ <div v-show="notice && item.name.search(/工作台/)>0" class="if-notice" />
|
|
<svg-icon :icon-class="item.icon" />
|
|
<svg-icon :icon-class="item.icon" />
|
|
</div>
|
|
</div>
|
|
<div class="name">{{ item.name }}</div>
|
|
<div class="name">{{ item.name }}</div>
|
|
@@ -34,9 +35,11 @@
|
|
<script>
|
|
<script>
|
|
import { mapGetters } from 'vuex'
|
|
import { mapGetters } from 'vuex'
|
|
import routes from '@/router/newRouter'
|
|
import routes from '@/router/newRouter'
|
|
|
|
+import websocket from '@/views/workbench/mixins/websocket'
|
|
import { memberGetLoginInMemberInfoByLdap } from '@/api/projectIndex'
|
|
import { memberGetLoginInMemberInfoByLdap } from '@/api/projectIndex'
|
|
import { logoutUrl } from '@/apiConfig/requestIP.js'
|
|
import { logoutUrl } from '@/apiConfig/requestIP.js'
|
|
export default {
|
|
export default {
|
|
|
|
+ mixins: [websocket],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
headList: routes.filter(item => item.name !== '业务线'),
|
|
headList: routes.filter(item => item.name !== '业务线'),
|
|
@@ -44,7 +47,7 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
- ...mapGetters(['activeNavTag', 'navTagType'])
|
|
|
|
|
|
+ ...mapGetters(['activeNavTag', 'navTagType', 'notice'])
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
$route: {
|
|
$route: {
|
|
@@ -89,6 +92,19 @@ export default {
|
|
},
|
|
},
|
|
topHome() {
|
|
topHome() {
|
|
this.$router.push({ path: '/' })
|
|
this.$router.push({ path: '/' })
|
|
|
|
+ },
|
|
|
|
+ // websocket数据接收
|
|
|
|
+ websocketonmessage(e) {
|
|
|
|
+ const { hasReminding } = JSON.parse(e.data)
|
|
|
|
+ if (hasReminding) {
|
|
|
|
+ this.$store.dispatch('data/setNotice', true)
|
|
|
|
+ const link = document.querySelector('link')
|
|
|
|
+ link.href = link.href.replace(/favicon.ico/, 'favicon-tips.ico')
|
|
|
|
+ } else {
|
|
|
|
+ this.$store.dispatch('data/setNotice', false)
|
|
|
|
+ const link = document.querySelector('link')
|
|
|
|
+ link.href = link.href.replace(/favicon-tips.ico/, 'favicon.ico')
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -138,6 +154,17 @@ export default {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 100%;
|
|
height: 100%;
|
|
}
|
|
}
|
|
|
|
+ .if-notice {
|
|
|
|
+ position: absolute;
|
|
|
|
+ z-index: 1;
|
|
|
|
+ height: 8px;
|
|
|
|
+ width: 8px;
|
|
|
|
+ background-color: #E02020;
|
|
|
|
+ border-radius: 50%;
|
|
|
|
+ top: 0;
|
|
|
|
+ right: 0;
|
|
|
|
+ transform: translateY(-50%);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
.nav-tag-type {
|
|
.nav-tag-type {
|
|
margin-top: auto;
|
|
margin-top: auto;
|