统计分析
This commit is contained in:
@@ -4,15 +4,25 @@
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
|
||||
<div class="search">
|
||||
<div class="sl">
|
||||
<el-form-item label="消息内容" prop="mesContent">
|
||||
<el-form-item label="消息内容" prop="content">
|
||||
<el-input
|
||||
v-model="queryParams.mesContent"
|
||||
v-model="queryParams.content"
|
||||
placeholder="请输入消息内容"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="states">
|
||||
<el-select v-model="queryParams.states" placeholder="状态" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.msg_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="sr">
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
@@ -22,40 +32,18 @@
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="lrtt">
|
||||
<div class="lt">
|
||||
<el-input
|
||||
v-model="deptName"
|
||||
placeholder="请输入部门名称"
|
||||
clearable
|
||||
size="small"
|
||||
prefix-icon="el-icon-search"
|
||||
style="margin-bottom: 20px"
|
||||
/>
|
||||
<div class="divide"></div><!--divide 分隔-->
|
||||
<el-tree
|
||||
:data="deptOptions"
|
||||
:props="defaultProps"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
ref="tree"
|
||||
node-key="id"
|
||||
default-expand-all
|
||||
highlight-current
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</div><!--lt 左-->
|
||||
<div class="rt">
|
||||
<div class="operate">
|
||||
<el-button type="primary" @click="markRead(null)">全部标记已读</el-button>
|
||||
<el-button type="primary" @click="setAllMarkedRead">全部标记已读</el-button>
|
||||
</div><!--operate 操作按钮-->
|
||||
<el-table v-loading="loading" :data="tableList">
|
||||
<el-table-column label="消息内容" prop="msgContent" min-width="120" />
|
||||
<el-table-column label="接收时间" prop="msgRecTime" :show-overflow-tooltip="true" min-width="120"/>
|
||||
<el-table-column label="消息状态" prop="msgStatus" :show-overflow-tooltip="true" min-width="80" >
|
||||
<el-table-column label="消息内容" prop="content" min-width="120" />
|
||||
<el-table-column label="接收时间" prop="createTime" :show-overflow-tooltip="true" min-width="120"/>
|
||||
<el-table-column label="消息状态" prop="states" :show-overflow-tooltip="true" min-width="80" >
|
||||
<template v-slot="{ row }">
|
||||
<template v-for="dict in dict.type.msg_status">
|
||||
<!-- {{ dict }} -->
|
||||
<el-tag :type="dict.raw.listClass" v-if="row.msgStatus == dict.value" :key="dict.value">{{ dict.label }}</el-tag>
|
||||
<el-tag :type="dict.raw.listClass" v-if="row.states == dict.value" :key="dict.value">{{ dict.label }}</el-tag>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -64,8 +52,8 @@
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
v-if="row.msgStatus === 'unread'"
|
||||
@click="markRead(row.id)"
|
||||
v-if="row.states == '1'"
|
||||
@click="markRead(row)"
|
||||
>标记已读</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -83,7 +71,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { markAllRead, markReadById, getMessageList } from "@/api/message/message"
|
||||
import { listMessage, getMessage, delMessage, addMessage, updateMessage,allMarkedRead } from "@/api/message/message"
|
||||
import { deptTreeSelect } from "@/api/system/user";
|
||||
|
||||
export default {
|
||||
@@ -128,7 +116,8 @@ export default {
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
mesContent: ''
|
||||
content: '',
|
||||
states: '',
|
||||
},
|
||||
};
|
||||
},
|
||||
@@ -145,7 +134,8 @@ export default {
|
||||
},
|
||||
getList() {
|
||||
this.loading = true
|
||||
getMessageList(this.queryParams).then(response => {
|
||||
this.$set(this.queryParams,"createById", this.$store.getters.userId)
|
||||
listMessage(this.queryParams).then(response => {
|
||||
this.total = response?.total
|
||||
this.tableList = response?.rows || []
|
||||
this.loading = false
|
||||
@@ -176,24 +166,41 @@ export default {
|
||||
* 标记已读:id为null时表示标记全部已读
|
||||
* @param id
|
||||
*/
|
||||
markRead(id) {
|
||||
this.$confirm('确认标记已读吗?', '提示', {
|
||||
markRead(row) {
|
||||
let self = this
|
||||
self.$confirm('确认标记已读吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if(id) {
|
||||
markReadById(id).then(response => {
|
||||
this.$modal.msgSuccess(response?.msg || '操作成功')
|
||||
this.getList();
|
||||
})
|
||||
} else {
|
||||
markAllRead().then(response => {
|
||||
this.$modal.msgSuccess(response?.msg || '操作成功')
|
||||
this.getList();
|
||||
let formData = JSON.parse(JSON.stringify(row))
|
||||
self.$set(formData, "states", 2)
|
||||
updateMessage(formData).then(response => {
|
||||
self.$modal.msgSuccess(response?.msg || '操作成功')
|
||||
self.getList();
|
||||
})
|
||||
}).catch((err) => {console.error(err)});
|
||||
},
|
||||
|
||||
/**
|
||||
* 标记已读:id为null时表示标记全部已读
|
||||
* @param id
|
||||
*/
|
||||
setAllMarkedRead() {
|
||||
let self = this
|
||||
self.$confirm('确认全部标记已读吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
let formData = {
|
||||
"states": 2
|
||||
}
|
||||
}).catch(() => {});
|
||||
allMarkedRead(formData).then(response => {
|
||||
self.$modal.msgSuccess(response?.msg || '操作成功')
|
||||
self.getList();
|
||||
})
|
||||
}).catch((err) => {console.error(err)});
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user