|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" size="small" label-width="100px">
|
|
|
- <el-form-item label="内容关键字">
|
|
|
+ <el-form-item label="内容关键字" prop="noticeContent">
|
|
|
<el-input v-model="queryParams.noticeContent" clearable style="width: 200px;" placeholder="请输入内容关键字"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
@@ -13,15 +13,14 @@
|
|
|
<span class="title">列表</span>
|
|
|
</h3>
|
|
|
<el-table v-loading="loading" :data="list" border>
|
|
|
- <el-table-column label="通知类型" prop="noticeType" width="120" align="center" />
|
|
|
- <el-table-column label="内容" prop="noticeContent" align="center"></el-table-column>
|
|
|
- <el-table-column label="状态" prop="status" align="center" width="120" />
|
|
|
- <el-table-column label="发送时间" align="center" prop="createTime" width="160"></el-table-column>
|
|
|
- <el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="text" @click="handleView(scope.row)">查看</el-button>
|
|
|
- </template>
|
|
|
+ <el-table-column label="通知类型" prop="noticeType" width="120" align="center" :formatter="noticeTypeFormat"/>
|
|
|
+ <el-table-column label="内容" prop="noticeContent" align="center">
|
|
|
+ <template slot-scope="scope" >
|
|
|
+ <span class="content_msg"> {{scope.row.noticeContent}}</span> <el-button @click="handleView(scope.row)" type="text" size="small">查看详情</el-button>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="状态" prop="status" align="center" width="120" :formatter="statusFormat"/>
|
|
|
+ <el-table-column label="发送时间" align="center" prop="createTime" width="160"></el-table-column>
|
|
|
</el-table>
|
|
|
<pagination
|
|
|
v-show="total>0"
|
|
@@ -33,7 +32,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {listMsgApi} from "@/api/admin/msg/msg"
|
|
|
+ import {listMsgApi,noticeByIdApi} from "@/api/admin/msg/msg"
|
|
|
import {entStateOptions, getLabel, authStateOptions} from '@/utils/dataFormat'
|
|
|
export default {
|
|
|
data () {
|
|
@@ -44,6 +43,8 @@
|
|
|
provinceDataList: [],
|
|
|
cityDataList: [],
|
|
|
districtDataList: [],
|
|
|
+ msgTypeOptions: [], //通知类型
|
|
|
+ statusOptions: [], //通知状态
|
|
|
entStateOptions: entStateOptions,
|
|
|
authStateOptions: authStateOptions,
|
|
|
// 模板状态
|
|
@@ -62,6 +63,15 @@
|
|
|
},
|
|
|
created() {
|
|
|
this.getList()
|
|
|
+ //通知类型
|
|
|
+ this.getDicts("sys_notice_type").then(response => {
|
|
|
+ this.msgTypeOptions = response.data;
|
|
|
+ });
|
|
|
+ //通知状态 sys_notice_status
|
|
|
+ this.getDicts("msg_type").then(response => {
|
|
|
+ this.statusOptions = response.data;
|
|
|
+ });
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
getList() {
|
|
@@ -72,8 +82,12 @@
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
- handleView(row) {
|
|
|
- this.$router.push("message/info/"+row.noticeId)
|
|
|
+ /** 查看 */
|
|
|
+ handleView(row){
|
|
|
+ const id = row.noticeId;
|
|
|
+ noticeByIdApi(id).then(response => {
|
|
|
+ this.$alert(response.data.noticeContent, "消息内容");
|
|
|
+ });
|
|
|
},
|
|
|
// 重置
|
|
|
resetQuery() {
|
|
@@ -85,18 +99,20 @@
|
|
|
this.queryParams.pageNum = 1;
|
|
|
this.getList();
|
|
|
},
|
|
|
- statusFormat(row, col, val, index) {
|
|
|
- return getLabel(accessStatus, val)
|
|
|
+ noticeTypeFormat(row, col) {
|
|
|
+ return this.selectDictLabel(this.msgTypeOptions, row.noticeType);
|
|
|
},
|
|
|
- entSateFormat(row, col, val, index) {
|
|
|
- return getLabel(entStateOptions, val)
|
|
|
- },
|
|
|
- authStateFormat(row, col, val, index) {
|
|
|
- return getLabel(authStateOptions, val)
|
|
|
+ statusFormat(row, col) {
|
|
|
+ return this.selectDictLabel(this.statusOptions, row.status)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style>
|
|
|
+<style scoped>
|
|
|
+ .content_msg{
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
</style>
|