Browse Source

1.对接采暖泵监测列表

2.对接采暖泵在线情况
3.对接采暖泵报警信息列表
gh_ers
selia-zx 2 months ago
parent
commit
b0d836e4b3
  1. 27
      src/api/boiler/heatingPump.js
  2. 8
      src/store/modules/permission.js
  3. 718
      src/views/boilerSys/heatingPump/heatingPumpDetails.vue
  4. 20
      src/views/boilerSys/steamHeating/index.vue
  5. 420
      src/views/boilerSys/steamHeating/steamHeatingDetails.vue

27
src/api/boiler/heatingPump.js

@ -0,0 +1,27 @@
import request from "@/utils/request";
// 采暖泵列表
export function heatPumpList(query) {
return request({
url: "/device/heatPump/list",
method: "get",
params: query,
});
}
// 采暖泵在线情况
export function heatPumpOnlineList(query) {
return request({
url: "/device/heatPump/online",
method: "get",
params: query,
});
}
// 采暖泵报警列表
export function heatPumpAlarmList(query) {
return request({
url: "/device/heatPump/alarmList",
method: "get",
params: query,
});
}

8
src/store/modules/permission.js

@ -155,6 +155,14 @@ const permission = {
import("@/views/boilerSys/heatingPump/heatingPumpDetails"), import("@/views/boilerSys/heatingPump/heatingPumpDetails"),
meta: { title: "采暖泵监控", icon: "screen" }, meta: { title: "采暖泵监控", icon: "screen" },
}, },
{
path: "/steamHeatingDetails",
name: "steamHeatingDetails",
hidden: true,
component: () =>
import("@/views/boilerSys/steamHeating/steamHeatingDetails"),
meta: { title: "蒸汽采暖运行监控", icon: "screen" },
},
// 可以继续添加更多路由对象 // 可以继续添加更多路由对象
]; ];
// 循环添加额外的路由对象到各路由数组 // 循环添加额外的路由对象到各路由数组

718
src/views/boilerSys/heatingPump/heatingPumpDetails.vue

