|
@@ -14,8 +14,8 @@
|
|
|
|
|
|
<vxe-toolbar :refresh="{query: refreshList}" custom>
|
|
|
<template #buttons>
|
|
|
- <el-button type="primary" size="small">全部标记已读</el-button>
|
|
|
- <el-button type="primary" size="small">标记为已读</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="readAll()">全部标记已读</el-button>
|
|
|
+ <el-button :disabled="$refs.notifyTable && $refs.notifyTable.getCheckboxRecords().length === 0" type="warning" size="small" @click="portionRead()">标记为已读</el-button>
|
|
|
</template>
|
|
|
</vxe-toolbar>
|
|
|
|
|
@@ -164,6 +164,49 @@
|
|
|
resetSearch () {
|
|
|
this.$refs.searchForm.resetFields()
|
|
|
this.refreshList()
|
|
|
+ },
|
|
|
+
|
|
|
+ // 全部已读
|
|
|
+ readAll () {
|
|
|
+ this.$confirm(`确定将全部通告标记为已读吗?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.loading = true
|
|
|
+ this.notifyService.readAll().then(({data}) => {
|
|
|
+ this.loading = false
|
|
|
+ this.$message({
|
|
|
+ message: data,
|
|
|
+ type: 'success',
|
|
|
+ duration: 1500
|
|
|
+ })
|
|
|
+ this.refreshList()
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 部分已读
|
|
|
+ portionRead (id) {
|
|
|
+ let ids = id || this.$refs.notifyTable.getCheckboxRecords().map(item => {
|
|
|
+ return item.id
|
|
|
+ }).join(',')
|
|
|
+ this.$confirm(`确定将选定通告标记为已读吗?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.loading = true
|
|
|
+ this.notifyService.portionRead(ids).then(({data}) => {
|
|
|
+ this.loading = false
|
|
|
+ this.$message({
|
|
|
+ message: data,
|
|
|
+ type: 'success',
|
|
|
+ duration: 1500
|
|
|
+ })
|
|
|
+ this.refreshList()
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|