|
@@ -88,13 +88,27 @@
|
|
|
v-if="dialogNoticeVisible"
|
|
|
:before-close="dialogClose"
|
|
|
:visible.sync="dialogNoticeVisible"
|
|
|
- :close-on-click-modal="true"
|
|
|
+ :close-on-click-modal="false"
|
|
|
:append-to-body="true">
|
|
|
+ <el-button type="danger"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ size="mini"
|
|
|
+ @click="delMsgAllEvent"
|
|
|
+ style="float: right;margin-bottom: 10px;">清空</el-button>
|
|
|
+ <el-button icon="el-icon-delete"
|
|
|
+ size="mini"
|
|
|
+ @click="multipleDelMsgEvent"
|
|
|
+ style="float: right;margin-bottom: 10px; margin-right: 10px;">批量删除</el-button>
|
|
|
<el-table
|
|
|
:data="tableNoticeData" border :stripe="true"
|
|
|
@sort-change="sortChange"
|
|
|
:header-cell-style="{background: '#E8E8E8'}"
|
|
|
- style="width: 100%; height: calc(100% - 50px); overflow: auto;">
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ style="width: 100%; height: calc(100% - 100px); overflow: auto;">
|
|
|
+ <el-table-column
|
|
|
+ type="selection"
|
|
|
+ width="55">
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="序号" align="center" width="80">
|
|
|
<template slot-scope="scope">
|
|
|
{{ scope.$index + 1 }}
|
|
@@ -106,6 +120,15 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" sortable label="报警时间" prop="createTime" width="200">
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="操作" align="center" width="300">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text"
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ style="color: red;"
|
|
|
+ @click="handleDelete(scope.$index, scope.row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
<el-pagination
|
|
|
style="margin-top: 20px;"
|
|
@@ -128,6 +151,7 @@ import {getPubKey} from '@/utils/auth'
|
|
|
import {encrypt} from '@/utils/jsencrypt'
|
|
|
import {customCompare, showAlertWin, showLoading} from '@/utils/cqcy'
|
|
|
import {getAllMessageNotice} from "@/api/basic";
|
|
|
+import {clearMessage, delDataModelById, deleteMessageNoticeById, delMesNotByIdList} from "@/api/datasource";
|
|
|
|
|
|
let pkg = require('../../../package.json')
|
|
|
|
|
@@ -155,6 +179,7 @@ export default {
|
|
|
tablePage: 1,
|
|
|
tableLimit: 10,
|
|
|
tableTotal: 0,
|
|
|
+ multipleSelectionMsg: [],
|
|
|
userPwdForm: {
|
|
|
password: '',
|
|
|
newPassword: '',
|
|
@@ -320,6 +345,90 @@ export default {
|
|
|
}).catch(() => {
|
|
|
});
|
|
|
},
|
|
|
+ /** 删除报警信息 */
|
|
|
+ handleDelete(index, row) {
|
|
|
+ this.$confirm('您确定要删除该报警信息吗?', '温馨提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ customClass: 'close_confirm',
|
|
|
+ closeOnClickModal: false
|
|
|
+ }).then(() => {
|
|
|
+ const loading = showLoading(this, '删除中,请稍候···')
|
|
|
+ deleteMessageNoticeById(row.id).then(res => {
|
|
|
+ loading.close()
|
|
|
+ this.$message({
|
|
|
+ message: '删除成功!',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.tablePage = 1
|
|
|
+ this.getWarnInfo()
|
|
|
+ }).catch((e) => {
|
|
|
+ loading.close()
|
|
|
+ showAlertWin(this, e)
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /** 表格选择事件 */
|
|
|
+ handleSelectionChange(val) {
|
|
|
+ this.multipleSelectionMsg = val
|
|
|
+ },
|
|
|
+ /** 批量删除报警信息 */
|
|
|
+ multipleDelMsgEvent() {
|
|
|
+ if (this.multipleSelectionMsg.length == 0) {
|
|
|
+ this.$message({
|
|
|
+ message: '请至少选择一项报警信息',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$confirm('您确定要删除选中的' + this.multipleSelectionMsg.length + '条报警信息吗?', '温馨提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ customClass: 'close_confirm',
|
|
|
+ closeOnClickModal: false
|
|
|
+ }).then(() => {
|
|
|
+ const loading = showLoading(this, '删除中,请稍候···')
|
|
|
+ let ids = Array.from(this.multipleSelectionMsg, ({ id }) => id)
|
|
|
+ delMesNotByIdList(ids).then(res => {
|
|
|
+ loading.close()
|
|
|
+ this.$message({
|
|
|
+ message: '删除成功!',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.tablePage = 1
|
|
|
+ this.getWarnInfo()
|
|
|
+ }).catch((e) => {
|
|
|
+ loading.close()
|
|
|
+ showAlertWin(this, e)
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /** 清空所有消息 */
|
|
|
+ delMsgAllEvent() {
|
|
|
+ this.$confirm('清除后不可恢复,您确定要继续吗?', '温馨提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ customClass: 'close_confirm',
|
|
|
+ closeOnClickModal: false
|
|
|
+ }).then(() => {
|
|
|
+ const loading = showLoading(this, '清除中,请稍候···')
|
|
|
+ clearMessage().then(res => {
|
|
|
+ loading.close()
|
|
|
+ this.$message({
|
|
|
+ message: '清除成功!',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.tablePage = 1
|
|
|
+ this.getWarnInfo()
|
|
|
+ }).catch((e) => {
|
|
|
+ loading.close()
|
|
|
+ showAlertWin(this, e)
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ })
|
|
|
+ },
|
|
|
/** 弹出层关闭事件 */
|
|
|
dialogClose(done) {
|
|
|
if (this.$refs['userPwdForm'])
|