@ -46,144 +46,12 @@
/> />
</div> </div>
<div class="heatingPump"> <div class="heatingPump">
<div class="pumpli"> <div class="pumpli" v-for="(item, index) in heatPumpList" :key="index">
<div class="special-div one"> <div class="special-div one">
<div class="special-top"> <div class="special-top">
<div class="special-title"> <div class="special-title">
<div class="title-left"> <div class="title-left">
<div>采暖泵1</div> <div>{{ item.name }}</div>
</div>
</div>
</div>
<div class="pumpli-monitor">
<div class="pumpli-top">
<img
src="../../../assets/images/heatingPump.png"
class="pump-img"
alt=""
/>
<div class="greenStatus">
<img
src="../../../assets/images/green-out.png"
class="green-out"
alt=""
/>
<img
src="../../../assets/images/whiteFan.png"
class="whiteFan move"
alt=""
/>
</div>
</div>
<div class="pump-data">
<div class="pump-data-li">
<div>运行状态</div>
<div class="pump-data-text">运行</div>
</div>
<div class="pump-data-li">
<div>实际转速(rpm)</div>
<div class="pump-data-text">1000</div>
</div>
<div class="pump-data-li">
<div>电机功率(kw)</div>
<div class="pump-data-text">100</div>
</div>
<div class="pump-data-li">
<div>电机输入电压(V)</div>
<div class="pump-data-text">220</div>
</div>
<div class="pump-data-li">
<div>点击输入电流(A)</div>
<div class="pump-data-text">5</div>
</div>
<div class="pump-data-li">
<div>总流量(/h)</div>
<div class="pump-data-text">1000</div>
</div>
<div class="pump-data-li">
<div>泵运行总用电量(kwh)</div>
<div class="pump-data-text">10</div>
</div>
<div class="pump-data-li">
<div>泵总运行时间(小时)</div>
<div class="pump-data-text">1000</div>
</div>
</div>
</div>
</div>
</div>
<div class="pumpli">
<div class="special-div one">
<div class="special-top">
<div class="special-title">
<div class="title-left">
<div>采暖泵2</div>
</div>
</div>
</div>
<div class="pumpli-monitor">
<div class="pumpli-top">
<img
src="../../../assets/images/heatingPump.png"
class="pump-img"
alt=""
/>
<div class="greenStatus">
<img
src="../../../assets/images/green-out.png"
class="green-out"
alt=""
/>
<img
src="../../../assets/images/whiteFan.png"
class="whiteFan"
alt=""
/>
</div>
</div>
<div class="pump-data">
<div class="pump-data-li">
<div>运行状态</div>
<div class="pump-data-text">运行</div>
</div>
<div class="pump-data-li">
<div>实际转速(rpm)</div>
<div class="pump-data-text">1000</div>
</div>
<div class="pump-data-li">
<div>电机功率(kw)</div>
<div class="pump-data-text">100</div>
</div>
<div class="pump-data-li">
<div>电机输入电压(V)</div>
<div class="pump-data-text">220</div>
</div>
<div class="pump-data-li">
<div>点击输入电流(A)</div>
<div class="pump-data-text">5</div>
</div>
<div class="pump-data-li">
<div>总流量(/h)</div>
<div class="pump-data-text">1000</div>
</div>
<div class="pump-data-li">
<div>泵运行总用电量(kwh)</div>
<div class="pump-data-text">10</div>
</div>
<div class="pump-data-li">
<div>泵总运行时间(小时)</div>
<div class="pump-data-text">1000</div>
</div>
</div>
</div>
</div>
</div>
<div class="pumpli">
<div class="special-div one">
<div class="special-top">
<div class="special-title">
<div class="title-left">
<div>采暖泵3</div>
</div> </div>
</div> </div>
</div> </div>
@ -203,42 +71,26 @@
<img <img
src="../../../assets/images/whiteFan.png" src="../../../assets/images/whiteFan.png"
class="whiteFan" class="whiteFan"
:class="{ move: shouldAddMoveClass(item) }"
alt="" alt=""
/> />
</div> </div>
</div> </div>
<div class="pump-data"> <div class="pump-data">
<div class="pump-data-li"> <div
<div>运行状态</div> class="pump-data-li"
<div class="pump-data-text">运行</div> v-for="(val, index) in item.values"
</div> :key="index + 1"
<div class="pump-data-li"> >
<div>实际转速(rpm)</div> <div>{{ val.otherName }}</div>
<div class="pump-data-text">1000</div> <div
</div> class="pump-data-text"
<div class="pump-data-li"> :class="{
<div>电机功率(kw)</div> 'bad-data-text': val.curValue === '故障',
<div class="pump-data-text">100</div> }"
</div> >
<div class="pump-data-li"> {{ val.curValue }}
<div>电机输入电压(V)</div> </div>
<div class="pump-data-text">220</div>
</div>
<div class="pump-data-li">
<div>点击输入电流(A)</div>
<div class="pump-data-text">5</div>
</div>
<div class="pump-data-li">
<div>总流量(/h)</div>
<div class="pump-data-text">1000</div>
</div>
<div class="pump-data-li">
<div>泵运行总用电量(kwh)</div>
<div class="pump-data-text">10</div>
</div>
<div class="pump-data-li">
<div>泵总运行时间(小时)</div>
<div class="pump-data-text">1000</div>
</div> </div>
</div> </div>
</div> </div>
@ -293,6 +145,11 @@
<script> <script>
import { runTime } from "@/api/centerairC/sysMonitor"; import { runTime } from "@/api/centerairC/sysMonitor";
import { alarmRecordList } from "@/api/alarm/alarmRecord"; import { alarmRecordList } from "@/api/alarm/alarmRecord";
import {
heatPumpList,
heatPumpOnlineList,
heatPumpAlarmList,
} from "@/api/boiler/heatingPump";
import { getDay } from "@/utils/datetime"; import { getDay } from "@/utils/datetime";
import * as echarts from "echarts"; import * as echarts from "echarts";
export default { export default {
@ -310,6 +167,7 @@ export default {
energyMes: {}, // energyMes: {}, //
// //
alarmList: [], alarmList: [],
heatPumpList: [],
}; };
}, },
computed: { computed: {
@ -352,6 +210,8 @@ export default {
this.getAlarnStatus(); this.getAlarnStatus();
this.getDayData(); this.getDayData();
this.initChart(); this.initChart();
this.getHotWaterBoiler();
this.getHotPumpAlarmList();
this.$nextTick(() => { this.$nextTick(() => {
this.echartsData(); this.echartsData();
}); });
@ -405,215 +265,242 @@ export default {
this.$router.push("/alarm/alarmRecord"); this.$router.push("/alarm/alarmRecord");
}, },
echartsData() { echartsData() {
console.log("父组件传过来的值", this.energyMes); let queryParams = {
if (this.energyMes) { systemType: "3",
const titleFontSize = (this.$refs.chart_ref.offsetWidth / 100) * 2; type: "0",
const colorList = ["#ffe21e", "#08c8ff", "#0882ff", "#2df499"]; // };
const adapterOption = { heatPumpOnlineList(queryParams).then((res) => {
tooltip: { if (res.code == 200 && res.rows) {
trigger: "item", console.log("采暖泵在线情况数据", res.rows);
formatter: "{a} <br/>{b} : {c} ({d}%)", this.energyMes = res.rows[0];
}, if (this.energyMes) {
legend: { const titleFontSize = (this.$refs.chart_ref.offsetWidth / 100) * 2;
itemWidth: titleFontSize, const colorList = ["#ffe21e", "#08c8ff", "#0882ff", "#2df499"]; //
itemHeight: titleFontSize, const adapterOption = {
itemGap: titleFontSize * 2, title: {
formatter: function (name) { text: this.energyMes.total,
var arr = [];
let data = adapterOption.series[0].data;
var index = 0;
var total = 0;
//
for (var i = 0; i < data.length; i++) {
total += data[i].value;
if (data[i].name == name) {
index = i;
}
}
// 0
var percentage =
data[index].value === 0
? "0.00"
: ((data[index].value / total) * 100).toFixed(2);
arr.push(
"{name|" + name + "}",
"{text|" + " " + ":" + " " + "}",
"{value|" + data[index].value + " " + "}",
"{percentage|" + " " + percentage + "%}"
);
return arr.join("");
},
textStyle: {
color: function (name) {
const dataSeries = adapterOption.series[1].data; // data
const index = dataSeries.findIndex(
(item) => item.name === name
);
const colorList = ["#08c8ff", "#2df499", "#ffe21e", "#0882ff"]; //
return colorList[index];
}, },
rich: { tooltip: {
name: { trigger: "item",
align: "left", formatter: "{a} <br/>{b} : {c} ({d}%)",
fontSize: titleFontSize * 1.6, },
legend: {
itemWidth: titleFontSize,
itemHeight: titleFontSize,
itemGap: titleFontSize * 2,
formatter: function (name) {
var arr = [];
let data = adapterOption.series[0].data;
var index = 0;
var total = 0;
//
for (var i = 0; i < data.length; i++) {
total += data[i].value;
if (data[i].name == name) {
index = i;
}
}
// 0
var percentage =
data[index].value === 0
? "0.00"
: ((data[index].value / total) * 100).toFixed(2);
arr.push(
"{name|" + name + "}",
"{text|" + " " + ":" + " " + "}",
"{value|" + data[index].value + " " + "}",
"{percentage|" + " " + percentage + "%}"
);
return arr.join("");
}, },
text: { textStyle: {
align: "left", color: function (name) {
fontSize: titleFontSize * 1.6, const dataSeries = adapterOption.series[1].data; // data
const index = dataSeries.findIndex(
(item) => item.name === name
);
const colorList = [
"#08c8ff",
"#2df499",
"#ffe21e",
"#0882ff",
]; //
return colorList[index];
},
rich: {
name: {
align: "left",
fontSize: titleFontSize * 1.6,
},
text: {
align: "left",
fontSize: titleFontSize * 1.6,
},
value: {
align: "left",
fontSize: titleFontSize * 1.6,
// color: function (params) {
// let data = adapterOption.series[1].data;
// return data.itemStyle.color({ dataIndex: params.dataIndex });
// },
},
percentage: {
align: "left",
fontSize: titleFontSize * 1.6,
// color: function (params) {
// let data = adapterOption.series[1].data;
// return data.itemStyle.color({ dataIndex: params.dataIndex });
// },
},
},
}, },
value: { },
align: "left", series: [
fontSize: titleFontSize * 1.6, {
// color: function (params) { name: "数据详情:",
// let data = adapterOption.series[1].data; data: [
// return data.itemStyle.color({ dataIndex: params.dataIndex }); { value: this.energyMes.online, name: "在线" },
// }, { value: this.energyMes.offline, name: "离线" },
],
itemStyle: {
color: function (params) {
var colorList = [
"#08c8ff",
"#2df499",
"#ffe21e",
"#0882ff",
];
return colorList[params.dataIndex];
},
// borderWidth: 5,
borderColor: "#002a56",
},
}, },
percentage: { {
align: "left", data: [
fontSize: titleFontSize * 1.6, { value: this.energyMes.online, name: "在线" },
// color: function (params) { { value: this.energyMes.offline, name: "离线" },
// let data = adapterOption.series[1].data; ],
// return data.itemStyle.color({ dataIndex: params.dataIndex });
// },
}, },
},
},
},
series: [
{
name: "数据详情:",
data: [
{ value: 2, name: "设备1" },
{ value: 3, name: "设备2" },
{ value: 4, name: "设备3" },
{ value: 5, name: "设备4" },
], ],
itemStyle: { };
color: function (params) { this.chartInstance.setOption(adapterOption);
var colorList = ["#08c8ff", "#2df499", "#ffe21e", "#0882ff"]; this.chartInstance.resize();
return colorList[params.dataIndex]; }
}, } else {
// borderWidth: 5, const titleFontSize = (this.$refs.chart_ref.offsetWidth / 100) * 2;
borderColor: "#002a56", const adapterOption = {
}, title: {
text: 0,
}, },
{ tooltip: {
data: [ trigger: "item",
{ value: 2, name: "设备1" }, formatter: "{a} <br/>{b} : {c} ({d}%)",
{ value: 3, name: "设备2" },
{ value: 4, name: "设备3" },
{ value: 5, name: "设备4" },
],
}, },
], legend: {
}; itemWidth: titleFontSize,
this.chartInstance.setOption(adapterOption); itemHeight: titleFontSize,
this.chartInstance.resize(); itemGap: titleFontSize * 2,
} else { formatter: function (name) {
const titleFontSize = (this.$refs.chart_ref.offsetWidth / 100) * 2; var arr = [];
const adapterOption = { let data = adapterOption.series[0].data;
tooltip: { var index = 0;
trigger: "item", var total = 0;
formatter: "{a} <br/>{b} : {c} ({d}%)", //
}, for (var i = 0; i < data.length; i++) {
legend: { total += data[i].value;
itemWidth: titleFontSize, if (data[i].name == name) {
itemHeight: titleFontSize, index = i;
itemGap: titleFontSize * 2, }
formatter: function (name) {
var arr = [];
let data = adapterOption.series[0].data;
var index = 0;
var total = 0;
//
for (var i = 0; i < data.length; i++) {
total += data[i].value;
if (data[i].name == name) {
index = i;
} }
} // 0
// 0 var percentage =
var percentage = data[index].value === 0
data[index].value === 0 ? "0.00"
? "0.00" : ((data[index].value / total) * 100).toFixed(2);
: ((data[index].value / total) * 100).toFixed(2); arr.push(
arr.push( "{name|" + name + "}",
"{name|" + name + "}", "{text|" + " " + ":" + " " + "}",
"{text|" + " " + ":" + " " + "}", "{value|" + data[index].value + " " + "}",
"{value|" + data[index].value + " " + "}", "{percentage|" + " " + percentage + "%}"
"{percentage|" + " " + percentage + "%}"
);
return arr.join("");
},
textStyle: {
color: function (name) {
const dataSeries = adapterOption.series[1].data; // data
const index = dataSeries.findIndex(
(item) => item.name === name
); );
const colorList = ["#08c8ff", "#2df499", "#ffe21e", "#0882ff"]; // return arr.join("");
return colorList[index];
}, },
rich: { textStyle: {
name: { color: function (name) {
align: "left", const dataSeries = adapterOption.series[1].data; // data
fontSize: titleFontSize * 1.6, const index = dataSeries.findIndex(
}, (item) => item.name === name
text: { );
align: "left", const colorList = [
fontSize: titleFontSize * 1.6, "#08c8ff",
}, "#2df499",
value: { "#ffe21e",
align: "left", "#0882ff",
fontSize: titleFontSize * 1.6, ]; //
// color: function (params) { return colorList[index];
// let data = adapterOption.series[1].data;
// return data.itemStyle.color({ dataIndex: params.dataIndex });
// },
}, },
percentage: { rich: {
align: "left", name: {
fontSize: titleFontSize * 1.6, align: "left",
// color: function (params) { fontSize: titleFontSize * 1.6,
// let data = adapterOption.series[1].data; },
// return data.itemStyle.color({ dataIndex: params.dataIndex }); text: {
// }, align: "left",
fontSize: titleFontSize * 1.6,
},
value: {
align: "left",
fontSize: titleFontSize * 1.6,
// color: function (params) {
// let data = adapterOption.series[1].data;
// return data.itemStyle.color({ dataIndex: params.dataIndex });
// },
},
percentage: {
align: "left",
fontSize: titleFontSize * 1.6,
// color: function (params) {
// let data = adapterOption.series[1].data;
// return data.itemStyle.color({ dataIndex: params.dataIndex });
// },
},
}, },
}, },
}, },
}, series: [
series: [ {
{ name: "数据详情:",
name: "数据详情:", data: [
data: [ { value: 0, name: "在线" },
{ value: 0, name: "设备1" }, { value: 0, name: "离线" },
{ value: 0, name: "设备2" }, ],
{ value: 0, name: "设备3" }, itemStyle: {
{ value: 0, name: "设备4" }, color: function (params) {
], var colorList = [
itemStyle: { "#08c8ff",
color: function (params) { "#2df499",
var colorList = ["#08c8ff", "#2df499", "#ffe21e", "#0882ff"]; "#ffe21e",
return colorList[params.dataIndex]; "#0882ff",
];
return colorList[params.dataIndex];
},
// borderWidth: 5,
borderColor: "#002a56",
}, },
// borderWidth: 5,
borderColor: "#002a56",
}, },
}, {
{ data: [
data: [ { value: 0, name: "在线" },
{ value: 0, name: "设备1" }, { value: 0, name: "离线" },
{ value: 0, name: "设备2" }, ],
{ value: 0, name: "设备3" }, },
{ value: 0, name: "设备4" }, ],
], };
}, this.chartInstance.setOption(adapterOption);
], this.chartInstance.resize();
}; }
this.chartInstance.setOption(adapterOption); });
this.chartInstance.resize();
}
}, },
// 线+ + 线 // 线+ + 线
screenAdapter() { screenAdapter() {
@ -622,6 +509,9 @@ export default {
//optionoption //optionoption
const adapterOption = { const adapterOption = {
title: { title: {
textStyle: {
fontSize: titleFontSize * 1.4,
},
subtextStyle: { subtextStyle: {
fontSize: titleFontSize * 1.2, fontSize: titleFontSize * 1.2,
}, },
@ -647,7 +537,7 @@ export default {
}, },
textAlign: "center", textAlign: "center",
x: "27%", x: "27%",
y: "36%", // y: "33%", //
}, },
tooltip: { tooltip: {
trigger: "item", trigger: "item",
@ -776,6 +666,82 @@ export default {
// //
this.chartInstance.setOption(this.option, true); this.chartInstance.setOption(this.option, true);
}, },
//
getHotWaterBoiler() {
let queryParams = {
systemType: "3",
type: "0",
};
heatPumpList(queryParams).then((res) => {
if (res.code == 200) {
console.log("采暖泵数据", res.rows);
this.heatPumpList = res.rows;
this.processHeatPumpList();
}
});
},
// heatPumpList
processHeatPumpList() {
// heatPumpList
this.heatPumpList.forEach((item) => {
// values
if (Array.isArray(item.values) && item.values.length > 0) {
// values
item.values.forEach((valueItem) => {
// otherName ""
if (valueItem.otherName && valueItem.otherName.includes("故障")) {
// curValue
const numValue = parseFloat(valueItem.curValue);
if (!isNaN(numValue)) {
if (numValue === 0) {
valueItem.curValue = "无故障";
} else if (numValue === 1) {
valueItem.curValue = "故障";
}
}
}
if (
valueItem.otherName &&
valueItem.otherName.includes("运行状态")
) {
// curValue
const numValue = parseFloat(valueItem.curValue);
if (!isNaN(numValue)) {
if (numValue === 0) {
valueItem.curValue = "不运行";
} else if (numValue === 1) {
valueItem.curValue = "运行";
}
}
}
});
}
});
},
// -
shouldAddMoveClass(item) {
for (let val of item.values) {
if (val.otherName.includes("运行状态") && val.curValue === "运行") {
return true;
}
}
return false;
},
//
getHotPumpAlarmList() {
let queryParams = {
systemType: "3",
type: "0",
};
heatPumpAlarmList(queryParams).then((res) => {
if (res.code == 200) {
console.log("采暖泵报警数据", res.rows);
this.alarmList = res.rows;
} else {
this.alarmList = [];
}
});
},
}, },
}; };
</script> </script>
@ -968,6 +934,23 @@ export default {
color: #05d120; color: #05d120;
font-weight: bold; font-weight: bold;
} }
.bad-data-text {
color: #f50d0d !important;
font-weight: bold;
animation: blink 1s infinite; /* 应用闪烁动画,持续时间 1 秒,无限循环 */
}
@keyframes blink {
0% {
opacity: 1; /* 初始透明度为 1(完全不透明) */
}
50% {
opacity: 0; /* 中间透明度为 0(完全透明) */
}
100% {
opacity: 1; /* 结束透明度为 1(完全不透明) */
}
}
} }
} }
} }
@ -1008,4 +991,23 @@ export default {
padding: 0.04rem 0.26rem 0.04rem 0px; padding: 0.04rem 0.26rem 0.04rem 0px;
min-height: 0.37rem; min-height: 0.37rem;
} }
.pumpli-monitor >>> .el-table {
font-size: 0.14rem !important;
}
.pumpli-monitor >>> .el-table .el-table__header-wrapper th,
.pumpli-monitor >>> .el-table .el-table__fixed-header-wrapper th {
font-size: 0.13rem !important;
height: 0.4rem !important;
}
.pumpli-monitor >>> table tr {
height: 0.4rem !important;
}
.pumpli-monitor >>> .el-table--medium .el-table__cell {
padding: 0.1rem 0 !important;
}
.pumpli-monitor >>> .el-table .cell {
line-height: 0.23rem !important;
padding-left: 0.1rem !important;
padding-right: 0.1rem !important;
}
</style> </style>

