Browse Source

完善问题

master
yunuo970428 2 years ago
parent
commit
a572c9172d
  1. 79
      supervise-message-ui/src/router/modules/codemenu.js
  2. 204
      supervise-message-ui/src/views/message/fullmessage.vue
  3. 6
      supervise-message-ui/src/views/message/readmessage.vue
  4. 188
      supervise-message-ui/src/views/message/unreadmessage.vue

79
supervise-message-ui/src/router/modules/codemenu.js

@ -1,68 +1,19 @@
import Layout from '@/layout' import Layout from '@/layout'
const codemenu = [{ const codemenu = [
path: '/xxzxqbxx', {
component: Layout, path: '/message',
redirect: '/qbxx/index', component: Layout,
meta: { redirect: '/message',
title: '全部消息'
},
children: [{
path: '/qbxx/index',
component: () => import('@/views/message/qbxx.vue'),
name: 'XxzxQbxx',
meta: { meta: {
title: '全部消息', title: '消息管理'
noCache: true },
} children: [{
}] path: '/message/unreadmessage',
}, { component: () => import('@/views/message/unreadmessage.vue'),
path: '/xxzxwdxx', name: 'UnreadMessage',
component: Layout, meta: { title: '消息管理', noCache: true }
redirect: '/wdxx/index', }]
meta: { }
title: '未读消息' ]
},
children: [{
path: '/wdxx/index',
component: () => import('@/views/message/unreadmessage.vue'),
name: 'XxzxWdxx',
meta: {
title: '未读消息',
noCache: true
}
}]
}, {
path: '/xxzxydxx',
component: Layout,
redirect: '/ydxx/index',
meta: {
title: '已读消息'
},
children: [{
path: '/ydxx/index',
component: () => import('@/views/message/ydxx.vue'),
name: 'XxzxYdxx',
meta: {
title: '已读消息',
noCache: true
}
}]
}, {
path: '/xxzxydxx',
component: Layout,
redirect: '/mbxx/index',
meta: {
title: '模板消息'
},
children: [{
path: '/mbxx/index',
component: () => import('@/views/message/mbxx.vue'),
name: 'XxzxYdxx',
meta: {
title: '模板消息',
noCache: true
}
}]
}]
export default codemenu export default codemenu

204
supervise-message-ui/src/views/message/fullmessage.vue

