|
@@ -2,10 +2,10 @@
|
|
|
<div class="navbar-news">
|
|
|
<!-- 权限写法 -->
|
|
|
<!-- <div class="nn-item" v-if="$hasPermission2('sys_test_add')" > -->
|
|
|
- <div class="nn-item" @click="showTask" title="用户消息">
|
|
|
- <i class="smp-nav-icon smp-ni-news" :class="{shansuo:taskNum}">
|
|
|
+ <div class="nn-item" @click="showNews" title="消息提醒">
|
|
|
+ <i class="smp-nav-icon smp-ni-news" :class="{shansuo:newsNum}">
|
|
|
</i>
|
|
|
- <span v-if="taskNum">{{taskStr}}</span>
|
|
|
+ <span v-if="newsNum">{{newsStr}}</span>
|
|
|
</div>
|
|
|
<div class="nn-item" @click="showNotice" title="通知公告">
|
|
|
<i class="smp-nav-icon smp-ni-notice" :class="{shansuo:noticeNum}">
|
|
@@ -20,19 +20,18 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
isOpen: false,
|
|
|
- taskUrl: 'http://124.225.17.80:8146/odae/clue/supervisionTask/pressTaskList',
|
|
|
- taskNum: 0,
|
|
|
+ newsNum: 0,
|
|
|
noticeNum: 0
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- taskStr () {
|
|
|
- if (this.taskNum > 0) {
|
|
|
- if (this.taskNum > 9) {
|
|
|
+ newsStr () {
|
|
|
+ if (this.newsNum > 0) {
|
|
|
+ if (this.newsNum > 9) {
|
|
|
return '9+'
|
|
|
}
|
|
|
|
|
|
- return this.taskNum
|
|
|
+ return this.newsNum
|
|
|
}
|
|
|
},
|
|
|
noticeStr () {
|
|
@@ -48,32 +47,31 @@ export default {
|
|
|
inject: ['allComponent'],
|
|
|
mounted () {
|
|
|
this.addSelfToAllComponent()
|
|
|
- this.getTask()
|
|
|
- this.getNotice()
|
|
|
+ this.getNews()
|
|
|
+ // this.getNotice()
|
|
|
},
|
|
|
methods: {
|
|
|
addSelfToAllComponent () {
|
|
|
this.allComponent['main-navbar-news'] = this
|
|
|
},
|
|
|
- showNews () {},
|
|
|
- showNotice () {
|
|
|
- // this.$parent.$parent.showNotice()
|
|
|
+ showNews () {
|
|
|
+ // this.$parent.$parent.shownews()
|
|
|
// this.$parent.$refs.navbarmenu.gotoPageByUUID('fe9b5adf20975c1bd13fd38cee3b09a68VfGsVRBgJ3')
|
|
|
this.allComponent['main-navbar-menu'].gotoPageByName('GRZX')
|
|
|
- this.$router.push({ name: 'GRZXXXZX' })
|
|
|
+ this.$router.push({ name: 'GRZXXXZX', params: {tab: 'todo'} })
|
|
|
},
|
|
|
- showTask () {
|
|
|
- // this.$parent.$parent.showTask()
|
|
|
+ showNotice () {
|
|
|
+ // this.$parent.$parent.showNotice()
|
|
|
// this.$parent.$refs.navbarmenu.gotoPageByUUID('fe9b5adf20975c1bd13fd38cee3b09a68VfGsVRBgJ3')
|
|
|
this.allComponent['main-navbar-menu'].gotoPageByName('GRZX')
|
|
|
- this.$router.push({ name: 'GRZXXXZX' })
|
|
|
+ this.$router.push({ name: 'GRZXXXZX', params: {tab: 'remind'} })
|
|
|
},
|
|
|
- getTask () {
|
|
|
+ getNews () {
|
|
|
let config = {
|
|
|
status: 0
|
|
|
}
|
|
|
this.$http.get(
|
|
|
- '/sys/message/list',
|
|
|
+ '/csb/user/messageNewsCount/new',
|
|
|
{
|
|
|
params: config
|
|
|
}
|
|
@@ -82,7 +80,14 @@ export default {
|
|
|
if (res.code !== 0) {
|
|
|
return this.$message.error(res.msg)
|
|
|
}
|
|
|
- this.taskNum = res.messageList.length
|
|
|
+ res.data.forEach((e) => {
|
|
|
+ if (e.type === 'news') {
|
|
|
+ this.newsNum = e.count
|
|
|
+ }
|
|
|
+ if (e.type === 'message') {
|
|
|
+ this.noticeNum = e.count
|
|
|
+ }
|
|
|
+ })
|
|
|
}).catch(() => {
|
|
|
|
|
|
})
|