20
src/views/boilerSys/steamHeating/index.vue

@ -0,0 +1,20 @@
<template>
<div></div>
</template>
<script>
export default {
created() {
this.toPage();
},
methods: {
toPage() {
console.log("需要跳转的")
//
this.$router.push("/steamHeatingDetails")
},
},
};
</script>
<style></style>

420
src/views/boilerSys/steamHeating/steamHeatingDetails.vue

@ -0,0 +1,420 @@
<template>
<div class="monitor" v-loading="loading">
<div class="monitor-top">
<img
class="title-left"
src="../../../assets/images/title-left.png"
alt=""
/>
<img
class="title-center"
src="../../../assets/images/title-center.png"
alt=""
@click="goSys"
/>
<img
class="title-right"
src="../../../assets/images/title-right.png"
alt=""
/>
<div class="sys-title" @click="goSys">蒸汽采暖系统运行监测</div>
<!-- logo -->
<img src="../../../assets/images/logo-3.png" class="sys-logo" alt="" />
<div class="nowTime">{{ formattedDate }}</div>
<div class="monitor-time">已监测时长:{{ dayData }}</div>
<img
class="icon_warning"
src="../../../assets/images/warning.png"
title="报警记录"
@click="goWarning"
v-if="isShowWarning"
alt=""
/>
<img
class="icon_home"
src="../../../assets/images/icon_home.png"
title="首页"
@click="goSys"
alt=""
/>
<img
class="back-icon"
src="../../../assets/images/back-icon.png"
title="返回"
@click="goBack"
alt=""
/>
</div>
</div>
</template>
<script>
import { runTime } from "@/api/centerairC/sysMonitor";
import { alarmRecordList } from "@/api/alarm/alarmRecord";
import { monitorList } from "@/api/centerairC/sysMonitor";
import { getDay } from "@/utils/datetime";
export default {
name: "boilerMonitorDetails",
data() {
return {
loading: false,
currentDate: new Date(),
nowTimer: null,
timer: null, // ID
isShowWarning: false, //
dayData: "", //
currentWeekday: "",
//
steamHeatingData: [],
};
},
computed: {
formattedDate() {
const year = this.currentDate.getFullYear();
const month = String(this.currentDate.getMonth() + 1).padStart(2, "0");
const day = String(this.currentDate.getDate()).padStart(2, "0");
const hours = String(this.currentDate.getHours()).padStart(2, "0");
const minutes = String(this.currentDate.getMinutes()).padStart(2, "0");
const seconds = String(this.currentDate.getSeconds()).padStart(2, "0");
const weekDays = [
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六",
];
const weekDay = weekDays[this.currentDate.getDay()];
return `${year}${month}${day}${hours}:${minutes}:${seconds} ${weekDay}`;
},
},
created() {
const weekdays = [
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六",
];
const date = new Date();
const dayIndex = date.getDay();
this.currentWeekday = weekdays[dayIndex];
console.log("今天是星期几", this.currentWeekday);
},
mounted() {
this.getAlarnStatus();
this.getDayData();
//
this.getSteamHeatingData();
// 10
this.timer = setInterval(() => {
this.getAlarnStatus();
this.getDayData();
//
this.getSteamHeatingData();
}, 10000);
},
beforeDestroy() {
//
if (this.timer) {
clearInterval(this.timer);
}
//
if (this.nowTimer) {
clearInterval(this.nowTimer);
}
},
methods: {
//
goSys() {
this.$router.push("/");
},
//
goBack() {
window.history.go(-2);
},
//
getDayData() {
runTime().then((res) => {
if (res.code == 200) {
this.dayData = res.data.runTime;
}
});
},
//
getAlarnStatus() {
let data = {
pageNum: 1,
pageSize: 10,
status: "0",
};
let timeArr = [getDay(0), getDay(0)];
alarmRecordList(this.addDateRange(data, timeArr)).then((res) => {
if (res.code == 200 && res.rows.length > 0) {
this.isShowWarning = true;
} else {
this.isShowWarning = false;
}
});
},
goWarning() {
this.$router.push("/alarm/alarmRecord");
},
//
getSteamHeatingData() {
monitorList({ systemType: 3 }).then((res) => {
if (res.code === 200) {
console.log("设备监测列表返回", res);
//
this.hostList = [];
this.coolingPump = [];
this.freezingPump = [];
this.coolingTower = [];
this.frozenValve = [];
this.coolingValue = [];
this.coolingTowerInlet = [];
this.coolingTowerOutlet = [];
this.freezingManifold = [];
this.coolingOutletBuild = []; //
this.coolingInletBuild = []; //
this.coolingOutletGuest = []; //
this.coolingInletGuest = []; //
this.hotOutletBuild = []; //
this.hotInletBuild = []; //
this.hotOutletGuest = []; //
this.hotInletGuest = []; //
res.rows.forEach((row) => {
switch (row.name) {
case "0":
this.hostList = this.processDeviceList(row.values);
console.log("主机列表", this.hostList);
break;
case "1":
this.coolingPump = this.processDeviceList(row.values);
console.log("冷却泵列表", this.coolingPump);
break;
case "2":
this.freezingPump = this.processDeviceList(row.values);
console.log("冷冻泵列表", this.freezingPump);
break;
case "3":
this.coolingTower = this.processDeviceList(row.values);
console.log("冷却塔列表", this.coolingTower);
break;
case "4":
this.frozenValve = this.processDeviceList(row.values);
console.log("冷冻蝶阀列表", this.frozenValve);
break;
case "7":
this.coolingValue = this.processDeviceList(row.values);
console.log("冷却蝶阀列表", this.coolingValue);
break;
case "8":
this.coolingTowerInlet = this.processDeviceList(row.values);
console.log("冷却塔进水阀列表", this.coolingTowerInlet);
break;
case "9":
this.coolingTowerOutlet = this.processDeviceList(row.values);
console.log("冷却塔出水阀列表", this.coolingTowerOutlet);
break;
case "15":
this.freezingManifold = row.values;
console.log("冷冻总管", this.freezingManifold);
break;
case "18":
let buildInData = row.values;
buildInData.forEach((item) => {
if (item.deviceName.includes("供冷")) {
this.coolingInletBuild.push(item);
}
if (item.deviceName.includes("供暖")) {
this.hotInletBuild.push(item);
}
});
console.log("裙楼供冷进水阀", this.coolingInletBuild);
console.log("裙楼供暖进水阀", this.hotInletBuild);
break;
case "19":
let buildOutData = row.values;
buildOutData.forEach((item) => {
if (item.deviceName.includes("供冷")) {
this.coolingOutletBuild.push(item);
}
if (item.deviceName.includes("供暖")) {
this.hotOutletBuild.push(item);
}
});
console.log("裙楼供冷出水阀", this.coolingOutletBuild);
console.log("裙楼供暖出水阀", this.hotOutletBuild);
break;
case "20":
let guestInData = row.values;
guestInData.forEach((item) => {
if (item.deviceName.includes("供冷")) {
this.coolingInletGuest.push(item);
}
if (item.deviceName.includes("供暖")) {
this.hotInletGuest.push(item);
}
});
console.log("客房供冷进水阀", this.coolingInletGuest);
console.log("客房供暖进水阀", this.hotInletGuest);
break;
case "21":
let guestOutData = row.values;
guestOutData.forEach((item) => {
if (item.deviceName.includes("供冷")) {
this.coolingOutletGuest.push(item);
}
if (item.deviceName.includes("供暖")) {
this.hotOutletGuest.push(item);
}
});
console.log("客房供冷出水阀", this.coolingOutletGuest);
console.log("客房供暖出水阀", this.hotOutletGuest);
break;
default:
break;
}
});
}
});
},
//
processDeviceList(values) {
const deviceList = [];
//
values.forEach((item) => {
//
const match = item.deviceName.match(/(\d+)号/);
if (match) {
const deviceNumber = parseInt(match[1]);
// deviceList
if (!deviceList[deviceNumber - 1]) {
deviceList[deviceNumber - 1] = {
deviceName: item.deviceName,
properties: [],
};
}
// properties
deviceList[deviceNumber - 1].properties.push(item);
}
});
// deviceList
return deviceList.filter((item) => item);
},
},
};
</script>
<style lang="scss" scoped>
.monitor {
width: 100%;
min-height: 100vh;
background-color: black;
color: #fff;
.monitor-top {
width: 100%;
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: space-between;
flex-wrap: nowrap;
padding: 0.1rem 0.2rem;
position: relative;
.title-left {
width: 3.41rem;
height: 0.8rem;
}
.title-center {
width: 9.46rem;
height: 0.8rem;
}
.title-right {
width: 5.04rem;
height: 0.78rem;
}
.sys-title {
position: absolute;
top: 40%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 0.28rem;
color: #ffffff;
font-weight: bold;
z-index: 100;
cursor: pointer;
}
.nowTime {
position: absolute;
top: 0.37rem;
right: 0.6rem;
font-size: 0.18rem;
color: #ffffff;
font-weight: bold;
z-index: 100;
}
.sys-logo {
width: 1.8rem;
height: 0.5rem;
position: absolute;
top: 0.26rem;
left: 0.8rem;
z-index: 10;
}
.monitor-time {
position: absolute;
top: 0.44rem;
left: 4.2rem;
z-index: 10;
font-size: 0.18rem;
color: #ffffff;
font-weight: bold;
}
.icon_warning {
position: absolute;
top: 0.39rem;
right: 4.4rem;
z-index: 10;
width: 0.35rem;
height: 0.32rem;
margin: 0 0.25rem 0 0.27rem;
cursor: pointer;
/* 添加闪烁动画 */
animation: blink 1s infinite;
}
@keyframes blink {
100% {
opacity: 1;
}
50% {
opacity: 0;
}
}
.icon_home {
position: absolute;
top: 0.39rem;
right: 4rem;
z-index: 10;
width: 0.35rem;
height: 0.32rem;
margin: 0 0.2rem 0 0.27rem;
cursor: pointer;
}
.back-icon {
position: absolute;
top: 0.39rem;
right: 3.7rem;
z-index: 10;
width: 0.35rem;
height: 0.32rem;
cursor: pointer;
}
}
}
</style>
Loading…
Cancel
Save