Browse Source

1.中央空调-对接系统监测、系统控制模块

dev
selia-zx 1 month ago
parent
commit
9f704c052f
  1. 60
      src/api/centerairC/sysMonitor.js
  2. 18
      src/api/hotWater/waterControl.js
  3. 18
      src/api/hotWater/waterMonitor.js
  4. 47
      src/api/index.js
  5. 1
      src/assets/icons/svg/controlSys.svg
  6. 1
      src/assets/icons/svg/hotWater.svg
  7. 1
      src/assets/icons/svg/monitorSys.svg
  8. BIN
      src/assets/images/fan-img.png
  9. BIN
      src/assets/images/fan-img2.png
  10. BIN
      src/assets/images/haiwang.png
  11. BIN
      src/assets/images/host-img.png
  12. BIN
      src/assets/images/host-img2.png
  13. BIN
      src/assets/images/in-arrow.png
  14. BIN
      src/assets/images/offOrON.png
  15. BIN
      src/assets/images/out-arrow.png
  16. BIN
      src/assets/images/overview-img.png
  17. BIN
      src/assets/images/project-icon1.png
  18. BIN
      src/assets/images/project-icon2.png
  19. BIN
      src/assets/images/project-icon3.png
  20. BIN
      src/assets/images/project-icon4.png
  21. BIN
      src/assets/images/project-icon5.png
  22. BIN
      src/assets/images/pump-fan.png
  23. BIN
      src/assets/images/text_img_title.png
  24. BIN
      src/assets/images/title-bg.png
  25. 32
      src/assets/styles/element-ui.scss
  26. 528
      src/views/centerairC/sysControl/index.vue
  27. 1360
      src/views/centerairC/sysMonitor/index.vue
  28. 120
      src/views/centerairC/sysMonitor/lineChildren.vue
  29. 578
      src/views/components/viewColdSys.vue
  30. 293
      src/views/components/viewEnergy.vue
  31. 330
      src/views/hotWater/waterControl/index.vue
  32. 18
      src/views/hotWater/waterMonitor/index.vue
  33. 649
      src/views/index.vue
  34. 264
      src/views/region/index.vue

60
src/api/centerairC/sysMonitor.js

@ -1,27 +1,51 @@
import request from '@/utils/request'
import request from "@/utils/request";
// 查询设备参数列表
export function cmpList(query) {
// 获取天气相关数据
export function weatherData() {
return request({
url: '/device/cmp/list',
method: 'get',
params: query
})
url: "/device/cs/getWeatherData",
method: "get",
});
}
// 根据id查询设备参数信息
export function getCMP(cmpId) {
// 获取运行时间
export function runTime() {
return request({
url: '/device/cmp/' + cmpId,
method: 'get'
})
url: "/device/cs/runTime",
method: "get",
});
}
// 新增设备参数
export function addCMP(data) {
// 获取系统性能数据
export function sysPerformance() {
return request({
url: '/device/cmp',
method: 'post',
data: data
})
url: "/device/cs/sysPerformance",
method: "get",
});
}
// 系统监测列表
export function monitorList(query) {
return request({
url: "/device/cs/monitor/list",
method: "get",
params: query,
});
}
// 查询系统控制列表
export function operationList(query) {
return request({
url: "/device/cs/operation/list",
method: "get",
params: query,
});
}
// 系统控制
export function operationConrol(data) {
return request({
url: "/device/operation",
method: "post",
data: data,
});
}

18
src/api/hotWater/waterControl.js

@ -0,0 +1,18 @@
import request from "@/utils/request";
// 控制列表
export function waterOperateList(query) {
return request({
url: "/device/hotWater/operateList",
method: "get",
params: query,
});
}
// 系统控制
export function operationConrol(data) {
return request({
url: "/device/operation",
method: "post",
data: data,
});
}

18
src/api/hotWater/waterMonitor.js

@ -0,0 +1,18 @@
import request from "@/utils/request";
// 公共信息
export function waterPublic(query) {
return request({
url: "/device/hotWater/monitorPublic",
method: "get",
params: query,
});
}
// 系统状态显示
export function waterMonitorList(query) {
return request({
url: "/device/hotWater/monitorList",
method: "get",
params: query,
});
}

47
src/api/index.js

@ -0,0 +1,47 @@
import request from "@/utils/request";
// 获取项目简介数据
export function introduction() {
return request({
url: "/pro/overview/introduction",
method: "get",
});
}
// 项目logo上传
export function changeLogo(data) {
const formData = new FormData();
Object.keys(data).forEach((key) => {
formData.append(key, data[key]);
});
return request({
url: "/pro/overview/logo",
method: "post",
data: formData,
headers: {
"Content-Type": "multipart/form-data",
},
// responseType: 'blob',
});
}
// 项目概况
export function viewProfile() {
return request({
url: "/pro/overview/profile",
method: "get",
});
}
// 最近12月能耗
export function viewYearEnergy() {
return request({
url: "/pro/overview/energyAnalysis",
method: "get",
});
}
// 各个系统主要参数值
export function viewMainParams() {
return request({
url: "/pro/overview/mainParams",
method: "get",
});
}

1
src/assets/icons/svg/controlSys.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1743062647933" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10613" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M511.890095 1023.660073c-282.279354 0-511.890024-229.61067-511.890024-511.770049s229.61067-511.890024 511.890024-511.890024c282.279354 0 511.890024 229.61067 511.890023 511.890024 0 282.279354-229.600672 511.770049-511.890023 511.770049z m0-952.005468c-242.747847 0-440.235418 197.477573-440.235419 440.235419s197.477573 440.235418 440.235419 440.235418S952.125513 754.637871 952.125513 511.890024 754.64794 71.654605 511.890095 71.654605z m0 21.435395" fill="" p-id="10614"></path><path d="M511.890095 191.90877l133.671281 133.671281h-267.342563l133.671282-133.671281z m0 639.95251l133.671281-133.671282h-267.342563l133.671282 133.671282zM191.918838 511.890024l133.671282-133.671282v267.342563l-133.671282-133.671281z m639.952511 0l-133.671282-133.671282v267.342563l133.671282-133.671281z m0 0" fill="" p-id="10615"></path></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

1
src/assets/icons/svg/hotWater.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1743148872137" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2792" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M591.856014 1010.759795a23.584395 23.584395 0 0 1-23.584396-23.584395v-207.392936a23.584395 23.584395 0 0 1 23.584396-23.584395h160.972856a23.584395 23.584395 0 0 1 23.584395 23.584395v33.317638a14.225508 14.225508 0 0 0 14.225508 14.225508h31.445861a14.225508 14.225508 0 0 0 14.225508-14.225508v-198.408404a14.225508 14.225508 0 0 0-14.225508-14.225508h-31.071505a14.225508 14.225508 0 0 0-14.225508 14.225508V636.404316a23.584395 23.584395 0 0 1-23.584396 23.584395h-160.972856a23.584395 23.584395 0 0 1-23.584395-23.584395v-127.280864H293.869052v475.805815a23.584395 23.584395 0 0 1-47.168791 0V484.041635a23.584395 23.584395 0 0 1 23.584395-23.584395h321.197002a23.584395 23.584395 0 0 1 23.584395 23.584395v127.280863h112.306644a61.394299 61.394299 0 0 1 61.019943-58.025099h31.071505a61.394299 61.394299 0 0 1 61.019943 61.019943v198.034049a61.394299 61.394299 0 0 1-61.019943 61.019943h-31.071505a61.394299 61.394299 0 0 1-61.019943-61.019943v-9.733242h-112.306644v184.557251a23.584395 23.584395 0 0 1-23.584395 23.584395z m0 0" fill="" p-id="2793"></path><path d="M344.781397 909.30946a23.21004 23.21004 0 0 1-17.220352-7.487109 23.584395 23.584395 0 0 1 0-32.943282c24.333106-22.835684 43.05088-53.158478 17.594707-122.414242a134.393617 134.393617 0 0 1 32.568927-155.73188 23.584395 23.584395 0 0 1 29.199728 37.435548 89.096604 89.096604 0 0 0-17.594708 102.947757c37.435548 96.583714 0 144.875571-29.574083 172.952232a23.584395 23.584395 0 0 1-16.097286 6.364043z m92.840159 0a23.21004 23.21004 0 0 1-17.220352-7.487109 23.21004 23.21004 0 0 1 0-32.943282c24.333106-22.835684 43.05088-53.158478 17.594707-122.414242a134.393617 134.393617 0 0 1 32.568927-155.73188 23.584395 23.584395 0 0 1 29.199727 37.435548 89.096604 89.096604 0 0 0-17.594707 102.947757c37.435548 96.583714 0 144.875571-29.574083 172.952232a23.584395 23.584395 0 0 1-16.097286 6.364043z m0 0" fill="" p-id="2794"></path><path d="M980.437002 243.331062L552.174333 10.481953a86.850471 86.850471 0 0 0-83.855628 0L39.681681 248.946394A77.491584 77.491584 0 0 0 0 316.33038v667.475821a32.943282 32.943282 0 1 0 65.886564 0V316.704736a11.60502 11.60502 0 0 1 5.989688-10.107598l428.637024-238.090085a20.963907 20.963907 0 0 1 20.589552 0L949.365497 299.484384a11.60502 11.60502 0 0 1 5.989687 10.107598v677.957774a32.943282 32.943282 0 1 0 65.512209 0V311.089404a77.117229 77.117229 0 0 0-40.430391-67.758342z" fill="" p-id="2795"></path><path d="M647.63498 497.144077H214.880045a70.37883 70.37883 0 0 1-70.37883-70.37883V345.155752a70.37883 70.37883 0 0 1 70.37883-70.37883H647.63498a70.37883 70.37883 0 0 1 70.37883 70.37883v81.609495a70.37883 70.37883 0 0 1-70.37883 70.37883zM214.880045 321.571357a23.584395 23.584395 0 0 0-23.584395 23.584395v81.609495a23.584395 23.584395 0 0 0 23.584395 23.584395H647.63498a23.584395 23.584395 0 0 0 23.584395-23.584395V345.155752a23.584395 23.584395 0 0 0-23.584395-23.584395z m0 0" fill="" p-id="2796"></path><path d="M262.048836 336.919932a26.204884 26.204884 0 0 0-24.707462 27.32795v93.963225A26.204884 26.204884 0 0 0 262.048836 486.662124h455.964974a26.204884 26.204884 0 0 0 24.707462-27.32795V364.996593a26.204884 26.204884 0 0 0-24.707462-28.076661z m0 0" fill="" p-id="2797"></path></svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

1
src/assets/icons/svg/monitorSys.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1743062569565" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5173" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M694.86848 494.445714a182.857143 182.857143 0 1 0-182.857143 182.857143 182.857143 182.857143 0 0 0 182.857143-182.857143z m-292.571429 0a109.714286 109.714286 0 1 1 109.714286 109.714286 109.714286 109.714286 0 0 1-109.714286-109.714286z" fill="" p-id="5174"></path><path d="M459.714194 194.925714a52.662857 52.297143 90 1 0 104.594286 0 52.662857 52.297143 90 1 0-104.594286 0Z" fill="" p-id="5175"></path><path d="M709.131337 798.354286A424.228571 424.228571 0 0 0 512.011337 0a424.228571 424.228571 0 0 0-207.725714 792.502857l-73.142857 158.354286H109.725623v73.142857h804.571428v-73.142857h-146.285714zM164.582766 423.862857a348.16 348.16 0 1 1 348.16 350.72 349.622857 349.622857 0 0 1-348.16-350.72zM371.577051 822.857143a421.302857 421.302857 0 0 0 141.165715 24.868571 412.525714 412.525714 0 0 0 129.828571-20.845714l47.542857 123.977143H312.697051z" fill="" p-id="5176"></path></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
src/assets/images/fan-img.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
src/assets/images/fan-img2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
src/assets/images/haiwang.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 MiB

BIN
src/assets/images/host-img.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
src/assets/images/host-img2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
src/assets/images/in-arrow.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
src/assets/images/offOrON.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
src/assets/images/out-arrow.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
src/assets/images/overview-img.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
src/assets/images/project-icon1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
src/assets/images/project-icon2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
src/assets/images/project-icon3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
src/assets/images/project-icon4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
src/assets/images/project-icon5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
src/assets/images/pump-fan.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
src/assets/images/text_img_title.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
src/assets/images/title-bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

32
src/assets/styles/element-ui.scss

@ -1317,22 +1317,44 @@
.el-radio {
color: #ffffff !important;
}
.tree-border{
.tree-border {
border: 1px solid #0163a8 !important;
box-shadow: inset 0 0 10px rgba(1, 99, 168, 0.5); /* 外部发光效果 */
}
.el-input-number__increase, .el-input-number__decrease{
.el-input-number__increase,
.el-input-number__decrease {
background: #b0ccdc;
}
.el-table .el-dropdown, .el-icon-arrow-down{
.el-table .el-dropdown,
.el-icon-arrow-down {
color: #606266;
}
.ql-editor p, .ql-editor ol, .ql-editor pre, .ql-editor blockquote, .ql-editor h1, .ql-editor h2, .ql-editor h3, .ql-editor h4, .ql-editor h5, .ql-editor h6{
.ql-editor p,
.ql-editor ol,
.ql-editor pre,
.ql-editor blockquote,
.ql-editor h1,
.ql-editor h2,
.ql-editor h3,
.ql-editor h4,
.ql-editor h5,
.ql-editor h6 {
color: #ffffff !important;
}
.ql-snow.ql-toolbar button svg, .ql-snow .ql-toolbar button svg{
.ql-snow.ql-toolbar button svg,
.ql-snow .ql-toolbar button svg {
color: #ffffff !important;
}
.el-dialog__body {
color: #ffffff;
}
.el-upload-list__item-actions {
border: solid 1px #0163a8 !important;
}
.el-upload--picture-card{
background-color: transparent !important;
border: 1px dashed #0163a8 !important;
}
.el-switch__label{
color: #d1cfcf;
}

528
src/views/centerairC/sysControl/index.vue

@ -0,0 +1,528 @@
<template>
<div class="app-container">
<!-- 状态统计 -->
<div class="status-statistics">
<div class="status-card">
<div class="status-label">运行设备</div>
<div class="status-value-running">
{{ statistics.running }}/{{ deviceList.length }}
</div>
</div>
<div class="status-card">
<div class="status-label">手动模式</div>
<div class="status-value-auto">
{{ statistics.manual }}/{{ deviceList.length }}
</div>
</div>
<div class="status-card">
<div class="status-label">自动模式</div>
<div class="status-value-maintenance">
{{ statistics.auto }}/{{ deviceList.length }}
</div>
</div>
<div class="status-card">
<div class="status-label">故障设备</div>
<div class="status-value-error">
{{ statistics.warn }}/{{ deviceList.length }}
</div>
</div>
</div>
<!-- 非蝶阀控制列表 -->
<div class="device-container">
<div class="device-li">
<div class="device-name">设备名称</div>
<div class="device-name">运行状态</div>
<div class="device-name">手动控制</div>
<div class="device-name">手自动切换</div>
<div class="device-name">故障报警</div>
<div class="device-name">频率调节</div>
<div class="device-name">频率反馈</div>
</div>
<div class="device-li" v-for="(item, index) in deviceList" :key="index">
<div class="device-name">{{ item.name }}</div>
<div class="device-name">
<div
class="run"
:class="item.runStatus === '运行' ? 'run' : 'no-run'"
>
{{ item.runStatus }}
</div>
</div>
<div class="device-name">
<el-switch
style="display: block"
v-model="item.controlText"
active-color="#13ce66"
inactive-color="#ff4949"
active-text="开启"
inactive-text="停止"
@change="handleControlText(item)"
>
</el-switch>
</div>
<div class="device-name">
<span
:class="
item.automaticText === '手动'
? 'strong-electric'
: 'auto-electric'
"
>{{ item.automaticText }}</span
>
</div>
<div class="device-name">
<div :class="item.warnText === '故障' ? 'bad-status' : 'good-status'">
{{ item.warnText }}
</div>
</div>
<div class="device-name">
<el-input
v-if="item.frequencySet !== null && item.frequencySet !== undefined"
v-model="item.frequencySet"
size="mini"
@keyup.enter.native="handleEnter(item)"
@input="handleInput(item)"
></el-input>
<div class="device-name" v-else></div>
</div>
<div class="device-name" v-if="item.frequency">
{{ item.frequency }}Hz
</div>
<div class="device-name" v-else></div>
</div>
</div>
<!-- 蝶阀控制列表 -->
<div class="device-container second">
<div class="device-li">
<div class="device-name">设备名称</div>
<div class="device-name">手动阀关控制</div>
<div class="device-name">阀关反馈</div>
<div class="device-name">手动阀开控制</div>
<div class="device-name">阀开反馈</div>
</div>
<div class="device-li" v-for="(item, index) in valveList" :key="index">
<div class="device-name">{{ item.name }}</div>
<div class="device-name">
<el-switch
style="display: block"
v-model="item.openText"
active-color="#13ce66"
inactive-color="#ff4949"
active-text="开启"
inactive-text="停止"
@change="handleValveOpen(item)"
>
</el-switch>
</div>
<div class="device-name">
<div
:class="item.openStauts === '关闭' ? 'bad-status' : 'good-status'"
>
{{ item.openStauts }}
</div>
</div>
<div class="device-name">
<el-switch
style="display: block"
v-model="item.closeText"
active-color="#13ce66"
inactive-color="#ff4949"
active-text="开启"
inactive-text="停止"
@change="handleValveClose(item)"
>
</el-switch>
</div>
<div class="device-name">
<div
:class="item.closeStatus === '关闭' ? 'bad-status' : 'good-status'"
>
{{ item.closeStatus }}
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { operationList, operationConrol } from "@/api/centerairC/sysMonitor";
export default {
name: "sysMonitor",
data() {
return {
deviceList: [
{
name: "",
runStatus: "",
controlText: "",
automaticText: "",
warnText: "",
frequencySet: "",
frequency: "",
},
],
valveList: [
{
name: "",
openText: "",
openStatus: "",
closeText: "",
closeStatus: "",
},
],
};
},
computed: {
statistics() {
return {
running: this.deviceList.filter((d) => d.runStatus === "运行").length,
manual: this.deviceList.filter((d) => d.automaticText === "手动")
.length,
auto: this.deviceList.filter((d) => d.automaticText === "自动").length,
warn: this.deviceList.filter((d) => d.warnText === "故障").length,
};
},
},
mounted() {
this.getOperationList();
},
methods: {
getOperationList() {
operationList({ systemType: 0 }).then((res) => {
console.log("列表返回res", res);
if (res.code == 200) {
let handleList = res.rows;
this.deviceList = [];
this.valveList = [];
handleList.forEach((element) => {
if (element.children && element.children.length > 0) {
//
let deviceItem = {
name: element.name,
};
//
let valveItem = {
name: element.name,
};
//
const limitedChildren = element.children;
limitedChildren.forEach((child) => {
if (child.name) {
if (child.name.includes("运行状态")) {
deviceItem.runStatus =
child.value === "0.000" ? "不运行" : "运行";
} else if (child.name.includes("启停控制")) {
deviceItem.controlText =
child.value === "0.000" ? false : true;
deviceItem.controlId = child.id;
} else if (child.name.includes("手自动状态")) {
deviceItem.automaticText =
child.value === "0.000" ? "自动" : "手动";
} else if (child.name.includes("故障报警")) {
deviceItem.warnText =
child.value === "0.000" ? "未故障" : "故障";
} else if (child.name.includes("频率调节")) {
deviceItem.frequencySet =
child.value === "0.000" ? "0" : child.value;
deviceItem.frequencyId = child.id;
} else if (child.name.includes("频率反馈")) {
deviceItem.frequency = child.value;
} else if (child.name.includes("阀开反馈")) {
valveItem.openStauts =
child.value === "0.000" ? "关闭" : "开启";
} else if (
child.name.includes("阀开") &&
!child.name.includes("反馈")
) {
valveItem.openText = child.value === "0.000" ? false : true;
valveItem.openId = child.id;
} else if (
child.name.includes("阀关") &&
!child.name.includes("反馈")
) {
valveItem.colseText =
child.value === "0.000" ? false : true;
valveItem.closeId = child.id;
} else if (child.name.includes("阀关反馈")) {
valveItem.closeStatus =
child.value === "0.000" ? "关闭" : "开启";
}
}
});
// console.log("", deviceItem);
// deviceList
if (Object.keys(deviceItem).length > 1) {
this.deviceList.push(deviceItem);
}
// valveList
if (Object.keys(valveItem).length > 1) {
this.valveList.push(valveItem);
}
}
});
console.log("处理过的this.deviceList", this.deviceList);
console.log("处理过的this.valveList", this.valveList);
}
});
},
//
handleInput(item) {
console.log("校验");
//
item.frequencySet = String(item.frequencySet).replace(/[^\d]/g, "");
},
handleEnter(item) {
console.log("请求后端");
this.$confirm(
`确定要修改"${item.name}"的频率为:${item.frequencySet} Hz吗?"`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
this.operationConrol(item.frequencyId, item.frequencySet);
})
.catch(() => {
//
this.getOperationList();
});
},
//
handleControlText(item) {
this.$confirm(
`确定要切换设备"${item.name}"的状态为:${
item.controlText ? "开启" : "停止 吗?"
}`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
//
console.log("请求后台", item.controlText);
let param = null;
if (item.controlText) {
param = 1;
} else {
param = 0;
}
this.operationConrol(item.controlId, param);
})
.catch(() => {
//
item.controlText = !item.controlText;
console.log("不请求后台");
});
},
//
handleValveClose(item) {
this.$confirm(
`确定要切换设备"${item.name}"的状态为:${
item.closeText ? "开启" : "停止 吗?"
}`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
let param = null;
if (item.closeText) {
param = 1;
} else {
param = 0;
}
this.operationConrol(item.closeId, param);
})
.catch(() => {
//
item.closeText = !item.closeText;
console.log("不请求后台");
});
},
//
handleValveOpen(item) {
this.$confirm(
`确定要切换设备"${item.name}"的状态为:${
item.openText ? "开启" : "停止 吗?"
}`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
let param = null;
if (item.openText) {
param = 1;
} else {
param = 0;
}
this.operationConrol(item.openId, param);
})
.catch(() => {
//
item.openText = !item.openText;
console.log("不请求后台");
});
},
operationConrol(id, param) {
let data = {
id: id,
param: param,
};
console.log("操作参数", data);
operationConrol([data]).then((res) => {
if (res.code == 200) {
this.$modal.msgSuccess("操作成功");
// ;
this.getOperationList();
} else {
this.$modal.msgError("操作失败");
// ;
this.getOperationList();
}
});
},
},
};
</script>
<style lang="scss" scoped>
/* 设备控制列表样式 */
.device-container {
display: flex;
flex-direction: column;
width: 100%;
background-color: #142c4e;
padding: 10px 10px 30px 10px;
border-radius: 10px;
.device-li {
flex: 1;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
padding: 12px 0;
color: #abcdfc;
border-bottom: 1px dashed #0349ac;
.device-name {
flex: 1;
white-space: nowrap;
.run {
display: flex;
flex-direction: row;
align-items: center;
display: block;
}
.run::before {
content: "";
display: inline-block;
width: 10px;
height: 10px;
background-color: rgb(16, 231, 16);
border-radius: 50%;
margin-right: 5px;
}
.no-run {
display: flex;
flex-direction: row;
align-items: center;
display: block;
}
.no-run::before {
content: "";
display: inline-block;
width: 10px;
height: 10px;
background-color: rgb(180, 180, 180);
border-radius: 50%;
margin-right: 5px;
}
.el-input {
width: 100px;
}
.strong-electric {
background-color: rgba(59, 130, 246, 0.2);
color: #60a5fa;
padding: 5px 20px;
border-radius: 10px;
}
.auto-electric {
background-color: rgba(231, 144, 45, 0.2);
color: #e47f21;
padding: 5px 20px;
border-radius: 10px;
}
.good-status {
color: #4ade80;
}
.bad-status {
color: #f05348;
}
}
}
.device-li:nth-child(1) {
color: #9ca3af;
}
}
.second {
margin-top: 20px;
}
/* 状态统计样式 */
.status-statistics {
margin-bottom: 25px;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.status-card {
background-color: #142c4e;
border-radius: 10px;
padding: 10px;
width: 24%;
}
.status-label {
color: #9ca3af;
margin-bottom: 20px;
}
.status-value-running {
font-size: 24px;
font-weight: bold;
color: #22c55e;
}
.status-value-auto {
font-size: 24px;
font-weight: bold;
color: #60a5fa;
}
.status-value-error {
font-size: 24px;
font-weight: bold;
color: #ef4444;
}
.status-value-maintenance {
font-size: 24px;
font-weight: bold;
color: #f59e0b;
}
</style>

1360
src/views/centerairC/sysMonitor/index.vue

File diff suppressed because it is too large Load Diff

120
src/views/centerairC/sysMonitor/lineChildren.vue

@ -0,0 +1,120 @@
<template>
<div class="line-container">
<!-- 第一个圆点 -->
<div class="dot dot-start"></div>
<!-- 第一条直线 -->
<div
class="line line1"
:style="{
transform: `rotate(${angle1}deg)`,
width: lineWidth1Rem + 'rem'
}"
></div>
<!-- 中间圆点 -->
<div
class="dot dot-mid"
:style="{
top: (1 + Math.sin((angle1 * Math.PI) / 180) * lineWidth1Rem - 0.025) + 'rem',
left: (1 + Math.cos((angle1 * Math.PI) / 180) * lineWidth1Rem - 0.025) + 'rem'
}"
></div>
<!-- 第二条直线 -->
<div
class="line line2"
:style="{
top: (1 + Math.sin((angle1 * Math.PI) / 180) * lineWidth1Rem) + 'rem',
left: (1 + Math.cos((angle1 * Math.PI) / 180) * lineWidth1Rem) + 'rem',
transform: `rotate(${angle2}deg)`,
width: lineWidth2Rem + 'rem'
}"
></div>
<!-- 最后一个圆点 -->
<div
class="dot dot-end"
:style="{
top: endDotTop + 'rem',
left: endDotLeft + 'rem'
}"
></div>
</div>
</template>
<script>
export default {
props: {
// 线
angle1: {
type: Number,
default: 0
},
// 线
angle2: {
type: Number,
default: 0
},
// 线px
lineWidth1: {
type: Number,
default: 100
},
// 线px
lineWidth2: {
type: Number,
default: 100
}
},
computed: {
lineWidth1Rem() {
return this.lineWidth1 / 100;
},
lineWidth2Rem() {
return this.lineWidth2 / 100;
},
endDotTop() {
// 线 y
const firstLineEndY = 1 + Math.sin((this.angle1 * Math.PI) / 180) * this.lineWidth1Rem;
// 线线 y
const secondLineYOffset = Math.sin((this.angle2 * Math.PI) / 180) * this.lineWidth2Rem;
return firstLineEndY + secondLineYOffset - 0.025;
},
endDotLeft() {
// 线 x
const firstLineEndX = 1 + Math.cos((this.angle1 * Math.PI) / 180) * this.lineWidth1Rem;
// 线线 x
const secondLineXOffset = Math.cos((this.angle2 * Math.PI) / 180) * this.lineWidth2Rem;
return firstLineEndX + secondLineXOffset - 0.025;
}
}
};
</script>
<style scoped>
.line-container {
position: relative;
}
.line {
position: absolute;
height: 1px;
background-color: rgba(0, 255, 255, 0.3);
transform-origin: left center;
}
.line1 {
top: 1rem;
left: 1rem;
}
.dot {
position: absolute;
width: 0.05rem;
height: 0.05rem;
background-color: aqua;
border-radius: 50%;
}
.dot-start {
top: 0.97rem;
left: 0.97rem;
}
</style>

578
src/views/components/viewColdSys.vue

@ -0,0 +1,578 @@
<template>
<div class="energy_content">
<div class="sys_charts" ref="sys_charts"></div>
<div class="eer">实时EER</div>
</div>
</template>
<script>
import * as echarts from "echarts";
import { viewMainParams } from "@/api/index";
export default {
data() {
return {
chartInstance: null,
option: {},
isShowModule: false,
energyCostText: "eer数据",
dateType: "",
dateUse: "",
timeType: "", //
startTime: "",
endTime: "",
backData: {
usedValue: "0",
maxValue: 100, //
momValueRate: "0%",
yoyValueRate: "0%",
usedMoney: "0",
maxMoney: 100,
momMoneyRate: "0%",
yoyMoneyRate: "0%",
},
useForm: {
useData: 5,
maxData: 10, //
},
};
},
mounted() {
this.initChart();
this.screenAdapter();
window.addEventListener("resize", this.screenAdapter);
this.getChartsData();
},
destroyed() {
//mounted
window.removeEventListener("resize", this.screenAdapter);
},
methods: {
//
getAxisLineColor(useData, maxData) {
//
// 0.75使
const threshold = maxData * 0.75;
//
if (useData > threshold) {
return [
[
useData / maxData,
new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{ offset: 0, color: "rgba(0,127,208,1)" },
{ offset: 0.6, color: "rgba(0,127,208,1)" },
{ offset: 1, color: "rgba(69, 235, 167,0.5)" },
]),
],
[1, "rgba(28,128,245,.0)"],
];
} else {
return [
[
useData / maxData,
new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{ offset: 0, color: "rgba(0,127,208,1)" },
{ offset: 0.5, color: "rgba(0,127,208,1)" },
{ offset: 1, color: "rgba(0,127,208,1)" },
]),
],
[1, "rgba(28,128,245,.0)"],
];
}
},
//chartInstance2 线
initChart() {
// 使
const axisLineColor = this.getAxisLineColor(
this.useForm.useData,
this.useForm.maxData
);
this.chartInstance = echarts.init(this.$refs.sys_charts);
// var dataArr = 80;
this.option = {
backgroundColor: "transparent",
tooltip: {
formatter: "{a} <br/>{b} : {c}",
},
series: [
{
name: "内部动态阴影",
type: "gauge",
center: ["50%", "100%"],
startAngle: 180,
endAngle: -0,
radius: "155%",
z: 1,
splitNumber: 10,
axisLine: {
lineStyle: {
color: axisLineColor,
//
// width: 80,
},
},
axisLabel: {
show: false,
},
axisTick: {
show: false,
},
splitLine: {
show: false,
},
itemStyle: {
show: false,
},
textStyle: {
formatter: function (value) {
if (value !== 0) {
return parseInt(value);
} else {
return 0;
}
},
offsetCenter: [0, 5],
detail: {
padding: [0, 0, 0, 0],
// fontSize: titleFontSize * 1.2,
color: "#EDFFFD",
},
},
title: {
//
show: false,
},
pointer: {
show: false,
},
},
{
//
name: "蓝色背景",
type: "gauge",
center: ["50%", "100%"],
//
startAngle: 200,
//
endAngle: -20,
radius: "155%",
z: 0, //
splitNumber: 10,
axisLine: {
lineStyle: {
color: [
[1, "#01366d"], //
],
},
},
axisLabel: {
show: false,
},
axisTick: {
show: false,
},
splitLine: {
show: false,
},
itemStyle: {
show: false,
},
textStyle: {
show: false,
},
title: {
show: false,
},
pointer: {
show: false,
},
},
{
name: "内部大边框",
type: "gauge",
z: 2,
min: 0,
max: this.useForm.maxData,
splitNumber: 10,
radius: "180%",
center: ["50%", "100%"],
startAngle: 180,
endAngle: -0,
axisLine: {
lineStyle: {
color: [[1, "#023B80"]],
width: 3,
//
shadowColor: "rgba(14,31,73)",
shadowBlur: 6,
shadowOffsetX: 0,
},
},
tooltip: {
show: false,
},
axisLabel: {
show: false,
},
axisTick: {
show: false,
},
splitLine: {
show: false,
},
itemStyle: {
show: false,
},
detail: {
show: false,
},
title: {
//
show: false,
},
pointer: {
show: false,
},
},
{
name: "指针上的圆",
//
type: "pie",
tooltip: {
show: false,
},
emphasis: {
scale: false, //
},
legendHoverLink: false,
radius: ["0%", "70%"],
center: ["50%", "100%"],
startAngle: 120,
endAngle: -0,
labelLine: {
show: false,
},
axisLine: {
lineStyle: {
color: [[1, "#F2BF59"]],
width: 3,
//
shadowColor: "rgba(14,31,73)",
shadowBlur: 60,
shadowOffsetX: 0,
},
},
label: {
show: false,
},
data: [
{
value: 120,
itemStyle: {
color: "#00223a",
},
},
],
z: 4,
},
{
name: "指针上的渐变圆",
//-
type: "pie",
tooltip: {
show: false,
},
emphasis: {
scale: false, //
},
legendHoverLink: false,
radius: ["0%", "70%"],
center: ["50%", "100%"],
startAngle: 120,
endAngle: 0,
labelLine: {
show: false,
},
axisLine: {
lineStyle: {
color: [[1, "#F2BF59"]],
width: 3,
//
shadowColor: "rgba(14,31,73)",
shadowBlur: 60,
shadowOffsetX: 0,
},
},
z: 5,
},
{
//
name: this.energyCostText,
type: "gauge",
radius: "175%",
center: ["50%", "100%"],
min: 0, //
max: this.useForm.maxData, //
splitNumber: 0, //
startAngle: 180,
endAngle: -0,
axisLine: {
show: false,
}, //线
axisLabel: {
show: true,
color: "rgba(4,112,212,1)",
// distance: 16,
// fontSize: 12,
formatter: (value) => {
// 0
if (value === 0 || value == this.useForm.maxData) {
// 100
return value;
}
return "";
},
}, //-
axisTick: {
show: true,
// splitNumber: 5,
lineStyle: {
color: "rgba(4,112,212,1)", //
// width: 3,
},
// length: 6,
}, //
splitLine: {
show: true,
// length: 6,
lineStyle: {
color: "rgba(106, 104, 228, 0.5)", //
},
}, //线
itemStyle: {
show: false,
},
detail: {
show: false,
},
title: {
//
show: false,
},
data: [
{
name: this.dateUse,
value: this.useForm.useData,
},
],
itemStyle: {
color: "#EDF85B",
},
pointer: {
show: true,
length: "60%",
radius: "30%",
shape: "triangle", // 使
// width: 15, //
itemStyle: {
color: "rgb(3, 105, 206,0.5)", //
// shadowColor: "rgb(104, 194, 247, 1)", //
shadowBlur: 20, //
},
},
animationDuration: 4000,
z: 2,
},
],
};
//
this.chartInstance.setOption(this.option, true);
},
screenAdapter() {
const titleFontSize = this.$refs.sys_charts.offsetWidth / 18;
const adapterOption = {
series: [
{
name: "内部动态阴影",
type: "gauge",
axisLine: {
lineStyle: {
width: titleFontSize * 1,
},
},
},
{
name: "蓝色背景",
type: "gauge",
axisLine: {
lineStyle: {
width: titleFontSize * 1,
},
},
},
{
//
name: this.energyCostText,
axisLabel: {
distance: titleFontSize,
fontSize: titleFontSize / 4,
},
axisTick: {
distance: -(titleFontSize / 70),
lineStyle: {
width: titleFontSize / 20,
},
length: titleFontSize / 5,
}, //
splitLine: {
distance: -(titleFontSize / 70),
lineStyle: {
width: titleFontSize / 20,
},
length: titleFontSize / 3.6,
}, //线
pointer: {
width: titleFontSize / 2, //
},
},
],
};
this.chartInstance.setOption(adapterOption);
this.chartInstance.resize();
},
//
getChartsData() {
viewMainParams().then((res) => {
console.log("系统参数返回", res);
console.log("冷源监控返回",res.rows[0]);
if (res.code == 200) {
this.useForm.maxData = 10;
this.useForm.useData = res.rows[0].values[0].value;
let that = this;
// 使
const axisLineColor = this.getAxisLineColor(
this.useForm.useData,
this.useForm.maxData
);
const adapterOption = {
series: [
{
name: "内部动态阴影",
axisLine: {
lineStyle: {
color: axisLineColor,
//
// width: 80,
},
},
},
{
name: "内部大边框",
min: 0,
max: this.useForm.maxData,
},
{
name: "指针上的圆",
data: [
{
value: 5,
},
],
},
{
name: "指针上的渐变圆",
label: {
show: true,
position: "center", //
offset: [0, -5], // 10
formatter: function () {
// HTML 使 rich
return `{line|${that.useForm.useData}}`;
},
rich: {
line: {
color: "#fff", //
fontSize: 20, //
lineHeight: 0, //
},
},
},
data: [
{
value: 0,
itemStyle: {
//
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgb(4,112,212)", //
},
{
offset: 0.3,
color: "rgba(0, 46, 93)", //
},
],
global: false, // false
},
},
},
],
},
{
//
name: this.energyCostText,
max: this.useForm.maxData, //
axisLabel: {
formatter: (value) => {
// 0
if (value === 0 || value == this.useForm.maxData) {
// 100
return value;
}
return "";
},
},
data: [
{
name: this.dateUse,
value: this.useForm.useData,
},
],
},
],
};
this.chartInstance.setOption(adapterOption);
//resize
this.chartInstance.resize();
}
});
},
},
};
</script>
<style lang="scss" scoped>
.energy_content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100% !important;
height: 100%;
.sys_charts {
width: 100%;
height: 1.6rem;
}
.eer {
font-size: 18px;
margin-top: 25px;
}
}
</style>

293
src/views/components/viewEnergy.vue

@ -0,0 +1,293 @@
<template>
<div style="width: 100%; height: 100%">
<div class="right-table">
<div class="choice">
<div
class="mr20"
v-for="(item, index) in energyTypes"
:key="index"
@click="handleEnter(index, item.name)"
:class="{ timeStyle: sharedIndex == index }"
>
{{ item.name }}
</div>
</div>
<div class="charts" ref="chart_ref"></div>
</div>
</div>
</template>
<script>
import * as echarts from "echarts";
import { viewYearEnergy } from "@/api/index";
export default {
data() {
return {
energyTypes: [],
sharedIndex: 0,
chartInstance: null,
option: {},
colorList: [
{
color: "#00CED1",
offsetColor1: "rgba(0, 206, 209, 0.5)",
offsetColor2: "rgba(0, 206, 209, 0)",
},
{
color: "#ffe21e",
offsetColor1: "rgba(255,226,30, 0.5)",
offsetColor2: "rgba(255,226,30, 0)",
},
{
color: "#1a69f1",
offsetColor1: "rgba(26, 105, 241, 0.5)",
offsetColor2: "rgba(26, 105, 241, 0)",
},
{
color: "#2df499",
offsetColor1: "rgba(45,244,153, 0.5)",
offsetColor2: "rgba(45,244,153, 0)",
},
{
color: "#e87b4b",
offsetColor1: "rgba(232, 123, 75, 0.5)",
offsetColor2: "rgba(232, 123, 75, 0)",
},
],
};
},
mounted() {
this.initChart();
window.addEventListener("resize", this.screenAdapter);
this.screenAdapter();
this.echartsData();
},
destroyed() {
//
window.removeEventListener("resize", this.screenAdapter);
},
methods: {
//
handleEnter(index, event) {
console.log("index", index);
console.log("event", event);
this.chartInstance.dispose();
this.initChart();
this.sharedIndex = index;
// 使 find
const chartsObj = this.energyTypes.find((item) => item.name === event);
const colorObj = this.colorList.find(
(_, currentIndex) => currentIndex === index
);
console.log("当前要渲染的数据对象", chartsObj);
console.log("当前要渲染的颜色对象", colorObj);
let adapterOption = {};
// 线
adapterOption = {
tooltip: {
trigger: "axis",
// tooltip
formatter: function (params) {
var res = params[0].name + "<br/>";
for (var i = 0, l = params.length; i < l; i++) {
var seriesName = params[i].seriesName;
var value = params[i].value;
var marker =
'<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' +
params[i].color +
'"></span>';
// seriesName
if (chartsObj.unit) {
res +=
marker +
seriesName +
":" +
'<span style="color: #000000; font-weight: bold;margin-left:5px">' +
value +
chartsObj.unit +
"</span><br>";
} else {
res +=
marker +
seriesName +
":" +
'<span style="color: #000000; font-weight: bold;margin-left:5px">' +
value +
"</span><br>";
}
}
return res;
},
},
xAxis: {
data: chartsObj.timeStr,
},
yAxis: {
name: chartsObj.unit,
},
series: [
{
data: chartsObj.data,
name: event,
//线
itemStyle: {
color: colorObj.color, //线
},
lineStyle: {
color: colorObj.color, //线
},
areaStyle: {
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: colorObj.offsetColor1, //
},
{
offset: 1,
color: colorObj.offsetColor2, //
},
],
global: false, // false
},
},
},
],
};
//.chartInstanceoptiondataoption
this.chartInstance.setOption(adapterOption);
//resize
this.chartInstance.resize();
},
// 线+ + 线
screenAdapter() {
//,2.6 mes_ref
const titleFontSize = this.$refs.chart_ref.offsetWidth / 130;
//optionoption
const adapterOption = {};
//.chartInstanceoptiondataoption
this.chartInstance.setOption(adapterOption);
//resize
this.chartInstance.resize();
},
//chartInstance
initChart() {
this.chartInstance = echarts.init(this.$refs.chart_ref);
this.option = {
tooltip: {
trigger: "item",
},
legend: {
show: false,
},
grid: {
top: "10%",
left: "4%",
right: "6%",
bottom: "3%",
containLabel: true,
},
xAxis: {
type: "category",
//true
boundaryGap: true,
// x
axisLabel: {
// interval: 0, //x
// rotate: 30, //x30
color: "rgba(255, 255, 255, 1)",
},
axisTick: {
show: false, // 线
},
// x
axisLine: {
show: true,
lineStyle: {
color: "#365576",
},
},
splitLine: {
lineStyle: {
color: "#e2e6f0",
},
}, //x线
},
yAxis: {
min: 0,
// max:20,
// // // min:'dataMin',
// // // max:'dataMax',
// name: "kwh", // y
// name
nameTextStyle: {
color: "rgba(255, 255, 255, 1)",
fontSize: 12,
},
miniInterval: 5,
type: "value",
// y
axisLabel: {
color: "rgba(255, 255, 255, 1)",
},
// y
axisLine: {
show: true,
lineStyle: {
color: "#365576", // y 线
},
},
//y线
// splitNumber: 10,
// y线
splitLine: {
lineStyle: {
color: "#1a3d62", // 线
type: "dashed", // 线线
},
},
},
series: [
{
type: "line",
//
symbolSize: 8,
},
],
};
//
this.chartInstance.setOption(this.option, true);
},
echartsData() {
viewYearEnergy().then((res) => {
console.log("折线图返回值", res);
this.energyTypes = res.rows;
//
// handleEnter
if (this.energyTypes.length > 0) {
this.handleEnter(0, this.energyTypes[0].name);
}
});
},
},
};
</script>
<style lang="scss" scoped>
.right-table {
padding: 27px 15px 35px 15px;
}
.mr20 {
width: 92px;
padding: 2px;
}
.charts {
margin-top: 20px;
width: 100%;
height: 300px;
}
</style>

