Commit bb3248b0 authored by xuke's avatar xuke

报警参数-第三次提交

parent 149bd11f
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
</el-card> </el-card>
<el-dialog v-model="show" class="dialog" :show-scrollbar="true"> <el-dialog @close="onClose" 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="查询类型:">
...@@ -86,10 +86,14 @@ ...@@ -86,10 +86,14 @@
<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"
<el-table-column prop="cnName"> class="scroll-table"
:row-style="{height: '16px'}"
: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>
...@@ -188,7 +192,7 @@ ...@@ -188,7 +192,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 +210,10 @@ ...@@ -206,11 +210,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,14 +221,17 @@ ...@@ -218,14 +221,17 @@
<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"
<el-table-column prop="cnName"> class="scroll-table"
:row-style="{height: '16px'}"
: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>
...@@ -410,10 +416,6 @@ function getPipes() { ...@@ -410,10 +416,6 @@ function getPipes() {
} }
}); });
} }
// options.forEach(element => {
// AlarmInfo.push(element.value);
// })
// console.log(AlarmInfo.value);
} }
//获取换热机组列表 //获取换热机组列表
...@@ -520,7 +522,7 @@ let params = ref({ ...@@ -520,7 +522,7 @@ let params = ref({
"alarmPlan": "", "alarmPlan": "",
"isShortMessage": "", "isShortMessage": "",
"isAlarm": "", "isAlarm": "",
"isActive": "", "isActive": true,
"updateNullFields": "", "updateNullFields": "",
}) })
...@@ -536,7 +538,7 @@ let addParams = ref({ ...@@ -536,7 +538,7 @@ let addParams = ref({
"alarmPlan": "", "alarmPlan": "",
"isShortMessage": "", "isShortMessage": "",
"isAlarm": "", "isAlarm": "",
"isActive": "" "isActive": true
}) })
const reset = () => { const reset = () => {
...@@ -551,7 +553,7 @@ const reset = () => { ...@@ -551,7 +553,7 @@ const reset = () => {
"alarmPlan": "", "alarmPlan": "",
"isShortMessage": "", "isShortMessage": "",
"isAlarm": "", "isAlarm": "",
"isActive": "" "isActive": true
} }
} }
let param = ref({ let param = ref({
...@@ -595,9 +597,9 @@ const paramsSetting = () => { ...@@ -595,9 +597,9 @@ const paramsSetting = () => {
} }
let newRow = ref({}) let newRow = ref({})
const selectParams = (row) => { const selectBeforeParams = (row) => {
reset()
button.value = true
if (type.value === "GetPipeAlarmStatusData") { if (type.value === "GetPipeAlarmStatusData") {
newType.value = 1 newType.value = 1
param.value.baseId = "pipeParaBaseId" param.value.baseId = "pipeParaBaseId"
...@@ -608,13 +610,11 @@ const selectParams = (row) => { ...@@ -608,13 +610,11 @@ const selectParams = (row) => {
newType.value = 3 newType.value = 3
param.value.baseId = "transParaBaseId" param.value.baseId = "transParaBaseId"
} }
console.log("+++++++++++++++++", param.value.baseId); console.log("+++++++++++++++++", param.value.baseId);
param.value.baseId = row[param.value.baseId] param.value.baseId = row[param.value.baseId]
newRow.value = param.value.baseId newRow.value = param.value.baseId
if (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) const data = http.post("api/alarm/para/GetAlarmParaInfo", { type: newType.value, id: dept.value, baseid: param.value.baseId }, false)
console.log("查看baseId --- dataaaaa:", data); console.log("查看baseId --- dataaaaa:", data);
data.then(function (val) { data.then(function (val) {
console.log("valllll:", val); console.log("valllll:", val);
...@@ -627,19 +627,80 @@ const selectParams = (row) => { ...@@ -627,19 +627,80 @@ const selectParams = (row) => {
} }
} }
// 添加参数后
// 删除参数id -> 需要添加参数后的参数的id
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);
// Object.assign({...addParams.value},val)
// params.value = val.data
addParams.value = {...val.data}
// 回显数据
// "updateNullFields": "",
// "voicePath": "",
// "isVoice": "",
// "topMost": "",
// "upper": "",
// "lower": "",
// "downMost": "",
// "alarmPlan": "",
// "isShortMessage": "",
// "isAlarm": "",
// "isActive": true
// addParams.value.updateNullFields=val.
// addParams.value.voicePath=""
// addParams.value.
// addParams.value.
// addParams.value.
// addParams.value.
// addParams.value.
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("该参数暂不需要修改...")
}
}
//"pipeId": "",
// "boilerId": "",
// "unitId": "",
// 总管 // 总管
const onAdd = () => { const onAdd = () => {
console.log("!!!!!!!", addParams.value); console.log("!!!!!!!", addParams.value);
if (newType.value === 1) { if (newType.value === 1) {
addParams.value.pipeId = dept.value addParams.value.pipeId = dept.value
addParams.value.pipeParaBaseId = newRow.value addParams.value.pipeParaBaseId = newRow.value
addParams.value.gatherType = 1 if (dept.value === "f8fdf686-30ec-4e4c-ab60-d74ec8b98e3f") {
addParams.value.voicePath = 1 addParams.value.gatherType = 4
} else {
addParams.value.gatherType = 1
}
http.post("api/alarm/para/pipesave", { ...addParams.value }, false).then((res) => { http.post("api/alarm/para/pipesave", { ...addParams.value }, false).then((res) => {
if (res.success) { if (res.success) {
ElMessage.success("总管新增成功!!") ElMessage.success("总管新增成功!!")
...@@ -691,14 +752,59 @@ const onAdd = () => { ...@@ -691,14 +752,59 @@ const onAdd = () => {
} }
} }
// 按钮 // 按钮
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);
...@@ -841,6 +947,46 @@ table td { ...@@ -841,6 +947,46 @@ 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