@ -0,0 +1,204 @@
<template>
<div class="app-container">
<!-- Start 列表页面 -->
<div v-show="viewState == 1">
<button-bar view-title="消息管理" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
<div class="main-content">
<div class="switch_btn">
<el-button class="" @click="handleClick">未读消息</el-button>
<el-button class="" @click="handleRead">已读消息</el-button>
<el-button :class="{btn_style:viewState === 1}">全部消息</el-button>
</div>
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
<div v-show="isSearchShow" class="search">
<el-form ref="listQueryform" :inline="true" :model="listQuery" class="tab-header">
<el-form-item label="消息类型">
<el-input v-model="listQuery.params.type" clearable placeholder="" class="addinputw"></el-input>
</el-form-item>
<el-form-item label="消息来源">
<el-input v-model="listQuery.params.msgSource" clearable placeholder="" class="addinputw"></el-input>
</el-form-item>
<el-form-item label="消息标题">
<el-input v-model="listQuery.params.title" clearable placeholder="" class="addinputw"></el-input>
</el-form-item>
<el-form-item label="发送人">
<el-input v-model="listQuery.params.senderName" clearable placeholder="" class="addinputw"></el-input>
</el-form-item>
<el-form-item class="formItem" label="接收日期">
<el-date-picker value-format="yyyy-MM-dd" v-model="listQuery.params.createTimeStart" clearable type="date" placeholder="开始日期" />
<span style="padding: 0 8px"></span>
<el-date-picker value-format="yyyy-MM-dd" v-model="listQuery.params.createTimeEnd" clearable type="date" placeholder="结束日期" />
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" icon="el-icon-search" @click="handleFilter" size="small">查询</el-button>
<el-button type="primary" icon="el-icon-refresh" @click="handleReset" size="small">重置</el-button>
</div>
</div>
</div>
<div class="listtop">
<div class="tit">已读消息列表</div>
<pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
<div class="">
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;">
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center"/>
<el-table-column prop="senderName" width="100" label="发送人" align="center" />
<el-table-column prop="title" label="标题" align="left" header-align="center" />
<el-table-column prop="createTime" width="150" label="日期" align="center" />
<el-table-column prop="type" width="100" label="消息类别" align="center" />
<el-table-column prop="msgSource" width="100" label="消息来源" align="center" />
</el-table>
</div>
<div class="pages">
<!-- 翻页 -->
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
</div>
</div>
<!-- End 列表页面 -->
</div>
</template>
<script>
import req from '@/api/message/message'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
export default {
name: 'ReadMessage',
components: {
Pagination,
pageye,
ButtonBar
},
data() {
return {
viewState: 1,
btndisabled: false,
btnList: [
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
isSearchShow: false,
searchxianshitit: '显示查询条件',
// -----------
tableKey: 0,
list: [],
listLoading: false,
listQuery: {
params: {
userSid: '',
state: '',
createTimeStart: '',
createTimeEnd: '',
type: '',
msgSource: '',
title: '',
senderName: ''
},
current: 1,
size: 10,
total: 0
},
rules: {}
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
methods: {
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'doClose':
this.doClose()
break
default:
break
}
},
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
//
getList() {
this.listLoading = true
this.listQuery.params.userSid = '5d4b06cd-9d5e-11ed-87ce-525401028fe6'
req.listPage(this.listQuery).then((response) => {
console.log('列表查询结果:', response)
this.listLoading = false
if (response.success) {
this.list = response.data.records
this.listQuery.total = response.data.total
} else {
this.list = []
this.listQuery.total = 0
}
})
},
handleClick() {
this.$parent.resetState()
},
handleRead() {
this.$parent.handleRead()
},
//
handleFilter() {
this.listQuery.current = 1
this.getList()
},
resetState() {
this.viewState = 1
},
handleReset() {
this.listQuery = {
params: {
userSid: '',
state: '',
createTimeStart: '',
createTimeEnd: '',
type: '',
msgSource: '',
title: '',
senderName: ''
},
current: 1,
size: 10,
total: 0
}
this.getList()
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
}
}
}
</script>
<style scoped>
.btn_style {
background-color: #018ad2;
color: white;
font-weight: 600;
}
</style>

6
supervise-message-ui/src/views/message/readmessage.vue

@ -7,6 +7,7 @@
<div class="switch_btn"> <div class="switch_btn">
<el-button class="" @click="handleClick">未读消息</el-button> <el-button class="" @click="handleClick">未读消息</el-button>
<el-button :class="{btn_style:viewState === 1}">已读消息</el-button> <el-button :class="{btn_style:viewState === 1}">已读消息</el-button>
<el-button class="" @click="handleFull">全部消息</el-button>
</div> </div>
<div class="searchcon"> <div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button> <el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
@ -71,7 +72,7 @@ export default {
components: { components: {
Pagination, Pagination,
pageye, pageye,
ButtonBar ButtonBar,
}, },
data() { data() {
return { return {
@ -158,6 +159,9 @@ export default {
handleClick() { handleClick() {
this.$parent.resetState() this.$parent.resetState()
}, },
handleFull() {
this.$parent.handleFull()
},
// //
handleFilter() { handleFilter() {
this.listQuery.current = 1 this.listQuery.current = 1

188
supervise-message-ui/src/views/message/unreadmessage.vue

@ -6,20 +6,21 @@
<div class="main-content"> <div class="main-content">
<div class="switch_btn"> <div class="switch_btn">
<el-button :class="{btn_style:viewState === 1}">未读消息</el-button> <el-button :class="{btn_style:viewState === 1}">未读消息</el-button>
<el-button class="" @click="handleClick">已读消息</el-button> <el-button class="" @click="handleRead">已读消息</el-button>
<el-button class="" @click="handleFull">全部消息</el-button>
</div> </div>
<div class="searchcon"> <div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button> <el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
<div v-show="isSearchShow" class="search"> <div v-show="isSearchShow" class="search">
<el-form ref="listQueryform" :inline="true" :model="listQuery" class="tab-header"> <el-form ref="listQueryform" :inline="true" :model="listQuery" class="tab-header">
<el-form-item label="消息类型"> <el-form-item label="消息类型">
<el-input v-model="listQuery.params.msgType" clearable placeholder="" class="addinputw"></el-input> <el-input v-model="listQuery.params.type" clearable placeholder="" class="addinputw"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="消息来源"> <el-form-item label="消息来源">
<el-input v-model="listQuery.params.msgSource" clearable placeholder="" class="addinputw"></el-input> <el-input v-model="listQuery.params.msgSource" clearable placeholder="" class="addinputw"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="消息标题"> <el-form-item label="消息标题">
<el-input v-model="listQuery.params.msgTitle" clearable placeholder="" class="addinputw"></el-input> <el-input v-model="listQuery.params.title" clearable placeholder="" class="addinputw"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="发送人"> <el-form-item label="发送人">
<el-input v-model="listQuery.params.senderName" clearable placeholder="" class="addinputw"></el-input> <el-input v-model="listQuery.params.senderName" clearable placeholder="" class="addinputw"></el-input>
@ -58,8 +59,10 @@
</div> </div>
</div> </div>
<!-- End 列表页面 --> <!-- End 列表页面 -->
<!-- 已选择列表 --> <!-- 查看已读消息列表 -->
<readmessage v-show="viewState == 2" ref="divRead" @doback="resetState"/> <readmessage v-show="viewState == 2" ref="divRead" @doback="resetState"/>
<!-- 查看全部消息列表 -->
<fullmessage v-show="viewState == 3" ref="divFull" @doback="resetState"/>
</div> </div>
</template> </template>
@ -69,6 +72,7 @@ import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye' import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar' import ButtonBar from '@/components/ButtonBar'
import readmessage from './readmessage' import readmessage from './readmessage'
import fullmessage from './fullmessage'
export default { export default {
name: 'UnreadMessage', name: 'UnreadMessage',
@ -76,7 +80,8 @@ export default {
Pagination, Pagination,
pageye, pageye,
ButtonBar, ButtonBar,
readmessage readmessage,
fullmessage
}, },
data() { data() {
return { return {
@ -125,9 +130,9 @@ export default {
state: '0', state: '0',
createTimeStart: '', createTimeStart: '',
createTimeEnd: '', createTimeEnd: '',
msgType: '', type: '',
msgSource: '', msgSource: '',
msgTitle: '', title: '',
senderName: '' senderName: ''
}, },
current: 1, current: 1,
@ -200,9 +205,13 @@ export default {
} }
}) })
}, },
handleClick() { handleRead() {
this.viewState = 2 this.viewState = 2
this.$refs['divSelect'].getList() this.$refs['divRead'].getList()
},
handleFull() {
this.viewState = 3
this.$refs['divFull'].getList()
}, },
// //
handleFilter() { handleFilter() {
@ -216,9 +225,9 @@ export default {
state: '0', state: '0',
createTimeStart: '', createTimeStart: '',
createTimeEnd: '', createTimeEnd: '',
msgType: '', type: '',
msgSource: '', msgSource: '',
msgTitle: '', title: '',
senderName: '' senderName: ''
}, },
current: 1, current: 1,
@ -229,89 +238,92 @@ export default {
}, },
// //
toPartialMark() { toPartialMark() {
if (this.sids.length === 0) { this.$message({ showClose: true, type: 'info', message: '功能正在开发中' })
this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行操作' }) // if (this.sids.length === 0) {
return // this.$message({ showClose: true, type: 'error', message: '' })
} // return
const tip = '请确认是否标记所选 ' + this.sids.length + ' 条记录?' // }
this.$confirm(tip, '提示', { // const tip = ' ' + this.sids.length + ' ?'
confirmButtonText: '确定', // this.$confirm(tip, '', {
cancelButtonText: '取消', // confirmButtonText: '',
type: 'warning' // cancelButtonText: '',
}).then(() => { // type: 'warning'
const loading = this.$loading({ // }).then(() => {
lock: true, // const loading = this.$loading({
text: 'Loading', // lock: true,
spinner: 'el-icon-loading', // text: 'Loading',
background: 'rgba(0, 0, 0, 0.7)' // spinner: 'el-icon-loading',
}) // background: 'rgba(0, 0, 0, 0.7)'
req.ChangeRead(this.sids).then(resp => { // })
if (resp.success) { // req.ChangeRead(this.sids).then(resp => {
this.$message({ type: 'success', message: resp.msg, showClose: true }) // if (resp.success) {
} // this.$message({ type: 'success', message: resp.msg, showClose: true })
this.getList() // }
loading.close() // this.getList()
}).catch(e => { // loading.close()
loading.close() // }).catch(e => {
}) // loading.close()
}).catch(() => { // })
}) // }).catch(() => {
// })
}, },
// //
toAllMark() { toAllMark() {
const tip = '请确认是否标记全部记录?' this.$message({ showClose: true, type: 'info', message: '功能正在开发中' })
this.$confirm(tip, '提示', { // const tip = '?'
confirmButtonText: '确定', // this.$confirm(tip, '', {
cancelButtonText: '取消', // confirmButtonText: '',
type: 'warning' // cancelButtonText: '',
}).then(() => { // type: 'warning'
const loading = this.$loading({ // }).then(() => {
lock: true, // const loading = this.$loading({
text: 'Loading', // lock: true,
spinner: 'el-icon-loading', // text: 'Loading',
background: 'rgba(0, 0, 0, 0.7)' // spinner: 'el-icon-loading',
}) // background: 'rgba(0, 0, 0, 0.7)'
req.changeAll(this.sids).then(resp => { // })
if (resp.success) { // req.changeAll(this.sids).then(resp => {
this.$message({ type: 'success', message: resp.msg, showClose: true }) // if (resp.success) {
} // this.$message({ type: 'success', message: resp.msg, showClose: true })
this.getList() // }
loading.close() // this.getList()
}).catch(e => { // loading.close()
loading.close() // }).catch(e => {
}) // loading.close()
}).catch(() => { // })
}) // }).catch(() => {
// })
}, },
// //
doDel() { doDel() {
if (this.sids.length === 0) { this.$message({ showClose: true, type: 'info', message: '功能正在开发中' })
this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作' }) // if (this.sids.length === 0) {
return // this.$message({ showClose: true, type: 'error', message: '' })
} // return
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?' // }
this.$confirm(tip, '提示', { // const tip = ' ' + this.sids.length + ' ?'
confirmButtonText: '确定', // this.$confirm(tip, '', {
cancelButtonText: '取消', // confirmButtonText: '',
type: 'warning' // cancelButtonText: '',
}).then(() => { // type: 'warning'
const loading = this.$loading({ // }).then(() => {
lock: true, // const loading = this.$loading({
text: 'Loading', // lock: true,
spinner: 'el-icon-loading', // text: 'Loading',
background: 'rgba(0, 0, 0, 0.7)' // spinner: 'el-icon-loading',
}) // background: 'rgba(0, 0, 0, 0.7)'
req.delete(this.sids).then(resp => { // })
if (resp.success) { // req.delete(this.sids).then(resp => {
this.$message({ type: 'success', message: resp.msg, showClose: true }) // if (resp.success) {
} // this.$message({ type: 'success', message: resp.msg, showClose: true })
this.getList() // }
loading.close() // this.getList()
}).catch(e => { // loading.close()
loading.close() // }).catch(e => {
}) // loading.close()
}).catch(() => { // })
}) // }).catch(() => {
// })
}, },
resetState() { resetState() {
this.viewState = 1 this.viewState = 1

Loading…
Cancel
Save