联调 在线监测 页面 修改云效问题
This commit is contained in:
@@ -1,13 +1,33 @@
|
||||
<template>
|
||||
<!-- <div>1 监测点信息 发起预告警单 </div> -->
|
||||
|
||||
<TableHeader area datePicker nextFlag ref="TableHeaderRef">
|
||||
<TableHeader datePicker nextFlag ref="TableHeaderRef">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="区域">
|
||||
<Area ref="areaRef" v-model="tableStore.table.params.deptId" @changeValue="changeArea" />
|
||||
</el-form-item>
|
||||
<el-form-item label="超标指标">
|
||||
<el-select v-model="tableStore.table.params.targetId" clearable placeholder="请选择超标指标">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.targetList"
|
||||
clearable
|
||||
multiple
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
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-switch
|
||||
v-model="tableStore.table.params.dataType"
|
||||
inline-prompt
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
active-text="超标数据"
|
||||
inactive-text="无数据"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="预警阈值">
|
||||
<!-- <el-input v-model="tableStore.table.params.alertThreshold" placeholder="请输入预警阈值" clearable></el-input> -->
|
||||
<el-input-number
|
||||
@@ -27,33 +47,58 @@
|
||||
@change="changeAlarm"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="搜索">
|
||||
<el-input
|
||||
v-model="tableStore.table.params.searchValue"
|
||||
placeholder="输入变电站、终端、监测点名称"
|
||||
clearable
|
||||
></el-input>
|
||||
</el-form-item> -->
|
||||
</template>
|
||||
<template #operation v-if="flag == '2'">
|
||||
<el-button icon="el-icon-Plus" type="primary" @click="launch('发起预警单')">发起预警单</el-button>
|
||||
<el-button icon="el-icon-Plus" type="primary" @click="launch('发起告警单')">发起告警单</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
<!-- /告警单 -->
|
||||
<alarmList ref="alarmListRef" @onSubmit="tableStore.index()" />
|
||||
<!-- 详情 -->
|
||||
<detail ref="detailRef" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Area from '@/components/form/area/index.vue'
|
||||
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 { handleWarningAlarmFlag } from '@/api/process-boot/electricitymanagement'
|
||||
// Steady_Statis
|
||||
import alarmList from './form/alarmList.vue'
|
||||
import detail from './form/detail.vue'
|
||||
const dictData = useDictData()
|
||||
|
||||
//字典获取超标指标
|
||||
const exceeded = dictData.getBasicData('Steady_Statis')
|
||||
const tableRef = ref()
|
||||
const industry = dictData.getBasicData('Business_Type')
|
||||
const TableHeaderRef = ref()
|
||||
|
||||
const alarmListRef = ref()
|
||||
const detailRef = ref()
|
||||
const list: any = ref({
|
||||
deptId: '',
|
||||
searchBeginTime: '',
|
||||
searchEndTime: ''
|
||||
})
|
||||
const level: any = ref(dictData.state.area[0]?.level)
|
||||
const flag = ref('')
|
||||
const tableStore = new TableStore({
|
||||
url: '/supervision-boot/onlineMonitor/list',
|
||||
publicHeight: 65,
|
||||
method: 'POST',
|
||||
// isWebPaging:true,
|
||||
column: [
|
||||
{ title: '', type: 'checkbox', width: 40 },
|
||||
{
|
||||
title: '序号',
|
||||
type: 'seq',
|
||||
@@ -63,9 +108,11 @@ const tableStore = new TableStore({
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ field: 'dept', title: '负责单位' },
|
||||
{ field: 'substation', title: '变电站名称' },
|
||||
{ field: 'lineName', title: '监测点名称' },
|
||||
{ field: 'deviceName', title: '终端名称' },
|
||||
{ field: 'lineName', title: '监测点名称' },
|
||||
|
||||
{
|
||||
field: 'businessType',
|
||||
title: '监测对象类型',
|
||||
@@ -75,21 +122,20 @@ const tableStore = new TableStore({
|
||||
}
|
||||
},
|
||||
{ field: 'objectName', title: '监测对象名称' },
|
||||
{ field: 'dept', title: '负责单位' },
|
||||
{
|
||||
field: 'dataResource',
|
||||
title: '数据来源',
|
||||
render: 'tag',
|
||||
custom: {
|
||||
0: 'primary',
|
||||
1: 'success'
|
||||
},
|
||||
replaceValue: {
|
||||
0: '系统默认',
|
||||
1: '自定义'
|
||||
field: 'targetType',
|
||||
title: '指标类型',
|
||||
formatter: (row: any) => {
|
||||
return exceeded.find((item: any) => item.id == row.cellValue)?.name || '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'overLimitDay',
|
||||
title: '累计超标天数',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue != null ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{ field: 'overLimitDay', title: '累计超标天数' },
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
@@ -100,70 +146,87 @@ const tableStore = new TableStore({
|
||||
buttons: [
|
||||
{
|
||||
name: 'productSetting',
|
||||
title: '发起告警单',
|
||||
type: 'warning',
|
||||
disabled: row => {
|
||||
return row.overLimitDay < tableStore.table.params.alarmThreshold
|
||||
},
|
||||
title: '查看详情',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
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()
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '发起预警单',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Open',
|
||||
disabled: row => {
|
||||
return row.overLimitDay >= tableStore.table.params.alarmThreshold
|
||||
},
|
||||
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()
|
||||
click: row => {
|
||||
detailRef.value.open({
|
||||
text: '详情',
|
||||
form: list.value
|
||||
})
|
||||
}
|
||||
}
|
||||
// {
|
||||
// name: 'productSetting',
|
||||
// title: '发起告警单',
|
||||
// type: 'warning',
|
||||
// disabled: row => {
|
||||
// return row.overLimitDay < tableStore.table.params.alarmThreshold
|
||||
// },
|
||||
// icon: 'el-icon-EditPen',
|
||||
// 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()
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// name: 'edit',
|
||||
// title: '发起预警单',
|
||||
// type: 'primary',
|
||||
// icon: 'el-icon-Open',
|
||||
// disabled: row => {
|
||||
// return row.overLimitDay >= tableStore.table.params.alarmThreshold
|
||||
// },
|
||||
// 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()
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
]
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.deptId = tableStore.table.params.deptIndex
|
||||
tableStore.table.params.currentPage = tableStore.table.params.pageNum
|
||||
list.value.deptId = tableStore.table.params.deptId
|
||||
list.value.searchBeginTime = tableStore.table.params.searchBeginTime
|
||||
list.value.searchEndTime = tableStore.table.params.searchEndTime
|
||||
flag.value = level.value
|
||||
},
|
||||
loadCallback: () => {
|
||||
// tableStore.table.data = [
|
||||
@@ -187,9 +250,10 @@ const tableStore = new TableStore({
|
||||
}
|
||||
})
|
||||
tableStore.table.params.alertThreshold = 10
|
||||
|
||||
tableStore.table.params.alarmThreshold = 15
|
||||
// tableStore.table.params.targetId = ''
|
||||
tableStore.table.params.targetList = []
|
||||
tableStore.table.params.dataType = '1'
|
||||
tableStore.table.params.deptId = dictData.state.area[0].id
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {
|
||||
@@ -215,6 +279,22 @@ const changeAlarm = e => {
|
||||
}
|
||||
}
|
||||
}
|
||||
// 发起预警单
|
||||
const launch = (title: string) => {
|
||||
if (tableStore.table.selection.length == 0) {
|
||||
ElMessage.warning('请选择一条数据')
|
||||
return
|
||||
}
|
||||
|
||||
alarmListRef.value.open({
|
||||
text: title,
|
||||
form: list.value,
|
||||
row: tableStore.table.selection
|
||||
})
|
||||
}
|
||||
const changeArea = e => {
|
||||
level.value = e.data.level
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
Reference in New Issue
Block a user