联调 技术监督 草稿功能
This commit is contained in:
@@ -4,16 +4,29 @@
|
||||
<TableHeader area datePicker nextFlag ref="TableHeaderRef">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="超标指标">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.evaluateType"
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
placeholder="请选择超标指标"
|
||||
>
|
||||
<el-select v-model="tableStore.table.params.targetId" clearable placeholder="请选择超标指标">
|
||||
<el-option v-for="item in exceeded" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="预警阈值">
|
||||
<!-- <el-input v-model="tableStore.table.params.alertThreshold" placeholder="请输入预警阈值" clearable></el-input> -->
|
||||
<el-input-number
|
||||
v-model="tableStore.table.params.alertThreshold"
|
||||
:min="0"
|
||||
:step="1"
|
||||
step-strictly
|
||||
@change="changeAlert"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="告警阈值">
|
||||
<el-input-number
|
||||
v-model="tableStore.table.params.alarmThreshold"
|
||||
:min="0"
|
||||
:step="1"
|
||||
step-strictly
|
||||
@change="changeAlarm"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
@@ -25,19 +38,18 @@ import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ValueType } from 'exceljs'
|
||||
|
||||
import { handleWarningAlarmFlag } from '@/api/process-boot/electricitymanagement'
|
||||
// Steady_Statis
|
||||
const dictData = useDictData()
|
||||
//字典获取超标指标
|
||||
const exceeded = dictData.getBasicData('Indicator_Type')
|
||||
const exceeded = dictData.getBasicData('Steady_Statis')
|
||||
const tableRef = ref()
|
||||
const planAddRef = ref()
|
||||
const listFormRef = ref()
|
||||
const industry = dictData.getBasicData('Business_Type')
|
||||
const TableHeaderRef = ref()
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/harmonic-boot/rmppartharmonicdetail/getRMpPartHarmonicDetail',
|
||||
url: '/supervision-boot/onlineMonitor/list',
|
||||
publicHeight: 65,
|
||||
method: 'POST',
|
||||
// isWebPaging:true,
|
||||
@@ -51,34 +63,34 @@ const tableStore = new TableStore({
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ field: 'sustationName', title: '变电站名称', width: 170 },
|
||||
{ field: 'barName', title: '母线名称', width: 170 },
|
||||
{ field: 'dutyOrgName', title: '负责单位', minWidth: '150' },
|
||||
{ field: 'measurementPointName', title: '监测点名称', width: 170 },
|
||||
{ field: 'voltageLevel', title: '电压等级', width: 170 },
|
||||
{ field: 'loadType', title: '监测点对象类型', width: 170 },
|
||||
{ field: 'objName', title: '监测点对象名称', width: 170 },
|
||||
{ field: 'dateList', title: '超标天数详情', width: 170 },
|
||||
{ field: 'substation', title: '变电站名称' },
|
||||
{ field: 'lineName', title: '监测点名称' },
|
||||
{ field: 'deviceName', title: '终端名称' },
|
||||
{
|
||||
field: 'overLimitContinuous',
|
||||
title: '连续超标天数',
|
||||
width: 170
|
||||
},
|
||||
{
|
||||
field: 'overLimitDay',
|
||||
title: '超标天数',
|
||||
width: 170
|
||||
},
|
||||
{
|
||||
field: 'overLimitrate',
|
||||
title: '超标占比',
|
||||
width: 170,
|
||||
field: 'businessType',
|
||||
title: '监测对象类型',
|
||||
|
||||
formatter: (row: any) => {
|
||||
console.log(row.cellValue, row)
|
||||
let value = parseFloat(row.cellValue * 100).toFixed(2) + '%'
|
||||
return value
|
||||
return industry.find((item: any) => item.id == row.cellValue)?.name || '/'
|
||||
}
|
||||
},
|
||||
{ field: 'objectName', title: '监测对象名称' },
|
||||
{ field: 'dept', title: '负责单位' },
|
||||
{
|
||||
field: 'dataResource',
|
||||
title: '数据来源',
|
||||
render: 'tag',
|
||||
custom: {
|
||||
0: 'primary',
|
||||
1: 'success'
|
||||
},
|
||||
replaceValue: {
|
||||
0: '系统默认',
|
||||
1: '自定义'
|
||||
}
|
||||
},
|
||||
{ field: 'overLimitDay', title: '累计超标天数' },
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
width: '180',
|
||||
@@ -91,19 +103,26 @@ const tableStore = new TableStore({
|
||||
title: '发起告警单',
|
||||
type: 'warning',
|
||||
disabled: row => {
|
||||
return row.alarmFlag != 1
|
||||
return row.overLimitDay < tableStore.table.params.alarmThreshold
|
||||
},
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'confirmButton',
|
||||
popconfirm: {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonType: 'primary',
|
||||
title: '请确认发起告警单!'
|
||||
},
|
||||
click: row => {
|
||||
handleWarningAlarmFlag(row).then(res => {
|
||||
console.log(res)
|
||||
render: 'basicButton',
|
||||
|
||||
click: async row => {
|
||||
// handleWarningAlarmFlag(row).then(res => {
|
||||
// console.log(res)
|
||||
// ElMessage.success('发起告警单成功!')
|
||||
// tableStore.index()
|
||||
// })
|
||||
const { value } = await ElMessageBox.prompt('', '整改意见', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
|
||||
inputType: 'textarea',
|
||||
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
|
||||
inputErrorMessage: '请输入整改意见'
|
||||
})
|
||||
handleWarningAlarmFlag({ ...row, reformAdvice: value }).then(res => {
|
||||
ElMessage.success('发起告警单成功!')
|
||||
tableStore.index()
|
||||
})
|
||||
@@ -115,19 +134,25 @@ const tableStore = new TableStore({
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Open',
|
||||
disabled: row => {
|
||||
return row.warningFlag != 1
|
||||
},
|
||||
render: 'confirmButton',
|
||||
popconfirm: {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonType: 'primary',
|
||||
title: '请确认发起预警单!'
|
||||
return row.overLimitDay >= tableStore.table.params.alarmThreshold
|
||||
},
|
||||
render: 'basicButton',
|
||||
|
||||
click: row => {
|
||||
handleWarningAlarmFlag(row).then(res => {
|
||||
console.log(res)
|
||||
click: async row => {
|
||||
// handleWarningAlarmFlag(row).then(res => {
|
||||
// console.log(res)
|
||||
// ElMessage.success('发起预警单成功!')
|
||||
// tableStore.index()
|
||||
// })
|
||||
const { value } = await ElMessageBox.prompt('', '整改意见', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
|
||||
inputType: 'textarea',
|
||||
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
|
||||
inputErrorMessage: '请输入整改意见'
|
||||
})
|
||||
handleWarningAlarmFlag({ ...row, reformAdvice: value }).then(res => {
|
||||
ElMessage.success('发起预警单成功!')
|
||||
tableStore.index()
|
||||
})
|
||||
@@ -137,7 +162,7 @@ const tableStore = new TableStore({
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
|
||||
tableStore.table.params.deptId = tableStore.table.params.deptIndex
|
||||
tableStore.table.params.currentPage = tableStore.table.params.pageNum
|
||||
},
|
||||
loadCallback: () => {
|
||||
@@ -161,12 +186,35 @@ const tableStore = new TableStore({
|
||||
// ]
|
||||
}
|
||||
})
|
||||
tableStore.table.params.alertThreshold = 10
|
||||
|
||||
tableStore.table.params.alarmThreshold = 15
|
||||
// tableStore.table.params.targetId = ''
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
const changeAlert = e => {
|
||||
if (e == null) {
|
||||
tableStore.table.params.alertThreshold = 10
|
||||
} else {
|
||||
if (e > tableStore.table.params.alarmThreshold) {
|
||||
ElMessage.warning('预警阈值不能大于报警阈值')
|
||||
tableStore.table.params.alertThreshold = 10
|
||||
}
|
||||
}
|
||||
}
|
||||
const changeAlarm = e => {
|
||||
if (e == null) {
|
||||
tableStore.table.params.alarmThreshold = 15
|
||||
} else {
|
||||
if (e < tableStore.table.params.alertThreshold) {
|
||||
ElMessage.warning('报警阈值不能小于预警阈值')
|
||||
tableStore.table.params.alarmThreshold = 15
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
Reference in New Issue
Block a user