Commit 91831caa authored by 裴文涛's avatar 裴文涛
parents 086aeb08 99666f63
...@@ -62,8 +62,7 @@ ...@@ -62,8 +62,7 @@
</el-table> </el-table>
</el-card> </el-card>
<el-dialog @close="onClose" v-model="show" class="dialog" :show-scrollbar="true">
<el-dialog v-model="show" class="dialog" :show-scrollbar="true">
<div class="div-header"> <div class="div-header">
<el-form :inline="true"> <el-form :inline="true">
<el-form-item label="查询类型:"> <el-form-item label="查询类型:">
...@@ -81,15 +80,15 @@ ...@@ -81,15 +80,15 @@
<el-button type="primary" @click="paramsSetting" style="min-width: 70px;">确定</el-button> <el-button type="primary" @click="paramsSetting" style="min-width: 70px;">确定</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<div class="left"> <div class="left">
<el-table :data="cnNames_before" :style="{ width: '100%' }"> <el-table :data="cnNames_before" class="scroll-table" :row-style="{ height: '16px' }"
<el-table-column prop="cnName"> :cell-style="{ padding: '0px' }">
<el-table-column prop="cnName" class-name="before-hover-column" :show-overflow-tooltip="true">
<template #default="scope"> <template #default="scope">
<div @click="selectParams(scope.row)">{{ scope.row.cnName }}</div> <div @click="selectBeforeParams(scope.row)">{{ scope.row.cnName }}</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -98,7 +97,6 @@ ...@@ -98,7 +97,6 @@
<el-col :span="12"> <el-col :span="12">
<div class="middle"> <div class="middle">
<!-- <el-card class="card_contianer"> -->
<table cellpadding="0" cellspacing="1" border="1" class="big_table"> <table cellpadding="0" cellspacing="1" border="1" class="big_table">
<tr> <tr>
<th style="width: 25%">报警名称:</th> <th style="width: 25%">报警名称:</th>
...@@ -130,7 +128,7 @@ ...@@ -130,7 +128,7 @@
<table cellpadding="0" cellspacing="0"> <table cellpadding="0" cellspacing="0">
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-input style="width: 80%" v-model="addParams.topMost"></el-input> <el-input v-float-number style="width: 80%" v-model="addParams.topMost"></el-input>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -142,7 +140,7 @@ ...@@ -142,7 +140,7 @@
<table cellpadding="0" cellspacing="0"> <table cellpadding="0" cellspacing="0">
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-input style="width: 80%" v-model="addParams.upper"></el-input> <el-input v-float-number style="width: 80%" v-model="addParams.upper"></el-input>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -155,21 +153,21 @@ ...@@ -155,21 +153,21 @@
<table cellpadding="0" cellspacing="0"> <table cellpadding="0" cellspacing="0">
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-input style="width: 80%" v-model="addParams.downMost"></el-input> <el-input v-float-number style="width: 80%" v-model="addParams.downMost"></el-input>
</td> </td>
</tr> </tr>
</table> </table>
</td> </td>
</tr> </tr>
<tr> <tr>
<th style="width: 25%">报警预案</th> <th style="width: 25%">报警预案</th>
<td style="width: 60%; margin: 0; padding: 0"> <td style="width: 60%; margin: 0; padding: 0">
<table cellpadding="0" cellspacing="0"> <table cellpadding="0" cellspacing="0">
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left">
<el-input style="width: 80%" type="textarea" rows="6" v-model="addParams.alarmPlan"></el-input> <el-input v-float-number style="width: 80%" type="textarea" rows="6"
v-model="addParams.alarmPlan"></el-input>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -188,7 +186,7 @@ ...@@ -188,7 +186,7 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<th style="width: 25%">启用短通知:</th> <th style="width: 25%">启用短通知:</th>
<td style="width: 60%; margin:0; padding: 0"> <td style="width: 60%; margin:0; padding: 0">
<table cellpadding="0" cellspacing="0"> <table cellpadding="0" cellspacing="0">
<tr> <tr>
...@@ -206,11 +204,10 @@ ...@@ -206,11 +204,10 @@
<el-button :disabled="param.cnName === '' ? true : false" type="primary" @click="onAdd">添加</el-button> <el-button :disabled="param.cnName === '' ? true : false" type="primary" @click="onAdd">添加</el-button>
<el-button disabled type="primary" @click="onDel">删除</el-button> <el-button disabled type="primary" @click="onDel">删除</el-button>
</div> </div>
<div v-else="button"> <div v-else>
<el-button type="primary" @click="onEdit">修改</el-button> <el-button type="primary" @click="onEdit">修改</el-button>
<el-button type="primary" @click="onDel">删除</el-button> <el-button type="primary" @click="onDel">删除</el-button>
</div> </div>
</div> </div>
<!-- </el-card> --> <!-- </el-card> -->
</div> </div>
...@@ -218,20 +215,18 @@ ...@@ -218,20 +215,18 @@
<el-col :span="6"> <el-col :span="6">
<div class="left"> <div class="left">
<el-table :data="cnNames_after" :style="{ width: '100%' }"> <el-table :data="cnNames_after" class="scroll-table" :row-style="{ height: '16px' }"
<el-table-column prop="cnName"> :cell-style="{ padding: '0px' }">
<el-table-column prop="cnName" class-name="after-hover-column">
<template #default="scope"> <template #default="scope">
<div @click="selectParams(scope.row)">{{ scope.row.cnName }}</div> <div @click="selectAfterParams(scope.row)">{{ scope.row.cnName }}</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
</el-dialog> </el-dialog>
</template> </template>
...@@ -242,8 +237,9 @@ import { ref, reactive, onMounted, onUnmounted } from 'vue'; ...@@ -242,8 +237,9 @@ import { ref, reactive, onMounted, onUnmounted } from 'vue';
import http from '../../api/http'; import http from '../../api/http';
import store from "../../store/index"; import store from "../../store/index";
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
import { watch } from 'fs';
import { watchEffect } from 'vue'; import { watchEffect } from 'vue';
import { add } from 'lodash';
import { vFloatNumber } from "@/utils/directives.js";
//分页设置 //分页设置
const currentPage = ref(1) const currentPage = ref(1)
...@@ -262,10 +258,6 @@ const refreshItem = ref(0) ...@@ -262,10 +258,6 @@ const refreshItem = ref(0)
const AlarmInfo = ref([]) const AlarmInfo = ref([])
const dept = ref('') const dept = ref('')
function open() { function open() {
show.value = true show.value = true
} }
...@@ -276,7 +268,6 @@ function onsubmit() { ...@@ -276,7 +268,6 @@ function onsubmit() {
function onCancel() { function onCancel() {
show.value = false show.value = false
refreshItem++ refreshItem++
} }
getEnterprise(); getEnterprise();
...@@ -297,7 +288,7 @@ function handleHeadAddClass({ column }) { ...@@ -297,7 +288,7 @@ function handleHeadAddClass({ column }) {
if (sortField[column.property]) { if (sortField[column.property]) {
column.order = sortField[column.property] column.order = sortField[column.property]
} }
}; }
var date = new Date(); var date = new Date();
var year = date.getFullYear(); var year = date.getFullYear();
...@@ -330,8 +321,6 @@ if (!endTime) { ...@@ -330,8 +321,6 @@ if (!endTime) {
sessionStorage.setItem("DeviceQueryEnd", endTime); sessionStorage.setItem("DeviceQueryEnd", endTime);
} }
getSupplys(); getSupplys();
getdata(); getdata();
function getdata() { function getdata() {
...@@ -340,7 +329,6 @@ function getdata() { ...@@ -340,7 +329,6 @@ function getdata() {
gettransfer(); gettransfer();
} }
//获取选择列表 //获取选择列表
function getoptions() { function getoptions() {
if (type.value === "GetPipeAlarmStatusData") { if (type.value === "GetPipeAlarmStatusData") {
...@@ -410,10 +398,6 @@ function getPipes() { ...@@ -410,10 +398,6 @@ function getPipes() {
} }
}); });
} }
// options.forEach(element => {
// AlarmInfo.push(element.value);
// })
// console.log(AlarmInfo.value);
} }
//获取换热机组列表 //获取换热机组列表
...@@ -505,33 +489,6 @@ console.log("AlarmInfo.value:::", AlarmInfo.value); ...@@ -505,33 +489,6 @@ console.log("AlarmInfo.value:::", AlarmInfo.value);
let cnNames_before = ref([]) let cnNames_before = ref([])
let cnNames_after = ref([]) let cnNames_after = ref([])
console.log("---------------------AlarmInfo.value:", AlarmInfo.value); console.log("---------------------AlarmInfo.value:", AlarmInfo.value);
let newType = ref(0)
watchEffect(() => {
console.log("监听::::", type.value);
if (type.value === "GetPipeAlarmStatusData") {
newType.value = 1
} else if (type.value === "GetBoilerAlarmStatusData") {
newType.value = 2
} else {
newType.value = 3
}
})
// 接口2:换热站基础参数编号(transParaBaseId) -> 接口1:baseId
const getCnNames = () => {
// console.log('dept-------------------', dept.value);
// console.log("++++++++++++++++++++++++", newType.value);
let data = http.post("api/alarm/para/GetAlarmPara", { type: newType.value, id: dept.value }, false);
data.then(function (val) {
cnNames_before.value = val.data.before
cnNames_after.value = val.data.after
// console.log("cnNames_before@@@@", cnNames_before);
// console.log("cnNames_after@@@@", cnNames_after);
// console.log("cnNames_before.transParaBaseId:", cnNames_before.transParaBaseId)
});
}
let params = ref({ let params = ref({
"pipeAlarmParaId": "", "pipeAlarmParaId": "",
...@@ -547,14 +504,13 @@ let params = ref({ ...@@ -547,14 +504,13 @@ let params = ref({
"alarmPlan": "", "alarmPlan": "",
"isShortMessage": "", "isShortMessage": "",
"isAlarm": "", "isAlarm": "",
"isActive": "", "isActive": true,
"updateNullFields": "", "updateNullFields": "",
}) })
let addParams = ref({ let addParams = ref({
"updateNullFields": "", "updateNullFields": "",
"pipeParaBaseId": "",
"pipeId": dept.value,
"gatherType": "",
"voicePath": "", "voicePath": "",
"isVoice": "", "isVoice": "",
"topMost": "", "topMost": "",
...@@ -564,26 +520,84 @@ let addParams = ref({ ...@@ -564,26 +520,84 @@ let addParams = ref({
"alarmPlan": "", "alarmPlan": "",
"isShortMessage": "", "isShortMessage": "",
"isAlarm": "", "isAlarm": "",
"isActive": "" "isActive": true
}) })
const reset = () => {
addParams.value = {
"updateNullFields": "",
"voicePath": "",
"isVoice": "",
"topMost": "",
"upper": "",
"lower": "",
"downMost": "",
"alarmPlan": "",
"isShortMessage": "",
"isAlarm": "",
"isActive": true
}
}
let param = ref({ let param = ref({
"cnName": "", "cnName": "",
"transParaBaseId": "" "baseId": ""
}) })
let newType = ref(0)
watchEffect(() => {
console.log("监听::::", type.value);
if (type.value === "GetPipeAlarmStatusData") {
newType.value = 1
param.value.baseId = "pipeParaBaseId"
} else if (type.value === "GetBoilerAlarmStatusData") {
newType.value = 2
param.value.baseId = "boilerParaBaseId"
} else {
newType.value = 3
param.value.baseId = "transParaBaseId"
}
})
// 接口2:换热站基础参数编号(transParaBaseId) -> 接口1:baseId
const getCnNames = () => {
// console.log('dept-------------------', dept.value);
// console.log("++++++++++++++++++++++++", newType.value);
let data = http.post("api/alarm/para/GetAlarmPara", { type: newType.value, id: dept.value }, false);
data.then(function (val) {
cnNames_before.value = val.data.before
cnNames_after.value = val.data.after
console.log("cnNames_before@@@@", cnNames_before);
console.log("cnNames_after@@@@", cnNames_after);
// console.log("cnNames_before.transParaBaseId:", cnNames_before.transParaBaseId)
});
}
// 点击确定查询数据 // 点击确定查询数据
const paramsSetting = () => { const paramsSetting = () => {
getCnNames() getCnNames()
} }
const selectParams = (row) => { let newRow = ref({})
param.value.transParaBaseId = row.transParaBaseId const selectBeforeParams = (row) => {
console.log("param.value.transParaBaseId========", param.value.transParaBaseId); reset()
button.value = true
if (param.value.transParaBaseId) { if (type.value === "GetPipeAlarmStatusData") {
const data = http.post("/api/alarm/para/GetAlarmParaInfo", { type: newType.value, id: dept.value, baseid: param.value.transParaBaseId }, false) newType.value = 1
console.log("dataaaaa:", data); param.value.baseId = "pipeParaBaseId"
} else if (type.value === "GetBoilerAlarmStatusData") {
newType.value = 2
param.value.baseId = "boilerParaBaseId"
} else {
newType.value = 3
param.value.baseId = "transParaBaseId"
}
console.log("+++++++++++++++++", param.value.baseId);
param.value.baseId = row[param.value.baseId]
newRow.value = param.value.baseId
if (param.value.baseId) {
const data = http.post("api/alarm/para/GetAlarmParaInfo", { type: newType.value, id: dept.value, baseid: param.value.baseId }, false)
console.log("查看baseId --- dataaaaa:", data);
data.then(function (val) { data.then(function (val) {
console.log("valllll:", val); console.log("valllll:", val);
params.value = val.data params.value = val.data
...@@ -595,37 +609,157 @@ const selectParams = (row) => { ...@@ -595,37 +609,157 @@ const selectParams = (row) => {
} }
} }
watchEffect(() => { // 添加参数后
addParams.value.pipeId = dept.value // 删除参数id -> 需要添加参数后的参数的id
console.log(addParams.value.pipeId); const delId = ref(0)
const selectAfterParams = (row) => {
}) reset()
button.value = false
if (type.value === "GetPipeAlarmStatusData") {
newType.value = 1
param.value.baseId = "pipeParaBaseId"
} else if (type.value === "GetBoilerAlarmStatusData") {
newType.value = 2
param.value.baseId = "boilerParaBaseId"
} else {
newType.value = 3
param.value.baseId = "transParaBaseId"
}
console.log("+++++++++++++++++", param.value.baseId);
param.value.baseId = row[param.value.baseId]
newRow.value = param.value.baseId
if (param.value.baseId) {
const data = http.post("/api/alarm/para/GetAlarmParaInfo", { type: newType.value, id: dept.value, baseid: param.value.baseId }, false)
console.log("查看baseId --- dataaaaa:", data);
data.then(function (val) {
console.log("valllll:", val);
addParams.value = { ...val.data }
console.log("addParams.value/////////", addParams.value);
console.log("!!!!!Params.value:", params.value);
param.value.cnName = row.cnName
if (type.value === 1) {
delId.value = val.data.pipeAlarmParaId
} else if (type.value === 2) {
delId.value = val.data.boilerAlarmParaId
} else {
delId.value = val.data.transAlarmParaId
}
});
} else {
ElMessage.info("该参数暂不需要修改...")
}
}
// 总管
const onAdd = () => { const onAdd = () => {
// const data = http.post("api/alarm/para/pipesave", { ...addParams.value }, false) console.log("!!!!!!!", addParams.value);
// console.log("新增data:::", data); if (newType.value === 1) {
// if (data.success) { addParams.value.pipeId = dept.value
// ElMessage.success("修改成功!!") addParams.value.pipeParaBaseId = newRow.value
// } else { if (dept.value === "f8fdf686-30ec-4e4c-ab60-d74ec8b98e3f") {
// ElMessage.error("修改失败!!") addParams.value.gatherType = 4
// }
http.post("api/alarm/para/pipesave", { ...addParams.value }, false).then((res) => {
if (res.success) {
ElMessage.success("修改成功!!")
getCnNames()
} else { } else {
ElMessage.error("修改失败!!") addParams.value.gatherType = 1
} }
}) http.post("api/alarm/para/pipesave", { ...addParams.value }, false).then((res) => {
if (res.success) {
ElMessage.success("总管新增成功!!")
delete addParams.value.pipeId
delete addParams.value.pipeParaBaseId
delete addParams.value.gatherType
delete addParams.value.voicePath
reset()
param.value.cnName = ""
getCnNames()
} else {
ElMessage.error("总管修改失败!!")
}
})
} else if (newType.value === 2) {
addParams.value.boilerParaBaseId = newRow.value
addParams.value.boilerId = dept.value
http.post("api/alarm/para/boilersave", { ...addParams.value }, false).then((res) => {
if (res.success) {
ElMessage.success("锅炉修改成功!!")
delete addParams.value.boilerParaBaseId
delete addParams.value.boilerId
reset()
param.value.cnName = ""
getCnNames()
} else {
ElMessage.error("锅炉修改失败!!")
}
})
} else if (newType.value === 3) {
addParams.value.transParaBaseId = newRow.value
addParams.value.unitId = dept.value
http.post("api/alarm/para/transsave", { ...addParams.value }, false).then((res) => {
if (res.success) {
ElMessage.success("换热机修改成功!!")
delete addParams.value.transParaBaseId
delete addParams.value.unitId
reset()
param.value.cnName = ""
getCnNames()
} else {
ElMessage.error("换热机修改失败!!")
}
})
}
} }
// 按钮 // 按钮
const button = ref(true) const button = ref(true)
// 删除逻辑
const onDel = () => {
if (type.value === 1) {
http.post("api/alarm/para/pipedelete", { id: delId.value }, false).then((res) => {
if (res.success) {
ElMessage.success("总管参数删除成功!!")
reset()
getCnNames()
} else {
ElMessage.error("删除失败!!")
}
})
} else if (type.value === 2) {
http.post("api/alarm/para/boilerdelete", { id: delId.value }, false).then((res) => {
if (res.success) {
ElMessage.success("锅炉参数删除成功!!")
getCnNames()
reset()
} else {
ElMessage.error("删除失败!!")
}
})
} else {
http.post("api/alarm/para/transdelete", { id: delId.value }, false).then((res) => {
if (res.success) {
ElMessage.success("换热站参数删除成功!!")
getCnNames()
reset()
} else {
ElMessage.error("删除失败!!")
}
})
}
}
// 关闭dialog清空数据
const onClose = () => {
type.value = ""
dept.value = ""
cnNames_before.value = ""
cnNames_after.value = ""
reset()
param.value.cnName = ""
}
onMounted(() => { onMounted(() => {
setContentHeight(); setContentHeight();
window.addEventListener('resize', setContentHeight); window.addEventListener('resize', setContentHeight);
}) })
onUnmounted(() => { onUnmounted(() => {
window.removeEventListener('resize', setContentHeight); window.removeEventListener('resize', setContentHeight);
...@@ -684,7 +818,7 @@ onUnmounted(() => { ...@@ -684,7 +818,7 @@ onUnmounted(() => {
.el-cascader .el-input .el-input__inner:focus, .el-cascader .el-input .el-input__inner:focus,
.el-cascader .el-input.is-focus .el-input__inner { .el-cascader .el-input.is-focus .el-input__inner {
height: 33px; //这里高度根据需求自己设定 height: 33px;
} }
.el-cascader__tags { .el-cascader__tags {
...@@ -768,6 +902,44 @@ table td { ...@@ -768,6 +902,44 @@ table td {
} }
.dialog { .dialog {
width: 60%; width: 70%;
}
// dialog中的滚动条
.scroll-table {
max-height: 400px;
overflow-y: auto;
}
// .scroll-table,
// .scroll-table .el-table__header-wrapper,
// .scroll-table .el-table__body-wrapper,
// .scroll-table .el-table__row,
// .scroll-table th,
// .scroll-table td {
// border: none !important;
// }
.scroll-table::-webkit-scrollbar {
width: 5px;
}
.scroll-table::-webkit-scrollbar-thumb {
background-color: #BFBFBF;
// border-radius: 1px;
}
.scroll-table::-webkit-scrollbar-track {
background-color: #f0f0f0;
}
.before-hover-column .cell:hover {
background-color: #CECECE;
color: white;
}
.after-hover-column .cell:hover {
background-color: #508EFF;
color: white;
} }
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment