Commit 7150d11d by wuqian

异常消息

parent e3f95781
import axios from './axios'
export function getMqMessagePage(data) {
return axios.post('sys/MqMessage/list_page', data)
}
export function getMessageDetails(data) {
return axios.get('sys/MqMessage/getMessageDetails?id=' + data)
}
export function getMessageReSend(data) {
return axios.get('sys/MqMessage/reSend?ids=' + data)
}
\ No newline at end of file
...@@ -133,6 +133,12 @@ const routes = [ ...@@ -133,6 +133,12 @@ const routes = [
meta: { title: '丢单管理' } meta: { title: '丢单管理' }
}, },
{ {
path: '/operation/exceptionMessage',
component: () => import('@/views/operation/exceptionMessage.vue'),
name: 'exceptionMessage',
meta: { title: '异常消息' }
},
{
path: '/dynamicForm', path: '/dynamicForm',
component: () => import('@/components/dynamicForms/index.vue'), component: () => import('@/components/dynamicForms/index.vue'),
name: 'system_management', name: 'system_management',
......
...@@ -289,6 +289,14 @@ export default { ...@@ -289,6 +289,14 @@ export default {
children: [] children: []
}, },
{ {
id: 6_2,
path: '',
label: '异常消息',
icon: 'el-icon-bell',
index: '/operation/exceptionMessage',
children: []
},
{
id: 9, id: 9,
path: '', path: '',
label: '运维工具', label: '运维工具',
......
<template>
<div class="saas-manage card">
<div class="search">
<el-form :model="searchForm" size="small" :inline="true">
<el-form-item label="创建时间">
<el-date-picker
style="width: 360px"
v-model="period"
type="datetimerange"
value-format="yyyy-MM-dd HH:ss:mm"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"></el-date-picker>
</el-form-item>
<el-form-item label="route">
<el-input
size="small"
style="width: 160px"
clearable
v-model.trim="searchForm.route"
placeholder="请输入route"></el-input>
</el-form-item>
<el-form-item>
<el-button
type="primary"
size="small"
icon="el-icon-search"
@click="search">
查询
</el-button>
</el-form-item>
<el-form-item>
<el-button
type="warning"
size="small"
icon="el-icon-s-promotion"
@click="resendMsg()">
批量发送
</el-button>
</el-form-item>
</el-form>
</div>
<div
class="table_wrap"
style="min-height: 50%; max-height: 90%; padding: 0">
<table-view
:sourceData="messageLists"
:serialNumber="true"
:tableColumns="tableColumns"
ref="multipleTable"
@selectionChange="selectionChange"
:selection="true"></table-view>
</div>
<div class="pagination">
<el-pagination
layout="sizes, total, prev, pager, next, jumper"
background
:total="total"
:page-size="pageSize"
:current-page="currentPage"
@size-change="sizeChange"
@current-change="onCurrentChange"></el-pagination>
</div>
<el-dialog
title="查看详情"
:visible.sync="detailsVisible"
:close-on-click-modal="false"
width="700px">
<json-viewer :value="jsonData" :expand-depth="5"></json-viewer>
</el-dialog>
</div>
</template>
<script>
import {
getMqMessagePage,
getMessageDetails,
getMessageReSend
} from '@/common/api/message'
import tableView from '@/common/components/base/tableView.vue'
import JsonViewer from 'vue-json-viewer' // 下载vue-json-viewer插件
export default {
name: 'exceptionMessage',
components: { tableView, JsonViewer },
data() {
return {
detailsVisible: false,
jsonData: {},
period: [],
messageLists: [],
searchForm: {},
editForm: {
domain: ''
},
total: 0,
pageSize: 50,
currentPage: 1,
selection: [],
loading: false
}
},
computed: {
tableColumns() {
return [
{
label: 'route',
key: 'route'
},
{
label: '发送状态',
key: 'statusStr'
},
{
label: '创建时间',
key: 'createTime'
},
{
label: '操作',
width: 150,
render: (item) => (
<div>
<span
class="icon-view icon-tools-view"
title="详情"
onClick={() => this.lookJson(item.id)}>
<i class="el-icon-tickets"></i>
</span>
<span
class="icon-view icon-edit-view"
title="重新发送"
onClick={() => this.resendMsg(item)}>
<i class="el-icon-s-promotion"></i>
</span>
</div>
)
}
]
}
},
async created() {
this.getList()
},
methods: {
async resendMsg(row) {
const arr = row ? [row] : this.selection
if (arr.length === 0) {
this.$message.error('请至少选择一条记录')
return
}
try {
await this.$confirm('确认发送?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
const ids = arr.map((item) => item.id)
const loading = this.$loading({
background: 'rgba(0, 0, 0, 0.3)'
})
try {
const res = await getMessageReSend(String(ids))
if (res.code === 200) {
this.$message.success('发送成功')
this.selection = []
this.getList()
} else {
this.$message.error(res.message)
}
} finally {
loading.close()
}
} catch {}
},
async lookJson(id) {
this.jsonData = {}
const res = await getMessageDetails(id)
if (res.code === 200) {
this.jsonData = res.data || {}
this.detailsVisible = true
}
},
async getList() {
this.loading = true
const params = {
currentPage: this.currentPage,
pageSize: this.pageSize,
route: this.searchForm.route,
startTime: this.period && this.period[0],
endTime: this.period && this.period[1]
}
try {
const res = await getMqMessagePage(params)
this.messageLists = res.data.records || []
this.total = res.data.total || 0
} catch (e) {
console.error(e)
} finally {
this.loading = false
}
},
search() {
this.getList()
},
selectionChange(selection) {
this.selection = selection
},
onCurrentChange(currentPage) {
this.currentPage = currentPage
this.getList()
},
sizeChange(pageSize) {
this.pageSize = pageSize
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
::v-deep .jv-light {
background-color: #ececec !important;
}
.saas-manage {
height: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
&::v-deep {
.el-table .el-table__cell {
padding: 6px 0;
}
.el-input__inner {
padding: 0 4px;
}
.el-input--small .el-input__inner {
height: 30px;
line-height: 30px;
}
.el-icon-time:before {
content: '';
}
.el-dialog__footer {
text-align: center;
.el-button--small {
padding: 9px 50px;
}
}
.el-dialog__body {
padding: 10px 20px;
}
.el-range-editor--small .el-range-separator {
line-height: 31px;
}
.header-row-class-name th {
background-color: #f8f8f9;
}
.el-input-group__append {
padding-left: 0;
}
}
}
.search {
background: #fff;
}
.table-wrap {
background: #fff;
flex: 1;
overflow: hidden;
}
</style>
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
</div> --> </div> -->
<div <div
class="table_wrap scroll" class="table_wrap scroll"
style="min-height: 50%; max-height: 82%; padding: 0"> style="min-height: 50%; max-height: 82%; padding: 0 10px">
<div class="card-mode" v-if="sourceData.length > 0"> <div class="card-mode" v-if="sourceData.length > 0">
<div <div
class="card-item" class="card-item"
...@@ -155,7 +155,14 @@ ...@@ -155,7 +155,14 @@
</span> </span>
</template> </template>
<template slot="synthesizeStatus"> <template slot="synthesizeStatus">
<div title="应用类型" style="position: absolute; right: 0"> <div
title="应用类型"
style="
position: absolute;
right: 0;
width: 36px;
height: 20px;
">
<el-tag :type="!item.isCollectFee ? 'success' : 'warning'"> <el-tag :type="!item.isCollectFee ? 'success' : 'warning'">
{{ !item.isCollectFee ? '免费' : '收费' }} {{ !item.isCollectFee ? '免费' : '收费' }}
</el-tag> </el-tag>
...@@ -192,7 +199,9 @@ ...@@ -192,7 +199,9 @@
</div> </div>
<div class="empty" v-else>暂无数据</div> <div class="empty" v-else>暂无数据</div>
</div> </div>
<div slot="footer" style="display: flex; justify-content: center;align-items: center;"> <div
slot="footer"
style="display: flex; justify-content: center; align-items: center">
<div class="select-number"> <div class="select-number">
选中 选中
<span style="color: red; font-weight: bold"> <span style="color: red; font-weight: bold">
...@@ -1026,6 +1035,13 @@ export default { ...@@ -1026,6 +1035,13 @@ export default {
padding: 2px 6px; padding: 2px 6px;
} }
} }
::v-deep .el-tag {
width: 36px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
}
.customize-tree-node { .customize-tree-node {
font-size: 14px; font-size: 14px;
flex: 1; flex: 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment