2022-06-08 14:51:11 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="fullHeight pages">
|
2022-08-12 11:36:52 +08:00
|
|
|
|
<!-- :showR="true" -->
|
2022-06-08 14:51:11 +08:00
|
|
|
|
<!-- <vhead :titleName="'消息中心'"></vhead> -->
|
|
|
|
|
|
<div class="pageContainer">
|
|
|
|
|
|
<div class="pageDataContainer">
|
|
|
|
|
|
<div class="searchBox whiteBlock">
|
2022-08-12 11:36:52 +08:00
|
|
|
|
<el-form :inline="true" size="medium" :model="searchForm" ref="searchForm">
|
|
|
|
|
|
<!-- '标题' -->
|
|
|
|
|
|
<el-form-item :label="$t('message.messageCenter.title')" prop="title" class="last">
|
2022-06-08 14:51:11 +08:00
|
|
|
|
<el-input
|
|
|
|
|
|
v-model="searchForm.title"
|
2022-08-12 11:36:52 +08:00
|
|
|
|
:placeholder="$t('message.docManage.dialog_file_renaming.placeholder')"
|
2022-06-08 14:51:11 +08:00
|
|
|
|
clearable
|
|
|
|
|
|
></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<!-- '消息类型' -->
|
2022-08-12 11:36:52 +08:00
|
|
|
|
<el-form-item :label="$t('message.messageCenter.messageType')" prop="title" class="last">
|
2022-06-08 14:51:11 +08:00
|
|
|
|
<el-select v-model="searchForm.type" :placeholder="$t('message.messageCenter.placeholderText')">
|
|
|
|
|
|
<!-- 全部 -->
|
2022-08-12 11:36:52 +08:00
|
|
|
|
<el-option :label="$t('message.messageCenter.all')" value=""> </el-option>
|
|
|
|
|
|
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
|
|
|
|
|
<el-date-picker
|
2022-08-12 11:36:52 +08:00
|
|
|
|
v-model="timeData"
|
|
|
|
|
|
type="daterange"
|
|
|
|
|
|
value-format="yyyy-MM-dd"
|
|
|
|
|
|
:range-separator="$t('message.messageCenter.to')"
|
|
|
|
|
|
:start-placeholder="$t('message.messageCenter.startTime')"
|
|
|
|
|
|
:end-placeholder="$t('message.messageCenter.endTime')"
|
|
|
|
|
|
>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</el-date-picker>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
2022-08-12 11:36:52 +08:00
|
|
|
|
<el-button type="primary" plain @click="getListData">{{ $t('message.docManage.query') }}</el-button>
|
|
|
|
|
|
<el-button type="warning" plain @click="resetForm">{{ $t('message.docManage.refresh') }}</el-button>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
<!-- 一键清空消息 -->
|
2022-08-12 11:36:52 +08:00
|
|
|
|
<el-button type="danger" plain @click="clearAllFn">{{ $t('message.messageCenter.allClearMsg') }}</el-button>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<el-row :gutter="25">
|
|
|
|
|
|
<el-col :span="6" v-for="(item, index) in tableData" :key="index">
|
|
|
|
|
|
<div class="whiteBlock fileContent">
|
2022-08-12 11:36:52 +08:00
|
|
|
|
<img class="imgs" v-if="item.imageUrl" :src="item.imageUrl" :preview="item.imageUrl" />
|
2022-06-08 14:51:11 +08:00
|
|
|
|
<div class="msgBox">
|
|
|
|
|
|
<p class="title">
|
|
|
|
|
|
<!-- 标题 -->
|
2022-08-12 11:36:52 +08:00
|
|
|
|
{{ $t('message.messageCenter.title') }}:{{ item.title }}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</p>
|
|
|
|
|
|
<p class="content">
|
|
|
|
|
|
<!-- 内容 -->
|
2022-08-12 11:36:52 +08:00
|
|
|
|
{{ $t('message.messageCenter.content') }}:{{ item.msg }}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</p>
|
|
|
|
|
|
<p class="time">
|
|
|
|
|
|
<!-- 发送时间 -->
|
2022-08-12 11:36:52 +08:00
|
|
|
|
{{ $t('message.messageCenter.sendTime') }}:{{ item.sendTime }}
|
|
|
|
|
|
</p>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<!-- <div class="right">
|
|
|
|
|
|
<img src="@/assets/images/eye.png" @click="viewFn(item)" />
|
|
|
|
|
|
<img src="@/assets/images/download.png" @click="downFn(item)" />
|
|
|
|
|
|
</div> -->
|
|
|
|
|
|
<i class="el-icon-close" @click="deleteNotice(item)"></i>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
2022-08-12 11:36:52 +08:00
|
|
|
|
<div class="placeholderBox" v-show="tableData.length == 0">
|
|
|
|
|
|
<img src="@/assets/images/noData.png" />
|
|
|
|
|
|
<!-- 暂无消息 -->
|
|
|
|
|
|
<p>{{ $t('message.messageCenter.noMsg') }}</p>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</div>
|
2022-08-12 11:36:52 +08:00
|
|
|
|
<el-pagination
|
|
|
|
|
|
v-show="tableData.length > 0"
|
2022-06-08 14:51:11 +08:00
|
|
|
|
class="pagerBox"
|
|
|
|
|
|
@size-change="handleSizeChange"
|
|
|
|
|
|
@current-change="handleCurrentChange"
|
|
|
|
|
|
:current-page="pageNo"
|
|
|
|
|
|
:page-sizes="[20, 30, 50]"
|
|
|
|
|
|
:page-size="pageSize"
|
|
|
|
|
|
layout="total, sizes, prev, pager, next"
|
|
|
|
|
|
:total="total"
|
|
|
|
|
|
background
|
|
|
|
|
|
></el-pagination>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<script>
|
2022-08-12 11:36:52 +08:00
|
|
|
|
import { getNoticeListApi, cleanAllNoticeApi, deleteNoticeApi } from '@/assets/js/api/company/project'
|
2022-06-08 14:51:11 +08:00
|
|
|
|
// import vhead from "@/components/header";
|
|
|
|
|
|
export default {
|
|
|
|
|
|
// components: { vhead },
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
searchForm: {
|
2022-08-12 11:36:52 +08:00
|
|
|
|
title: '',
|
|
|
|
|
|
type: ''
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
2022-08-12 11:36:52 +08:00
|
|
|
|
timeData: '',
|
2022-06-08 14:51:11 +08:00
|
|
|
|
total: 0,
|
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
|
pageSize: 20,
|
|
|
|
|
|
tableData: [],
|
2022-08-03 10:46:20 +08:00
|
|
|
|
// options:[{
|
|
|
|
|
|
// label: "防疫人员通知",
|
2022-08-12 18:07:14 +08:00
|
|
|
|
// value: "17"
|
2022-08-09 11:56:36 +08:00
|
|
|
|
// },{
|
2022-08-03 10:46:20 +08:00
|
|
|
|
// label: "访客通知",
|
2022-08-12 18:07:14 +08:00
|
|
|
|
// value: "18"
|
2022-08-03 10:46:20 +08:00
|
|
|
|
// }],
|
2022-08-12 18:07:14 +08:00
|
|
|
|
options:[{
|
|
|
|
|
|
label: "高空火警",
|
|
|
|
|
|
value: "8"
|
|
|
|
|
|
},{
|
|
|
|
|
|
label: "考勤提醒",
|
|
|
|
|
|
value: "1"
|
|
|
|
|
|
},{
|
|
|
|
|
|
label: "防疫人员通知",
|
|
|
|
|
|
value: "2"
|
|
|
|
|
|
},{
|
|
|
|
|
|
label: "防疫车辆通知",
|
|
|
|
|
|
value: "3"
|
|
|
|
|
|
},{
|
|
|
|
|
|
label: "访客通知",
|
|
|
|
|
|
value: "16"
|
|
|
|
|
|
},{
|
|
|
|
|
|
label: "混凝土监测",
|
|
|
|
|
|
value: "4"
|
|
|
|
|
|
},{
|
|
|
|
|
|
label: "卸料平台",
|
|
|
|
|
|
value: "5"
|
|
|
|
|
|
},{
|
|
|
|
|
|
label: "配电箱",
|
|
|
|
|
|
value: "6"
|
|
|
|
|
|
},{
|
|
|
|
|
|
label: "扬尘",
|
|
|
|
|
|
value: "7"
|
|
|
|
|
|
},{
|
|
|
|
|
|
label: "标养室",
|
|
|
|
|
|
value: "9"
|
|
|
|
|
|
},{
|
|
|
|
|
|
label: "安全检查",
|
|
|
|
|
|
value: "10"
|
|
|
|
|
|
},{
|
|
|
|
|
|
label: "质量检查",
|
|
|
|
|
|
value: "11"
|
|
|
|
|
|
},{
|
|
|
|
|
|
label: "塔吊",
|
|
|
|
|
|
value: "12"
|
|
|
|
|
|
},{
|
|
|
|
|
|
label: "升降机",
|
|
|
|
|
|
value: "13"
|
|
|
|
|
|
},{
|
|
|
|
|
|
label: "电表",
|
|
|
|
|
|
value: "14"
|
|
|
|
|
|
},{
|
|
|
|
|
|
label: "水表",
|
|
|
|
|
|
value: "15"
|
|
|
|
|
|
}],
|
2022-06-08 14:51:11 +08:00
|
|
|
|
};
|
|
|
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
|
|
|
// '消息中心'
|
2022-08-12 11:36:52 +08:00
|
|
|
|
document.title = this.$t('message.messageCenter.msgCenter')
|
2022-06-08 14:51:11 +08:00
|
|
|
|
this.selectNowDate()
|
2022-08-12 11:36:52 +08:00
|
|
|
|
this.getListData()
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
// 获取当前时间 返回YYYY-MM-DD HH:mm:ss
|
2022-08-12 11:36:52 +08:00
|
|
|
|
selectNowDate() {
|
|
|
|
|
|
var date = new Date(),
|
|
|
|
|
|
year = date.getFullYear(),
|
|
|
|
|
|
month = date.getMonth() + 1,
|
|
|
|
|
|
day = date.getDate(),
|
|
|
|
|
|
hours = date.getHours(), //获取当前小时数(0-23)
|
|
|
|
|
|
minutes = date.getMinutes(), //获取当前分钟数(0-59)
|
|
|
|
|
|
seconds = date.getSeconds()
|
|
|
|
|
|
month >= 1 && month <= 9 ? (month = '0' + month) : ''
|
|
|
|
|
|
day >= 0 && day <= 9 ? (day = '0' + day) : ''
|
|
|
|
|
|
hours >= 0 && hours <= 9 ? (hours = '0' + hours) : ''
|
|
|
|
|
|
minutes >= 0 && minutes <= 9 ? (minutes = '0' + minutes) : ''
|
|
|
|
|
|
seconds >= 0 && seconds <= 9 ? (seconds = '0' + seconds) : ''
|
|
|
|
|
|
// var timer = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes+ ':' + seconds;
|
|
|
|
|
|
var timer = year + '-' + month + '-' + day
|
|
|
|
|
|
this.timeData = [timer, timer]
|
|
|
|
|
|
console.log(timer)
|
|
|
|
|
|
// return timer;
|
|
|
|
|
|
},
|
|
|
|
|
|
deleteNotice(val) {
|
2022-06-08 14:51:11 +08:00
|
|
|
|
console.log(val)
|
|
|
|
|
|
// '此操作将永久删除该消息, 是否继续?', '提示'
|
2022-08-12 11:36:52 +08:00
|
|
|
|
this.$confirm(this.$t('message.messageCenter.hintContent'), this.$t('message.messageCenter.hint'), {
|
|
|
|
|
|
confirmButtonText: this.$t('message.messageCenter.confirm'),
|
|
|
|
|
|
cancelButtonText: this.$t('message.messageCenter.cancel'),
|
|
|
|
|
|
type: 'warning'
|
|
|
|
|
|
})
|
|
|
|
|
|
.then(() => {
|
|
|
|
|
|
deleteNoticeApi({ id: val.id }).then(res => {
|
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
|
this.$message({
|
|
|
|
|
|
type: 'success',
|
|
|
|
|
|
message: this.$t('message.messageCenter.removeSuccess')
|
|
|
|
|
|
})
|
|
|
|
|
|
this.getListData()
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
})
|
2022-08-12 11:36:52 +08:00
|
|
|
|
})
|
|
|
|
|
|
.catch(() => {
|
2022-06-08 14:51:11 +08:00
|
|
|
|
this.$message({
|
|
|
|
|
|
type: 'info',
|
|
|
|
|
|
message: this.$t('message.messageCenter.cancelRemove')
|
2022-08-12 11:36:52 +08:00
|
|
|
|
})
|
|
|
|
|
|
})
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
2022-08-12 11:36:52 +08:00
|
|
|
|
clearAllFn() {
|
|
|
|
|
|
cleanAllNoticeApi({ userId: this.$store.state.userInfo.userId }).then(res => {
|
2022-06-08 14:51:11 +08:00
|
|
|
|
this.$message.success(res.message)
|
|
|
|
|
|
this.getListData()
|
2022-08-12 11:36:52 +08:00
|
|
|
|
})
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
//获取列表数据
|
|
|
|
|
|
getListData() {
|
2022-08-12 11:36:52 +08:00
|
|
|
|
let data = this.searchForm
|
|
|
|
|
|
if (this.timeData) {
|
2022-06-08 14:51:11 +08:00
|
|
|
|
data.startTime = this.timeData[0]
|
|
|
|
|
|
data.endTime = this.timeData[1]
|
2022-08-12 11:36:52 +08:00
|
|
|
|
} else {
|
2022-06-08 14:51:11 +08:00
|
|
|
|
data.startTime = ''
|
|
|
|
|
|
data.endTime = ''
|
|
|
|
|
|
}
|
2022-08-12 11:36:52 +08:00
|
|
|
|
data.pageNo = this.pageNo
|
|
|
|
|
|
data.pageSize = this.pageSize
|
|
|
|
|
|
data.accountId = this.$store.state.userInfo.userId
|
|
|
|
|
|
getNoticeListApi(data).then(res => {
|
|
|
|
|
|
console.log(res)
|
|
|
|
|
|
this.tableData = res.result.records
|
|
|
|
|
|
this.total = res.result.total
|
|
|
|
|
|
})
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
2022-08-12 11:36:52 +08:00
|
|
|
|
viewFn(item) {},
|
2022-06-08 14:51:11 +08:00
|
|
|
|
resetForm() {
|
2022-08-12 11:36:52 +08:00
|
|
|
|
this.$refs['searchForm'].resetFields()
|
|
|
|
|
|
this.getListData()
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
//查看条数
|
|
|
|
|
|
handleSizeChange(val) {
|
2022-08-12 11:36:52 +08:00
|
|
|
|
this.pageSize = val
|
|
|
|
|
|
this.getListData()
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
//查看页
|
|
|
|
|
|
handleCurrentChange(val) {
|
2022-08-12 11:36:52 +08:00
|
|
|
|
this.pageNo = val
|
|
|
|
|
|
this.getListData()
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
|
.fileContent {
|
|
|
|
|
|
border-radius: 3px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
2022-07-06 10:27:28 +08:00
|
|
|
|
height: 200px;
|
2022-06-08 14:51:11 +08:00
|
|
|
|
padding: 0 20px;
|
|
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
|
position: relative;
|
2022-08-12 11:36:52 +08:00
|
|
|
|
.el-icon-close {
|
2022-06-08 14:51:11 +08:00
|
|
|
|
position: absolute;
|
|
|
|
|
|
right: 10px;
|
|
|
|
|
|
top: 6px;
|
2022-08-12 11:36:52 +08:00
|
|
|
|
color: #f56c6c;
|
2022-06-08 14:51:11 +08:00
|
|
|
|
font-size: 18px;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
2022-08-12 11:36:52 +08:00
|
|
|
|
// justify-content: space-between;
|
|
|
|
|
|
// .right {
|
|
|
|
|
|
// display: flex;
|
|
|
|
|
|
// align-items: center;
|
|
|
|
|
|
// img {
|
|
|
|
|
|
// margin-left: 18px;
|
|
|
|
|
|
// cursor: pointer;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
.imgs {
|
2022-06-08 14:51:11 +08:00
|
|
|
|
width: 60px;
|
|
|
|
|
|
height: 60px;
|
|
|
|
|
|
margin-right: 10px;
|
2022-08-12 11:36:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
.msgBox {
|
|
|
|
|
|
.title {
|
|
|
|
|
|
font-size: 15px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.content {
|
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
opacity: 0.8;
|
|
|
|
|
|
margin-top: 3px;
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
2022-08-12 11:36:52 +08:00
|
|
|
|
.time {
|
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
opacity: 0.6;
|
|
|
|
|
|
margin-top: 3px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.pageContainer {
|
|
|
|
|
|
height: calc(100% - 61px);
|
2022-07-15 09:47:14 +08:00
|
|
|
|
overflow: auto;
|
|
|
|
|
|
|
2022-08-12 11:36:52 +08:00
|
|
|
|
/deep/.el-input__inner {
|
2022-06-08 14:51:11 +08:00
|
|
|
|
background: #fff;
|
|
|
|
|
|
color: #000;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|