330
src/views/hotWater/waterControl/index.vue

@ -0,0 +1,330 @@
<template>
<div class="app-container">
<div class="left-tree">
<!-- el-tree 设置一个固定的高度和滚动条 -->
<div style="height: 550px; overflow-y: auto">
<el-tree
ref="tree"
:data="treeData"
node-key="id"
:default-expand-all="false"
:default-expanded-keys="expandedKeys"
:auto-expand-parent="true"
icon-class="none"
@node-expand="handleNodeExpand"
@node-collapse="handleNodeCollapse"
:highlight-current="true"
@node-click="handleNodeClick"
>
<template #default="{ node }">
<span class="custom-tree-node">
<!-- 根据节点状态动态设置图标类名 -->
<div class="tree-left">
<i :class="getIconClass(node)" class="custom-tree-icon"></i>
<span class="tree-label">{{ node.label }}</span>
</div>
</span>
</template>
</el-tree>
</div>
<div class="status">
<div class="status-li">
<div class="status1">正常</div>
<div>0</div>
</div>
<div class="status-li">
<div class="status2">报警</div>
<div>0</div>
</div>
<div class="status-li">
<div class="status3">异常</div>
<div>0</div>
</div>
<div class="status-li">
<div class="status4">离线</div>
<div>0</div>
</div>
</div>
</div>
<div class="right-monitor">
<div>
<div class="buildingDiv">
<img
class="title-bg"
src="../../../assets/images/title-bg.png"
alt=""
/>
<div class="title-word">{{ buildingName }}</div>
</div>
<div class="monitor-context" v-loading="loading"></div>
</div>
</div>
</div>
</template>
<script>
import { spaceTree } from "@/api/region";
import { waterOperateList, operationConrol } from "@/api/hotWater/waterControl";
export default {
data() {
return {
loading: false,
buildingName: "",
treeData: [],
defaultProps: {
children: "children",
label: "label",
},
deviceList: [],
expandedKeys: [],
currentId: "", //id
currentName: "", //
currentLevel: "", //
currentParentId: "", //id
};
},
mounted() {
this.getSysBuild();
},
methods: {
getSysBuild() {
spaceTree().then((res) => {
console.log("楼栋返回值", res);
if (res.code == 200) {
//
console.log("楼栋返回值", res);
let newRes = { ...res };
if (newRes.data && newRes.data[0] && newRes.data[0].children) {
newRes.data[0].children = newRes.data[0].children.filter((item) => {
// label ""
return item.label && item.label.includes("热水");
});
}
// 1 2
const targetLevel = 4;
// data[0] 1
if (newRes.data[0]) {
this.removeChildrenAfterLevel(newRes.data[0], 1, targetLevel);
}
console.log("筛选后的新结果", newRes);
this.treeData = newRes.data;
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.treeData[0].id);
});
console.log("this.treeData[0].id", this.treeData[0].id);
console.log("this.treeData[0].label", this.treeData[0].label);
this.currentId = this.treeData[0].id;
this.currentLevel = this.treeData[0].nodeType;
this.currentName = this.treeData[0].label;
this.getExpandedKeys(this.treeData, 2);
}
});
},
// children
removeChildrenAfterLevel(obj, currentLevel, targetLevel) {
if (currentLevel >= targetLevel) {
// children
obj.children = [];
return;
}
if (obj.children && obj.children.length > 0) {
// children
for (let i = 0; i < obj.children.length; i++) {
this.removeChildrenAfterLevel(
obj.children[i],
currentLevel + 1,
targetLevel
);
}
}
},
//
getExpandedKeys(nodes, level) {
nodes.forEach((node) => {
if (level <= this.currentId + 4) {
this.expandedKeys.push(node.id);
}
if (node.children) {
this.getExpandedKeys(node.children, level + 1);
}
});
},
//
getIconClass(node) {
console.log("当前图标的节点内容", node);
if (node.level === 5) {
//
if (node.expanded) {
return "el-icon-document-opened"; //
}
return "el-icon-document"; //
}
if (node.expanded) {
return "el-icon-folder-opened"; //
}
return "el-icon-folder-add"; //
},
handleNodeExpand(node) {
//
},
handleNodeCollapse(node) {
//
},
//
handleNodeClick(node, data) {
console.log("点击的当前节点", node, data);
this.currentId = node.id;
this.currentLevel = node.nodeType;
this.currentName = node.label;
},
},
};
</script>
<style lang="scss" scoped>
.app-container {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: stretch;
height: 100%;
.left-tree {
width: 216px;
padding: 15px 10px;
border: 1px solid #004b8c;
min-height: 800px;
.status {
display: flex;
flex-direction: row;
justify-content: space-between;
flex-wrap: wrap;
margin-top: 20px;
.status-li {
width: 50%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-bottom: 15px;
}
.status1,
.status2,
.status3,
.status4 {
display: flex;
flex-direction: row;
align-items: center;
margin-bottom: 5px;
}
.status1::before {
content: "";
width: 10px;
height: 10px;
border-radius: 50%;
background-color: #00d2ff;
margin-right: 5px;
}
.status2::before {
content: "";
width: 10px;
height: 10px;
border-radius: 50%;
background-color: #ff2f2f;
margin-right: 5px;
}
.status3::before {
content: "";
width: 10px;
height: 10px;
border-radius: 50%;
background-color: #ff9908;
margin-right: 5px;
}
.status4::before {
content: "";
width: 10px;
height: 10px;
border-radius: 50%;
background-color: #7398c7;
margin-right: 5px;
}
}
}
.right-monitor {
width: calc(100% - 240px);
display: flex;
flex-direction: column;
justify-content: space-between;
.buildingDiv {
padding-left: 54px;
display: flex;
flex-direction: row;
align-items: center;
margin-bottom: 20px;
position: relative;
.title-bg {
width: 208px;
height: 38px;
position: absolute;
left: 0;
z-index: 0;
}
.title-word {
z-index: 10;
font-family: YouSheBiaoTiHei;
font-size: 24px;
color: #ffffff;
white-space: nowrap;
}
}
.monitor-context {
height: 640px;
width: 100%;
overflow-y: auto;
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: flex-start;
flex-wrap: wrap;
align-content: flex-start;
}
}
}
.tree-container {
height: 300px; /* 设置固定高度 */
overflow-y: auto; /* 启用垂直滚动条 */
}
//
:-webkit-scrollbar {
width: 10px; /* 滚动条宽度 */
}
::-webkit-scrollbar-track {
background: transparent !important; /* 滚动条轨道背景色 */
}
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
.tree-left {
.custom-tree-icon {
margin-right: 5px;
}
}
}
</style>
<style scoped>
/* 自定义高亮颜色 */
.left-tree
>>> .el-tree--highlight-current
.el-tree-node.is-current
> .el-tree-node__content {
background-color: #285b9e !important;
/* color: #f56c6c; */
color: #25f1f8;
}
</style>

18
src/views/hotWater/waterMonitor/index.vue

@ -0,0 +1,18 @@
<template>
<div>热水监测</div>
</template>
<script>
import { monitorList } from "@/api/centerairC/sysMonitor";
export default {
data() {
return {
deviceList: [],
};
},
mounted() {},
methods: {},
};
</script>
<style></style>

649
src/views/index.vue

