xuhuajiao
9 months ago
13 changed files with 541 additions and 370 deletions
-
3src/router/index.js
-
4src/views/archivesManage/archivesCheck/module/checkDetail.vue
-
19src/views/archivesManage/archivesSearch/index.vue
-
215src/views/archivesManage/lendManage/index.vue
-
6src/views/archivesManage/outInStorage/module/detailDialog.vue
-
27src/views/components/AccessDoor.vue
-
27src/views/components/SecurityDoor.vue
-
27src/views/components/WarehouseWarning.vue
-
53src/views/dashboard/PanelGroup.vue
-
57src/views/home.vue
-
2src/views/login.vue
-
5src/views/system/logManage/index.vue
-
466src/views/system/user/messageCenter/index.vue
@ -1,105 +1,110 @@ |
|||||
<template> |
|
||||
<div class="app-container lend-container"> |
|
||||
<!-- 借阅列表 --> |
|
||||
<!-- 借阅管理tab --> |
|
||||
<div class="tab-content"> |
|
||||
<span class="right-top-line" /> |
|
||||
<span class="left-bottom-line" /> |
|
||||
<span class="right-bottom-line" /> |
|
||||
<ul class="tab-nav"> |
|
||||
<li :class="{ 'active-tab-nav': activeIndex == 0 }" @click="changeActiveTab(0)">待借档案<i /></li> |
|
||||
<li :class="{ 'active-tab-nav': activeIndex == 1 }" @click="changeActiveTab(1)">借出确认<i /></li> |
|
||||
<li :class="{ 'active-tab-nav': activeIndex == 2 }" @click="changeActiveTab(2)">归还确认<i /></li> |
|
||||
<li :class="{ 'active-tab-nav': activeIndex == 3 }" @click="changeActiveTab(3)">借还记录<i /></li> |
|
||||
<li :class="{ 'active-tab-nav': activeIndex == 4 }" @click="changeActiveTab(4)">借阅者管理<i /></li> |
|
||||
<li :class="{ 'active-tab-nav': activeIndex == 5 }" @click="changeActiveTab(5)">借阅流程管理<i /></li> |
|
||||
<!-- 最右侧装饰img --> |
|
||||
<span class="tab-right-img" /> |
|
||||
</ul> |
|
||||
<component :is="comName" :ref="comName" @callBack="callBack" @getSelections="getSelections" /> |
|
||||
</div> |
|
||||
<!-- 借阅档案list --> |
|
||||
<lendArchivesList v-if="activeIndex === 1 && archivesOrderNum" :archives-order-num="archivesOrderNum" /> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import toLend from './toLend/index.vue' |
|
||||
import lendConfirm from './lendConfirm/index.vue' |
|
||||
import returnArchives from './returnArchives/index.vue' |
|
||||
import lendQuery from './lendQuery/index.vue' |
|
||||
import borrowerManage from './borrowerManage/index.vue' |
|
||||
import lendProcess from './lendProcess/index.vue' |
|
||||
import lendArchivesList from './components/lendArchivesList' |
|
||||
import { lendingCrud } from './mixins/lending' |
|
||||
|
|
||||
export default { |
|
||||
name: 'BorrowManage', |
|
||||
components: { |
|
||||
toLend, |
|
||||
lendConfirm, |
|
||||
returnArchives, |
|
||||
lendQuery, |
|
||||
borrowerManage, |
|
||||
lendProcess, |
|
||||
lendArchivesList |
|
||||
}, |
|
||||
mixins: [lendingCrud], |
|
||||
data() { |
|
||||
return { |
|
||||
activeIndex: 0, |
|
||||
archivesOrderNum: '' |
|
||||
} |
|
||||
}, |
|
||||
computed: { |
|
||||
comName: function() { |
|
||||
if (this.activeIndex === 0) { |
|
||||
return 'toLend' |
|
||||
} else if (this.activeIndex === 1) { |
|
||||
return 'lendConfirm' |
|
||||
} else if (this.activeIndex === 2) { |
|
||||
return 'returnArchives' |
|
||||
} else if (this.activeIndex === 3) { |
|
||||
return 'lendQuery' |
|
||||
} else if (this.activeIndex === 4) { |
|
||||
return 'borrowerManage' |
|
||||
} else if (this.activeIndex === 5) { |
|
||||
return 'lendProcess' |
|
||||
} |
|
||||
return 'toLend' |
|
||||
} |
|
||||
}, |
|
||||
methods: { |
|
||||
changeActiveTab(data) { |
|
||||
this.activeIndex = data |
|
||||
if (this.activeIndex === 1) { |
|
||||
this.archivesOrderNum = '' |
|
||||
} |
|
||||
}, |
|
||||
// 重新登记 |
|
||||
callBack(val) { |
|
||||
this.activeIndex = val.index |
|
||||
}, |
|
||||
getSelections(data) { |
|
||||
if (data) { |
|
||||
this.archivesOrderNum = data.orderNo |
|
||||
} else { |
|
||||
this.archivesOrderNum = '' |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style lang="scss" scoped> |
|
||||
.lend-container{ |
|
||||
.tab-content{ |
|
||||
position: relative; |
|
||||
margin-top: 61px; |
|
||||
border: 1px solid #113d72; |
|
||||
} |
|
||||
} |
|
||||
.tab-content .tab-nav{ |
|
||||
margin-bottom: 0; |
|
||||
} |
|
||||
</style> |
|
||||
|
<template> |
||||
|
<div class="app-container lend-container"> |
||||
|
<!-- 借阅列表 --> |
||||
|
<!-- 借阅管理tab --> |
||||
|
<div class="tab-content"> |
||||
|
<span class="right-top-line" /> |
||||
|
<span class="left-bottom-line" /> |
||||
|
<span class="right-bottom-line" /> |
||||
|
<ul class="tab-nav"> |
||||
|
<li :class="{ 'active-tab-nav': activeIndex == 0 }" @click="changeActiveTab(0)">待借档案<i /></li> |
||||
|
<li :class="{ 'active-tab-nav': activeIndex == 1 }" @click="changeActiveTab(1)">借出确认<i /></li> |
||||
|
<li :class="{ 'active-tab-nav': activeIndex == 2 }" @click="changeActiveTab(2)">归还确认<i /></li> |
||||
|
<li :class="{ 'active-tab-nav': activeIndex == 3 }" @click="changeActiveTab(3)">借还记录<i /></li> |
||||
|
<li :class="{ 'active-tab-nav': activeIndex == 4 }" @click="changeActiveTab(4)">借阅者管理<i /></li> |
||||
|
<li :class="{ 'active-tab-nav': activeIndex == 5 }" @click="changeActiveTab(5)">借阅流程管理<i /></li> |
||||
|
<!-- 最右侧装饰img --> |
||||
|
<span class="tab-right-img" /> |
||||
|
</ul> |
||||
|
<component :is="comName" :ref="comName" @callBack="callBack" @getSelections="getSelections" /> |
||||
|
</div> |
||||
|
<!-- 借阅档案list --> |
||||
|
<lendArchivesList v-if="activeIndex === 1 && archivesOrderNum" :archives-order-num="archivesOrderNum" /> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import toLend from './toLend/index.vue' |
||||
|
import lendConfirm from './lendConfirm/index.vue' |
||||
|
import returnArchives from './returnArchives/index.vue' |
||||
|
import lendQuery from './lendQuery/index.vue' |
||||
|
import borrowerManage from './borrowerManage/index.vue' |
||||
|
import lendProcess from './lendProcess/index.vue' |
||||
|
import lendArchivesList from './components/lendArchivesList' |
||||
|
import { lendingCrud } from './mixins/lending' |
||||
|
|
||||
|
export default { |
||||
|
name: 'BorrowManage', |
||||
|
components: { |
||||
|
toLend, |
||||
|
lendConfirm, |
||||
|
returnArchives, |
||||
|
lendQuery, |
||||
|
borrowerManage, |
||||
|
lendProcess, |
||||
|
lendArchivesList |
||||
|
}, |
||||
|
mixins: [lendingCrud], |
||||
|
data() { |
||||
|
return { |
||||
|
activeIndex: 0, |
||||
|
archivesOrderNum: '' |
||||
|
} |
||||
|
}, |
||||
|
computed: { |
||||
|
comName: function() { |
||||
|
if (this.activeIndex === 0) { |
||||
|
return 'toLend' |
||||
|
} else if (this.activeIndex === 1) { |
||||
|
return 'lendConfirm' |
||||
|
} else if (this.activeIndex === 2) { |
||||
|
return 'returnArchives' |
||||
|
} else if (this.activeIndex === 3) { |
||||
|
return 'lendQuery' |
||||
|
} else if (this.activeIndex === 4) { |
||||
|
return 'borrowerManage' |
||||
|
} else if (this.activeIndex === 5) { |
||||
|
return 'lendProcess' |
||||
|
} |
||||
|
return 'toLend' |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
if (this.$route.params.locationIndex) { |
||||
|
this.activeIndex = this.$route.params.locationIndex |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
changeActiveTab(data) { |
||||
|
this.activeIndex = data |
||||
|
if (this.activeIndex === 1) { |
||||
|
this.archivesOrderNum = '' |
||||
|
} |
||||
|
}, |
||||
|
// 重新登记 |
||||
|
callBack(val) { |
||||
|
this.activeIndex = val.index |
||||
|
}, |
||||
|
getSelections(data) { |
||||
|
if (data) { |
||||
|
this.archivesOrderNum = data.orderNo |
||||
|
} else { |
||||
|
this.archivesOrderNum = '' |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.lend-container{ |
||||
|
.tab-content{ |
||||
|
position: relative; |
||||
|
margin-top: 61px; |
||||
|
border: 1px solid #113d72; |
||||
|
} |
||||
|
} |
||||
|
.tab-content .tab-nav{ |
||||
|
margin-bottom: 0; |
||||
|
} |
||||
|
</style> |
@ -1,233 +1,233 @@ |
|||||
<template> |
|
||||
<div> |
|
||||
<div class="head-container"> |
|
||||
<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" size="mini" @click="handleAllRead">全部标记已读</el-button> |
|
||||
<date-range-picker v-model="query.createTime" class="date-item" /> |
|
||||
<el-button icon="el-icon-search" size="mini" style="background:#3A99FD;margin-left: -10px;" @click="getTableData">搜索</el-button> |
|
||||
</div> |
|
||||
<el-table |
|
||||
ref="table" |
|
||||
v-loading="isLoading" |
|
||||
:data="tableData" |
|
||||
style="width: 100%;" |
|
||||
:row-class-name="cell" |
|
||||
height="calc(100vh - 362px)" |
|
||||
@row-click="clickRowHandler" |
|
||||
@selection-change="selectionChangeHandler" |
|
||||
> |
|
||||
<el-table-column type="selection" width="55" align="center" /> |
|
||||
<el-table-column type="index" label="序号" width="100" align="center" /> |
|
||||
<el-table-column prop="noticeContent" :show-overflow-tooltip="true" label="通知内容" min-width="300" align="center" /> |
|
||||
<el-table-column prop="noticeType" label="消息类型" align="center" min-width="150"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span v-if="scope.row.noticeType===1">系统消息</span> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="pushUserName" label="推送人" align="center" min-width="150" /> |
|
||||
<el-table-column prop="create_time" label="推送时间" align="center" min-width="180"> |
|
||||
<template slot-scope="scope"> |
|
||||
<div>{{ scope.row.create_time | parseTime }}</div> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<el-pagination |
|
||||
:page-size.sync="page.size" |
|
||||
:total="page.total" |
|
||||
:current-page.sync="page.page" |
|
||||
style="margin-top: 8px;" |
|
||||
layout="total, prev, pager, next, sizes" |
|
||||
@size-change="sizeChangeHandler($event)" |
|
||||
@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> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import DateRangePicker from '@/components/DateRangePicker' |
|
||||
import { getUserNotice, isread, userMsgDel } from '@/api/system/logs' |
|
||||
import CRUD, { presenter, header, crud } from '@crud/crud' |
|
||||
|
|
||||
export default { |
|
||||
name: 'MessageCenter', |
|
||||
inject: ['reload'], |
|
||||
components: { DateRangePicker }, |
|
||||
mixins: [presenter(), crud(), header()], |
|
||||
cruds() { |
|
||||
return CRUD({ |
|
||||
url: 'api/users/notice', |
|
||||
sort: ['createTime,desc'], |
|
||||
optShow: {} |
|
||||
}) |
|
||||
}, |
|
||||
data() { |
|
||||
return { |
|
||||
tableData: [], |
|
||||
selections: [], |
|
||||
query: { |
|
||||
createTime: [] |
|
||||
}, |
|
||||
page: { |
|
||||
total: 0, |
|
||||
size: 10, |
|
||||
page: 1 |
|
||||
}, |
|
||||
isLoading: false, |
|
||||
delVisible: false |
|
||||
} |
|
||||
}, |
|
||||
created() { |
|
||||
this.getTableData() |
|
||||
}, |
|
||||
methods: { |
|
||||
getTableData() { |
|
||||
this.isLoading = true |
|
||||
getUserNotice(this.getParams()).then(res => { |
|
||||
this.page.total = res.totalElements |
|
||||
const table = res.content |
|
||||
table.forEach(item => { |
|
||||
item.pushUserName = item.noticeUsers[0].pushUserName |
|
||||
item.isRead = item.noticeUsers[0].isRead |
|
||||
}) |
|
||||
this.tableData = table |
|
||||
this.isLoading = false |
|
||||
}) |
|
||||
}, |
|
||||
getParams() { |
|
||||
const params = { |
|
||||
page: this.page.page - 1, |
|
||||
size: this.page.size, |
|
||||
createTime: this.query.createTime, |
|
||||
sort: 'createTime,desc' |
|
||||
} |
|
||||
return params |
|
||||
}, |
|
||||
getUserMsgId(list) { |
|
||||
const ids = [] |
|
||||
list.forEach(item => { |
|
||||
item.noticeUsers.forEach(i => { |
|
||||
ids.push(i.id) |
|
||||
}) |
|
||||
}) |
|
||||
return ids |
|
||||
}, |
|
||||
// 标记已读 |
|
||||
handleRead() { |
|
||||
isread(this.getUserMsgId(this.selections)).then(res => { |
|
||||
if (res) { |
|
||||
// this.getTableData() |
|
||||
this.reload() |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
// 全部标记已读 |
|
||||
async handleAllRead() { |
|
||||
const params = { |
|
||||
page: 0, |
|
||||
size: 10, |
|
||||
// createTime: [], |
|
||||
sort: 'createTime,desc' |
|
||||
} |
|
||||
const list = [] |
|
||||
const allList = await this.getAllNoRead(params, list) |
|
||||
isread(this.getUserMsgId(allList)).then(res => { |
|
||||
if (res) { |
|
||||
this.reload() |
|
||||
// this.getTableData() |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
// 递归获取所有列表 |
|
||||
async getAllNoRead(params, list) { |
|
||||
const allList = await getUserNotice(params).then(res => { |
|
||||
list = list.concat(res.content) |
|
||||
if ((list.length) < res.totalElements) { |
|
||||
params.page++ |
|
||||
return this.getAllNoRead(params, list) |
|
||||
} else { |
|
||||
return list |
|
||||
} |
|
||||
}) |
|
||||
return allList |
|
||||
}, |
|
||||
// 删除 |
|
||||
handleDelConfirm() { |
|
||||
userMsgDel(this.getUserMsgId(this.selections)).then(res => { |
|
||||
if (res) { |
|
||||
// this.getTableData() |
|
||||
this.delVisible = false |
|
||||
this.reload() |
|
||||
this.$message({ |
|
||||
message: '删除成功', |
|
||||
type: 'success' |
|
||||
}) |
|
||||
} else { |
|
||||
this.$message.error('删除失败') |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
clickRowHandler(row) { |
|
||||
// this.$refs.table.clearSelection() |
|
||||
this.$refs.table.toggleRowSelection(row) // 单选选中 |
|
||||
}, |
|
||||
selectionChangeHandler(val) { |
|
||||
this.selections = val |
|
||||
}, |
|
||||
cell({ row }) { |
|
||||
if (row.isRead) { // 已读 |
|
||||
return 'read-color' |
|
||||
} |
|
||||
}, |
|
||||
// 每页条数改变 |
|
||||
sizeChangeHandler(e) { |
|
||||
this.loading = true |
|
||||
this.page.size = e |
|
||||
this.page.page = 1 |
|
||||
this.getTableData() |
|
||||
this.loading = false |
|
||||
}, |
|
||||
// 当前页改变 |
|
||||
pageChangeHandler(e) { |
|
||||
this.loading = true |
|
||||
this.page.page = e |
|
||||
this.getTableData() |
|
||||
this.loading = false |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style lang="scss" scoped> |
|
||||
@import '~@/assets/styles/lend-manage.scss'; |
|
||||
.head-container { |
|
||||
padding-top: 0; |
|
||||
.date-item{ |
|
||||
margin: -1px 20px 0 12px; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.container-wrap{ |
|
||||
margin-top: 0; |
|
||||
min-height: 0; |
|
||||
height: calc(100vh - 240px); |
|
||||
} |
|
||||
::v-deep .read-color td{ |
|
||||
color: #999 !important; |
|
||||
} |
|
||||
.delMsg{ |
|
||||
color: #fff; |
|
||||
font-size: 16px; |
|
||||
} |
|
||||
</style> |
|
||||
|
<template> |
||||
|
<div> |
||||
|
<div class="head-container"> |
||||
|
<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" size="mini" @click="handleAllRead">全部标记已读</el-button> |
||||
|
<date-range-picker v-model="query.createTime" class="date-item" /> |
||||
|
<el-button icon="el-icon-search" size="mini" style="background:#3A99FD;margin-left: -10px;" @click="getTableData">搜索</el-button> |
||||
|
</div> |
||||
|
<el-table |
||||
|
ref="table" |
||||
|
v-loading="isLoading" |
||||
|
:data="tableData" |
||||
|
style="width: 100%;" |
||||
|
:row-class-name="cell" |
||||
|
height="calc(100vh - 362px)" |
||||
|
@row-click="clickRowHandler" |
||||
|
@selection-change="selectionChangeHandler" |
||||
|
> |
||||
|
<el-table-column type="selection" width="55" align="center" /> |
||||
|
<el-table-column type="index" label="序号" width="100" align="center" /> |
||||
|
<el-table-column prop="noticeContent" :show-overflow-tooltip="true" label="通知内容" min-width="300" align="center" /> |
||||
|
<el-table-column prop="noticeType" label="消息类型" align="center" min-width="150"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="scope.row.noticeType===1">系统消息</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="pushUserName" label="推送人" align="center" min-width="150" /> |
||||
|
<el-table-column prop="create_time" label="推送时间" align="center" min-width="180"> |
||||
|
<template slot-scope="scope"> |
||||
|
<div>{{ scope.row.create_time | parseTime }}</div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<el-pagination |
||||
|
:page-size.sync="page.size" |
||||
|
:total="page.total" |
||||
|
:current-page.sync="page.page" |
||||
|
style="margin-top: 8px;" |
||||
|
layout="total, prev, pager, next, sizes" |
||||
|
@size-change="sizeChangeHandler($event)" |
||||
|
@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> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import DateRangePicker from '@/components/DateRangePicker' |
||||
|
import { getUserNotice, isread, userMsgDel } from '@/api/system/logs' |
||||
|
import CRUD, { presenter, header, crud } from '@crud/crud' |
||||
|
|
||||
|
export default { |
||||
|
name: 'MessageCenter', |
||||
|
inject: ['reload'], |
||||
|
components: { DateRangePicker }, |
||||
|
mixins: [presenter(), crud(), header()], |
||||
|
cruds() { |
||||
|
return CRUD({ |
||||
|
url: 'api/users/notice', |
||||
|
sort: ['createTime,desc'], |
||||
|
optShow: {} |
||||
|
}) |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
tableData: [], |
||||
|
selections: [], |
||||
|
query: { |
||||
|
createTime: [] |
||||
|
}, |
||||
|
page: { |
||||
|
total: 0, |
||||
|
size: 10, |
||||
|
page: 1 |
||||
|
}, |
||||
|
isLoading: false, |
||||
|
delVisible: false |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.getTableData() |
||||
|
}, |
||||
|
methods: { |
||||
|
getTableData() { |
||||
|
this.isLoading = true |
||||
|
getUserNotice(this.getParams()).then(res => { |
||||
|
this.page.total = res.totalElements |
||||
|
const table = res.content |
||||
|
table.forEach(item => { |
||||
|
item.pushUserName = item.noticeUsers[0].pushUserName |
||||
|
item.isRead = item.noticeUsers[0].isRead |
||||
|
}) |
||||
|
this.tableData = table |
||||
|
this.isLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
getParams() { |
||||
|
const params = { |
||||
|
page: this.page.page - 1, |
||||
|
size: this.page.size, |
||||
|
createTime: this.query.createTime, |
||||
|
sort: 'createTime,desc' |
||||
|
} |
||||
|
return params |
||||
|
}, |
||||
|
getUserMsgId(list) { |
||||
|
const ids = [] |
||||
|
list.forEach(item => { |
||||
|
item.noticeUsers.forEach(i => { |
||||
|
ids.push(i.id) |
||||
|
}) |
||||
|
}) |
||||
|
return ids |
||||
|
}, |
||||
|
// 标记已读 |
||||
|
handleRead() { |
||||
|
isread(this.getUserMsgId(this.selections)).then(res => { |
||||
|
if (res) { |
||||
|
// this.getTableData() |
||||
|
this.reload() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 全部标记已读 |
||||
|
async handleAllRead() { |
||||
|
const params = { |
||||
|
page: 0, |
||||
|
size: 10, |
||||
|
// createTime: [], |
||||
|
sort: 'createTime,desc' |
||||
|
} |
||||
|
const list = [] |
||||
|
const allList = await this.getAllNoRead(params, list) |
||||
|
isread(this.getUserMsgId(allList)).then(res => { |
||||
|
if (res) { |
||||
|
this.reload() |
||||
|
// this.getTableData() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 递归获取所有列表 |
||||
|
async getAllNoRead(params, list) { |
||||
|
const allList = await getUserNotice(params).then(res => { |
||||
|
list = list.concat(res.content) |
||||
|
if ((list.length) < res.totalElements) { |
||||
|
params.page++ |
||||
|
return this.getAllNoRead(params, list) |
||||
|
} else { |
||||
|
return list |
||||
|
} |
||||
|
}) |
||||
|
return allList |
||||
|
}, |
||||
|
// 删除 |
||||
|
handleDelConfirm() { |
||||
|
userMsgDel(this.getUserMsgId(this.selections)).then(res => { |
||||
|
if (res) { |
||||
|
// this.getTableData() |
||||
|
this.delVisible = false |
||||
|
this.reload() |
||||
|
this.$message({ |
||||
|
message: '删除成功', |
||||
|
type: 'success' |
||||
|
}) |
||||
|
} else { |
||||
|
this.$message.error('删除失败') |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
clickRowHandler(row) { |
||||
|
// this.$refs.table.clearSelection() |
||||
|
this.$refs.table.toggleRowSelection(row) // 单选选中 |
||||
|
}, |
||||
|
selectionChangeHandler(val) { |
||||
|
this.selections = val |
||||
|
}, |
||||
|
cell({ row }) { |
||||
|
if (row.isRead) { // 已读 |
||||
|
return 'read-color' |
||||
|
} |
||||
|
}, |
||||
|
// 每页条数改变 |
||||
|
sizeChangeHandler(e) { |
||||
|
this.loading = true |
||||
|
this.page.size = e |
||||
|
this.page.page = 1 |
||||
|
this.getTableData() |
||||
|
this.loading = false |
||||
|
}, |
||||
|
// 当前页改变 |
||||
|
pageChangeHandler(e) { |
||||
|
this.loading = true |
||||
|
this.page.page = e |
||||
|
this.getTableData() |
||||
|
this.loading = false |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
@import '~@/assets/styles/lend-manage.scss'; |
||||
|
.head-container { |
||||
|
padding-top: 0; |
||||
|
.date-item{ |
||||
|
margin: -1px 20px 0 12px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.container-wrap{ |
||||
|
margin-top: 0; |
||||
|
min-height: 0; |
||||
|
height: calc(100vh - 240px); |
||||
|
} |
||||
|
::v-deep .read-color td{ |
||||
|
color: #999 !important; |
||||
|
} |
||||
|
.delMsg{ |
||||
|
color: #fff; |
||||
|
font-size: 16px; |
||||
|
} |
||||
|
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue