|
|
@ -26,7 +26,7 @@ |
|
|
|
<div class="message-date">{{ item.createTime | parseTime }}</div> |
|
|
|
<div class="message-cont"> |
|
|
|
<div class="message-cont-info"> |
|
|
|
<span :class="['message-type-title',{'type-title1': listIndex === 1 },{'type-title2': listIndex === 2 },{'type-title3': listIndex === 3 },{'type-title4': listIndex === 4 }]">{{ titleType }}</span> |
|
|
|
<span :class="setIconClass(item)">{{ setNoticeTitle(item) }}</span> |
|
|
|
<span :class="[ item.isRead === 0 ? 'unread-tip' : 'unread-tip read-tip']">{{ item.isRead === 0 ? '未读' : '已读' }}</span> |
|
|
|
<div class="message-title">{{ item.noticeTitle }}</div> |
|
|
|
<ul class="message-list-info"> |
|
|
@ -46,7 +46,7 @@ |
|
|
|
<el-dialog :visible.sync="messageVisible" :modal-append-to-body="false" :close-on-click-modal="false" append-to-body title="消息详情" @closed="closeDialog"> |
|
|
|
<div class="setting-dialog"> |
|
|
|
<div class="message-detail"> |
|
|
|
<span :class="['message-type-title',{'type-title1': listIndex === 1 },{'type-title2': listIndex === 2 },{'type-title3': listIndex === 3 },{'type-title4': listIndex === 4 }]">{{ titleType }}</span> |
|
|
|
<span :class="setIconClass(detailInfo)">{{ setNoticeTitle(detailInfo) }}</span> |
|
|
|
<span class="detail-date">【{{ detailInfo && detailInfo.createBy }}】 {{ detailInfo && detailInfo.createTime | parseTime }}</span> |
|
|
|
<div class="message-title">{{ detailInfo && detailInfo.noticeTitle }}</div> |
|
|
|
<el-input v-model="detailInfo.noticeContext" placeholder="请输入" type="textarea" :rows="10" /> |
|
|
@ -76,6 +76,7 @@ import store from '@/store' |
|
|
|
export default { |
|
|
|
name: 'MessageCenter', |
|
|
|
components: { DateRangePicker, eForm, detial }, |
|
|
|
inject: ['reload'], |
|
|
|
data() { |
|
|
|
return { |
|
|
|
blurryTime: [], |
|
|
@ -101,22 +102,21 @@ export default { |
|
|
|
messageVisible: false, |
|
|
|
detailInfo: {}, |
|
|
|
currentMessage: null, |
|
|
|
hasMore: true, // 是否还有更多数据 |
|
|
|
hasNextPage: false |
|
|
|
hasNextPage: false, |
|
|
|
loadingMoreData: false |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
'$route'(val, from) { // 监听到路由(参数)改变 |
|
|
|
if (this.$route.query) { |
|
|
|
this.listIndex = this.$route.query.noticeType ? this.$route.query.noticeType : 1 |
|
|
|
this.getIndex() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
if (this.$route.query) { |
|
|
|
console.log(' this.$route.query.noticeType', this.$route.query.noticeType) |
|
|
|
this.listIndex = this.$route.query.noticeType ? this.$route.query.noticeType : 1 |
|
|
|
this.getIndex() |
|
|
|
} |
|
|
|
this.getListMessage() |
|
|
|
}, |
|
|
@ -127,7 +127,6 @@ export default { |
|
|
|
this.search = null |
|
|
|
this.unread = null |
|
|
|
this.handleSearch() |
|
|
|
this.getIndex() |
|
|
|
}, |
|
|
|
handleSearch() { |
|
|
|
this.page.page = 0 |
|
|
@ -159,27 +158,20 @@ export default { |
|
|
|
this.items = this.items.concat(listData) |
|
|
|
setTimeout(() => { |
|
|
|
this.loading = false |
|
|
|
this.loadingMoreData = false |
|
|
|
}, 1000) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// loadData() { |
|
|
|
// this.loading = true |
|
|
|
// setTimeout(() => { |
|
|
|
// this.getListMessage() |
|
|
|
// this.page.page++ |
|
|
|
// }, 1000) |
|
|
|
// }, |
|
|
|
// loadMore() { |
|
|
|
// if (this.loading) { |
|
|
|
// return |
|
|
|
// } |
|
|
|
// this.loadData() |
|
|
|
// }, |
|
|
|
// 监听滚动 |
|
|
|
listenScroll(e) { |
|
|
|
const ele = e.srcElement ? e.srcElement : e.target |
|
|
|
if (ele.scrollTop + ele.offsetHeight > ele.scrollHeight - 100) { // 监听滚动到div底部 |
|
|
|
this.addMoreData() |
|
|
|
setTimeout(() => { |
|
|
|
if (!this.loadingMoreData) { |
|
|
|
this.loadingMoreData = true |
|
|
|
this.addMoreData() |
|
|
|
} |
|
|
|
}, 1000) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 加载更多 |
|
|
@ -195,8 +187,6 @@ export default { |
|
|
|
}, |
|
|
|
handleDetail(item) { |
|
|
|
this.currentMessage = this.items.find(i => i.noticeId === item.noticeId) |
|
|
|
// this.detailInfo = item |
|
|
|
// this.messageVisible = true |
|
|
|
const params = { |
|
|
|
'newsType': item.noticeType, |
|
|
|
'noticeId': item.noticeId |
|
|
@ -210,7 +200,6 @@ export default { |
|
|
|
}, |
|
|
|
dealWithCont(row) { |
|
|
|
this.$refs.eForm.isMessage = true |
|
|
|
this.$refs.eForm.formVisible = true |
|
|
|
this.$refs.eForm.selectCenterRow = row |
|
|
|
this.$refs.eForm.activeIndex = 0 |
|
|
|
this.$refs.eForm.form.opinion = null |
|
|
@ -229,39 +218,43 @@ export default { |
|
|
|
closeDialog() { |
|
|
|
this.messageVisible = false |
|
|
|
this.currentMessage.isRead = 1 |
|
|
|
// this.handleSearch() |
|
|
|
store.dispatch('initMySystemNotice').then(() => {}) |
|
|
|
}, |
|
|
|
getIndex() { |
|
|
|
switch (this.listIndex) { |
|
|
|
case 1: |
|
|
|
this.titleType = '系统通知' |
|
|
|
break |
|
|
|
case 2: |
|
|
|
this.titleType = '有流程达到' |
|
|
|
break |
|
|
|
setIconClass(item) { |
|
|
|
if (item.noticeType === 1) { |
|
|
|
return 'message-type-title type-title1' |
|
|
|
} else if (item.noticeType === 2) { |
|
|
|
return 'message-type-title type-title2' |
|
|
|
} else if (item.noticeType === 3) { |
|
|
|
return 'message-type-title type-title3' |
|
|
|
} else if (item.noticeType === 4) { |
|
|
|
if (item.noticeContext.includes('到期')) { |
|
|
|
return 'message-type-title type-title5' |
|
|
|
} else if (item.noticeContext.includes('逾期')) { |
|
|
|
return 'message-type-title type-title4' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
setNoticeTitle(item) { |
|
|
|
switch (item.noticeType) { |
|
|
|
case 1 : |
|
|
|
return '系统通知' |
|
|
|
case 2 : |
|
|
|
return '有流程达到' |
|
|
|
case 3: |
|
|
|
this.titleType = '流程完成提醒' |
|
|
|
break |
|
|
|
return '流程完成提醒' |
|
|
|
case 4: |
|
|
|
this.titleType = '赋权到期提醒' |
|
|
|
break |
|
|
|
if (item.noticeContext.includes('到期')) { |
|
|
|
return '赋权到期提醒' |
|
|
|
} else if (item.noticeContext.includes('逾期')) { |
|
|
|
return '赋权逾期提醒' |
|
|
|
} |
|
|
|
return '赋权提醒' |
|
|
|
} |
|
|
|
}, |
|
|
|
// 全部标记已读 |
|
|
|
async handleAllRead() { |
|
|
|
// const arr = this.items.filter(item => { return !item.isRead }) |
|
|
|
// console.log('arr', arr) |
|
|
|
// arr.forEach(item => { |
|
|
|
// item.isRead = 1 |
|
|
|
// }) |
|
|
|
// this.handleSearch() |
|
|
|
// const params = { |
|
|
|
// page: 0, |
|
|
|
// size: 10, |
|
|
|
// sort: 'createTime,desc' |
|
|
|
// } |
|
|
|
// const list = [] |
|
|
|
// const allList = await this.getAllNoRead(params, list) |
|
|
|
const params = { |
|
|
|
'newsType': this.listIndex |
|
|
|
} |
|
|
|