@ -1,22 +1,659 @@
<template>
<div class="app-container">
<div>首页内容</div>
<div class="special-div">
<div class="special-top">
<div class="special-title">项目简介</div>
</div>
<div class="project-all">
<img
class="project-img"
:src="imgUrl + projectObj.logo"
@click="showDialog"
alt="Base64 Image"
/>
<div class="project-li">
<div class="list-con">
<div class="project-left">
<img
class="left-icon"
src="../assets/images/project-icon1.png"
alt=""
/>
<div class="project-name">项目名称</div>
</div>
<div class="project-right">{{ projectObj.proName }}</div>
</div>
<div class="list-con">
<div class="project-left">
<img
class="left-icon"
src="../assets/images/project-icon2.png"
alt=""
/>
<div class="project-name">建筑面积</div>
</div>
<div class="project-right">{{ projectObj.buildingArea }}</div>
</div>
<div class="list-con">
<div class="project-left">
<img
class="left-icon"
src="../assets/images/project-icon3.png"
alt=""
/>
<div class="project-name">运营地址</div>
</div>
<div class="project-right">{{ projectObj.proAddr }}</div>
</div>
</div>
<div class="project-li">
<div class="list-con">
<div class="project-left">
<img
class="left-icon"
src="../assets/images/project-icon3.png"
alt=""
/>
<div class="project-name">项目运行开始时间</div>
</div>
<div class="project-right">{{ projectObj.operateStartTime }}</div>
</div>
</div>
</div>
</div>
<div class="project-data">
<div class="special-div" style="width: 60%">
<div class="special-top">
<div class="special-title">项目概况</div>
</div>
<div class="overview">
<div class="overview-li">
<div>总耗电量(kwh)</div>
<div class="overview-details">{{ projectView.totalEle }}</div>
</div>
<div class="overview-li">
<div>总耗水量()</div>
<div class="overview-details">
{{ projectView.totalEle }}
</div>
</div>
<div class="overview-li">
<div>总用气量()</div>
<div class="overview-details">
{{ projectView.totalGas }}
</div>
</div>
<div class="overview-li">
<div>总产冷量(kw)</div>
<div class="overview-details">
{{ projectView.totalCold }}
</div>
</div>
<div class="overview-li">
<div>今年耗电量(kwh)</div>
<div class="overview-details">
{{ projectView.yearEle }}
</div>
</div>
<div class="overview-li">
<div>今年耗水量()</div>
<div class="overview-details">
{{ projectView.yearWater }}
</div>
</div>
<div class="overview-li">
<div>今年用气量()</div>
<div class="overview-details">
{{ projectView.yearGas }}
</div>
</div>
<div class="overview-li">
<div>今年产冷量(kw)</div>
<div class="overview-details">
{{ projectView.yearCold }}
</div>
</div>
</div>
</div>
<div class="special-div" style="width: 39%">
<div class="special-top">
<div class="special-title">冷源系统</div>
</div>
<view-cold-sys></view-cold-sys>
</div>
</div>
<div class="project-bie">
<div class="special-div">
<div class="special-top">
<div class="special-title">能耗分析</div>
</div>
<view-energy></view-energy>
</div>
</div>
<el-dialog
:visible.sync="dialogVisible"
title="上传图片"
width="500px"
@close="addExpenseClose"
>
<!-- 使用 el-upload 组件 -->
<el-upload
class="upload-demo"
ref="uploadComponent"
action="#"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
:before-upload="beforeUpload"
:limit="1"
:on-exceed="handleExceed"
:on-change="handleFileChange"
accept="image/png, image/jpeg"
:http-request="customHttpRequest"
>
<i class="el-icon-plus"></i>
</el-upload>
<div slot="footer" class="dialog-footer">
<!-- 取消按钮 -->
<el-button @click="dialogVisible = false">取消</el-button>
<!-- 确定按钮 -->
<el-button type="primary" @click="uploadFile">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import * as echarts from "echarts";
import { imgUrl } from "@/utils/global";
import { introduction, changeLogo, viewProfile } from "@/api/index";
import viewEnergy from "./components/viewEnergy.vue";
import ViewColdSys from "./components/viewColdSys.vue";
export default {
name: "Index",
components: { viewEnergy, ViewColdSys },
data() {
return {
imgUrl: "",
projectObj: {
proName: "",
logo: "",
proAddr: "",
buildingArea: "",
operateStartTime: "",
},
projectView: {
totalEle: "",
totalWater: "",
totalGas: "",
totalCold: "",
yearEle: "",
yearWater: "",
yearGas: "",
yearCold: "",
},
dialogVisible: false,
selectedFile: null,
viewImageUrl: "",
chartInstance: null,
data1: [],
data2: [],
xTable: [],
chartsData1: null,
chartsData2: null,
isShowHome: true,
};
},
mounted() {
this.getProject();
this.getHomeData();
// this.initChart();
// window.addEventListener("resize", this.screenAdapter);
// this.screenAdapter();
// this.getChartsData();
},
destroyed() {
//mounted
// window.removeEventListener("resize", this.screenAdapter);
},
methods: {
}
//
getProject() {
this.imgUrl = imgUrl;
introduction().then((res) => {
console.log("项目资料", res);
if (res.code == 200) {
this.projectObj = res.rows[0];
}
});
},
//
showDialog() {
this.dialogVisible = true;
},
//
handleFileChange(file, fileList) {
this.selectedFile = file.raw;
},
//
addExpenseClose() {
//
this.$refs.uploadComponent.clearFiles();
this.viewImageUrl = "";
},
//
reset() {
this.dialogData = {};
//
this.$refs.uploadComponent.clearFiles();
this.viewImageUrl = "";
},
//
handleRemove(file, fileList) {
console.log(file, fileList);
this.selectedFile = {};
},
//
handlePictureCardPreview(file) {
this.dialogVisible = true;
this.viewImageUrl = file.url;
},
//
handleUploadSuccess(response, file, fileList) {},
//
handleFileChange(file, fileList) {
console.log("file", file);
this.selectedFile = file.raw;
},
processFile(file) {
// file.raw
console.log("处理的文件", file);
//
const reader = new FileReader();
reader.onload = (event) => {
console.log("文件内容", event.target.result);
};
reader.readAsDataURL(file);
},
customHttpRequest(options) {
//
const file = options.file;
},
beforeUpload(file) {
const isJpgOrPng =
file.type === "image/jpeg" || file.type === "image/png";
if (!isJpgOrPng) {
this.$message.error("上传图片只能是 JPG 或 PNG 格式!");
}
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
this.$message.error("上传图片大小不能超过 2MB!");
}
return isJpgOrPng && isLt2M;
},
handleExceed(files, fileList) {
this.$message.warning(`上传文件数量超过限制, 当前限制为 1 张`);
},
//
uploadFile() {
console.log("这里进行请求");
let data = {
proId: 0,
logo: this.selectedFile,
};
changeLogo(data).then((res) => {
if (res.code == 200) {
this.$modal.msgSuccess("上传成功");
this.getProject();
this.dialogVisible = false;
} else {
this.$message.error("上传失败");
this.dialogVisible = false;
}
});
},
//
getHomeData() {
viewProfile().then((res) => {
if (res.code == 200) {
this.projectView = res.rows[0];
}
});
},
//chartInstance
initChart() {
this.chartInstance = echarts.init(this.$refs.charts_ref);
this.option = {
tooltip: {
trigger: "axis",
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true,
},
legend: {
data: ["消费总金额(元)", "消费总次数(次)"],
icon: "cricle", //
// //
textStyle: {
color: "#ffff",
fontSize: 12, //
},
left: "center",
top: "10",
//
itemGap: 5,
itemWidth: 10,
itemHeight: 5,
},
xAxis: {
type: "category",
//true
boundaryGap: true,
// data: [
// "1",
// "2",
// "3",
// "4",
// "5",
// "6",
// "7",
// "8",
// "9",
// "10",
// "11",
// "12",
// "13",
// "14",
// "15",
// "16",
// "17",
// "18",
// "19",
// "20",
// "21",
// "22",
// "23",
// "24",
// ],
data: this.xTable,
// x
axisLabel: {
// interval: 0, //x
// rotate: 30, //x30
color: "rgba(255, 255, 255, 1)",
},
axisTick: {
show: false, // 线
},
// x
axisLine: {
show: true,
lineStyle: {
// X
color: "#365576",
},
},
splitLine: {
lineStyle: {
color: "#e2e6f0",
},
}, //x线
},
yAxis: {
miniInterval: 5,
type: "value",
// name: "",
// name
nameTextStyle: {
color: "rgba(255, 255, 255, 1)",
fontSize: 12,
},
// y
axisLabel: {
color: "rgba(255, 255, 255, 1)",
},
// y
axisLine: {
show: true,
lineStyle: {
color: "#365576", // y 线
},
},
//y线
// splitNumber: 10,
// y线
splitLine: {
lineStyle: {
color: "#1a3d62", // 线
type: "dashed", // 线线
},
},
},
series: [
{
name: "消费总金额(元)",
type: "line",
// data: [
// 20, 42, 12, 43, 22, 56, 22, 7, 88, 34, 62, 12, 23, 41, 23, 22, 87,
// 56, 54, 34, 33, 10, 32, 54, 39, 27,
// ],
data: this.data1,
itemStyle: {
color: " #08c8ff",
},
},
{
name: "消费总次数(次)",
type: "line",
// data: [
// 40, 42, 2, 45, 32, 16, 92, 7, 88, 34, 62, 12, 23, 41, 23, 22, 43,
// 56, 524, 32, 3, 11, 32, 54, 39, 27,
// ],
data: this.data2,
itemStyle: {
color: "#277dff",
},
},
],
};
//
this.chartInstance.setOption(this.option, true);
},
// + 线
screenAdapter() {
//,2.6 mes_ref
const titleFontSize = (this.$refs.charts_ref.offsetWidth / 100) * 0.8;
//optionoption
const adapterOption = {};
//.chartInstanceoptiondataoption
this.chartInstance.setOption(adapterOption);
//resize
this.chartInstance.resize();
},
// 30
getChartsData() {
const now = new Date();
const startDate = new Date(
Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate() - 30)
);
const endDate = new Date(
Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate() - 1)
);
const startDateStr = startDate.toISOString().slice(0, 10);
const endDateStr = endDate.toISOString().slice(0, 10);
let params = {
page: 0,
limit: 10,
startDate: startDateStr,
endDate: endDateStr,
type: "projectDay",
buildingName: "",
};
// console.log("30", params)
findTableData(params).then((res) => {
// console.log("30", res)
if (res) {
(this.data1 = []),
(this.data2 = []),
(this.xTable = []),
res.data.forEach((item) => {
this.data1.push(item.AmountConsu);
this.data2.push(item.PersonTime);
this.xTable.push(item.DATE);
});
// console.log("xTable------------", this.xTable);
// console.log("data1--------------", this.data1);
// console.log("data2--------------", this.data2);
const adapterOption = {
xAxis: {
data: this.xTable,
},
series: [
{
data: this.data1,
},
{
data: this.data2,
},
],
};
//.chartInstanceoptiondataoption
this.chartInstance.setOption(adapterOption);
//resize
this.chartInstance.resize();
} else {
const adapterOption = {
xAxis: {
data: [],
},
series: [
{
data: [],
},
{
data: [],
},
],
};
//.chartInstanceoptiondataoption
this.chartInstance.setOption(adapterOption);
//resize
this.chartInstance.resize();
}
});
},
},
};
</script>
<style scoped lang="scss">
<style lang="scss" scoped>
.project-all {
width: 100%;
display: flex;
flex-direction: row;
align-items: flex-start;
padding: 0.35rem;
.project-img {
width: 1.4rem;
height: 1.4rem;
border-radius: 0.1rem;
border: solid 1px #0163a8;
margin-right: 0.4rem;
cursor: pointer;
}
.project-li {
width: calc((100% - 0.7rem) / 2);
display: flex;
flex-direction: column;
.list-con {
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
.project-left {
display: flex;
flex-direction: row;
align-items: center;
.left-icon {
width: 0.2rem;
height: 0.2rem;
}
.project-name {
font-family: SourceHanSansCN-Regular;
font-size: 0.18rem;
line-height: 0.4rem;
color: #ffffff;
opacity: 0.8;
margin-left: 0.15rem;
}
}
.project-right {
font-family: SourceHanSansCN-Regular;
font-size: 0.18rem;
line-height: 0.4rem;
color: #ffffff;
}
}
}
.project-li:nth-last-child(1) {
margin-left: 1.5rem;
}
}
.project-data {
display: flex;
flex-direction: row;
align-items: stretch;
justify-content: space-between;
margin: 16px 0;
.overview {
width: 100%;
padding-top: 0.32rem;
display: flex;
flex-direction: row;
align-items: center;
flex-wrap: wrap;
.overview-li {
width: calc(25%);
height: 1.56rem;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-image: url(../assets/images/overview-img.png);
background-repeat: no-repeat;
background-size: 1.56rem 1.56rem;
background-position: center center;
margin-bottom: 0.3rem;
font-family: SourceHanSansCN-Regular;
font-size: 0.15rem;
color: #ffffff;
.overview-details {
font-family: DIN-Bold;
font-size: 0.2rem;
color: #15e1fd;
margin-top: 0.05rem;
}
}
}
}
.chartsDiv {
width: 100%;
height: 4rem;
}
.project-bie {
width: 100%;
display: flex;
flex-direction: row;
align-items: stretch;
justify-content: space-between;
.special-div {
width: 100%;
}
}
</style>

