diff --git a/src/views/alarmManage/components/HandlePrompt.vue b/src/views/alarmManage/components/HandlePrompt.vue index 31b5587..a4f9553 100644 --- a/src/views/alarmManage/components/HandlePrompt.vue +++ b/src/views/alarmManage/components/HandlePrompt.vue @@ -47,6 +47,7 @@ jobStatus: '', // 工单状态 handleMessage: '' // 原因 }, + isBatch: false, // 是不是批量删除 dialogVisible: false, closeReasons: [{ value: '4', @@ -65,11 +66,13 @@ methods: { // 初始化对话框 initDialog: function(dialogFormVisible, jobId, isBatch, params) { + debugger this.dialogVisible = dialogFormVisible + this.isBatch = isBatch if (isBatch) { this.formData.keywords = params.keywords - this.formData.alarmType = params.alarmTpe - this.formData.alarmContent = params.alarmContent + this.formData.alarmType = params.alarmType + this.formData.alarmContent = params.alarmContentType this.formData.beginTime = params.beginTime this.formData.endTime = params.endTime } else { diff --git a/src/views/alarmManage/components/HandlePrompt.vue b/src/views/alarmManage/components/HandlePrompt.vue index 31b5587..a4f9553 100644 --- a/src/views/alarmManage/components/HandlePrompt.vue +++ b/src/views/alarmManage/components/HandlePrompt.vue @@ -47,6 +47,7 @@ jobStatus: '', // 工单状态 handleMessage: '' // 原因 }, + isBatch: false, // 是不是批量删除 dialogVisible: false, closeReasons: [{ value: '4', @@ -65,11 +66,13 @@ methods: { // 初始化对话框 initDialog: function(dialogFormVisible, jobId, isBatch, params) { + debugger this.dialogVisible = dialogFormVisible + this.isBatch = isBatch if (isBatch) { this.formData.keywords = params.keywords - this.formData.alarmType = params.alarmTpe - this.formData.alarmContent = params.alarmContent + this.formData.alarmType = params.alarmType + this.formData.alarmContent = params.alarmContentType this.formData.beginTime = params.beginTime this.formData.endTime = params.endTime } else { diff --git a/src/views/alarmManage/listAlarmNow.vue b/src/views/alarmManage/listAlarmNow.vue index 7563fbb..49713f4 100644 --- a/src/views/alarmManage/listAlarmNow.vue +++ b/src/views/alarmManage/listAlarmNow.vue @@ -7,7 +7,7 @@ - + 批量消警 - + @@ -89,6 +90,7 @@ import infoWell from '@/views/wellManage/infoWell' import { getAlarmList, batchExportAlarm, getAlarmType, getAlarmContentType } from '@/api/alarm' import HandlePrompt from './components/HandlePrompt' +import { isOperation } from '@/utils/permission' export default { name: 'ListAlarmNow', @@ -130,6 +132,12 @@ align: 'center' }, { + text: '告警等级', + value: 'alarmLevel', + align: 'center', + level: true + }, + { text: '告警数值', value: 'alarmValue', width: 90, @@ -146,18 +154,18 @@ value: 'alarmTime', width: 170, align: 'center' - }, - { - text: '联系人', - value: 'staff', - align: 'center' - }, - { - text: '联系方式', - value: 'tel', - width: 110, - align: 'center' } + // { + // text: '联系人', + // value: 'staff', + // align: 'center' + // }, + // { + // text: '联系方式', + // value: 'tel', + // width: 110, + // align: 'center' + // } ], // 显示列 multipleSelection: [], // 多选选中项 list: [], // 列表数据 @@ -187,6 +195,7 @@ } }, watch: { + // 当告警各类型变化时,刷新告警内容列表 alarmType(val) { this.listQuery.alarmContentType = '' if (val && val !== '') { @@ -195,6 +204,7 @@ this.alarmContentTypeList = [] } }, + // 当时间范围变化时,填充listQuery时间 timeRange(val) { if (val && val.length > 0) { this.listQuery.beginTime = val[0] @@ -224,20 +234,37 @@ // 取消报警 cancelAlarm(jobId) { this.cancelShow = true - this.$refs.handlePrompt.initDialog(this.cancelShow, jobId, false) + // setTimeout(function() { + this.$refs.handlePrompt.initDialog(true, jobId, false) + // }, 100) }, // 取消报警,调用结束工单接口 batchCancel() { this.cancelShow = true - this.$refs.handlePrompt.initDialog(this.cancelShow, '', true, this.listQuery) + // setTimeout(function() { + this.$refs.handlePrompt.initDialog(true, '', true, this.listQuery) + // }, 100) }, - formatValue(row, column, cellValue) { - if (cellValue === '') { - return '--' + formatValue(cellValue) { + if (cellValue === 1) { + return '一级告警' + } else if (cellValue === 2) { + return '二级告警' + } else if (cellValue === 3) { + return '三级告警' } else { - return cellValue + return '' } }, + // 计算行样式,不同等级显示不同颜色,暂时不用了 + tableRowClassName({ row, rowIndex }) { + // if (row.alarmLevel === 1) { + // return 'red-row' + // } else if (row.alarmLevel === 2) { + // return 'yellow-row' + // } + return '' + }, // 显示窨井详情 showWellDetail(row) { this.wellShow = true @@ -292,8 +319,9 @@ fetchAlarmType() { getAlarmType().then(response => { this.alarmTypeList = response.data - if (this.alarmTypeList.length <= 1) { + if (!isOperation()) { // 如果不是管理员和运维人员 this.showAlarmType = false + this.listQuery.alarmType = '1' } }) }, @@ -357,3 +385,16 @@ color:red } + diff --git a/src/views/alarmManage/components/HandlePrompt.vue b/src/views/alarmManage/components/HandlePrompt.vue index 31b5587..a4f9553 100644 --- a/src/views/alarmManage/components/HandlePrompt.vue +++ b/src/views/alarmManage/components/HandlePrompt.vue @@ -47,6 +47,7 @@ jobStatus: '', // 工单状态 handleMessage: '' // 原因 }, + isBatch: false, // 是不是批量删除 dialogVisible: false, closeReasons: [{ value: '4', @@ -65,11 +66,13 @@ methods: { // 初始化对话框 initDialog: function(dialogFormVisible, jobId, isBatch, params) { + debugger this.dialogVisible = dialogFormVisible + this.isBatch = isBatch if (isBatch) { this.formData.keywords = params.keywords - this.formData.alarmType = params.alarmTpe - this.formData.alarmContent = params.alarmContent + this.formData.alarmType = params.alarmType + this.formData.alarmContent = params.alarmContentType this.formData.beginTime = params.beginTime this.formData.endTime = params.endTime } else { diff --git a/src/views/alarmManage/listAlarmNow.vue b/src/views/alarmManage/listAlarmNow.vue index 7563fbb..49713f4 100644 --- a/src/views/alarmManage/listAlarmNow.vue +++ b/src/views/alarmManage/listAlarmNow.vue @@ -7,7 +7,7 @@ - + 批量消警 - + @@ -89,6 +90,7 @@ import infoWell from '@/views/wellManage/infoWell' import { getAlarmList, batchExportAlarm, getAlarmType, getAlarmContentType } from '@/api/alarm' import HandlePrompt from './components/HandlePrompt' +import { isOperation } from '@/utils/permission' export default { name: 'ListAlarmNow', @@ -130,6 +132,12 @@ align: 'center' }, { + text: '告警等级', + value: 'alarmLevel', + align: 'center', + level: true + }, + { text: '告警数值', value: 'alarmValue', width: 90, @@ -146,18 +154,18 @@ value: 'alarmTime', width: 170, align: 'center' - }, - { - text: '联系人', - value: 'staff', - align: 'center' - }, - { - text: '联系方式', - value: 'tel', - width: 110, - align: 'center' } + // { + // text: '联系人', + // value: 'staff', + // align: 'center' + // }, + // { + // text: '联系方式', + // value: 'tel', + // width: 110, + // align: 'center' + // } ], // 显示列 multipleSelection: [], // 多选选中项 list: [], // 列表数据 @@ -187,6 +195,7 @@ } }, watch: { + // 当告警各类型变化时,刷新告警内容列表 alarmType(val) { this.listQuery.alarmContentType = '' if (val && val !== '') { @@ -195,6 +204,7 @@ this.alarmContentTypeList = [] } }, + // 当时间范围变化时,填充listQuery时间 timeRange(val) { if (val && val.length > 0) { this.listQuery.beginTime = val[0] @@ -224,20 +234,37 @@ // 取消报警 cancelAlarm(jobId) { this.cancelShow = true - this.$refs.handlePrompt.initDialog(this.cancelShow, jobId, false) + // setTimeout(function() { + this.$refs.handlePrompt.initDialog(true, jobId, false) + // }, 100) }, // 取消报警,调用结束工单接口 batchCancel() { this.cancelShow = true - this.$refs.handlePrompt.initDialog(this.cancelShow, '', true, this.listQuery) + // setTimeout(function() { + this.$refs.handlePrompt.initDialog(true, '', true, this.listQuery) + // }, 100) }, - formatValue(row, column, cellValue) { - if (cellValue === '') { - return '--' + formatValue(cellValue) { + if (cellValue === 1) { + return '一级告警' + } else if (cellValue === 2) { + return '二级告警' + } else if (cellValue === 3) { + return '三级告警' } else { - return cellValue + return '' } }, + // 计算行样式,不同等级显示不同颜色,暂时不用了 + tableRowClassName({ row, rowIndex }) { + // if (row.alarmLevel === 1) { + // return 'red-row' + // } else if (row.alarmLevel === 2) { + // return 'yellow-row' + // } + return '' + }, // 显示窨井详情 showWellDetail(row) { this.wellShow = true @@ -292,8 +319,9 @@ fetchAlarmType() { getAlarmType().then(response => { this.alarmTypeList = response.data - if (this.alarmTypeList.length <= 1) { + if (!isOperation()) { // 如果不是管理员和运维人员 this.showAlarmType = false + this.listQuery.alarmType = '1' } }) }, @@ -357,3 +385,16 @@ color:red } + diff --git a/src/views/jobManage/detailJob.vue b/src/views/jobManage/detailJob.vue index de8c382..9614347 100644 --- a/src/views/jobManage/detailJob.vue +++ b/src/views/jobManage/detailJob.vue @@ -1,6 +1,6 @@