first commit
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<header class="header navbar bg-white shadow">
|
||||
<div class="btn-group tool-button m5">
|
||||
<a class="el-button el-button--default el-button--medium" href="${base}/platform/sys/msg/user/all" data-pjax>
|
||||
<i class="ti-angle-left"></i>
|
||||
返回
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="content-wrap">
|
||||
<div class="wrapper" style="min-height: 500px">
|
||||
<section class="panel">
|
||||
<div class="row mb10">
|
||||
<div class="col-lg-12">
|
||||
<!--#if(!isEmpty(obj)){#-->
|
||||
<div style="text-align: center">
|
||||
<h4>${obj.title!}</h4>
|
||||
</div>
|
||||
<div style="text-align: center; font-size: 14px; line-height: 24px">${@date.getDate(obj.sendAt)}</div>
|
||||
<div style="margin-top: 16px !important; border-bottom: 1px solid #ddd"></div>
|
||||
<div style="margin-top: 16px !important">${obj.note!}</div>
|
||||
<!--#}else{#-->
|
||||
消息不存在,或您没有阅读权限!
|
||||
<!--#}#-->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,35 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<header class="header navbar bg-white shadow">
|
||||
<div class="btn-group tool-button m5">
|
||||
<a class="el-button el-button--default el-button--medium" href="${base}/platform/sys/msg/user/read" data-pjax>
|
||||
<i class="ti-angle-left"></i>
|
||||
返回
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="content-wrap">
|
||||
<div class="wrapper" style="min-height: 500px">
|
||||
<section class="panel">
|
||||
<div class="row mb10">
|
||||
<div class="col-lg-12">
|
||||
<!--#if(!isEmpty(obj)){#-->
|
||||
<div style="text-align: center">
|
||||
<h4>${obj.title!}</h4>
|
||||
</div>
|
||||
<div style="text-align: center; font-size: 14px; line-height: 24px">${@date.getDate(obj.sendAt)}</div>
|
||||
<div style="margin-top: 16px !important; border-bottom: 1px solid #ddd"></div>
|
||||
<div style="margin-top: 16px !important">${obj.note!}</div>
|
||||
<!--#}else{#-->
|
||||
消息不存在,或您没有阅读权限!
|
||||
<!--#}#-->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,35 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<header class="header navbar bg-white shadow">
|
||||
<div class="btn-group tool-button m5">
|
||||
<a class="el-button el-button--default el-button--medium" href="${base}/platform/sys/msg/user/unread" data-pjax>
|
||||
<i class="ti-angle-left"></i>
|
||||
返回
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="content-wrap">
|
||||
<div class="wrapper" style="min-height: 500px">
|
||||
<section class="panel">
|
||||
<div class="row mb10">
|
||||
<div class="col-lg-12">
|
||||
<!--#if(!isEmpty(obj)){#-->
|
||||
<div style="text-align: center">
|
||||
<h4>${obj.title!}</h4>
|
||||
</div>
|
||||
<div style="text-align: center; font-size: 14px; line-height: 24px">${@date.getDate(obj.sendAt)}</div>
|
||||
<div style="margin-top: 16px !important; border-bottom: 1px solid #ddd"></div>
|
||||
<div style="margin-top: 16px !important">${obj.note!}</div>
|
||||
<!--#}else{#-->
|
||||
消息不存在,或您没有阅读权限!
|
||||
<!--#}#-->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,202 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-msg-active {
|
||||
background-color: #546478;
|
||||
color: #ffffff;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="消息类型:">
|
||||
<el-select clearable placeholder="请选择消息类型" v-model="pageForm.searchType" style="width: 100%" @change="doSearch">
|
||||
<el-option label="全部类型消息" value="all"></el-option>
|
||||
<el-option label="系统消息" value="system"></el-option>
|
||||
<el-option label="用户消息" value="user"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<table-tool label="消息列表">
|
||||
<el-radio-group v-model="pageForm.status" @change="doSearch" size="small">
|
||||
<el-radio-button label="all">全部消息</el-radio-button>
|
||||
<el-radio-button label="read">已读消息</el-radio-button>
|
||||
<el-radio-button label="unread">未读消息</el-radio-button>
|
||||
</el-radio-group>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" style="width: 100%">
|
||||
<el-table-column label="序号" type="index" :index="indexMethod" width="60"></el-table-column>
|
||||
<el-table-column prop="type" label="消息类型" width="120">
|
||||
<template v-slot="scope">
|
||||
<span v-if="'system'===scope.row.type">系统消息</span>
|
||||
<span v-if="'user'===scope.row.type">用户消息</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="title" label="标题" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column prop="createdAt" label="接收时间">
|
||||
<template slot-scope="scope">{{$moment(scope.row.createdAt).format("YYYY-MM-DD HH:mm:ss")}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="状态">
|
||||
<template v-slot="scope">
|
||||
<el-tag size="mini" v-if="0 === scope.row.status">未阅读</el-tag>
|
||||
<el-tag size="mini" type="warning" v-else-if="1 === scope.row.status && scope.row.needBack">已阅读未反馈</el-tag>
|
||||
<el-tag size="mini" type="success" v-else-if="1 === scope.row.status && !scope.row.needBack">已阅读无需反馈</el-tag>
|
||||
<el-tag size="mini" v-else-if="2 === scope.row.status">已阅读已反馈</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="backFiles" label="反馈附件">
|
||||
<template v-slot="scope">
|
||||
<el-link type="primary" v-if="scope.row.backFiles.length > 0" @click="viewFiles(scope.row)">点击查看</el-link>
|
||||
<el-link type="info" v-else>暂无</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="primary" @click="openView(scope.row)">查看</el-button>
|
||||
<el-button v-if="scope.row.needBack" size="mini" type="primary" @click="openBack(scope.row)">反馈</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
<template #view>
|
||||
<div style="text-align: center">
|
||||
<h4>{{viewData.title}}</h4>
|
||||
</div>
|
||||
<div style="text-align: center; font-size: 14px; line-height: 24px">{{$moment(viewData.createdAt).format('YYYY-MM-DD HH:mm')}}</div>
|
||||
<div style="margin-top: 16px !important; border-bottom: 1px solid #ddd"></div>
|
||||
<div style="margin-top: 16px !important;" v-html="viewData.note"></div>
|
||||
<file-preview complete_result :files="viewData.files"></file-preview>
|
||||
</template>
|
||||
</guava>
|
||||
<el-dialog :visible.sync="backDialogVisible" title="反馈附件" width="40%" top="2%">
|
||||
<el-form v-model="backFormData" ref="backFormRef" label-width="80px">
|
||||
<el-form-item label="反馈附件" prop="files">
|
||||
<file-upload
|
||||
v-if="isViewFiles === false"
|
||||
:value.sync="backFormData.files"
|
||||
upload_mode="drag"
|
||||
:upload_number="5"
|
||||
upload_result_category="array"
|
||||
complete_result
|
||||
upload_mode="file"
|
||||
></file-upload>
|
||||
<div v-else style="width: 100%; text-align: center">
|
||||
<file-preview :files="backFormData.files" complete_result></file-preview>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="反馈内容" prop="backText">
|
||||
<el-input v-model="backFormData.backText" type="textarea" :rows="4" placeholder="非必填" max="500" :readonly="isViewFiles"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer" v-if="isViewFiles === false">
|
||||
<el-button @click="backDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="backDo">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<script nonce="${cspNonce!}">
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
data: function () {
|
||||
return {
|
||||
backFormData: {},
|
||||
backFiles: [],
|
||||
backDialogVisible: false,
|
||||
viewData: {},
|
||||
tableData: [],
|
||||
pageForm: {
|
||||
searchType: "all",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "",
|
||||
pageOrderBy: "",
|
||||
status: "unread"
|
||||
},
|
||||
isViewFiles: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
viewFiles(row) {
|
||||
this.isViewFiles = true
|
||||
this.backFormData = {
|
||||
files: row.backFiles,
|
||||
backText: row.backText
|
||||
}
|
||||
this.backDialogVisible = true
|
||||
},
|
||||
async backDo() {
|
||||
if (this.backFormData.files.length === 0) {
|
||||
this.$message.warning("请上传反馈附件")
|
||||
return
|
||||
}
|
||||
|
||||
const resp = await this.$axios.post("/platform/sys/msg/user/backDo", {
|
||||
id: this.backFormData.id,
|
||||
backText: this.backFormData.backText,
|
||||
files: JSON.stringify(this.backFormData.files)
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.doSearch()
|
||||
this.backDialogVisible = false
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
},
|
||||
async openView(row) {
|
||||
const resp = await this.$axios.post("/platform/sys/msg/user/findOne", { id: row.msgId })
|
||||
this.viewData = resp.data
|
||||
this.$refs.guava.view()
|
||||
this.pageData()
|
||||
window.webSocketPubSub.send(
|
||||
JSON.stringify({
|
||||
room: store.state.room,
|
||||
action: "getMessage"
|
||||
})
|
||||
)
|
||||
},
|
||||
openBack(row) {
|
||||
this.isViewFiles = false
|
||||
this.backFormData = {
|
||||
files: row.backFiles,
|
||||
backText: row.backText,
|
||||
id: row.id
|
||||
}
|
||||
this.backDialogVisible = true
|
||||
},
|
||||
async pageData() {
|
||||
const resp = await this.$axios.post("/platform/sys/msg/user/data/" + this.pageForm.status, this.pageForm)
|
||||
if (resp.code === 0) {
|
||||
this.tableData = resp.data.list
|
||||
this.tableData.forEach((item) => {
|
||||
item.backFiles = item.backFiles ? JSON.parse(item.backFiles) : []
|
||||
})
|
||||
this.pageForm.totalCount = resp.data.totalCount
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
},
|
||||
formatAt: function (val) {
|
||||
if (val && val > 0) return this.$moment(val).format("YYYY-MM-DD HH:mm")
|
||||
return ""
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
this.pageForm.searchType = GetQueryString("type") ? GetQueryString("type") : "all"
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,209 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-msg-active {
|
||||
background-color: #546478;
|
||||
color: #ffffff;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<el-card shadow="never">
|
||||
<a
|
||||
href="${base}/platform/sys/msg/user/read"
|
||||
data-pjax
|
||||
class="el-button el-button--default el-button--medium"
|
||||
:class="{'el-msg-active':'all'==pageForm.searchType}"
|
||||
>
|
||||
全部类型消息
|
||||
</a>
|
||||
<a
|
||||
href="${base}/platform/sys/msg/user/read?type=system"
|
||||
data-pjax
|
||||
class="el-button el-button--default el-button--medium"
|
||||
:class="{'el-msg-active':'system'==pageForm.searchType}"
|
||||
>
|
||||
系统消息
|
||||
<span v-if="unreadnum.system>0">({{unreadnum.system}})</span>
|
||||
</a>
|
||||
<a
|
||||
href="${base}/platform/sys/msg/user/read?type=user"
|
||||
data-pjax
|
||||
class="el-button el-button--default el-button--medium"
|
||||
:class="{'el-msg-active':'user'==pageForm.searchType}"
|
||||
>
|
||||
用户消息
|
||||
<span v-if="unreadnum.user>0">({{unreadnum.user}})</span>
|
||||
</a>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
@sort-change="pageOrder"
|
||||
size="small"
|
||||
header-align="center"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="35"></el-table-column>
|
||||
<el-table-column prop="status" width="45">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="0==scope.row.status"><i class="fa fa-circle text-info ml5"></i></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="type" label="消息类型" header-align="center" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="'system'==scope.row.type">系统消息</span>
|
||||
<span v-if="'user'==scope.row.type">用户消息</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="title" label="标题" header-align="center" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<a :href="'${base}/platform/sys/msg/user/read/detail/'+scope.row.msgid" data-pjax>{{scope.row.title}}</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="opat" label="接收时间" header-align="center" align="center">
|
||||
<template slot-scope="scope">{{formatAt(scope.row.opat)}}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row class="el-pagination-container">
|
||||
<el-pagination
|
||||
style="float: left"
|
||||
@size-change="pageSizeChange"
|
||||
@current-change="pageNumberChange"
|
||||
:current-page="pageForm.pageNumber"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:page-size="pageForm.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pageForm.totalCount"
|
||||
></el-pagination>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</div>
|
||||
<script nonce="${cspNonce!}">
|
||||
new Vue({
|
||||
el: "#app",
|
||||
data: function () {
|
||||
return {
|
||||
addDialogVisible: false,
|
||||
editDialogVisible: false,
|
||||
selectDialogVisible: false,
|
||||
viewDialogVisible: false,
|
||||
tableData: [],
|
||||
pageForm: {
|
||||
searchType: "${type!}",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "createdAt",
|
||||
pageOrderBy: "descending"
|
||||
},
|
||||
formData: {
|
||||
id: "",
|
||||
type: "system"
|
||||
},
|
||||
selectData: [],
|
||||
unreadnum: {
|
||||
system: 0,
|
||||
user: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
pageOrder: function (column) {
|
||||
//按字段排序
|
||||
this.pageForm.pageOrderName = column.prop
|
||||
this.pageForm.pageOrderBy = column.order
|
||||
this.pageData()
|
||||
},
|
||||
pageNumberChange: function (val) {
|
||||
//页码更新操作
|
||||
this.pageForm.pageNumber = val
|
||||
this.pageData()
|
||||
},
|
||||
pageSizeChange: function (val) {
|
||||
//分页大小更新操作
|
||||
this.pageForm.pageSize = val
|
||||
this.pageData()
|
||||
},
|
||||
pageData: function () {
|
||||
//加载分页数据
|
||||
var self = this
|
||||
$.post(
|
||||
base + "/platform/sys/msg/user/data/read",
|
||||
self.pageForm,
|
||||
function (data) {
|
||||
if (data.code == 0) {
|
||||
self.tableData = data.data.list
|
||||
self.pageForm.totalCount = data.data.totalCount
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: "error"
|
||||
})
|
||||
}
|
||||
},
|
||||
"json"
|
||||
)
|
||||
},
|
||||
formatAt: function (val) {
|
||||
if (val && val > 0) return moment(val).format("YYYY-MM-DD HH:mm")
|
||||
return ""
|
||||
},
|
||||
handleSelectionChange: function (val) {
|
||||
this.selectData = val
|
||||
},
|
||||
delMore: function () {
|
||||
var self = this
|
||||
if (self.selectData.length == 0) {
|
||||
self.$message({
|
||||
message: "请选择消息",
|
||||
type: "warning"
|
||||
})
|
||||
return false
|
||||
}
|
||||
var ids = []
|
||||
self.selectData.forEach(function (val) {
|
||||
ids.push(val.id)
|
||||
})
|
||||
self.$confirm("您确定要删除选中的 " + ids.length + " 条消息? ", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
callback: function (a, b) {
|
||||
if ("confirm" == a) {
|
||||
//确认后再执行
|
||||
$.post(
|
||||
base + "/platform/sys/msg/user/delete",
|
||||
{ ids: ids.toString() },
|
||||
function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: "success"
|
||||
})
|
||||
self.pageData()
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: "error"
|
||||
})
|
||||
}
|
||||
},
|
||||
"json"
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,302 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-msg-active {
|
||||
background-color: #546478;
|
||||
color: #ffffff;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<el-card shadow="never">
|
||||
<a
|
||||
href="${base}/platform/sys/msg/user/unread"
|
||||
data-pjax
|
||||
class="el-button el-button--default el-button--medium"
|
||||
:class="{'el-msg-active':'all'==pageForm.searchType}"
|
||||
>
|
||||
全部类型消息
|
||||
</a>
|
||||
<a
|
||||
href="${base}/platform/sys/msg/user/unread?type=system"
|
||||
data-pjax
|
||||
class="el-button el-button--default el-button--medium"
|
||||
:class="{'el-msg-active':'system'==pageForm.searchType}"
|
||||
>
|
||||
系统消息
|
||||
<span v-if="unreadnum.system>0">({{unreadnum.system}})</span>
|
||||
</a>
|
||||
<a
|
||||
href="${base}/platform/sys/msg/user/unread?type=user"
|
||||
data-pjax
|
||||
class="el-button el-button--default el-button--medium"
|
||||
:class="{'el-msg-active':'user'==pageForm.searchType}"
|
||||
>
|
||||
用户消息
|
||||
<span v-if="unreadnum.user>0">({{unreadnum.user}})</span>
|
||||
</a>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
@sort-change="pageOrder"
|
||||
size="small"
|
||||
header-align="center"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="35"></el-table-column>
|
||||
<el-table-column prop="status" width="45">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="0==scope.row.status"><i class="fa fa-circle text-info ml5"></i></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="type" label="消息类型" header-align="center" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="'system'==scope.row.type">系统消息</span>
|
||||
<span v-if="'user'==scope.row.type">用户消息</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="title" label="标题" header-align="center" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<a :href="'${base}/platform/sys/msg/user/unread/detail/'+scope.row.msgid" data-pjax>{{scope.row.title}}</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="opat" label="接收时间" header-align="center" align="center">
|
||||
<template slot-scope="scope">{{formatAt(scope.row.opat)}}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row class="el-pagination-container">
|
||||
<el-pagination
|
||||
style="float: left"
|
||||
@size-change="pageSizeChange"
|
||||
@current-change="pageNumberChange"
|
||||
:current-page="pageForm.pageNumber"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:page-size="pageForm.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pageForm.totalCount"
|
||||
></el-pagination>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</div>
|
||||
<script nonce="${cspNonce!}">
|
||||
new Vue({
|
||||
el: "#app",
|
||||
data: function () {
|
||||
return {
|
||||
addDialogVisible: false,
|
||||
editDialogVisible: false,
|
||||
selectDialogVisible: false,
|
||||
viewDialogVisible: false,
|
||||
tableData: [],
|
||||
pageForm: {
|
||||
searchType: "${type!}",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "createdAt",
|
||||
pageOrderBy: "descending"
|
||||
},
|
||||
formData: {
|
||||
id: "",
|
||||
type: "system"
|
||||
},
|
||||
selectData: [],
|
||||
unreadnum: {
|
||||
system: 0,
|
||||
user: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
pageOrder: function (column) {
|
||||
//按字段排序
|
||||
this.pageForm.pageOrderName = column.prop
|
||||
this.pageForm.pageOrderBy = column.order
|
||||
this.pageData()
|
||||
},
|
||||
pageNumberChange: function (val) {
|
||||
//页码更新操作
|
||||
this.pageForm.pageNumber = val
|
||||
this.pageData()
|
||||
},
|
||||
pageSizeChange: function (val) {
|
||||
//分页大小更新操作
|
||||
this.pageForm.pageSize = val
|
||||
this.pageData()
|
||||
},
|
||||
pageData: function () {
|
||||
//加载分页数据
|
||||
var self = this
|
||||
$.post(
|
||||
base + "/platform/sys/msg/user/data/unread",
|
||||
self.pageForm,
|
||||
function (data) {
|
||||
if (data.code == 0) {
|
||||
self.tableData = data.data.list
|
||||
self.pageForm.totalCount = data.data.totalCount
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: "error"
|
||||
})
|
||||
}
|
||||
},
|
||||
"json"
|
||||
)
|
||||
},
|
||||
formatAt: function (val) {
|
||||
if (val && val > 0) return moment(val).format("YYYY-MM-DD HH:mm")
|
||||
return ""
|
||||
},
|
||||
handleSelectionChange: function (val) {
|
||||
this.selectData = val
|
||||
},
|
||||
unreadData: function () {
|
||||
//加载分页数据
|
||||
var self = this
|
||||
$.post(
|
||||
base + "/platform/sys/msg/user/unread_num",
|
||||
{},
|
||||
function (data) {
|
||||
if (data.code == 0) {
|
||||
self.unreadnum = data.data
|
||||
}
|
||||
},
|
||||
"json"
|
||||
)
|
||||
},
|
||||
readMore: function () {
|
||||
var self = this
|
||||
if (self.selectData.length == 0) {
|
||||
self.$message({
|
||||
message: "请选择消息",
|
||||
type: "warning"
|
||||
})
|
||||
return false
|
||||
}
|
||||
var ids = []
|
||||
self.selectData.forEach(function (val) {
|
||||
ids.push(val.id)
|
||||
})
|
||||
self.$confirm("您确定要标记选中的 " + ids.length + " 条消息为已读吗? ", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
callback: function (a, b) {
|
||||
if ("confirm" == a) {
|
||||
//确认后再执行
|
||||
$.post(
|
||||
base + "/platform/sys/msg/user/status/read",
|
||||
{ ids: ids.toString() },
|
||||
function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: "success"
|
||||
})
|
||||
self.pageData()
|
||||
self.unreadData()
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: "error"
|
||||
})
|
||||
}
|
||||
},
|
||||
"json"
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
readAll: function () {
|
||||
var self = this
|
||||
self.$confirm("您确定要标记全部消息为已读吗? ", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
callback: function (a, b) {
|
||||
if ("confirm" == a) {
|
||||
//确认后再执行
|
||||
$.post(
|
||||
base + "/platform/sys/msg/user/status/readAll",
|
||||
{},
|
||||
function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: "success"
|
||||
})
|
||||
self.pageData()
|
||||
self.unreadData()
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: "error"
|
||||
})
|
||||
}
|
||||
},
|
||||
"json"
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
delMore: function () {
|
||||
var self = this
|
||||
if (self.selectData.length == 0) {
|
||||
self.$message({
|
||||
message: "请选择消息",
|
||||
type: "warning"
|
||||
})
|
||||
return false
|
||||
}
|
||||
var ids = []
|
||||
self.selectData.forEach(function (val) {
|
||||
ids.push(val.id)
|
||||
})
|
||||
self.$confirm("您确定要删除选中的 " + ids.length + " 条消息? ", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
callback: function (a, b) {
|
||||
if ("confirm" == a) {
|
||||
//确认后再执行
|
||||
$.post(
|
||||
base + "/platform/sys/msg/user/delete",
|
||||
{ ids: ids.toString() },
|
||||
function (data) {
|
||||
if (data.code == 0) {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: "success"
|
||||
})
|
||||
self.pageData()
|
||||
self.unreadData()
|
||||
} else {
|
||||
self.$message({
|
||||
message: data.msg,
|
||||
type: "error"
|
||||
})
|
||||
}
|
||||
},
|
||||
"json"
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
this.pageData()
|
||||
this.unreadData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user