264
src/views/region/index.vue

@ -515,269 +515,7 @@ export default {
dicts: ["sys_type"],
data() {
return {
treeData: [
{
id: 12,
value: 12,
label: "测试服务",
children: [
{
id: 109,
value: 109,
label: "测试楼栋",
children: [
{
id: 675,
value: 675,
label: "测试101",
children: null,
},
{
id: 676,
value: 676,
label: "测试102",
children: null,
},
{
id: 677,
value: 677,
label: "测试103",
children: null,
},
{
id: 679,
value: 679,
label: "测试105",
children: null,
},
{
id: 680,
value: 680,
label: "测试106",
children: null,
},
{
id: 2024,
value: 2024,
label: "测试222",
children: null,
},
{
id: 1024,
value: 1024,
label: "测试4G-080231000001",
children: null,
},
{
id: 1025,
value: 1025,
label: "测试4G-080231000002",
children: null,
},
{
id: 749,
value: 749,
label: "测试4G-108",
children: null,
},
{
id: 719,
value: 719,
label: "测试4G-109",
children: null,
},
{
id: 1026,
value: 1026,
label: "测试4G-180230800005",
children: null,
},
{
id: 2055,
value: 2055,
label: "测试4G高校表",
children: null,
},
{
id: 2061,
value: 2061,
label: "测试801",
children: null,
},
{
id: 2062,
value: 2062,
label: "测试802",
children: null,
},
{
id: 678,
value: 678,
label: "个人专属",
children: null,
},
{
id: 2026,
value: 2026,
label: "测试444",
children: null,
},
{
id: 2027,
value: 2027,
label: "测试501",
children: null,
},
{
id: 2028,
value: 2028,
label: "测试502",
children: null,
},
{
id: 2029,
value: 2029,
label: "测试503",
children: null,
},
{
id: 2030,
value: 2030,
label: "测试504",
children: null,
},
{
id: 2031,
value: 2031,
label: "测试505",
children: null,
},
{
id: 2032,
value: 2032,
label: "测试506",
children: null,
},
{
id: 2033,
value: 2033,
label: "测试507",
children: null,
},
{
id: 2034,
value: 2034,
label: "乃哥专属总统房101",
children: null,
},
{
id: 2035,
value: 2035,
label: "乃哥专属总统房102",
children: null,
},
{
id: 2036,
value: 2036,
label: "乃哥专属总统房103",
children: null,
},
{
id: 2037,
value: 2037,
label: "演示测试101",
children: null,
},
{
id: 2038,
value: 2038,
label: "宁波水表测试",
children: null,
},
],
},
{
id: 152,
value: 152,
label: "碧桂园测试",
children: [
{
id: 755,
value: 755,
label: "201",
children: null,
},
{
id: 756,
value: 756,
label: "202",
children: null,
},
{
id: 757,
value: 757,
label: "203",
children: null,
},
{
id: 758,
value: 758,
label: "204",
children: null,
},
{
id: 759,
value: 759,
label: "205",
children: null,
},
{
id: 911,
value: 911,
label: "628",
children: null,
},
{
id: 912,
value: 912,
label: "629",
children: null,
},
{
id: 913,
value: 913,
label: "630",
children: null,
},
{
id: 914,
value: 914,
label: "631",
children: null,
},
{
id: 915,
value: 915,
label: "632",
children: null,
},
{
id: 916,
value: 916,
label: "633",
children: null,
},
{
id: 917,
value: 917,
label: "634",
children: null,
},
],
},
],
},
],
treeData: [],
nodeTree: null,
expandedKeys: [],

Loading…
Cancel
Save