首页消息修改

This commit is contained in:
fengachen
2021-10-09 19:28:58 +08:00
parent 6928254cda
commit 6cdd2b66d9
+75 -9
View File
@@ -31,37 +31,52 @@
</div>
<!-- <span v-html="item.msgContent"></span>-->
<span>{{item.sendTime}}</span>
<span class="operate">操作</span>
<span class="operate">
<a @click="showAnnouncement(item)" style="margin-right: 8px">查看</a>
<a @click="haveRead(item)" v-if="item.readFlag === '0' ">已读</a>
<a class="readed" v-if="item.readFlag === '1' ">已读</a>
</span>
</div>
</div>
</div>
</div>
</div>
<show-announcement ref="ShowAnnouncement"></show-announcement>
<dynamic-notice ref="showDynamNotice" :path="openPath" :formData="formData"/>
</div>
</template>
<script>
import IndexRouter from '@views/dashboard/indexRouter'
import {getAction} from '@api/manage'
import {getAction, putAction} from '@api/manage'
import {Bus} from '@comp/tools/Bus'
import ShowAnnouncement from '@/components/tools/ShowAnnouncement'
import DynamicNotice from '../../components/tools/DynamicNotice'
export default {
name: 'Analysis',
components: {},
components: {
DynamicNotice,
ShowAnnouncement,
},
data() {
return {
IndexRouter,
url:{
list:'/sys/sysAnnouncementSend/getCompanyMyAnnouncementSend'
list:'/sys/sysAnnouncementSend/getCompanyMyAnnouncementSend',
editCementSend: 'sys/sysAnnouncementSend/editCompanyByAnntIdAndUserId',
},
// 消息数据
dataMessageList:[]
dataMessageList:[],
openPath: '',
formData: ''
}
},
created() {
getAction(this.url.list,{readFlag:'0'}).then(res => {
if(res.success){
this.dataMessageList = [...res.result.records]
}
this.loadData()
Bus.$on('header-notice-change', () => {
this.loadData()
})
},
methods: {
@@ -73,6 +88,15 @@ export default {
path:record.path
})
},
// loadData
loadData(){
getAction(this.url.list,{readFlag:'0'}).then(res => {
this.dataMessageList = []
if(res.success){
this.dataMessageList = [...res.result.records]
}
})
},
/*
* 跳转我的消息
* */
@@ -93,6 +117,48 @@ export default {
}
return value
},
showAnnouncement(record) {
putAction(this.url.editCementSend, {anntId: record.anntId}).then((res) => {
if (res.success) {
this.loadData()
this.syncHeadNotic(record.anntId)
Bus.$emit('notice-change')
}
})
const param = JSON.parse(record.busId)
if (record.openType === 'component') {
this.openPath = record.openPage
// 将参数传入
this.formData = param
this.$refs.showDynamNotice.detail()
} 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 if(record.openType === 'href'){
let url = `${record.openPage}=${param.id}`
// 返回的是报名页面的链接 打开网址
window.open(url,'_blank')
} else {
this.$refs.ShowAnnouncement.detail(record)
}
},
haveRead(record) {
putAction(this.url.editCementSend, {anntId: record.anntId}).then((res) => {
if (res.success) {
this.loadData()
this.syncHeadNotic(record.anntId)
Bus.$emit('notice-change')
}
})
},
syncHeadNotic(anntId) {
getAction('sys/annountCement/syncNotic', {anntId: anntId})
}
}
}
</script>