|
@ -1,7 +1,7 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div> |
|
|
<div> |
|
|
<div class="head-container"> |
|
|
<div class="head-container"> |
|
|
<el-button icon="el-icon-delete" :disabled="!(selections.length)" size="mini" @click="handleDel">删除</el-button> |
|
|
|
|
|
|
|
|
<el-button icon="el-icon-delete" :disabled="!(selections.length)" size="mini" @click="delVisible=true">删除</el-button> |
|
|
<el-button class="iconfont icon-biaojiyidu-fanbai" :disabled="!(selections.length)" size="mini" @click="handleRead">标记已读</el-button> |
|
|
<el-button class="iconfont icon-biaojiyidu-fanbai" :disabled="!(selections.length)" size="mini" @click="handleRead">标记已读</el-button> |
|
|
<el-button class="iconfont icon-biaojiyidu-fanbai" size="mini" @click="handleAllRead">全部标记已读</el-button> |
|
|
<el-button class="iconfont icon-biaojiyidu-fanbai" size="mini" @click="handleAllRead">全部标记已读</el-button> |
|
|
<date-range-picker v-model="query.createTime" class="date-item" /> |
|
|
<date-range-picker v-model="query.createTime" class="date-item" /> |
|
@ -41,6 +41,17 @@ |
|
|
@size-change="sizeChangeHandler($event)" |
|
|
@size-change="sizeChangeHandler($event)" |
|
|
@current-change="pageChangeHandler" |
|
|
@current-change="pageChangeHandler" |
|
|
/> |
|
|
/> |
|
|
|
|
|
<!-- 删除 --> |
|
|
|
|
|
<el-dialog :visible.sync="delVisible" title="提示"> |
|
|
|
|
|
<span class="dialog-right-top" /> |
|
|
|
|
|
<span class="dialog-left-bottom" /> |
|
|
|
|
|
<div class="setting-dialog"> |
|
|
|
|
|
<p class="delMsg">确定删除所选消息吗?</p> |
|
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
|
|
<el-button type="primary" @click="handleDelConfirm">确定</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-dialog> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
@ -51,6 +62,7 @@ import CRUD, { presenter, header, crud } from '@crud/crud' |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: 'MessageCenter', |
|
|
name: 'MessageCenter', |
|
|
|
|
|
inject: ['reload'], |
|
|
components: { DateRangePicker }, |
|
|
components: { DateRangePicker }, |
|
|
mixins: [presenter(), crud(), header()], |
|
|
mixins: [presenter(), crud(), header()], |
|
|
cruds() { |
|
|
cruds() { |
|
@ -72,7 +84,8 @@ export default { |
|
|
size: 10, |
|
|
size: 10, |
|
|
page: 1 |
|
|
page: 1 |
|
|
}, |
|
|
}, |
|
|
isLoading: false |
|
|
|
|
|
|
|
|
isLoading: false, |
|
|
|
|
|
delVisible: false |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
@ -82,7 +95,6 @@ export default { |
|
|
getTableData() { |
|
|
getTableData() { |
|
|
this.isLoading = true |
|
|
this.isLoading = true |
|
|
getUserNotice(this.getParams()).then(res => { |
|
|
getUserNotice(this.getParams()).then(res => { |
|
|
console.log(res, 'list') |
|
|
|
|
|
this.page.total = res.totalElements |
|
|
this.page.total = res.totalElements |
|
|
const table = res.content |
|
|
const table = res.content |
|
|
table.forEach(item => { |
|
|
table.forEach(item => { |
|
@ -115,7 +127,8 @@ export default { |
|
|
handleRead() { |
|
|
handleRead() { |
|
|
isread(this.getUserMsgId(this.selections)).then(res => { |
|
|
isread(this.getUserMsgId(this.selections)).then(res => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
this.getTableData() |
|
|
|
|
|
|
|
|
// this.getTableData() |
|
|
|
|
|
this.reload() |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
@ -131,7 +144,8 @@ export default { |
|
|
const allList = await this.getAllNoRead(params, list) |
|
|
const allList = await this.getAllNoRead(params, list) |
|
|
isread(this.getUserMsgId(allList)).then(res => { |
|
|
isread(this.getUserMsgId(allList)).then(res => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
this.getTableData() |
|
|
|
|
|
|
|
|
this.reload() |
|
|
|
|
|
// this.getTableData() |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
@ -149,11 +163,12 @@ export default { |
|
|
return allList |
|
|
return allList |
|
|
}, |
|
|
}, |
|
|
// 删除 |
|
|
// 删除 |
|
|
handleDel() { |
|
|
|
|
|
|
|
|
handleDelConfirm() { |
|
|
userMsgDel(this.getUserMsgId(this.selections)).then(res => { |
|
|
userMsgDel(this.getUserMsgId(this.selections)).then(res => { |
|
|
console.log(res, '删除') |
|
|
|
|
|
if (res) { |
|
|
if (res) { |
|
|
this.getTableData() |
|
|
|
|
|
|
|
|
// this.getTableData() |
|
|
|
|
|
this.delVisible = false |
|
|
|
|
|
this.reload() |
|
|
this.$message({ |
|
|
this.$message({ |
|
|
message: '删除成功', |
|
|
message: '删除成功', |
|
|
type: 'success' |
|
|
type: 'success' |
|
@ -211,4 +226,8 @@ export default { |
|
|
::v-deep .read-color td{ |
|
|
::v-deep .read-color td{ |
|
|
color: #999 !important; |
|
|
color: #999 !important; |
|
|
} |
|
|
} |
|
|
|
|
|
.delMsg{ |
|
|
|
|
|
color: #fff; |
|
|
|
|
|
font-size: 16px; |
|
|
|
|
|
} |
|
|
</style> |
|
|
</style> |