消息修改

This commit is contained in:
fengachen
2021-09-26 11:12:04 +08:00
parent d49c133db4
commit 9f534e2381
3 changed files with 44 additions and 7 deletions
+3
View File
@@ -0,0 +1,3 @@
import Vue from 'vue'
export const Bus = new Vue()
+21 -3
View File
@@ -43,6 +43,7 @@
// import ShowAnnouncement from './ShowAnnouncement'
import store from '@/store/'
import DynamicNotice from './DynamicNotice'
import {Bus} from '@comp/tools/Bus'
export default {
@@ -85,8 +86,15 @@
this.initWebSocket()
// this.heartCheckFun();
},
created() {
Bus.$on('notice-change', () => {
// console.log('notice-change')
this.loadData()
})
},
destroyed: function () { // 离开页面生命周期函数
this.websocketOnclose()
Bus.$off('notice-change')
},
methods: {
timerFun() {
@@ -136,15 +144,25 @@
putAction(this.url.editCementSend,{anntId:record.id}).then((res)=>{
if(res.success){
this.loadData()
Bus.$emit('header-notice-change')
}
})
this.hovered = false
const param = JSON.parse(record.busId)
if(record.openType==='component'){
this.openPath = record.openPage
this.formData = {id:record.busId}
this.formData = param
this.$refs.showDynamNotice.detail(record.openPage)
}else{
// this.$refs.ShowAnnouncement.detail(record);
}else if(record.openType === 'url') {
console.log(record.openPage,'url')
const param = JSON.parse(record.busId)
// 如果是url 跳转页面
this.$router.push({
path:record.openPage,
query:param
})
}else {
this.$refs.ShowAnnouncement.detail(record)
}
},
toMyAnnouncement(){
+20 -4
View File
@@ -90,6 +90,7 @@ import '@/assets/less/TableExpand.less'
import JDate from '@comp/tools/JDate'
import PageHeaderTitle from '@comp/layouts/PageHeaderTitle'
import IconImg from '@/assets/imgs/icon/icon_message.png'
import {Bus} from '@comp/tools/Bus'
export default {
name: 'UserAnnouncementList',
@@ -159,6 +160,14 @@ export default {
formData: ''
}
},
created() {
Bus.$on('header-notice-change', () => {
this.loadData()
})
},
destroyed: function() { // 离开页面生命周期函数
Bus.$off('header-notice-change')
},
methods: {
handleDetail: function (record) {
this.$refs.sysAnnouncementModal.detail(record)
@@ -169,6 +178,7 @@ export default {
if (res.success) {
this.loadData()
this.syncHeadNotic(record.anntId)
Bus.$emit('notice-change')
}
})
const param = JSON.parse(record.busId)
@@ -178,8 +188,8 @@ export default {
this.formData = param
this.$refs.showDynamNotice.detail()
} else if(record.openType === 'url') {
console.log(JSON.parse(record.busId))
const param = {id: record.busId}
console.log(record.openPage,'url')
const param = JSON.parse(record.busId)
// 如果是url 跳转页面
this.$router.push({
path:record.openPage,
@@ -208,8 +218,14 @@ export default {
}
})
},
haveRead() {
console.log('已读')
haveRead(record) {
putAction(this.url.editCementSend, {anntId: record.anntId}).then((res) => {
if (res.success) {
this.loadData()
this.syncHeadNotic(record.anntId)
Bus.$emit('notice-change')
}
})
},
/*
* 字符串截取