Compare commits

...

16 Commits
dev ... meizhou

Author SHA1 Message Date
selia-zx ad60088e00 1.主机详情页面,图表添加负载y轴,压缩机参数不采用tab形式 10 hours ago
selia-zx 8282126f15 1.冷源监控-系统监测添加可点击打开弹窗控制阀门、水泵、风机、主机 3 days ago
mh ee447e1d7f 监控界面、主机详情、温湿度图表优化 4 days ago
selia-zx a9833153fb 1.修改中央空调-系统监测-压缩机参数内容tab分开展示 2 weeks ago
selia-zx c06ca6002c 1.空调风柜监控系统-系统监控添加定时开关功能 2 weeks ago
selia-zx e6b93684ae 1.修改生活热水-实时监控的动态图 2 weeks ago
selia-zx abec1b1416 1.ps修改生活热水-实时监控的动态图,修改添加供水泵1、供水泵2、补水状态、回水状态、热泵等状态 2 weeks ago
mh ac91f0837c 冷热源界面修改 2 weeks ago
v-lijf43 f9a2a9b905 阀门开关到位修改 2 weeks ago
selia-zx 39661b7ba6 1.联调梅州-中央空调-系统监测页面内容,调整样式 2 weeks ago
selia-zx ccde8e6187 修改主机参数页面数据 1 month ago
selia-zx 4f79f5bac9 1.解决冲突 1 month ago
selia-zx c6b4345766 系统监测采用大屏显示版本 1 month ago
selia-zx a74c3ad306 修改定时任务、表单构建样式 1 month ago
selia-zx 11d131c3ec 1.修改系统监测页面 1 month ago
selia-zx e068a1a14b 梅州分支 1 month ago
  1. 6
      .env.development
  2. 17
      src/api/aircAndWindc/index.js
  3. BIN
      src/assets/flowimg/bu-move.gif
  4. BIN
      src/assets/flowimg/bu-nomove.png
  5. BIN
      src/assets/flowimg/circulate-move.gif
  6. BIN
      src/assets/flowimg/pump.png
  7. BIN
      src/assets/flowimg/replenish-move.gif
  8. BIN
      src/assets/flowimg/replenish-nomove.png
  9. BIN
      src/assets/flowimg/replenish-nomove3.png
  10. BIN
      src/assets/flowimg/supply-move.gif
  11. BIN
      src/assets/flowimg/supply-nomove - 副本.png
  12. BIN
      src/assets/flowimg/supply-nomove.png
  13. BIN
      src/assets/flowimg/supply-nomove2.png
  14. BIN
      src/assets/images/detail-line.png
  15. BIN
      src/assets/images/host-img3.png
  16. BIN
      src/assets/images/host-img5.png
  17. BIN
      src/assets/images/meizhou.png
  18. BIN
      src/assets/images/pump.png
  19. BIN
      src/assets/images/supply-nomove.png
  20. 266
      src/assets/styles/index.scss
  21. 22
      src/components/Crontab/index.vue
  22. 427
      src/views/aircAndWindc/awSysMonitor/index.vue
  23. 2
      src/views/centerairC/deviceStrategy/index.vue
  24. 431
      src/views/centerairC/sysControl/index copy 2.vue
  25. 643
      src/views/centerairC/sysControl/index copy.vue
  26. 31
      src/views/centerairC/sysControl/index.vue
  27. 159
      src/views/centerairC/sysControl/listHeader.vue
  28. 107
      src/views/centerairC/sysControl/vavleheader.vue
  29. 404
      src/views/centerairC/sysMonitor/components/hostChart.vue
  30. 393
      src/views/centerairC/sysMonitor/hostDetails.vue
  31. 2198
      src/views/centerairC/sysMonitor/monitorCenter.vue
  32. 147
      src/views/centerairC/sysMonitor/performance.vue
  33. 11
      src/views/centerairC/timeSwitch/index.vue
  34. 16
      src/views/components/waterTank.vue
  35. 252
      src/views/hotWater/waterControl/index.vue
  36. 147
      src/views/hotWater/waterMonitor/index.vue
  37. 15
      src/views/temSys/temHistory/components/historyCharts.vue
  38. 32
      src/views/temSys/temHistory/components/historyTables.vue
  39. 91
      src/views/temSys/temHistory/index.vue
  40. 29
      src/views/temSys/temMonitor/index.vue
  41. 473
      src/views/tool/build/index.vue

6
.env.development

@ -7,9 +7,9 @@ ENV = 'development'
# 开发环境
# VUE_APP_BASE_API = '/dev-api'
# 后台
# VUE_APP_BASE_API = 'http://192.168.1.222:8080'
# 云端
VUE_APP_BASE_API = 'http://106.55.173.225:8090'
VUE_APP_BASE_API = 'http://192.168.1.222:8080'
# 梅州云端
# VUE_APP_BASE_API = 'http://106.55.173.225:8091'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

17
src/api/aircAndWindc/index.js

@ -8,3 +8,20 @@ export function windList(query) {
params: query,
});
}
//查询定时开关列表
export function timeList(query) {
return request({
url: "/device/ahu/monitor/timeList",
method: "get",
params: query,
});
}
//修改定时开关
export function undateTime(query) {
return request({
url: "/device/ahu/monitor/time",
method: "put",
params: query,
});
}

BIN
src/assets/flowimg/bu-move.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
src/assets/flowimg/bu-nomove.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
src/assets/flowimg/circulate-move.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 20 KiB

BIN
src/assets/flowimg/pump.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
src/assets/flowimg/replenish-move.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 20 KiB

BIN
src/assets/flowimg/replenish-nomove.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
src/assets/flowimg/replenish-nomove3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

BIN
src/assets/flowimg/supply-move.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 KiB

After

Width:  |  Height:  |  Size: 248 KiB

BIN
src/assets/flowimg/supply-nomove - 副本.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

BIN
src/assets/flowimg/supply-nomove.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 KiB

After

Width:  |  Height:  |  Size: 135 KiB

BIN
src/assets/flowimg/supply-nomove2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

BIN
src/assets/images/detail-line.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 417 KiB

After

Width:  |  Height:  |  Size: 410 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 KiB

BIN
src/assets/images/meizhou.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 MiB

BIN
src/assets/images/pump.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
src/assets/images/supply-nomove.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

266
src/assets/styles/index.scss

@ -449,7 +449,7 @@ table th {
.el-dialog .el-row .el-select {
width: 100% !important;
}
.el-dialog .el-row .el-date-editor{
.el-dialog .el-row .el-date-editor {
width: 100% !important;
}
@ -502,7 +502,7 @@ table th {
/* 设置滚动条背景颜色 */
}
.analysis-table::-webkit-scrollbar-thumb {
background-color: rgb(21, 50, 104);
background-color: rgb(21, 50, 104);
/* 设置滑块颜色 */
}
.analysis-table::-webkit-scrollbar-thumb:hover {
@ -513,3 +513,265 @@ table th {
background-color: #002249;
/* 设置滑道颜色 */
}
.detail-data-li {
width: 80%;
margin-right: 0.1rem;
position: relative;
color: #c0dffc;
font-family: Arial, sans-serif;
letter-spacing: 0.02rem;
font-size: 0.18rem;
position: relative;
margin-bottom: 0.08rem;
border-left: 0.01rem solid #217df5;
border-right: 0.01rem solid #217df5;
background-image: radial-gradient(
circle at left top,
#217df5 0.01rem,
transparent 0.01rem
),
radial-gradient(circle at right top, #217df5 0.01rem, transparent 0.01rem),
radial-gradient(circle at left bottom, #217df5 0.01rem, transparent 0.01rem),
radial-gradient(
circle at right bottom,
#217df5 0.01rem,
transparent 0.01rem
);
background-repeat: no-repeat;
background-position: left top, right top, left bottom, right bottom;
}
.detail-data-li::before,
.detail-data-li::after {
content: "";
position: absolute;
left: 0;
right: 0;
height: 0.01rem;
background-image: linear-gradient(
to right,
#217df5 0%,
rgba(41, 128, 185, 0) 50%,
#217df5 100%
) !important;
}
.year-data {
margin-top: 0.1rem;
}
.rightDot {
position: relative;
width: 100%;
height: 100%;
z-index: 999;
}
.leftDot {
position: relative;
width: 100%;
height: 100%;
padding: 0.04rem 0.1rem;
display: flex;
flex-direction: row;
justify-content: space-between;
.dotData {
font-weight: bold;
margin: 0 0.06rem;
color: #3b80ff;
display: flex;
align-items: center;
}
.dotUnit {
width: 0.55rem;
text-align: left;
display: flex;
align-items: center;
}
}
.rightDot::before {
content: "";
position: absolute;
top: -0.03rem;
right: -0.03rem;
width: 0.06rem;
height: 0.06rem;
background-color: #217df5;
box-shadow: 0 0 0.1rem 0.02rem rgba(33, 125, 245, 0.9);
background-image: radial-gradient(
circle at 30% 30%,
rgba(255, 255, 255, 0.8) 0%,
rgba(255, 255, 255, 0) 70%
);
border-radius: 50%;
}
.rightDot::after {
content: "";
position: absolute;
bottom: -0.03rem;
right: -0.03rem;
width: 0.06rem;
height: 0.06rem;
background-color: #217df5;
box-shadow: 0 0 0.1rem 0.02rem rgba(33, 125, 245, 0.9);
background-image: radial-gradient(
circle at 30% 30%,
rgba(255, 255, 255, 0.8) 0%,
rgba(255, 255, 255, 0) 70%
);
border-radius: 50%;
}
.leftDot::before {
content: "";
position: absolute;
top: -0.03rem;
left: -0.03rem;
width: 0.06rem;
height: 0.06rem;
background-color: #217df5;
border-radius: 50%;
box-shadow: 0 0 0.1rem 0.02rem rgba(33, 125, 245, 0.9);
background-image: radial-gradient(
circle at 30% 30%,
rgba(255, 255, 255, 0.8) 0%,
rgba(255, 255, 255, 0) 70%
);
}
.leftDot::after {
content: "";
position: absolute;
bottom: -0.03rem;
left: -0.03rem;
width: 0.06rem;
height: 0.06rem;
background-color: #217df5;
box-shadow: 0 0 0.1rem 0.02rem rgba(33, 125, 245, 0.9);
background-image: radial-gradient(
circle at 30% 30%,
rgba(255, 255, 255, 0.8) 0%,
rgba(255, 255, 255, 0) 70%
);
border-radius: 50%;
}
/* 设备控制列表样式 */
.device-container {
display: flex;
flex-direction: column;
width: 100%;
background-color: #142c4e;
padding: 10px 10px 30px 10px;
border-radius: 10px;
margin-bottom: 20px;
}
.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;
font-size: 14px;
.el-switch {
width: 120px !important;
}
.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-name2 {
width: 140px;
}
}
.device-li:nth-child(1) {
color: #9ca3af;
}
// 媒体查询适配大于2000px分辨率的大屏样式
@media (min-width: 2000px) {
.device-li {
padding: 0.12rem 0 !important;
border-bottom: 0.01rem dashed #0349ac !important;
.device-name {
font-size: 0.14rem !important;
.el-switch {
width: 1.2rem !important;
}
.run::before {
width: 0.1rem !important;
height: 0.1rem !important;
margin-right: 0.05rem !important;
}
.no-run::before {
width: 0.1rem !important;
height: 0.1rem !important;
margin-right: 0.05rem !important;
}
.el-input {
width: 1rem !important;
}
.strong-electric {
padding: 0.05rem 0.2rem;
border-radius: 0.1rem !important;
}
.auto-electric {
padding: 0.05rem 0.2rem;
border-radius: 0.1rem !important;
}
}
}
}

22
src/components/Crontab/index.vue

@ -70,33 +70,33 @@
<p class="title">时间表达式</p>
<table>
<thead>
<th v-for="item of tabTitles" width="40" :key="item">{{item}}</th>
<th v-for="item of tabTitles" width="40" :key="item">{{ item }}</th>
<th>Cron 表达式</th>
</thead>
<tbody>
<td>
<span>{{crontabValueObj.second}}</span>
<span>{{ crontabValueObj.second }}</span>
</td>
<td>
<span>{{crontabValueObj.min}}</span>
<span>{{ crontabValueObj.min }}</span>
</td>
<td>
<span>{{crontabValueObj.hour}}</span>
<span>{{ crontabValueObj.hour }}</span>
</td>
<td>
<span>{{crontabValueObj.day}}</span>
<span>{{ crontabValueObj.day }}</span>
</td>
<td>
<span>{{crontabValueObj.month}}</span>
<span>{{ crontabValueObj.month }}</span>
</td>
<td>
<span>{{crontabValueObj.week}}</span>
<span>{{ crontabValueObj.week }}</span>
</td>
<td>
<span>{{crontabValueObj.year}}</span>
<span>{{ crontabValueObj.year }}</span>
</td>
<td>
<span>{{crontabValueString}}</span>
<span>{{ crontabValueString }}</span>
</td>
</tbody>
</table>
@ -329,7 +329,7 @@ export default {
},
},
computed: {
crontabValueString: function() {
crontabValueString: function () {
let obj = this.crontabValueObj;
let str =
obj.second +
@ -363,7 +363,7 @@ export default {
//
},
},
mounted: function() {
mounted: function () {
this.resolveExp();
},
};

427
src/views/aircAndWindc/awSysMonitor/index.vue

@ -1,5 +1,5 @@
<template>
<div class="app-container" v-loading="loading">
<div class="app-container">
<div class="left-tree">
<!-- el-tree 设置一个固定的高度和滚动条 -->
<div style="height: 7rem; overflow-y: auto">
@ -39,6 +39,10 @@
</div>
<div class="mostDiv">
<div class="windC">
<!-- 定时开关机定位 -->
<div class="menu-title" @click="openTimeSwitch">
<div @click="openTimeSwitch">定时开关机</div>
</div>
<!-- 空调风柜定位 -->
<img
class="wind-img"
@ -137,6 +141,7 @@
@keyup.enter.native="handleEnter(airSupplyObj, $event, '℃')"
@input="handleInput(airSupplyObj)"
@blur="handleBlur()"
disabled
v-model="airSupplyObj.collectValue"
size="mini"
>
@ -199,6 +204,7 @@
@keyup.enter.native="handleEnter(waterSupplyObj, $event, '℃')"
@input="handleInput(waterSupplyObj)"
@blur="handleBlur()"
disabled
v-model="waterSupplyObj.collectValue"
size="mini"
>
@ -215,6 +221,7 @@
@keyup.enter.native="handleEnter(backwaterObj, $event, '℃')"
@input="handleInput(backwaterObj)"
@blur="handleBlur()"
disabled
v-model="backwaterObj.collectValue"
size="mini"
>
@ -243,11 +250,11 @@
</div>
</div>
<div class="wind-valve" v-if="isObjectValid(airValveBackObj)">
<div class="wind-text">风阀反馈</div>
<div class="wind-text">风阀反馈</div>
<div>{{ airValveBackObj.collectValue }}%</div>
</div>
<div class="wind-valve2" v-if="isObjectValid(airValveObj)">
<div class="wind-text">风阀调节</div>
<div class="wind-text">风阀调节</div>
<el-input
@keyup.enter.native="handleEnter(airValveObj, $event, '%')"
@input="handleInput(airValveObj)"
@ -265,12 +272,76 @@
</div>
</div>
</div>
<!-- 定时开关内容 -->
<el-dialog
title="定时开关机功能"
:visible.sync="isOpenTimeSwitch"
append-to-body
>
<div class="device-container" v-loading="loading">
<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>
<div class="device-li" v-for="(item, index) in delayList" :key="index">
<div class="device-name">{{ item.name }}</div>
<div class="device-name">
<el-input
size="mini"
v-model="item.delayOpenHour"
@keyup.enter.native="handleSwitchEnter(item, 'openHour', $event)"
@input="handleSwitchInput(item, 'delayOpenHour', 'hour')"
></el-input>
<div class="slip">:</div>
<el-input
size="mini"
v-model="item.delayOpenMinute"
@keyup.enter.native="
handleSwitchEnter(item, 'openMinute', $event)
"
@input="handleSwitchInput(item, 'delayOpenMinute', 'minute')"
></el-input>
</div>
<div class="device-name">
<el-input
size="mini"
v-model="item.delayCloseHour"
@keyup.enter.native="handleSwitchEnter(item, 'closeHour', $event)"
@input="handleSwitchInput(item, 'delayCloseHour', 'hour')"
></el-input>
<div class="slip">:</div>
<el-input
size="mini"
v-model="item.delayCloseMinute"
@keyup.enter.native="
handleSwitchEnter(item, 'closeMinute', $event)
"
@input="handleSwitchInput(item, 'delayCloseMinute', 'minute')"
></el-input>
</div>
<div class="device-name">
<el-switch
style="display: block"
active-color="#13ce66"
inactive-color="#ff4949"
active-text="开启"
inactive-text="停用"
v-model="item.delayStatus"
@change="handleSwitchStatus(item)"
>
</el-switch>
</div>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import { spaceTree } from "@/api/region";
import { windList } from "@/api/aircAndWindc/index";
import { windList, timeList, undateTime } from "@/api/aircAndWindc/index";
import { operationConrol } from "@/api/hotWater/waterControl";
export default {
data() {
@ -308,6 +379,8 @@ export default {
autoStatus: false, //
startStatus: false, //
frequency: "v",
isOpenTimeSwitch: false,
delayList: [],
};
},
watch: {
@ -513,7 +586,7 @@ export default {
//
else if (
item.paramType === "3" &&
item.collectName.includes("新风阀")
item.collectName.includes("新风阀")
) {
this.airValveObj = item;
}
@ -524,7 +597,7 @@ export default {
//
else if (
item.paramType === "3" &&
item.collectName.includes("调节")
item.collectName.includes("水阀调节")
) {
this.waterValveObj = item;
}
@ -720,6 +793,241 @@ export default {
this.getWindList();
});
},
//
openTimeSwitch() {
this.isOpenTimeSwitch = true;
this.getPolicyList();
},
//
getPolicyList() {
return new Promise((resolve, reject) => {
let data = {
systemType: "2",
funPolicyType: "3",
houseId: this.currentId,
};
timeList(data)
.then((res) => {
console.log("设备定时开关返回res", res);
if (res.code === 200) {
let handleList = res.rows;
this.delayList = [];
//
const chineseNumbers = ["一", "二", "三", "四", "五", "六", "日"];
handleList.forEach((element, index) => {
if (element.values && element.values.length > 0) {
//
let delayItem = {
name: element.name,
};
const limitedChildren = element.values;
limitedChildren.forEach((child) => {
// console.log("${index}_", `${index}_`);
// console.log("child.pointName", child.pointName);
if (child.pointName) {
//
const chineseNumber = chineseNumbers[index];
// -
if (child.pointName == `星期${chineseNumber}开_时`) {
// console.log("-·························");
delayItem.delayOpenHour = child.curValue;
delayItem.delayOpenHourId = child.id;
}
// -
else if (
child.pointName.includes(`星期${chineseNumber}开_分`)
) {
delayItem.delayOpenMinute = child.curValue;
delayItem.delayOpenMinuteId = child.id;
}
// -
else if (
child.pointName.includes(`星期${chineseNumber}关_时`)
) {
delayItem.delayCloseHour = child.curValue;
delayItem.delayCloseHourId = child.id;
}
// -
else if (
child.pointName.includes(`星期${chineseNumber}关_分`)
) {
delayItem.delayCloseMinute = child.curValue;
delayItem.delayCloseMinuteId = child.id;
}
//
else if (child.pointName.includes(`启动标志`)) {
delayItem.delayStatus =
Number(child.curValue) == 0 ? false : true;
delayItem.delayStatusId = child.id;
}
}
});
// delayList
if (Object.keys(delayItem).length > 1) {
this.delayList.push(delayItem);
}
}
});
console.log("处理后的数组", this.delayList);
// this.delayList = res.rows;
} else {
this.delayList = [];
}
// Promise
resolve(res);
})
.catch((error) => {
// Promise
reject(error);
});
});
},
//
handleSwitchInput(item, propertyName, name) {
console.log("校验", item[propertyName]);
//
if (item[propertyName] === "") {
return;
}
let isValid = true;
//
let inputValue = String(item[propertyName]).replace(/[^\d]/g, "");
if (name === "hour") {
isValid =
!isNaN(inputValue) &&
parseInt(inputValue) >= 0 &&
parseInt(inputValue) <= 23;
if (!isValid) {
this.$message.error("输入值在0-23区间,请重新输入");
item[propertyName] = "";
return;
}
} else if (name === "minute") {
isValid =
!isNaN(inputValue) &&
parseInt(inputValue) >= 0 &&
parseInt(inputValue) <= 59;
if (!isValid) {
this.$message.error("输入值在0-59区间,请重新输入");
item[propertyName] = "";
return;
}
}
item[propertyName] = inputValue;
},
handleSwitchEnter(item, name, event) {
//
event.target.blur();
let id = "";
let value = "";
let title = "";
let unit = "";
if (name === "openHour") {
id = item.delayOpenHourId;
value = item.delayOpenHour;
title = "定时开机-小时";
unit = "时";
} else if (name === "openMinute") {
id = item.delayOpenMinuteId;
value = item.delayOpenMinute;
title = "定时开机-分钟";
unit = "分";
} else if (name === "closeHour") {
id = item.delayCloseHourId;
value = item.delayCloseHour;
title = "定时关机-小时";
unit = "时";
} else if (name === "closeMinute") {
id = item.delayCloseMinuteId;
value = item.delayCloseMinute;
title = "定时关机-分钟";
unit = "分";
}
if (value === "") {
this.$message.warning("请输入当前设置值!");
return;
}
console.log("请求后端", item);
this.$confirm(
`确定要把"${item.name}"的${title}设置为:${value} ${unit}吗?`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
this.handleSwitchOperationConrol(id, value);
})
.catch(() => {
//
this.getPolicyList();
});
},
handleSwitchOperationConrol(id, param) {
let data = {
policyId: id,
timeValue: param,
};
console.log("操作参数", data);
undateTime(data)
.then((res) => {
if (res.code == 200) {
this.$modal.msgSuccess("指令下发成功!");
// loading
this.loading = true;
// ;
setTimeout(() => {
this.getPolicyList().finally(() => {
// loading
this.loading = false;
});
}, 500);
} else {
// this.$modal.msgError("");
console.log("应该更新状态的");
// ;
this.getPolicyList();
}
})
.catch((error) => {
console.log("请求发生错误,更新设备状态", error);
// ;
this.getPolicyList();
});
},
//
handleSwitchStatus(item) {
this.$confirm(
`确定要切换"${item.name}"的状态为:${
item.delayStatus ? "开启" : "停用 吗?"
}`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
//
console.log("请求后台", item.delayStatus);
let param = null;
if (item.delayStatus) {
param = 1;
} else {
param = 0;
}
this.handleSwitchOperationConrol(item.delayStatusId, param);
})
.catch(() => {
//
item.delayStatus = !item.delayStatus;
console.log("不请求后台");
});
},
},
};
</script>
@ -758,6 +1066,59 @@ export default {
width: 13rem;
height: 5.38rem;
position: relative;
.menu-title {
color: #e1f4ff;
font-size: 0.18rem;
--bRadius: 0.05rem;
text-align: center;
position: absolute;
top: 0;
right: 0.5rem;
width: 1.25rem;
cursor: pointer;
z-index: 999;
div {
position: relative;
text-align: center;
border-radius: var(--bRadius);
transition: all 0.3s;
padding: 0.01rem 0.02rem;
background-color: rgba(85, 139, 211, 0.2);
cursor: pointer;
&::before,
&::after {
content: "";
position: absolute;
top: -10px;
left: -10px;
right: -10px;
bottom: -10px;
border: 2px solid #46b2f1;
transition: all 0.5s;
border-radius: var(--bRadius);
animation: clippath 3s infinite linear;
cursor: pointer;
}
&::after {
animation: clippath 3s infinite -1.5s linear;
}
@keyframes clippath {
0%,
100% {
clip-path: inset(0 0 98% 0);
}
25% {
clip-path: inset(0 98% 0 0);
}
50% {
clip-path: inset(98% 0 0 0);
}
75% {
clip-path: inset(0 0 0 98%);
}
}
}
}
.wind-img {
width: 13.1rem;
height: 5.5rem;
@ -1155,6 +1516,60 @@ export default {
}
}
}
.device-container {
display: flex;
flex-direction: column;
width: 100%;
min-height: 530px;
background-color: #142c4e;
padding: 10px 10px 30px 10px;
border-radius: 10px;
font-size: 14px;
.device-li {
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;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
flex-wrap: nowrap;
padding: 0 5px;
.slip {
margin: 0 5px;
color: #1282d8;
font-weight: bold;
}
}
}
.device-li:nth-child(1) {
color: #9ca3af;
}
}
// 2000px
@media (min-width: 2000px) {
.device-container {
min-height: 7rem !important;
padding: 0.1rem 0.1rem 0.3rem 0.1rem !important;
border-radius: 0.1rem !important;
font-size: 0.14rem !important;
.device-li {
padding: 0.12rem 0 !important;
.device-name {
.slip {
margin: 0 0.05rem !important;
}
}
}
}
}
@media (min-width: 1360px) and (max-width: 1680px) {
.windC {
transform: scale(0.9);

2
src/views/centerairC/deviceStrategy/index.vue

@ -370,7 +370,7 @@ export default {
position: relative;
width: calc(33.33% - 40px);
margin: 0 20px;
min-height: 300px;
min-height: 350px;
background-image: url(../../../assets/images/strategy-border.png);
background-size: 100% 100%;
border-bottom: 1px solid #1587cc;

431
src/views/centerairC/sysControl/index copy 2.vue

@ -1,431 +0,0 @@
<template>
<div class="app-container" v-loading="loading">
<!-- 状态统计 -->
<div class="status-statistics">
<div class="status-card">
<div class="status-label">运行设备</div>
<div class="status-value-running">
{{ statistics.running }}/{{ total }}
</div>
</div>
<div class="status-card">
<div class="status-label">手动模式</div>
<div class="status-value-auto">{{ statistics.manual }}/{{ total }}</div>
</div>
<div class="status-card">
<div class="status-label">自动模式</div>
<div class="status-value-maintenance">
{{ statistics.auto }}/{{ total }}
</div>
</div>
<div class="status-card">
<div class="status-label">故障设备</div>
<div class="status-value-error">{{ statistics.warn }}/{{ total }}</div>
</div>
</div>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="主机" name="host"> </el-tab-pane>
<el-tab-pane label="冷却塔" name="second"> </el-tab-pane>
<el-tab-pane label="冷却泵" name="three"> </el-tab-pane>
<el-tab-pane label="冷冻泵" name="three"> </el-tab-pane>
<el-tab-pane label="冷冻蝶阀" name="three"> </el-tab-pane>
<el-tab-pane label="冷却蝶阀" name="three"> </el-tab-pane>
<el-tab-pane label="冷却塔出水阀" name="three"> </el-tab-pane>
</el-tabs>
<!-- 非蝶阀控制列表 -->
<div class="device-container">
<list-header
:deviceList="hostList"
@operationControl="hadleOperationConrol"
></list-header>
</div>
<div class="device-container">
<list-header
:deviceList="coolingTowerFanList"
@operationControl="hadleOperationConrol"
></list-header>
</div>
<div class="device-container">
<list-header
:deviceList="coolingPump"
@operationControl="hadleOperationConrol"
></list-header>
</div>
<div class="device-container">
<list-header
:deviceList="freezingPump"
@operationControl="hadleOperationConrol"
></list-header>
</div>
<!-- 蝶阀控制列表 -->
<div class="device-container">
<vavleheader
:valveList="freezingValve"
@operationControl="hadleOperationConrol"
></vavleheader>
</div>
<div class="device-container">
<vavleheader
:valveList="coolingValve"
@operationControl="hadleOperationConrol"
></vavleheader>
</div>
<div class="device-container">
<vavleheader
:valveList="coolingTowerOutValve"
@operationControl="hadleOperationConrol"
></vavleheader>
</div>
</div>
</template>
<script>
import { operationList, operationConrol } from "@/api/centerairC/sysMonitor";
import listHeader from "./listHeader.vue";
import Vavleheader from "./vavleheader.vue";
export default {
components: { listHeader, Vavleheader },
name: "sysMonitor",
data() {
return {
loading: false,
deviceList: [], //
hostList: [], //
coolingTowerFanList: [], //
coolingPump: [], //
freezingPump: [], //
valveList: [], //
total: null,
freezingValve: [], //
coolingValve: [], //
coolingTowerOutValve: [], //
activeName: "host", //
};
},
computed: {
statistics() {
const deviceManual = this.deviceList.filter(
(d) => d.automaticText === false
).length;
const deviceAuto = this.deviceList.filter(
(d) => d.automaticText === true
).length;
const valveManual = this.valveList.filter(
(v) => v.automaticText === false
).length;
const valveAuto = this.valveList.filter(
(v) => v.automaticText === true
).length;
return {
running: this.deviceList.filter((d) => d.runStatus === "运行").length,
manual: deviceManual + valveManual,
auto: deviceAuto + valveAuto,
warn: this.deviceList.filter((d) => d.warnText === "故障").length,
};
},
},
mounted() {
this.getOperationList();
},
methods: {
handleClick(tab, event) {
console.log(tab, event);
},
//
getOperationList() {
return new Promise((resolve, reject) => {
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;
let valveClosed = false;
let valveOpened = false;
limitedChildren.forEach((child) => {
if (child.name) {
//
if (
child.paramType === "1" &&
!child.name.includes("阀")
) {
deviceItem.runStatus =
Number(child.value) == 0 ? "不运行" : "运行";
}
//
else if (
child.paramType === "2" &&
!child.name.includes("阀")
) {
deviceItem.controlText =
Number(child.value) == 0 ? false : true;
deviceItem.controlId = child.id;
}
// 01
else if (
child.paramType === "6" &&
!child.name.includes("阀")
) {
deviceItem.automaticText =
Number(child.value) == 0 ? true : false;
deviceItem.automaticId = child.id;
}
//
else if (
child.paramType === "5" &&
!child.name.includes("阀")
) {
deviceItem.warnText =
Number(child.value) == 0 ? "未故障" : "故障";
//
} else if (
child.paramType === "22" &&
!child.name.includes("阀")
) {
deviceItem.localRemote =
Number(child.value) == 0 ? "本地" : "远程";
}
//
else if (
child.paramType === "3" &&
!child.name.includes("阀")
) {
deviceItem.frequencySet =
Number(child.value) == 0 ? "0" : child.value;
deviceItem.frequencyId = child.id;
}
//
else if (child.paramType === "4") {
deviceItem.frequency = child.value;
}
// -
else if (
child.paramType === "6" &&
child.name.includes("阀")
) {
valveItem.automaticText =
Number(child.value) == 0 ? true : false;
valveItem.automaticId = child.id;
}
// -
else if (
child.paramType === "2" &&
child.name.includes("阀")
) {
valveItem.controlText =
Number(child.value) == 0 ? false : true;
valveItem.controlId = child.id;
}
//
if (
child.name.includes("阀关到位") &&
Number(child.value) == 0
) {
valveClosed = false;
} else if (
child.name.includes("阀关到位") &&
Number(child.value) == 1
) {
valveClosed = true;
}
//
if (
child.name.includes("阀开到位") &&
Number(child.value) == 0
) {
valveOpened = false;
} else if (
child.name.includes("阀开到位") &&
Number(child.value) == 1
) {
valveOpened = true;
}
}
});
//
if (valveClosed && !valveOpened) {
valveItem.closeStatus = "开启";
valveItem.openStauts = "关闭";
} else if (!valveClosed && valveOpened) {
valveItem.closeStatus = "关闭";
valveItem.openStauts = "开启";
} else if (!valveClosed && !valveOpened) {
valveItem.closeStatus = "关闭";
valveItem.openStauts = "关闭";
}
// deviceList
if (Object.keys(deviceItem).length > 1) {
this.deviceList.push(deviceItem);
}
// valveList
if (Object.keys(valveItem).length > 1) {
this.valveList.push(valveItem);
}
}
});
this.valveList = this.valveList.filter(
(item) => item.name && item.name.includes("阀")
);
console.log("处理过的this.deviceList", this.deviceList);
console.log("处理过的this.valveList", this.valveList);
this.total = this.deviceList.length + this.valveList.length;
//
this.hostList = [];
this.coolingTowerFanList = [];
this.coolingPump = [];
this.freezingPump = [];
this.freezingValve = [];
this.coolingValve = [];
this.coolingTowerOutValve = [];
this.deviceList.forEach((list) => {
if (list.name.includes("机") && !list.name.includes("风")) {
this.hostList.push(list);
}
if (list.name.includes("风机")) {
this.coolingTowerFanList.push(list);
}
if (list.name.includes("冷却泵")) {
this.coolingPump.push(list);
}
if (list.name.includes("冷冻泵")) {
this.freezingPump.push(list);
}
});
this.valveList.forEach((list) => {
if (list.name.includes("冷冻蝶阀")) {
this.freezingValve.push(list);
}
if (list.name.includes("冷却蝶阀")) {
this.coolingValve.push(list);
}
if (list.name.includes("冷却塔出水阀")) {
this.coolingTowerOutValve.push(list);
}
});
console.log("处理过后的主机列表", this.hostList);
} else {
this.deviceList = [];
this.valveList = [];
this.total = 0;
}
// Promise
resolve(res);
})
.catch((error) => {
// Promise
reject(error);
});
});
},
//
hadleOperationConrol(id, param) {
let data = {
id: id,
param: param,
};
console.log("操作参数", data);
operationConrol([data])
.then((res) => {
if (res.code == 200) {
this.$modal.msgSuccess("指令下发成功!");
// loading
this.loading = true;
// ;
setTimeout(() => {
this.getOperationList().finally(() => {
// loading
this.loading = false;
});
}, 6000);
} else {
// this.$modal.msgError("");
console.log("应该更新状态的");
// ;
this.getOperationList();
}
})
.catch((error) => {
console.log("请求发生错误,更新设备状态", error);
// ;
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;
margin-bottom: 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>

643
src/views/centerairC/sysControl/index copy.vue

@ -1,643 +0,0 @@
<template>
<div class="app-container" v-loading="loading">
<!-- 状态统计 -->
<div class="status-statistics">
<div class="status-card">
<div class="status-label">运行设备</div>
<div class="status-value-running">
{{ statistics.running }}/{{ total }}
</div>
</div>
<div class="status-card">
<div class="status-label">手动模式</div>
<div class="status-value-auto">{{ statistics.manual }}/{{ total }}</div>
</div>
<div class="status-card">
<div class="status-label">自动模式</div>
<div class="status-value-maintenance">
{{ statistics.auto }}/{{ total }}
</div>
</div>
<div class="status-card">
<div class="status-label">故障设备</div>
<div class="status-value-error">{{ statistics.warn }}/{{ total }}</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 class="device-name">频率反馈</div>
</div> -->
<list-header :deviceList ="deviceList"></list-header>
<!-- <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">
<el-switch
style="display: block"
v-model="item.automaticText"
active-color="#13ce66"
inactive-color="#ff4949"
active-text="自动"
inactive-text="手动"
@change="handleAutomaticText(item)"
>
</el-switch>
</div>
<div class="device-name">
<span
:class="
item.localRemote === '远程' ? 'strong-electric' : 'auto-electric'
"
>{{ item.localRemote }}</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 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.controlText"
active-color="#13ce66"
inactive-color="#ff4949"
active-text="开启"
inactive-text="停止"
@change="handleControlText(item)"
>
</el-switch>
</div>
<div class="device-name">
<el-switch
style="display: block"
v-model="item.automaticText"
active-color="#13ce66"
inactive-color="#ff4949"
active-text="自动"
inactive-text="手动"
@change="handleAutomaticText(item)"
>
</el-switch>
</div>
<div class="device-name">
<span
:class="
item.localRemote === '远程' ? 'strong-electric' : 'auto-electric'
"
>{{ item.localRemote }}</span
>
</div>
<div class="device-name">
<div
:class="item.openStauts === '关闭' ? 'bad-status' : 'good-status'"
>
{{ item.openStauts }}
</div>
</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";
import listHeader from "./listHeader.vue";
export default {
components: { listHeader },
name: "sysMonitor",
data() {
return {
loading: false,
deviceList: [], //
hostList: [], //
coolingTowerFanList: [], //
coolingPump: [], //
freezingPump: [], //
valveList: [], //
total: null,
freezingValve: [], //
coolingValve: [], //
coolingTowerOutValve: [], //
};
},
computed: {
statistics() {
const deviceManual = this.deviceList.filter(
(d) => d.automaticText === false
).length;
const deviceAuto = this.deviceList.filter(
(d) => d.automaticText === true
).length;
const valveManual = this.valveList.filter(
(v) => v.automaticText === false
).length;
const valveAuto = this.valveList.filter(
(v) => v.automaticText === true
).length;
return {
running: this.deviceList.filter((d) => d.runStatus === "运行").length,
manual: deviceManual + valveManual,
auto: deviceAuto + valveAuto,
warn: this.deviceList.filter((d) => d.warnText === "故障").length,
};
},
},
mounted() {
this.getOperationList();
},
methods: {
//
getOperationList() {
return new Promise((resolve, reject) => {
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;
let valveClosed = false;
let valveOpened = false;
limitedChildren.forEach((child) => {
if (child.name) {
//
if (
child.paramType === "1" &&
!child.name.includes("阀")
) {
deviceItem.runStatus =
Number(child.value) == 0 ? "不运行" : "运行";
}
//
else if (
child.paramType === "2" &&
!child.name.includes("阀")
) {
deviceItem.controlText =
Number(child.value) == 0 ? false : true;
deviceItem.controlId = child.id;
}
// 01
else if (
child.paramType === "6" &&
!child.name.includes("阀")
) {
deviceItem.automaticText =
Number(child.value) == 0 ? true : false;
deviceItem.automaticId = child.id;
}
//
else if (
child.paramType === "5" &&
!child.name.includes("阀")
) {
deviceItem.warnText =
Number(child.value) == 0 ? "未故障" : "故障";
//
} else if (
child.paramType === "22" &&
!child.name.includes("阀")
) {
deviceItem.localRemote =
Number(child.value) == 0 ? "本地" : "远程";
}
//
else if (
child.paramType === "3" &&
!child.name.includes("阀")
) {
deviceItem.frequencySet =
Number(child.value) == 0 ? "0" : child.value;
deviceItem.frequencyId = child.id;
}
//
else if (child.paramType === "4") {
deviceItem.frequency = child.value;
}
// -
else if (
child.paramType === "22" &&
child.name.includes("阀")
) {
valveItem.localRemote =
Number(child.value) == 0 ? "本地" : "远程";
}
// -
else if (
child.paramType === "6" &&
child.name.includes("阀")
) {
valveItem.automaticText =
Number(child.value) == 0 ? true : false;
valveItem.automaticId = child.id;
}
// -
else if (
child.paramType === "2" &&
child.name.includes("阀")
) {
valveItem.controlText =
Number(child.value) == 0 ? false : true;
valveItem.controlId = child.id;
}
//
if (
child.name.includes("阀关到位") &&
Number(child.value) == 0
) {
valveClosed = false;
} else if (
child.name.includes("阀关到位") &&
Number(child.value) == 1
) {
valveClosed = true;
}
//
if (
child.name.includes("阀开到位") &&
Number(child.value) == 0
) {
valveOpened = false;
} else if (
child.name.includes("阀开到位") &&
Number(child.value) == 1
) {
valveOpened = true;
}
}
});
//
if (valveClosed && !valveOpened) {
valveItem.closeStatus = "开启";
valveItem.openStauts = "关闭";
} else if (!valveClosed && valveOpened) {
valveItem.closeStatus = "关闭";
valveItem.openStauts = "开启";
}
// 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);
this.total = this.deviceList.length + this.valveList.length;
//
this.hostList = [];
this.deviceList.forEach((list) => {
if (list.name.includes("机") && !list.name.includes("风")) {
this.hostList.push(list);
}
});
console.log("处理过后的主机列表", this.hostList);
} else {
this.deviceList = [];
this.valveList = [];
this.total = 0;
}
// Promise
resolve(res);
})
.catch((error) => {
// Promise
reject(error);
});
});
},
//
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.hadleOperationConrol(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.hadleOperationConrol(item.controlId, param);
})
.catch(() => {
//
item.controlText = !item.controlText;
console.log("不请求后台");
});
},
//
handleAutomaticText(item) {
this.$confirm(
`确定要切换设备"${item.name}"的状态为:${
item.automaticText ? "自动" : "手动 吗?"
}`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
//
console.log("请求后台", item.automaticText);
let param = null;
if (item.automaticText) {
param = 0;
} else {
param = 1;
}
this.hadleOperationConrol(item.automaticId, param);
})
.catch(() => {
//
item.automaticText = !item.automaticText;
console.log("不请求后台");
});
},
hadleOperationConrol(id, param) {
let data = {
id: id,
param: param,
};
console.log("操作参数", data);
operationConrol([data])
.then((res) => {
if (res.code == 200) {
this.$modal.msgSuccess("操作成功");
// loading
this.loading = true;
// ;
setTimeout(() => {
this.getOperationList().finally(() => {
// loading
this.loading = false;
});
}, 6000);
} else {
// this.$modal.msgError("");
console.log("应该更新状态的");
// ;
this.getOperationList();
}
})
.catch((error) => {
console.log("请求发生错误,更新设备状态", error);
// ;
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;
.el-switch {
width: 120px !important;
}
.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>

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

@ -86,6 +86,7 @@
<list-header
:deviceList="hostList"
:isNoShowHz="true"
:isNoShowlocalRemote="true"
@operationControl="hadleOperationConrol"
@upList="getOperationList"
></list-header>
@ -187,7 +188,8 @@ export default {
//
else if (
child.paramType === "2" &&
!child.name.includes("阀")
!child.name.includes("阀") &&
child.name.includes("启停")
) {
deviceItem.controlText =
Number(child.value) == 0 ? false : true;
@ -217,6 +219,15 @@ export default {
deviceItem.localRemote =
Number(child.value) == 0 ? "本地" : "远程";
}
// -
else if (
child.paramType === "40" &&
!child.name.includes("阀")
) {
deviceItem.frequencyAutotext =
Number(child.value) == 0 ? false : true;
deviceItem.frequencyAutotextId = child.id;
}
//
else if (
child.paramType === "3" &&
@ -258,24 +269,24 @@ export default {
}
//
if (
child.name.includes("关到位") &&
child.name.endsWith("关到位") &&
Number(child.value) == 0
) {
valveClosed = false;
} else if (
child.name.includes("关到位") &&
child.name.endsWith("关到位") &&
Number(child.value) == 1
) {
valveClosed = true;
}
//
if (
child.name.includes("开到位") &&
child.name.endsWith("开到位") &&
Number(child.value) == 0
) {
valveOpened = false;
} else if (
child.name.includes("开到位") &&
child.name.endsWith("开到位") &&
Number(child.value) == 1
) {
valveOpened = true;
@ -414,16 +425,6 @@ export default {
</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;
margin-bottom: 20px;
}
/* 状态统计样式 */
.status-statistics {
margin-bottom: 25px;

159
src/views/centerairC/sysControl/listHeader.vue

@ -7,6 +7,7 @@
<div class="device-name">手动控制</div>
<div class="device-name" v-if="!isNoShowlocalRemote">本地远程状态</div>
<div class="device-name">故障报警</div>
<div class="device-name" v-if="!isNoShowHz">频率手自动切换</div>
<div class="device-name" v-if="!isNoShowHz">频率调节</div>
<div class="device-name" v-if="!isNoShowHz">频率反馈</div>
<div class="device-name">运行时间</div>
@ -55,6 +56,20 @@
{{ item.warnText }}
</div>
</div>
<!-- 频率-手自动切换 -->
<div class="device-name" v-if="!isNoShowHz">
<el-switch
style="display: block"
v-model="item.frequencyAutotext"
active-color="#13ce66"
inactive-color="#ff4949"
active-text="手动"
inactive-text="自动"
v-if="item.frequencySet !== null && item.frequencySet !== undefined"
@change="handleFrequencyAutomaticText(item)"
>
</el-switch>
</div>
<!-- 频率调节 -->
<div class="device-name" v-if="!isNoShowHz">
<el-input
@ -64,7 +79,7 @@
@keyup.enter.native="handleEnter(item, $event)"
@input="handleInput(item)"
@blur="handleBlur()"
:disabled="!item.automaticText"
:disabled="!item.frequencyAutotext"
></el-input>
<div class="device-name" v-else></div>
</div>
@ -108,7 +123,7 @@ export default {
// this.currentFocusIndex = "";
},
handleEnter(item, event) {
console.log("请求后端");
console.log("请求后端", item);
//
event.target.blur();
this.$confirm(
@ -121,7 +136,6 @@ export default {
}
)
.then(() => {
// operationControl
this.$emit("operationControl", item.frequencyId, item.frequencySet);
})
.catch(() => {
@ -189,116 +203,37 @@ export default {
console.log("不请求后台");
});
},
// -
handleFrequencyAutomaticText(item) {
this.$confirm(
`确定要切换"${item.name}"的频率手自动状态为:${
item.frequencyAutotext ? "手动" : "自动 吗?"
}`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
//
console.log("请求后台", item.frequencyAutotext);
let param = null;
if (item.frequencyAutotext) {
param = 1;
} else {
param = 0;
}
this.$emit("operationControl", item.frequencyAutotextId, param);
})
.catch(() => {
//
item.frequencyAutotext = !item.frequencyAutotext;
console.log("不请求后台");
});
},
},
};
</script>
<style lang="scss" scoped>
.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;
font-size: 14px;
.el-switch {
width: 120px !important;
}
.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;
}
// 2000px
@media (min-width: 2000px) {
.device-li {
padding: 0.12rem 0 !important;
border-bottom: 0.01rem dashed #0349ac !important;
.device-name {
font-size: 0.14rem !important;
.el-switch {
width: 1.2rem !important;
}
.run::before {
width: 0.1rem !important;
height: 0.1rem !important;
margin-right: 0.05rem !important;
}
.no-run::before {
width: 0.1rem !important;
height: 0.1rem !important;
margin-right: 0.05rem !important;
}
.el-input {
width: 1rem !important;
}
.strong-electric {
padding: 0.05rem 0.2rem;
border-radius: 0.1rem !important;
}
.auto-electric {
padding: 0.05rem 0.2rem;
border-radius: 0.1rem !important;
}
}
}
}
</style>

107
src/views/centerairC/sysControl/vavleheader.vue

@ -125,111 +125,4 @@ export default {
</script>
<style lang="scss" scoped>
.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;
font-size: 14px;
.el-switch {
width: 120px !important;
}
.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;
}
// 2000px
@media (min-width: 2000px) {
.device-li {
padding: 0.12rem 0 !important;
border-bottom: 0.01rem dashed #0349ac !important;
.device-name {
font-size: 0.14rem !important;
.el-switch {
width: 1.2rem !important;
}
.run::before {
width: 0.1rem !important;
height: 0.1rem !important;
margin-right: 0.05rem !important;
}
.no-run::before {
width: 0.1rem !important;
height: 0.1rem !important;
margin-right: 0.05rem !important;
}
.el-input {
width: 1rem !important;
}
.strong-electric {
padding: 0.05rem 0.2rem;
border-radius: 0.1rem !important;
}
.auto-electric {
padding: 0.05rem 0.2rem;
border-radius: 0.1rem !important;
}
}
}
}
</style>

404
src/views/centerairC/sysMonitor/components/hostChart.vue

@ -21,6 +21,7 @@ export default {
chartData2: [],
chartData3: [],
chartData4: [],
chartData5: [],
bottomData: [],
};
},
@ -36,10 +37,10 @@ export default {
let data = newVal;
if (data.length > 0) {
// title titleStr
const title = data.data[0].title;
const titleStr = data.data[1].titleStr;
const title = data[0].title;
const titleStr = data[1].titleStr;
// dataList
const dataList = data.data[3].dataList;
const dataList = data[3].dataList;
// dataList
dataList.forEach((item) => {
@ -51,71 +52,134 @@ export default {
}
});
console.log("处理后的data", data);
let name1 = "";
let name2 = "";
let name3 = "";
let name4 = "";
let name5 = "";
data.forEach((item) => {
if (item.timeStr) {
this.bottomData = item.timeStr;
}
if (item.dataList) {
let name1 = "";
let name2 = "";
let name3 = "";
let name4 = "";
item.dataList.forEach((val, index) => {
// name
const names = [];
// chartData
const chartData = [];
//
let loadDataIndex = -1;
for (let i = 0; i < item.dataList.length; i++) {
if (
item.dataList[i].name &&
item.dataList[i].name.includes("负载")
) {
loadDataIndex = i;
this.chartData5 = item.dataList[i].value;
name5 = item.dataList[i].name;
break;
}
}
//
if (loadDataIndex !== -1) {
item.dataList.splice(loadDataIndex, 1);
}
//
item.dataList.slice(0, 4).forEach((val, index) => {
if (val.name) {
switch (index) {
case 0:
this.chartData1 = val.value;
name1 = val.name;
break;
case 1:
this.chartData2 = val.value;
name2 = val.name;
break;
case 2:
this.chartData3 = val.value;
name3 = val.name;
break;
case 3:
this.chartData4 = val.value;
name4 = val.name;
break;
default:
break;
}
chartData[index] = val.value;
names[index] = val.name;
}
});
// chartData this.chartDataX
this.chartData1 = chartData[0] || "";
this.chartData2 = chartData[1] || "";
this.chartData3 = chartData[2] || "";
this.chartData4 = chartData[3] || "";
// names
name1 = names[0] || "";
name2 = names[1] || "";
name3 = names[2] || "";
name4 = names[3] || "";
}
});
console.log("this.chartData1", this.chartData1);
console.log("this.chartData2", this.chartData2);
console.log("this.chartData3", this.chartData3);
console.log("this.chartData4", this.chartData4);
console.log("this.chartData5", this.chartData5);
this.$nextTick(() => {
// y
var Min1 = 0,
Min2 = 0,
Max1 = Math.ceil(
Math.max(
...this.chartData1,
...this.chartData2,
...this.chartData3,
...this.chartData4
)
),
Max2 = Math.ceil(Math.max(...this.chartData5));
console.log("Min1", Min1);
console.log("Min2", Min2);
console.log("Max1", Max1);
console.log("Max2", Max2);
const adapterOption = {
xAxis: {
data: this.bottomData,
},
yAxis: [
//y
{
min: Min1,
max: Max1,
splitNumber: 10,
interval: (Max1 - Min1) / 10,
},
{
min: Min2,
max: Max2,
splitNumber: 10,
interval: (Max2 - Min2) / 10,
},
],
series: [
{
yAxisIndex: 0,
name:name1,
name: name1,
data: this.chartData1,
},
{
yAxisIndex: 0,
name:name2,
name: name2,
data: this.chartData2,
},
{
yAxisIndex: 0,
name:name3,
name: name3,
data: this.chartData3,
},
{
yAxisIndex: 0,
name:name4,
name: name4,
data: this.chartData4,
},
{
yAxisIndex: 1,
name: name5,
data: this.chartData5,
},
],
};
this.chartInstance.setOption(adapterOption);
//resize
// resize
this.chartInstance.resize();
});
} else {
@ -124,6 +188,21 @@ export default {
xAxis: {
data: [],
},
yAxis: [
//y
{
min: 0,
max: 0,
splitNumber: 10,
interval: 0,
},
{
min: 0,
max: 0,
splitNumber: 10,
interval: 0,
},
],
series: [
{
yAxisIndex: 0,
@ -141,6 +220,10 @@ export default {
yAxisIndex: 0,
data: [],
},
{
yAxisIndex: 0,
data: [],
},
],
};
this.chartInstance.setOption(adapterOption);
@ -175,6 +258,17 @@ export default {
},
//chartInstance
initChart() {
var Min1 = 0,
Min2 = 0,
Max1 = Math.ceil(
Math.max(
...this.chartData1,
...this.chartData2,
...this.chartData3,
...this.chartData4
) + 4
),
Max2 = Math.ceil(Math.max(...this.chartData5) + 4);
const chartRef = this.$refs.chart_ref;
if (chartRef) {
//
@ -182,6 +276,42 @@ export default {
this.option = {
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;
console.log("打印颜色", params[i].color)
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 (seriesName.includes("负载")) {
res +=
marker +
seriesName +
":" +
'<span style="color: #000000; font-weight: bold;margin-left:5px">' +
value +
" " +
"%" +
"</span><br>";
} else {
res +=
marker +
seriesName +
":" +
'<span style="color: #000000; font-weight: bold;margin-left:5px">' +
value +
" " +
"℃" +
"</span><br>";
}
}
return res;
},
},
legend: {
show: true,
@ -224,176 +354,152 @@ export default {
}, //x线
data: this.bottomData,
},
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 线
yAxis: [
{
min: Min1,
max: Max1,
splitNumber: 10,
interval: (Max1 - Min1) / 10,
// 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", // 线线
},
},
},
//y线
// splitNumber: 10,
// y线
splitLine: {
lineStyle: {
color: "#1a3d62", // 线
type: "dashed", // 线线
{
min: Min2,
max: Max2,
splitNumber: 10,
interval: (Max2 - Min2) / 10,
// name
nameTextStyle: {
color: "rgba(255, 255, 255, 1)",
fontSize: 12,
},
miniInterval: 5,
type: "value",
name: "负载", // y
// y
axisLabel: {
color: "#ffffff",
},
// 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,
data: this.chartData1,
yAxisIndex: 0,
//线
itemStyle: {
color: "#1a69f1", //线
color: "#00CED1", //线
},
lineStyle: {
color: "#1a69f1", //线
color: "#00CED1", //线
},
smooth: false,
// 线
showSymbol: false,
//
areaStyle: {
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgba(26, 105, 241, 0.5)", //
},
{
offset: 1,
color: "rgba(26, 105, 241, 0)", //
},
],
global: false, // false
},
},
},
{
type: "line",
//
symbolSize: 8,
data: this.chartData2,
yAxisIndex: 0,
//线
itemStyle: {
color: "#00CED1", //线
color: "#3ba272", //线
},
smooth: false,
// 线
showSymbol: false,
areaStyle: {
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgba(0, 206, 209, 0.5)", //
},
{
offset: 1,
color: "rgba(0, 206, 209, 0)", //
},
],
global: false, // false
},
},
},
{
type: "line",
//
symbolSize: 8,
data: this.chartData3,
yAxisIndex: 0,
//线
itemStyle: {
color: "#00CED1", //线
color: "#1a69f1", //线
},
smooth: false,
// 线
showSymbol: false,
areaStyle: {
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgba(0, 206, 209, 0.5)", //
},
{
offset: 1,
color: "rgba(0, 206, 209, 0)", //
},
],
global: false, // false
},
},
},
{
type: "line",
//
symbolSize: 8,
data: this.chartData4,
yAxisIndex: 0,
//线
itemStyle: {
color: "#00CED1", //线
color: "#ee6666", //线
},
smooth: false,
// 线
showSymbol: false,
areaStyle: {
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgba(0, 206, 209, 0.5)", //
},
{
offset: 1,
color: "rgba(0, 206, 209, 0)", //
},
],
global: false, // false
},
},
{
type: "line",
//
symbolSize: 8,
data: this.chartData5,
yAxisIndex: 1,
//线
itemStyle: {
color: "#fac858", //线
},
smooth: false,
// 线
showSymbol: false,
},
],
};
@ -410,6 +516,6 @@ export default {
<style lang="scss" scoped>
.historyCharts {
width: 100%;
height: 4rem;
height: 4.4rem;
}
</style>

393
src/views/centerairC/sysMonitor/hostDetails.vue

@ -62,14 +62,14 @@
<div class="host-name">{{ deviceName }}</div>
<!-- 冷凝器蒸发器压力-->
<div class="outIn">
<div class="outIn-li in1">
<!-- <div class="outIn-li in1">
<svg-icon slot="prefix" icon-class="arrow" class="arrow" />
<div class="kpa">冷凝器压力:{{ condenserPre }}kpa</div>
</div>
<div class="outIn-li out1">
<svg-icon slot="prefix" icon-class="arrow" class="arrow" />
<div class="kpa">蒸发器压力:{{ evaporatorPre }}kpa</div>
</div>
</div> -->
<!-- <div class="outIn-li in2">
<svg-icon slot="prefix" icon-class="arrow" class="arrow" />
<div class="kpa">566.6kpa</div>
@ -112,6 +112,27 @@
></span>
</div>
</div>
<div class="hostStatus">
<div class="hostStatus-li">
<span>手自动切换:</span>
<span class="automaticData">{{ automaticObj.showValue }}</span>
</div>
<div class="hostStatus-li">
<span>本地远程状态:</span>
<span class="dotData">{{ localObj.showValue }}</span>
</div>
<div class="hostStatus-li">
<span>故障状态:</span>
<span class="goodData" v-if="badObj.showValue === '正常'">{{
badObj.showValue
}}</span>
<span class="badData" v-else>{{ badObj.showValue }}</span>
</div>
<div class="hostStatus-li">
<span>运行累计时间:</span>
<span class="timeData">{{ timeObj.showValue }}小时</span>
</div>
</div>
<!-- 负载 -->
<LoadData class="loadData" :hostData="hostData"></LoadData>
</div>
@ -121,27 +142,6 @@
</div>
</div>
<div class="detail-bottom">
<div class="hostStatus">
<div class="hostStatus-li">
<span>手自动切换:</span>
<span class="automaticData">{{ automaticObj.showValue }}</span>
</div>
<div class="hostStatus-li">
<span>本地远程状态:</span>
<span class="dotData">{{ localObj.showValue }}</span>
</div>
<div class="hostStatus-li">
<span>故障状态:</span>
<span class="goodData" v-if="badObj.showValue === '未故障'">{{
badObj.showValue
}}</span>
<span class="badData" v-else>{{ badObj.showValue }}</span>
</div>
<div class="hostStatus-li">
<span>运行累计时间:</span>
<span class="timeData">{{ timeObj.showValue }}小时</span>
</div>
</div>
<div class="detail-data hostparams">
<div class="detail-data-top">
<title-img></title-img>
@ -163,40 +163,78 @@
</div>
</div>
</div>
<line-square
class="line1"
:horizontalLength="700"
:verticalLength="300"
:overlap="15"
></line-square>
</div>
<div class="detail-data compressor">
<div class="detail-data-top">
<title-img></title-img>
<div class="details-title">压缩机参数</div>
<div class="choice">
<div>{{ compressorData1.mtTypeName }}</div>
</div>
<title-img></title-img>
</div>
<div class="detail-data-bottom">
<div
class="detail-data-li"
v-for="(item, index) in compressorData"
:key="index + 1"
v-for="(subItem, subIndex) in compressorData1.list"
:key="subIndex"
>
<div class="rightDot">
<div class="leftDot">
<span>{{ item.otherName }}:</span>
<span class="dotData">{{ item.curValue }}</span>
<span>{{ item.unit }}</span>
<span>{{ subItem.otherName }}:</span>
<span class="dotData">{{ subItem.curValue }}</span>
<span>{{ subItem.unit }}</span>
</div>
</div>
</div>
</div>
</div>
<div class="detail-data compressor">
<div class="detail-data-top">
<title-img></title-img>
<div class="choice">
<div>{{ compressorData2.mtTypeName }}</div>
</div>
<title-img></title-img>
</div>
<div class="detail-data-bottom">
<div
class="detail-data-li"
v-for="(subItem, subIndex) in compressorData2.list"
:key="subIndex"
>
<div class="rightDot">
<div class="leftDot">
<span>{{ subItem.otherName }}:</span>
<span class="dotData">{{ subItem.curValue }}</span>
<span>{{ subItem.unit }}</span>
</div>
</div>
</div>
</div>
</div>
<div class="detail-data compressor">
<div class="detail-data-top">
<title-img></title-img>
<div class="choice">
<div>{{ compressorData3.mtTypeName }}</div>
</div>
<title-img></title-img>
</div>
<div class="detail-data-bottom">
<div
class="detail-data-li"
v-for="(subItem, subIndex) in compressorData3.list"
:key="subIndex"
>
<div class="rightDot">
<div class="leftDot">
<span>{{ subItem.otherName }}:</span>
<span class="dotData">{{ subItem.curValue }}</span>
<span>{{ subItem.unit }}</span>
</div>
</div>
</div>
</div>
<line-square
class="line1"
:horizontalLength="700"
:verticalLength="300"
:overlap="15"
></line-square>
</div>
</div>
</div>
@ -216,6 +254,7 @@ import hostChart from "./components/hostChart.vue";
import titleImg from "./components/titleImg.vue";
import lineSquare from "./components/lineSquare.vue";
import { format } from "@/utils/datetime";
import { getDay } from "@/utils/datetime";
export default {
name: "sysControl",
components: { LoadData, hostChart, titleImg, lineSquare },
@ -234,11 +273,14 @@ export default {
localObj: {}, //
badObj: {}, //
timeObj: {}, //
compressorData: [], //
compressorData1: [], //1
compressorData2: [],
compressorData3: [],
temArray: [], //
isMagnetic: false,
isShowWarning: false, //
dayData: "", //
sharedIndex: 0,
};
},
computed: {
@ -369,11 +411,17 @@ export default {
//
this.leftHostData = [];
this.rightHostData = [];
// paramType
this.rightHostData = this.hostData.filter((item) => {
return !["2", "21", "20", "6", "5", "22", "26"].includes(
Number(item.paramType)
);
});
// ordernum
this.rightHostData.sort((a, b) => {
return Number(a.orderNum) - Number(b.orderNum);
});
this.hostData.forEach((item) => {
// 12
if (item.paramType === "12") {
this.rightHostData.push(item);
}
// paramType showValue
if (item.paramType === "6") {
//
@ -382,8 +430,7 @@ export default {
this.automaticObj = item;
} else if (item.paramType === "5") {
//
item.showValue =
Number(item.curValue) === 0 ? "未故障" : "故障";
item.showValue = item.curValue;
this.badObj = item;
} else if (item.paramType === "22") {
//
@ -397,22 +444,22 @@ export default {
}
});
}
});
// 使 filter item '0'
let compressorData = data.filter((obj) => obj.mtType !== "0");
console.log("压缩机数组", this.compressorData);
compressorData.forEach((item) => {
if (item.mtType === "9") {
//
this.compressorData = item.list;
this.compressorData.forEach((item) => {
if (
item.paramType === "13" &&
item.otherName.includes("冷凝器")
) {
this.condenserPre = item.curValue;
} else if (
item.paramType === "13" &&
item.otherName.includes("蒸发器")
) {
this.evaporatorPre = item.curValue;
}
});
// 1
this.compressorData1 = item;
}
if (item.mtType === "10") {
// 2
this.compressorData2 = item;
}
if (item.mtType === "11") {
// 3
this.compressorData3 = item;
}
});
}
@ -433,10 +480,11 @@ export default {
let newDataArray = []; //
data.forEach((item) => {
if (
item.otherName.includes("冷冻出水温度") ||
item.otherName.includes("冷冻进水温度") ||
item.otherName.includes("冷却出水温度") ||
item.otherName.includes("冷却进水温度")
item.otherName.includes("冷冻回水温度") ||
item.otherName.includes("冷冻供水温度") ||
item.otherName.includes("冷却回水温度") ||
item.otherName.includes("冷却供水温度") ||
item.otherName.includes("负载")
) {
let dataItem = {
name: item.otherName,
@ -474,8 +522,45 @@ export default {
hostListClass(paramType) {
for (let i = 0; i < this.hostData.length; i++) {
const item = this.hostData[i];
if (item.paramType === paramType && Number(item.curValue) !== 0) {
return true;
if (
item.paramType === paramType &&
typeof item.curValue === "string" &&
/[\u4e00-\u9fa5]/.test(item.curValue)
) {
switch (item.paramType) {
case "1": //
if (item.curValue === "运行") {
return true;
}
break;
case "2": //
if (item.curValue === "启动" && item.otherName.includes("启停")) {
return true;
}
break;
case "5": //
if (item.curValue === "正常") {
return true;
}
break;
case "6": //
if (item.curValue === "自动") {
return true;
}
break;
case "22": //
if (item.curValue === "远程") {
return true;
}
break;
default:
return false;
break;
}
} else {
if (item.paramType === paramType && Number(item.curValue) !== 0) {
return true;
}
}
}
//
@ -509,7 +594,6 @@ export default {
.monitor {
width: 100%;
min-height: 100vh;
height: auto;
background-color: black;
color: #fff;
.monitor-top {
@ -621,13 +705,12 @@ export default {
align-items: center;
justify-content: space-between;
.detail-top-left {
width: 7rem;
height: 4.4rem;
// background-color: aquamarine;
position: relative;
.host-img1 {
width: 4.88rem;
height: 3.97rem;
width: 4.48rem;
height: 3.57rem;
margin: 0.2rem 0 0 0.2rem;
}
.outIn {
@ -699,18 +782,71 @@ export default {
.startClass {
z-index: 10;
position: absolute;
top: 2.9rem;
left: 3.4rem;
top: 2.2rem;
left: 2.7rem;
width: 0.18rem;
height: 0.18rem;
border-radius: 50%;
animation: blink 1s infinite;
background-color: #38fc52 !important;
}
.hostStatus {
z-index: 10;
position: absolute;
top: 0.6rem;
left: 4.9rem;
display: flex;
flex-direction: column;
justify-content: flex-start;
width: 2.8rem !important;
margin-top: 1.5rem;
.hostStatus-li {
background-color: #25455a;
color: #c0dffc;
font-size: 0.16rem;
margin-bottom: 0.1rem;
padding: 0.1rem;
letter-spacing: 0.02rem;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: flex-start;
span {
white-space: nowrap;
}
}
.dotData {
font-weight: bold;
margin: 0 0.06rem;
color: #3b80ff;
display: flex;
align-items: center;
}
.goodData {
font-weight: bold;
margin: 0 0.06rem;
color: #3df574;
}
.badData {
font-weight: bold;
margin: 0 0.06rem;
color: #cf3607;
}
.automaticData {
font-weight: bold;
margin: 0 0.06rem;
color: #da7b10;
}
.timeData {
font-weight: bold;
margin: 0 0.06rem;
color: #1df3e8;
}
}
.water-flow3 {
z-index: 10;
position: absolute;
top: 3.6rem;
top: 3.5rem;
left: 1.2rem;
.water-flow-li {
margin-bottom: 0.04rem;
@ -753,8 +889,8 @@ export default {
.fanBlade {
z-index: 10;
position: absolute;
top: 2.55rem;
left: 4.65rem;
top: 2.5rem;
left: 4.1rem;
width: 0.5rem;
height: 0.5rem;
transform-style: preserve-3d;
@ -764,7 +900,7 @@ export default {
.leftFan {
z-index: 10;
position: absolute;
top: 2.55rem;
top: 2.29rem;
left: 0.53rem;
width: 0.5rem;
height: 0.5rem;
@ -777,46 +913,32 @@ export default {
.host-name {
z-index: 10;
position: absolute;
top: 1.55rem;
left: 1.8rem;
color: #3520f8;
top: 1.6rem;
left: 1.44rem;
color: #2925f8;
font-weight: bold;
font-size: 0.18rem;
}
.loadData {
z-index: 10;
position: absolute;
top: 0.2rem;
right: 0rem;
top: 0rem;
left: 5rem;
}
}
.detail-top-right {
width: calc(100% - 7.25rem);
width: calc(100% - 7.6rem);
height: 4.4rem;
// background-color: rgb(127, 172, 255);
}
}
.detail-bottom {
height: 2.6rem;
// height: 5rem;
margin-top: 0.3rem;
margin-left: 0.25rem;
display: flex;
flex-direction: row;
justify-content: space-between;
.hostStatus {
display: flex;
flex-direction: column;
justify-content: flex-end;
width: 3rem;
.hostStatus-li {
background-color: #25455a;
color: #c0dffc;
font-size: 0.18rem;
margin-bottom: 0.1rem;
padding: 0.1rem;
letter-spacing: 0.02rem;
}
}
.detail-data {
display: flex;
flex-direction: column;
@ -839,18 +961,19 @@ export default {
}
.detail-data-bottom {
width: 100%;
padding: 0.1rem 0.3rem;
// padding: 0.1rem 0.3rem;
z-index: 0;
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: flex-start;
align-items: stretch;
justify-content: flex-start;
.detail-data-li {
// width: 100%;
margin-right: 0.1rem;
margin-bottom: 0.15rem !important;
position: relative;
color: #89acc4;
color: #c0dffc;
font-family: Arial, sans-serif;
letter-spacing: 0.02rem;
font-size: 0.18rem;
@ -912,6 +1035,10 @@ export default {
width: 100%;
height: 100%;
padding: 0.04rem 0.1rem;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.rightDot::before {
@ -987,55 +1114,47 @@ export default {
}
.line1 {
position: absolute;
top: 0.53rem;
top: 0rem;
}
}
.hostparams {
width: 7.6rem;
width: 7rem;
.detail-data-bottom {
padding-left: 0.75rem;
// padding-left: 0.5rem;
.detail-data-li {
width: 3rem;
// width: 3.2rem;
width: calc(50% - 0.2rem) !important;
margin: 0 0.1rem;
}
}
}
.compressor {
width: 7.6rem;
width: 3.5rem;
.detail-data-bottom {
padding-left: 0.75rem;
// padding-left: 0.75rem;
.detail-data-li {
width: 3rem;
// width: 3.4rem;
width: calc(100%) !important;
margin: 0 0.1rem;
}
}
}
.dotData {
font-weight: bold;
margin: 0 0.06rem;
color: #3b80ff;
display: flex;
align-items: center;
}
.goodData {
font-weight: bold;
margin: 0 0.06rem;
color: #3df574;
}
.badData {
font-weight: bold;
margin: 0 0.06rem;
color: #cf3607;
}
.automaticData {
font-weight: bold;
margin: 0 0.06rem;
color: #da7b10;
}
.timeData {
font-weight: bold;
margin: 0 0.06rem;
color: #1df3e8;
}
}
}
}
.choice {
margin-left: 0 !important;
}
.choice .mr20 {
width: 1rem !important;
color: #c0dffc;
font-weight: bold !important;
font-size: 0.18rem !important;
text-align: center !important;
background-color: transparent !important;
box-shadow: none !important;
}
.timeStyle {
color: #ffffff !important;
}
</style>

2198
src/views/centerairC/sysMonitor/monitorCenter.vue

File diff suppressed because it is too large Load Diff

147
src/views/centerairC/sysMonitor/performance.vue

@ -714,153 +714,6 @@ export default {
flex-wrap: wrap;
align-items: flex-start;
justify-content: center;
.detail-data-li {
width: 80%;
margin-right: 0.1rem;
position: relative;
color: #89acc4;
font-family: Arial, sans-serif;
letter-spacing: 0.02rem;
font-size: 0.18rem;
position: relative;
margin-bottom: 0.08rem;
border-left: 0.01rem solid #217df5;
border-right: 0.01rem solid #217df5;
background-image: radial-gradient(
circle at left top,
#217df5 0.01rem,
transparent 0.01rem
),
radial-gradient(
circle at right top,
#217df5 0.01rem,
transparent 0.01rem
),
radial-gradient(
circle at left bottom,
#217df5 0.01rem,
transparent 0.01rem
),
radial-gradient(
circle at right bottom,
#217df5 0.01rem,
transparent 0.01rem
);
background-repeat: no-repeat;
background-position: left top, right top, left bottom, right bottom;
}
.detail-data-li::before,
.detail-data-li::after {
content: "";
position: absolute;
left: 0;
right: 0;
height: 0.01rem;
background-image: linear-gradient(
to right,
#217df5 0%,
rgba(41, 128, 185, 0) 50%,
#217df5 100%
) !important;
}
.year-data {
margin-top: 0.1rem;
}
.rightDot {
position: relative;
width: 100%;
height: 100%;
z-index: 999;
}
.leftDot {
position: relative;
width: 100%;
height: 100%;
padding: 0.04rem 0.1rem;
display: flex;
flex-direction: row;
justify-content: space-between;
.dotData {
font-weight: bold;
margin: 0 0.06rem;
color: #3b80ff;
display: flex;
align-items: center;
}
.dotUnit{
width: 0.55rem;
text-align: left;
display: flex;
align-items: center;
}
}
.rightDot::before {
content: "";
position: absolute;
top: -0.03rem;
right: -0.03rem;
width: 0.06rem;
height: 0.06rem;
background-color: #217df5;
box-shadow: 0 0 0.1rem 0.02rem rgba(33, 125, 245, 0.9);
background-image: radial-gradient(
circle at 30% 30%,
rgba(255, 255, 255, 0.8) 0%,
rgba(255, 255, 255, 0) 70%
);
border-radius: 50%;
}
.rightDot::after {
content: "";
position: absolute;
bottom: -0.03rem;
right: -0.03rem;
width: 0.06rem;
height: 0.06rem;
background-color: #217df5;
box-shadow: 0 0 0.1rem 0.02rem rgba(33, 125, 245, 0.9);
background-image: radial-gradient(
circle at 30% 30%,
rgba(255, 255, 255, 0.8) 0%,
rgba(255, 255, 255, 0) 70%
);
border-radius: 50%;
}
.leftDot::before {
content: "";
position: absolute;
top: -0.03rem;
left: -0.03rem;
width: 0.06rem;
height: 0.06rem;
background-color: #217df5;
border-radius: 50%;
box-shadow: 0 0 0.1rem 0.02rem rgba(33, 125, 245, 0.9);
background-image: radial-gradient(
circle at 30% 30%,
rgba(255, 255, 255, 0.8) 0%,
rgba(255, 255, 255, 0) 70%
);
}
.leftDot::after {
content: "";
position: absolute;
bottom: -0.03rem;
left: -0.03rem;
width: 0.06rem;
height: 0.06rem;
background-color: #217df5;
box-shadow: 0 0 0.1rem 0.02rem rgba(33, 125, 245, 0.9);
background-image: radial-gradient(
circle at 30% 30%,
rgba(255, 255, 255, 0.8) 0%,
rgba(255, 255, 255, 0) 70%
);
border-radius: 50%;
}
}
.line1 {
position: absolute;

11
src/views/centerairC/timeSwitch/index.vue

@ -419,13 +419,7 @@ export default {
border-radius: 10px;
font-size: 14px;
.device-li {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
padding: 12px 0;
color: #abcdfc;
border-bottom: 1px dashed #0349ac;
flex: none !important;
.device-name {
flex: 1;
white-space: nowrap;
@ -441,9 +435,6 @@ export default {
}
}
}
.device-li:nth-child(1) {
color: #9ca3af;
}
}
// 2000px
@media (min-width: 2000px) {

16
src/views/components/waterTank.vue

@ -46,9 +46,9 @@ export default {
}
.water {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
bottom: 0.05rem;
left: 0.03rem;
width: 1.13rem;
/* 修改颜色表示,添加透明度 */
background-color: rgba(23, 106, 201);
overflow: hidden;
@ -64,7 +64,7 @@ export default {
height: 120px !important;
}
.water {
width: 110px !important;
width: 105px !important;
}
}
@ -78,11 +78,11 @@ export default {
height: 100px !important;
}
.water {
width: 90px !important;
width: 85px !important;
}
}
@media (min-width: 720px) and (max-width: 1240px){
@media (min-width: 720px) and (max-width: 1240px) {
.monitor-container {
width: 100px !important;
height: 100px !important;
@ -92,7 +92,7 @@ export default {
height: 110px !important;
}
.water {
width: 100px !important;
width: 96px !important;
}
}
@ -106,7 +106,7 @@ export default {
height: 90px !important;
}
.water {
width: 80px !important;
width: 76px !important;
}
}
</style>

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

@ -69,15 +69,19 @@
<div class="words-li">
<div class="ash">开关状态:</div>
<div class="white">
<el-switch
style="display: block"
v-model="item.switchStatus"
active-color="#13ce66"
active-text="开启"
inactive-text="关闭"
<el-select
v-model="item.hotPumpStatus"
placeholder="请选择"
@change="handleHotPump(item)"
>
</el-switch>
<el-option
v-for="item in hotPumpOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</div>
</div>
<div class="words-li">
@ -129,7 +133,9 @@
/>
<div class="monitor-words">
<div class="words-li">
<div class="ash">PID手自动:</div>
<div class="ash" style="letter-spacing: 5px">
频率手自动:
</div>
<div class="white">
<el-switch
style="display: block"
@ -143,7 +149,9 @@
</div>
</div>
<div class="words-li">
<div class="ash">&nbsp;&nbsp;&nbsp;:</div>
<div class="ash" style="letter-spacing: 7px">
启停&nbsp;控制:
</div>
<div class="white">
<el-switch
style="display: block"
@ -160,7 +168,7 @@
</div>
<div class="control-bottom">
<div class="words-li">
<div class="ash">故障信息:</div>
<div class="ash">故障信息</div>
<el-tag
size="mini"
v-if="item.alarmStatus === '无故障'"
@ -172,7 +180,7 @@
}}</el-tag>
</div>
<div class="words-li">
<div class="ash">运行状态:</div>
<div class="ash">运行状态</div>
<el-tag
size="mini"
v-if="item.runningStatus === '运行'"
@ -245,23 +253,98 @@
<div class="white">S</div>
</div>
<div class="words-li">
<div class="ash">换机周期:</div>
<div class="ash">换机时间:</div>
<el-input
v-model="item.switchTimeSet"
v-model="item.counterSet"
@keyup.enter.native="
handleEnter(
item,
item.switchTimeSet,
item.switchTimeSetId,
'换机周期',
'S'
item.counterSet,
item.counterSetId,
'换机时间',
''
)
"
@input="handleInput(item)"
@blur="handleBlur()"
size="mini"
></el-input>
<div class="white">min</div>
<div class="white"></div>
</div>
<div class="words-li">
<div class="white">一次50分钟</div>
</div>
</div>
</div>
<!-- 裙楼供水泵高区供水泵中厨回水泵 -->
<div class="monitor-flex-left" v-if="activeName.includes('回水')">
<div class="control-top">
<img
class="monitor-img3"
src="../../../assets/images/pump.png"
/>
<div class="monitor-words">
<div class="words-li">
<div class="ash">回水温度:</div>
<div class="white">{{ item.temp }}</div>
</div>
<div class="words-li">
<div class="ash">回水温度设置:</div>
<el-input
v-model="item.tempSet"
@keyup.enter.native="
handleEnter(
item,
item.tempSet,
item.tempSetId,
'回水温度',
'℃'
)
"
@input="handleInput(item)"
@blur="handleBlur()"
size="mini"
></el-input>
<div class="white"></div>
</div>
<div class="words-li">
<div class="ash">回水温度设定差值:</div>
<el-input
v-model="item.diffValueSet"
@keyup.enter.native="
handleEnter(
item,
item.diffValueSet,
item.diffValueSetId,
'回水温度设定差值',
'℃'
)
"
@input="handleInput(item)"
@blur="handleBlur()"
size="mini"
></el-input>
<div class="white"></div>
</div>
<div class="words-li">
<div class="ash">回水温度设定延时时间:</div>
<el-input
v-model="item.delayTimeSet"
@keyup.enter.native="
handleEnter(
item,
item.delayTimeSet,
item.delayTimeSetId,
'回水温度设定延时时间',
'S'
)
"
@input="handleInput(item)"
@blur="handleBlur()"
size="mini"
></el-input>
<div class="white">min</div>
</div>
</div>
</div>
</div>
@ -310,8 +393,8 @@
></el-input>
<div class="white">%</div>
</div>
<div class="words-li words-li5">
<div class="ash">补水延时时间:</div>
<div class="words-li words-li6">
<div class="ash">液位设定延时时间:</div>
<el-input
size="mini"
v-model="item.delayTimeSet"
@ -321,15 +404,15 @@
item,
item.delayTimeSet,
item.delayTimeSetId,
'补水延时时间',
'S'
'液位设定延时时间',
'min'
)
"
@input="handleWaterInput(item)"
></el-input>
<div class="white">S</div>
<div class="white">min</div>
</div>
<div class="words-li words-li5">
<div class="words-li words-li2">
<div class="ash ash2">液位误差值:</div>
<el-input
size="mini"
@ -369,22 +452,22 @@
class="monitor-img2"
src="../../../assets/images/startpum.png"
/>
<div class="sigClass">
<div class="monitor-words">
<div class="words-li">
<div class="ash">启动:</div>
<div class="ash" style="letter-spacing: 8px">一键启动:</div>
<div class="white">
<el-switch
style="display: block"
v-model="item.openSwitch"
active-color="#13ce66"
active-text=""
inactive-text=""
active-text="开启"
inactive-text="停止"
@change="handleAllStart(item)"
>
</el-switch>
</div>
</div>
<div class="words-li">
<!-- <div class="words-li">
<div class="ash">停止:</div>
<div class="white">
<el-switch
@ -397,7 +480,7 @@
>
</el-switch>
</div>
</div>
</div> -->
</div>
</div>
<div class="control-bottom">
@ -429,7 +512,7 @@
<div class="white">{{ item.pressure }}bar</div>
</div>
<div class="words-li words-li4">
<div class="ash">供水温度误差设定:</div>
<div class="ash">温度偏差值:</div>
<el-input
v-model="item.diffValueSet"
@keyup.enter.native="
@ -437,7 +520,7 @@
item,
item.diffValueSet,
item.diffValueSetId,
'供水温度误差设定',
'温度偏差值',
'℃'
)
"
@ -459,7 +542,7 @@
item.alarmStatus
}}</el-tag>
</div>
<div class="words-li words-li4">
<!-- <div class="words-li words-li4">
<div class="ash">补水延时时间设定:</div>
<el-input
v-model="item.delayTimeSet"
@ -477,7 +560,7 @@
size="mini"
></el-input>
<div class="white">S</div>
</div>
</div> -->
</div>
</div>
</div>
@ -504,6 +587,24 @@ export default {
},
tabsList: [],
expandedKeys: [],
hotPumpOptions: [
{
label: "关机",
value: 0,
},
{
label: "制冷",
value: 2,
},
{
label: "制热",
value: 3,
},
{
label: "热水",
value: 4,
},
],
currentId: "", //id
currentName: "", //
currentLevel: "", //
@ -666,11 +767,12 @@ export default {
let deviceItem = {
...item,
waterLevel: Number(item.waterLevel),
runningStatus: Number(item.switchStatus) == 0 ? "运行" : "停止", //
runningStatus: Number(item.runningStatus) == 0 ? "停止" : "运行", //
hotPumpStatus: item.switchStatus, //
switchStatus: Number(item.switchStatus) == 0 ? false : true, //
alarmStatus: Number(item.alarmStatus) == 0 ? "无故障" : "故障", //
handAutomaticSwitch:
Number(item.handAutomaticSwitch) == 0 ? false : true, //
Number(item.handAutomaticSwitch) == 1 ? false : true, //
openSwitch: Number(item.openSwitch) == 0 ? false : true, //
closeSwitch: Number(item.closeSwitch) == 0 ? false : true, //
};
@ -726,7 +828,8 @@ export default {
...item,
waterLevel: Number(item.waterLevel),
runningStatus:
Number(item.switchStatus) == 0 ? "运行" : "停止", //
Number(item.runningStatus) == 0 ? "运行" : "停止", //
hotPumpStatus: item.switchStatus, //
switchStatus:
Number(item.switchStatus) == 0 ? false : true, //
alarmStatus:
@ -830,10 +933,26 @@ export default {
},
//
handleHotPump(item) {
//
const originalStatus = item.hotPumpStatus;
// value label
let statusLabel = "";
switch (item.hotPumpStatus) {
case 0:
statusLabel = "关机";
break;
case 2:
statusLabel = "制冷";
break;
case 3:
statusLabel = "制热";
break;
case 4:
statusLabel = "热水";
break;
}
this.$confirm(
`确定要切换设备"${item.name}"的状态为:${
item.switchStatus ? "开启" : "关闭 吗?"
}`,
`确定要切换设备"${item.name}"的状态为:${statusLabel} 吗?"`,
"提示",
{
confirmButtonText: "确定",
@ -842,19 +961,11 @@ export default {
}
)
.then(() => {
//
console.log("请求后台", item.switchStatus);
let param = null;
if (item.switchStatus) {
param = 1;
} else {
param = 0;
}
this.hadleOperationConrol(item.switchStatusId, param);
this.hadleOperationConrol(item.switchStatusId, item.hotPumpStatus);
})
.catch(() => {
//
item.switchStatus = !item.switchStatus;
//
item.hotPumpStatus = originalStatus;
});
},
//
@ -1155,6 +1266,10 @@ export default {
width: 1.2rem;
height: 0.8rem;
}
.monitor-img3 {
width: 1.2rem;
height: 0.8rem;
}
}
.control-bottom {
width: 100%;
@ -1214,6 +1329,12 @@ export default {
width: 100px;
}
}
.words-li6 {
width: 70%;
.ash2 {
width: 100px;
}
}
}
.sigClass {
width: 40%;
@ -1272,24 +1393,11 @@ export default {
}
}
}
@media (min-width: 1400px) and (max-width: 1620px) {
.monitor-li {
width: calc(49% - 40px) !important;
margin: 0 20px !important;
.monitor-img1 {
width: 120px !important;
height: 120px !important;
}
.monitor-img2 {
width: 120px !important;
height: 80px !important;
}
.monitor-flex-left {
padding: 0 0.3rem !important;
}
@media (min-width: 1350px) and (max-width: 1460px) {
.monitor-img3 {
}
}
@media (min-width: 1240px) and (max-width: 1400px) {
@media (min-width: 1350px) and (max-width: 1850px) {
.monitor-li {
width: calc(49% - 10px) !important;
margin: 0 5px !important;
@ -1302,8 +1410,12 @@ export default {
width: 100px !important;
height: 60px !important;
}
.monitor-img3 {
width: 1.2rem !important;
height: 0.9rem !important;
}
}
@media (max-width: 1240px) {
@media (max-width: 1350px) {
.monitor-li {
width: 100% !important;
margin: 0 !important;
@ -1316,6 +1428,10 @@ export default {
width: 100px !important;
height: 80px !important;
}
.monitor-img3 {
width: 100px !important;
height: 80px !important;
}
.monitor-flex-left {
padding: 0 30px !important;
}

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

@ -55,17 +55,18 @@
<img v-else src="../../../assets/images/flowimg/nomove.png" class="bigMove" alt="" /> -->
<!-- 文字定位 -->
<div class="flow-text text1">冷水泵</div>
<div class="flow-text text1">供水泵1</div>
<div class="flow-text text2">回水管</div>
<div class="flow-text text3">无线网关</div>
<div class="flow-text text4">回水阀</div>
<div class="flow-text text5">浴室</div>
<div class="flow-text text6">热水供水泵</div>
<div class="flow-text text5">房间</div>
<div class="flow-text text6">供水泵2</div>
<div class="flow-text text7">循环加热泵</div>
<!-- 补水定位 -->
<div class="flow-text text8">补水阀</div>
<!-- 补水阀定位 -->
<img
class="replenish"
v-if="this.coolpumstate === '运行'"
v-if="this.useWaterState === '1'"
src="../../../assets/flowimg/replenish-move.gif"
alt=""
/>
@ -78,7 +79,7 @@
<!-- 供水定位 -->
<img
class="supply"
v-if="this.waterpumstate === '运行'"
v-if="this.upWaterState1 === '1' || this.upWaterState2 === '1'"
src="../../../assets/flowimg/supply-move.gif"
alt=""
/>
@ -91,7 +92,7 @@
<!-- 加热定位 -->
<img
class="circulate"
v-if="this.hotpumstate === '运行' && this.isBad"
v-if="this.hotPumState === '1' && this.isBad !== '1'"
src="../../../assets/flowimg/circulate-move.gif"
alt=""
/>
@ -101,54 +102,49 @@
src="../../../assets/flowimg/circulate-nomove.png"
alt=""
/>
<!-- 冷水泵定位 -->
<!-- 供水泵1定位 -->
<img
class="coolpum"
v-if="this.coolpumstate === ''"
src="../../../assets/flowimg/closepum.png"
v-if="this.upWaterState1 === '1'"
src="../../../assets/flowimg/startpum.png"
alt=""
/>
<img
class="coolpum"
v-else-if="this.coolpumstate === '不运行'"
v-else
src="../../../assets/flowimg/closepum.png"
alt=""
/>
<!-- 供水泵2定位 -->
<img
class="coolpum"
v-else-if="this.coolpumstate === '运行'"
src="../../../assets/flowimg/startpum.png"
alt=""
/>
<img
class="coolpum"
v-else-if="this.coolpumstate === '补水'"
class="waterpum"
v-if="this.upWaterState2 === '1'"
src="../../../assets/flowimg/startpum.png"
alt=""
/>
<img
class="coolpum"
class="waterpum"
v-else
src="../../../assets/flowimg/closepum.png"
alt=""
/>
<!-- 热水供水泵定位 -->
<!-- 补水定位 -->
<img
class="waterpum"
v-if="this.waterpumstate === '运行'"
src="../../../assets/flowimg/startpum.png"
class="buwaterpum2"
v-if="backWaterState === '1'"
src="../../../assets/flowimg/bu-move.gif"
alt=""
/>
<img
class="waterpum"
class="buwaterpum"
v-else
src="../../../assets/flowimg/closepum.png"
src="../../../assets/flowimg/bu-nomove.png"
alt=""
/>
<!-- 循环加热泵定位-->
<img
class="cirpum"
v-if="this.hotpumstate === '运行' && this.isBad"
v-if="this.hotPumState === '1' && this.isBad !== '1'"
src="../../../assets/flowimg/startpum.png"
alt=""
/>
@ -161,13 +157,13 @@
<!-- 热泵定位 -->
<img
class="hotpum"
v-if="this.hotpumstate === '运行' && this.isBad"
v-if="this.hotPumState === '1' && this.isBad !== '1'"
src="../../../assets/flowimg/starthotpum.png"
alt=""
/>
<img
class="hotpum"
v-else-if="this.isBad === '故障'"
v-else-if="this.isBad === '1'"
src="../../../assets/flowimg/badhotpum.png"
alt=""
/>
@ -273,16 +269,34 @@
<span>{{ row.waterLevel }} </span>
</template>
</el-table-column>
<el-table-column prop="runState" label="热泵状态">
<el-table-column prop="upWaterState1" label="供水泵1状态">
<template slot-scope="{ row }">
<span v-if="row.runState === '0'">不运行 </span>
<span v-if="row.runState === '1'">运行 </span>
<span v-if="row.upWaterState1 === '0'">不运行 </span>
<span v-if="row.upWaterState1 === '1'">运行 </span>
</template>
</el-table-column>
<el-table-column prop="upWaterState2" label="供水泵2状态">
<template slot-scope="{ row }">
<span v-if="row.upWaterState2 === '0'">不运行 </span>
<span v-if="row.upWaterState2 === '1'">运行 </span>
</template>
</el-table-column>
<el-table-column prop="upWaterState" label="补水状态">
<template slot-scope="{ row }">
<span v-if="row.useWaterState === '0'">不运行 </span>
<span v-if="row.useWaterState === '1'">运行 </span>
</template>
</el-table-column>
<el-table-column prop="upWaterState" label="供水状态">
<el-table-column prop="backWaterState" label="回水状态">
<template slot-scope="{ row }">
<span v-if="row.upWaterState === '0'">不运行 </span>
<span v-if="row.upWaterState === '1'">运行 </span>
<span v-if="row.backWaterState === '0'">不运行 </span>
<span v-if="row.backWaterState === '1'">运行 </span>
</template>
</el-table-column>
<el-table-column prop="runState" label="热泵状态">
<template slot-scope="{ row }">
<span v-if="row.runState === '0'">不运行 </span>
<span v-if="row.runState === '1'">运行 </span>
</template>
</el-table-column>
<el-table-column prop="isFault" label="是否故障">
@ -320,15 +334,14 @@ export default {
baseTable: [], //
tableData: [], //
// 0 1
coolpumstate: "",
// 0 1
waterpumstate: "",
// 0 1
useWaterState: "",
upWaterState1: "", //1
upWaterState2: "", //2
backWaterState: "", //
//
hotpumstate: "关机模式",
hotPumState: "",
isBad: "无故障",
// 使 0使 1使
bathstate: 0,
// 线 0线 1线
webstate: 1,
//
@ -488,8 +501,13 @@ export default {
this.temdata = row.waterTemp;
this.pumname = row.pumpName;
//
this.hotpumstate = row.runState;
this.hotPumState = row.runState;
this.isBad = row.isFault;
this.useWaterState = row.useWaterState;
this.upWaterState1 = row.upWaterState1;
this.upWaterState2 = row.upWaterState2;
this.backWaterState = row.backWaterState;
console.log("补水阀状态11111111111111111111", this.useWaterState);
},
/* 加入小手状态 */
tableRowStyle({ row, column, rowIndex, columnIndex }) {
@ -516,7 +534,7 @@ export default {
baseltem.unit = "℃";
}
if (item.name.includes("压力")) {
baseltem.unit = "Mpa";
baseltem.unit = "bar";
}
if (item.value.includes("采集失败")) {
baseltem.value = "0";
@ -725,8 +743,8 @@ export default {
.text1 {
position: absolute;
top: 0.28rem;
left: 0.24rem;
top: 2.9rem;
left: 0.6rem;
z-index: 1;
}
@ -748,7 +766,7 @@ export default {
.text4 {
position: absolute;
top: 2.3rem;
top: 2.6rem;
right: 0.5rem;
z-index: 1;
}
@ -763,7 +781,7 @@ export default {
.text6 {
position: absolute;
top: 4.27rem;
left: 0.24rem;
left: 0.6rem;
z-index: 1;
}
@ -773,12 +791,18 @@ export default {
left: 5.6rem;
z-index: 1;
}
.text8 {
position: absolute;
top: 0.5rem;
left: 1.4rem;
z-index: 1;
}
.replenish {
position: absolute;
top: 0.7rem;
left: 0.9rem;
width: 1.7rem;
left: 0rem;
width:2.55rem;
height: 0.34rem;
z-index: 1;
}
@ -804,7 +828,8 @@ export default {
width: 1rem;
height: 0.78rem;
position: absolute;
top: 0.54rem;
top: 2rem;
left: 0.5rem;
z-index: 2;
}
@ -813,7 +838,23 @@ export default {
height: 0.78rem;
position: absolute;
top: 3.37rem;
left: 0.4rem;
left: 0.5rem;
}
.buwaterpum {
width: 8.5rem;
height: 2.9rem;
position: absolute;
top: -0.1rem;
right: -0.02rem;
z-index: 2;
}
.buwaterpum2 {
width: 8.5rem;
height: 4.4rem;
position: absolute;
top: -0.9rem;
right: -0.02rem;
z-index: 2;
}
.cirpum {
@ -894,7 +935,7 @@ export default {
background-color: #dff1fa;
margin-left: 2%;
position: absolute;
top: 1.78rem;
top: 1.47rem;
left: 2.6rem;
border: solid 0.01rem #11aaea;
z-index: 3;

15
src/views/temSys/temHistory/components/historyCharts.vue

@ -1,6 +1,10 @@
<template>
<div>
<div class="historyCharts" ref="chart_ref"></div>
<div
class="historyCharts"
:class="{ oneClass: isShowOne }"
ref="chart_ref"
></div>
</div>
</template>
@ -12,6 +16,9 @@ export default {
type: Array,
default: () => [],
},
isShowOne: {
type: Boolean,
},
},
data() {
return {
@ -293,6 +300,10 @@ export default {
<style lang="scss" scoped>
.historyCharts {
width: 100%;
height: 200px;
height: 230px;
}
.oneClass {
width: 100% !important;
height: 600px !important;
}
</style>

32
src/views/temSys/temHistory/components/historyTables.vue

@ -1,18 +1,14 @@
<template>
<div>
<el-table class="historyTables" :data="tableList" height="200px">
<el-table-column
prop="curTime"
label="时间"
></el-table-column>
<el-table-column
prop="indoorTemp"
label="温度(℃)"
></el-table-column>
<el-table-column
prop="indoorHumidity"
label="湿度(%)"
></el-table-column>
<el-table
class="historyTables"
:class="{ oneClass: isShowOne }"
:data="tableList"
height="230px"
>
<el-table-column prop="curTime" label="时间"></el-table-column>
<el-table-column prop="indoorTemp" label="温度(℃)"></el-table-column>
<el-table-column prop="indoorHumidity" label="湿度(%)"></el-table-column>
</el-table>
</div>
</template>
@ -24,6 +20,9 @@ export default {
type: Array,
default: () => [],
},
isShowOne: {
type: Boolean,
},
},
data() {
return {
@ -50,4 +49,9 @@ export default {
};
</script>
<style></style>
<style lang="scss" scoped>
.oneClass {
width: 100% !important;
height: 600px !important;
}
</style>

91
src/views/temSys/temHistory/index.vue

@ -26,6 +26,7 @@
v-model="timeDate"
:default-time="['00:00:00', '23:59:59']"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="至"
placeholder="选择日期"
start-placeholder="开始日期"
@ -48,7 +49,10 @@
<div class="history" v-loading="loading">
<div
class="history-li"
:class="{ oneClass: tableData.length === 1 }"
:class="{
oneClass: tableData.length === 1,
twoClass: tableData.length === 2,
}"
v-for="(item, index) in tableData"
:key="index"
>
@ -74,15 +78,20 @@
<history-charts
v-if="item.showCharts"
:chartsData="item.dataList"
:isShowOne="showOneClass"
></history-charts>
<history-tables v-else :tableData="item.dataList"></history-tables>
<history-tables
v-else
:tableData="item.dataList"
:isShowOne="showOneClass"
></history-tables>
</div>
</div>
</div>
</template>
<script>
import { format2,formatDay } from "@/utils/datetime";
import { format2, formatDay } from "@/utils/datetime";
import { spaceTree } from "@/api/region";
import { temHistory } from "@/api/temSys/temMonitor";
import historyCharts from "./components/historyCharts.vue";
@ -93,7 +102,7 @@ export default {
return {
loading: false,
timeDate: [],
dayDate:[],
dayDate: [],
//
queryParams: {
systemType: "4",
@ -109,20 +118,8 @@ export default {
multiple: true,
},
options: [],
tableData: [
{
name: "A201",
showCharts: true, //
},
{
name: "A202",
showCharts: true, //
},
{
name: "A203",
showCharts: true, //
},
],
tableData: [],
showOneClass: true,
};
},
mounted() {
@ -165,6 +162,7 @@ export default {
this.selectedValue = [path];
}
console.log("反推三个id", path);
this.queryParams.houseIds = path;
}
this.getList();
@ -205,27 +203,40 @@ export default {
getList() {
this.queryParams.startTime = this.timeDate[0];
this.queryParams.endTime = this.timeDate[1];
this.dayDate = [
formatDay(this.queryParams.startTime),
formatDay(this.queryParams.endTime),
];
let data = this.queryParams;
console.log("参数", data);
temHistory(data).then((res) => {
console.log("历史数据返回", res);
if (res.code == 200) {
// loading
this.loading = true;
// dataList
const filteredRows = res.rows.filter(
(item) => item.dataList && item.dataList.length > 0
);
// showCharts: true
const newRows = filteredRows.map((item) => ({
...item,
showCharts: true,
}));
this.tableData = newRows;
console.log("处理后的历史数据", newRows);
}
}).catch((error) => {
// loading
this.loading = true;
temHistory(data)
.then((res) => {
console.log("历史数据返回", res);
if (res.code == 200) {
// dataList
const filteredRows = res.rows.filter(
(item) => item.dataList && item.dataList.length > 0
);
// showCharts: true
const newRows = filteredRows.map((item) => ({
...item,
showCharts: true,
}));
this.tableData = newRows;
if (this.tableData.length > 2) {
this.showOneClass = false;
} else {
this.showOneClass = true;
}
console.log("处理后的历史数据", newRows);
console.log("动态class布尔值", this.showOneClass);
}
})
.catch((error) => {
console.error("查询表格数据时发生错误:", error);
this.loading = false;
})
.finally(() => {
setTimeout(() => {
@ -263,7 +274,7 @@ export default {
.history-li {
background-color: rgb(38, 64, 99);
width: calc(49% - 20px);
height: 330px;
height: 350px;
margin: 0 10px;
padding: 20px;
border-radius: 20px;
@ -304,11 +315,15 @@ export default {
}
.oneClass {
width: 100% !important;
height: 750px !important;
}
.twoClass {
height: 750px !important;
}
}
</style>
<style scoped>
.elCascader >>>.el-input__inner::placeholder {
.elCascader >>> .el-input__inner::placeholder {
color: transparent !important;
}
</style>

29
src/views/temSys/temMonitor/index.vue

@ -559,19 +559,15 @@ export default {
type: "line",
//
symbolSize: 8,
data: this.chartData1,
name: "度",
data: this.chartData2,
name: "湿度",
//线
itemStyle: {
color: "#1a69f1", //线
},
lineStyle: {
color: "#1a69f1", //线
color: "#00CED1", //线
},
smooth: false,
// 线
showSymbol: true,
//
areaStyle: {
color: {
type: "linear",
@ -582,11 +578,11 @@ export default {
colorStops: [
{
offset: 0,
color: "rgba(26, 105, 241, 0.5)", //
color: "rgba(0, 206, 209, 0.5)", //
},
{
offset: 1,
color: "rgba(26, 105, 241, 0)", //
color: "rgba(0, 206, 209, 0)", //
},
],
global: false, // false
@ -597,15 +593,19 @@ export default {
type: "line",
//
symbolSize: 8,
data: this.chartData2,
name: "湿度",
data: this.chartData1,
name: "度",
//线
itemStyle: {
color: "#00CED1", //线
color: "#1a69f1", //线
},
lineStyle: {
color: "#1a69f1", //线
},
smooth: false,
// 线
showSymbol: true,
//
areaStyle: {
color: {
type: "linear",
@ -616,11 +616,11 @@ export default {
colorStops: [
{
offset: 0,
color: "rgba(0, 206, 209, 0.5)", //
color: "rgba(26, 105, 241, 0.5)", //
},
{
offset: 1,
color: "rgba(0, 206, 209, 0)", //
color: "rgba(26, 105, 241, 0)", //
},
],
global: false, // false
@ -714,6 +714,7 @@ export default {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-content: flex-start;
height: 800px;
overflow-y: auto;
.tem-li {

473
src/views/tool/build/index.vue

@ -2,9 +2,7 @@
<div class="container">
<div class="left-board">
<div class="logo-wrapper">
<div class="logo">
<img :src="logo" alt="logo"> Form Generator
</div>
<div class="logo"><img :src="logo" alt="logo" /> Form Generator</div>
</div>
<el-scrollbar class="left-scrollbar">
<div class="components-list">
@ -21,7 +19,9 @@
@end="onEnd"
>
<div
v-for="(element, index) in inputComponents" :key="index" class="components-item"
v-for="(element, index) in inputComponents"
:key="index"
class="components-item"
@click="addComponent(element)"
>
<div class="components-body">
@ -58,12 +58,18 @@
<svg-icon icon-class="component" /> 布局型组件
</div>
<draggable
class="components-draggable" :list="layoutComponents"
:group="{ name: 'componentsGroup', pull: 'clone', put: false }" :clone="cloneComponent"
draggable=".components-item" :sort="false" @end="onEnd"
class="components-draggable"
:list="layoutComponents"
:group="{ name: 'componentsGroup', pull: 'clone', put: false }"
:clone="cloneComponent"
draggable=".components-item"
:sort="false"
@end="onEnd"
>
<div
v-for="(element, index) in layoutComponents" :key="index" class="components-item"
v-for="(element, index) in layoutComponents"
:key="index"
class="components-item"
@click="addComponent(element)"
>
<div class="components-body">
@ -81,10 +87,20 @@
<el-button icon="el-icon-download" type="text" @click="download">
导出vue文件
</el-button>
<el-button class="copy-btn-main" icon="el-icon-document-copy" type="text" @click="copy">
<el-button
class="copy-btn-main"
icon="el-icon-document-copy"
type="text"
@click="copy"
>
复制代码
</el-button>
<el-button class="delete-btn" icon="el-icon-delete" type="text" @click="empty">
<el-button
class="delete-btn"
icon="el-icon-delete"
type="text"
@click="empty"
>
清空
</el-button>
</div>
@ -96,7 +112,12 @@
:disabled="formConf.disabled"
:label-width="formConf.labelWidth + 'px'"
>
<draggable class="drawing-board" :list="drawingList" :animation="340" group="componentsGroup">
<draggable
class="drawing-board"
:list="drawingList"
:animation="340"
group="componentsGroup"
>
<draggable-item
v-for="(element, index) in drawingList"
:key="element.renderKey"
@ -131,28 +152,38 @@
:show-file-name="showFileName"
@confirm="generate"
/>
<input id="copyNode" type="hidden">
<input id="copyNode" type="hidden" />
</div>
</template>
<script>
import draggable from 'vuedraggable'
import beautifier from 'js-beautify'
import ClipboardJS from 'clipboard'
import render from '@/utils/generator/render'
import RightPanel from './RightPanel'
import { inputComponents, selectComponents, layoutComponents, formConf } from '@/utils/generator/config'
import { beautifierConf, titleCase } from '@/utils/index'
import { makeUpHtml, vueTemplate, vueScript, cssStyle } from '@/utils/generator/html'
import { makeUpJs } from '@/utils/generator/js'
import { makeUpCss } from '@/utils/generator/css'
import drawingDefault from '@/utils/generator/drawingDefault'
import logo from '@/assets/logo/logo.png'
import CodeTypeDialog from './CodeTypeDialog'
import DraggableItem from './DraggableItem'
import draggable from "vuedraggable";
import beautifier from "js-beautify";
import ClipboardJS from "clipboard";
import render from "@/utils/generator/render";
import RightPanel from "./RightPanel";
import {
inputComponents,
selectComponents,
layoutComponents,
formConf,
} from "@/utils/generator/config";
import { beautifierConf, titleCase } from "@/utils/index";
import {
makeUpHtml,
vueTemplate,
vueScript,
cssStyle,
} from "@/utils/generator/html";
import { makeUpJs } from "@/utils/generator/js";
import { makeUpCss } from "@/utils/generator/css";
import drawingDefault from "@/utils/generator/drawingDefault";
import logo from "@/assets/logo/logo.png";
import CodeTypeDialog from "./CodeTypeDialog";
import DraggableItem from "./DraggableItem";
let oldActiveId
let tempActiveData
let oldActiveId;
let tempActiveData;
export default {
components: {
@ -160,7 +191,7 @@ export default {
render,
RightPanel,
CodeTypeDialog,
DraggableItem
DraggableItem,
},
data() {
return {
@ -179,208 +210,214 @@ export default {
dialogVisible: false,
generateConf: null,
showFileName: false,
activeData: drawingDefault[0]
}
activeData: drawingDefault[0],
};
},
created() {
// firefox
document.body.ondrop = event => {
event.preventDefault()
event.stopPropagation()
}
document.body.ondrop = (event) => {
event.preventDefault();
event.stopPropagation();
};
},
watch: {
// eslint-disable-next-line func-names
'activeData.label': function (val, oldVal) {
"activeData.label": function (val, oldVal) {
if (
this.activeData.placeholder === undefined
|| !this.activeData.tag
|| oldActiveId !== this.activeId
this.activeData.placeholder === undefined ||
!this.activeData.tag ||
oldActiveId !== this.activeId
) {
return
return;
}
this.activeData.placeholder = this.activeData.placeholder.replace(oldVal, '') + val
this.activeData.placeholder =
this.activeData.placeholder.replace(oldVal, "") + val;
},
activeId: {
handler(val) {
oldActiveId = val
oldActiveId = val;
},
immediate: true
}
immediate: true,
},
},
mounted() {
const clipboard = new ClipboardJS('#copyNode', {
text: trigger => {
const codeStr = this.generateCode()
const clipboard = new ClipboardJS("#copyNode", {
text: (trigger) => {
const codeStr = this.generateCode();
this.$notify({
title: '成功',
message: '代码已复制到剪切板,可粘贴。',
type: 'success'
})
return codeStr
}
})
clipboard.on('error', e => {
this.$message.error('代码复制失败')
})
title: "成功",
message: "代码已复制到剪切板,可粘贴。",
type: "success",
});
return codeStr;
},
});
clipboard.on("error", (e) => {
this.$message.error("代码复制失败");
});
},
methods: {
activeFormItem(element) {
this.activeData = element
this.activeId = element.formId
this.activeData = element;
this.activeId = element.formId;
},
onEnd(obj, a) {
if (obj.from !== obj.to) {
this.activeData = tempActiveData
this.activeId = this.idGlobal
this.activeData = tempActiveData;
this.activeId = this.idGlobal;
}
},
addComponent(item) {
const clone = this.cloneComponent(item)
this.drawingList.push(clone)
this.activeFormItem(clone)
const clone = this.cloneComponent(item);
this.drawingList.push(clone);
this.activeFormItem(clone);
},
cloneComponent(origin) {
const clone = JSON.parse(JSON.stringify(origin))
clone.formId = ++this.idGlobal
clone.span = formConf.span
clone.renderKey = +new Date() // renderKey
if (!clone.layout) clone.layout = 'colFormItem'
if (clone.layout === 'colFormItem') {
clone.vModel = `field${this.idGlobal}`
clone.placeholder !== undefined && (clone.placeholder += clone.label)
tempActiveData = clone
} else if (clone.layout === 'rowFormItem') {
delete clone.label
clone.componentName = `row${this.idGlobal}`
clone.gutter = this.formConf.gutter
tempActiveData = clone
const clone = JSON.parse(JSON.stringify(origin));
clone.formId = ++this.idGlobal;
clone.span = formConf.span;
clone.renderKey = +new Date(); // renderKey
if (!clone.layout) clone.layout = "colFormItem";
if (clone.layout === "colFormItem") {
clone.vModel = `field${this.idGlobal}`;
clone.placeholder !== undefined && (clone.placeholder += clone.label);
tempActiveData = clone;
} else if (clone.layout === "rowFormItem") {
delete clone.label;
clone.componentName = `row${this.idGlobal}`;
clone.gutter = this.formConf.gutter;
tempActiveData = clone;
}
return tempActiveData
return tempActiveData;
},
AssembleFormData() {
this.formData = {
fields: JSON.parse(JSON.stringify(this.drawingList)),
...this.formConf
}
...this.formConf,
};
},
generate(data) {
const func = this[`exec${titleCase(this.operationType)}`]
this.generateConf = data
func && func(data)
const func = this[`exec${titleCase(this.operationType)}`];
this.generateConf = data;
func && func(data);
},
execRun(data) {
this.AssembleFormData()
this.drawerVisible = true
this.AssembleFormData();
this.drawerVisible = true;
},
execDownload(data) {
const codeStr = this.generateCode()
const blob = new Blob([codeStr], { type: 'text/plain;charset=utf-8' })
this.$download.saveAs(blob, data.fileName)
const codeStr = this.generateCode();
const blob = new Blob([codeStr], { type: "text/plain;charset=utf-8" });
this.$download.saveAs(blob, data.fileName);
},
execCopy(data) {
document.getElementById('copyNode').click()
document.getElementById("copyNode").click();
},
empty() {
this.$confirm('确定要清空所有组件吗?', '提示', { type: 'warning' }).then(
this.$confirm("确定要清空所有组件吗?", "提示", { type: "warning" }).then(
() => {
this.drawingList = []
this.drawingList = [];
}
)
);
},
drawingItemCopy(item, parent) {
let clone = JSON.parse(JSON.stringify(item))
clone = this.createIdAndKey(clone)
parent.push(clone)
this.activeFormItem(clone)
let clone = JSON.parse(JSON.stringify(item));
clone = this.createIdAndKey(clone);
parent.push(clone);
this.activeFormItem(clone);
},
createIdAndKey(item) {
item.formId = ++this.idGlobal
item.renderKey = +new Date()
if (item.layout === 'colFormItem') {
item.vModel = `field${this.idGlobal}`
} else if (item.layout === 'rowFormItem') {
item.componentName = `row${this.idGlobal}`
item.formId = ++this.idGlobal;
item.renderKey = +new Date();
if (item.layout === "colFormItem") {
item.vModel = `field${this.idGlobal}`;
} else if (item.layout === "rowFormItem") {
item.componentName = `row${this.idGlobal}`;
}
if (Array.isArray(item.children)) {
item.children = item.children.map(childItem => this.createIdAndKey(childItem))
item.children = item.children.map((childItem) =>
this.createIdAndKey(childItem)
);
}
return item
return item;
},
drawingItemDelete(index, parent) {
parent.splice(index, 1)
parent.splice(index, 1);
this.$nextTick(() => {
const len = this.drawingList.length
const len = this.drawingList.length;
if (len) {
this.activeFormItem(this.drawingList[len - 1])
this.activeFormItem(this.drawingList[len - 1]);
}
})
});
},
generateCode() {
const { type } = this.generateConf
this.AssembleFormData()
const script = vueScript(makeUpJs(this.formData, type))
const html = vueTemplate(makeUpHtml(this.formData, type))
const css = cssStyle(makeUpCss(this.formData))
return beautifier.html(html + script + css, beautifierConf.html)
const { type } = this.generateConf;
this.AssembleFormData();
const script = vueScript(makeUpJs(this.formData, type));
const html = vueTemplate(makeUpHtml(this.formData, type));
const css = cssStyle(makeUpCss(this.formData));
return beautifier.html(html + script + css, beautifierConf.html);
},
download() {
this.dialogVisible = true
this.showFileName = true
this.operationType = 'download'
this.dialogVisible = true;
this.showFileName = true;
this.operationType = "download";
},
run() {
this.dialogVisible = true
this.showFileName = false
this.operationType = 'run'
this.dialogVisible = true;
this.showFileName = false;
this.operationType = "run";
},
copy() {
this.dialogVisible = true
this.showFileName = false
this.operationType = 'copy'
this.dialogVisible = true;
this.showFileName = false;
this.operationType = "copy";
},
tagChange(newTag) {
newTag = this.cloneComponent(newTag)
newTag.vModel = this.activeData.vModel
newTag.formId = this.activeId
newTag.span = this.activeData.span
delete this.activeData.tag
delete this.activeData.tagIcon
delete this.activeData.document
Object.keys(newTag).forEach(key => {
if (this.activeData[key] !== undefined
&& typeof this.activeData[key] === typeof newTag[key]) {
newTag[key] = this.activeData[key]
newTag = this.cloneComponent(newTag);
newTag.vModel = this.activeData.vModel;
newTag.formId = this.activeId;
newTag.span = this.activeData.span;
delete this.activeData.tag;
delete this.activeData.tagIcon;
delete this.activeData.document;
Object.keys(newTag).forEach((key) => {
if (
this.activeData[key] !== undefined &&
typeof this.activeData[key] === typeof newTag[key]
) {
newTag[key] = this.activeData[key];
}
})
this.activeData = newTag
this.updateDrawingList(newTag, this.drawingList)
});
this.activeData = newTag;
this.updateDrawingList(newTag, this.drawingList);
},
updateDrawingList(newTag, list) {
const index = list.findIndex(item => item.formId === this.activeId)
const index = list.findIndex((item) => item.formId === this.activeId);
if (index > -1) {
list.splice(index, 1, newTag)
list.splice(index, 1, newTag);
} else {
list.forEach(item => {
if (Array.isArray(item.children)) this.updateDrawingList(newTag, item.children)
})
list.forEach((item) => {
if (Array.isArray(item.children))
this.updateDrawingList(newTag, item.children);
});
}
}
}
}
},
},
};
</script>
<style lang='scss'>
.editor-tabs{
<style lang="scss">
.editor-tabs {
background: #121315;
.el-tabs__header{
.el-tabs__header {
margin: 0;
border-bottom-color: #121315;
.el-tabs__nav{
.el-tabs__nav {
border-color: #121315;
}
}
.el-tabs__item{
.el-tabs__item {
height: 32px;
line-height: 32px;
color: #888a8e;
@ -389,15 +426,15 @@ export default {
margin-right: 5px;
user-select: none;
}
.el-tabs__item.is-active{
.el-tabs__item.is-active {
background: #1e1e1e;
border-bottom-color: #1e1e1e!important;
border-bottom-color: #1e1e1e !important;
color: #fff;
}
.el-icon-edit{
.el-icon-edit {
color: #f1fa8c;
}
.el-icon-document{
.el-icon-document {
color: #a95812;
}
}
@ -413,24 +450,24 @@ export default {
overflow-x: hidden !important;
margin-bottom: 0 !important;
}
.center-tabs{
.el-tabs__header{
margin-bottom: 0!important;
.center-tabs {
.el-tabs__header {
margin-bottom: 0 !important;
}
.el-tabs__item{
.el-tabs__item {
width: 50%;
text-align: center;
}
.el-tabs__nav{
.el-tabs__nav {
width: 100%;
}
}
.reg-item{
.reg-item {
padding: 12px 6px;
background: #f8f8f8;
position: relative;
border-radius: 4px;
.close-btn{
.close-btn {
position: absolute;
right: -6px;
top: -6px;
@ -445,16 +482,16 @@ export default {
z-index: 1;
cursor: pointer;
font-size: 12px;
&:hover{
background: rgba(210, 23, 23, 0.5)
&:hover {
background: rgba(210, 23, 23, 0.5);
}
}
& + .reg-item{
& + .reg-item {
margin-top: 18px;
}
}
.action-bar{
& .el-button+.el-button {
.action-bar {
& .el-button + .el-button {
margin-left: 15px;
}
& i {
@ -465,37 +502,37 @@ export default {
}
}
.custom-tree-node{
.custom-tree-node {
width: 100%;
font-size: 14px;
.node-operation{
.node-operation {
float: right;
}
i[class*="el-icon"] + i[class*="el-icon"]{
i[class*="el-icon"] + i[class*="el-icon"] {
margin-left: 6px;
}
.el-icon-plus{
color: #409EFF;
.el-icon-plus {
color: #409eff;
}
.el-icon-delete{
.el-icon-delete {
color: #157a0c;
}
}
.left-scrollbar .el-scrollbar__view{
.left-scrollbar .el-scrollbar__view {
overflow-x: hidden;
}
.el-rate{
.el-rate {
display: inline-block;
vertical-align: text-top;
}
.el-upload__tip{
.el-upload__tip {
line-height: 1.2;
}
$selectedColor: #f6f7ff;
$lighterBlue: #409EFF;
$lighterBlue: #409eff;
.container {
position: relative;
@ -514,14 +551,14 @@ $lighterBlue: #409EFF;
transition: transform 0ms !important;
}
}
.components-draggable{
.components-draggable {
padding-bottom: 20px;
}
.components-title{
.components-title {
font-size: 14px;
color: #ffffff;
margin: 6px 2px;
.svg-icon{
.svg-icon {
color: #666;
font-size: 18px;
}
@ -534,7 +571,7 @@ $lighterBlue: #409EFF;
cursor: move;
border: 1px dashed #436efc;
border-radius: 3px;
.svg-icon{
.svg-icon {
color: #777;
font-size: 15px;
}
@ -554,7 +591,7 @@ $lighterBlue: #409EFF;
top: 0;
height: 100vh;
}
.left-scrollbar{
.left-scrollbar {
height: calc(100vh - 42px);
overflow: hidden;
}
@ -571,7 +608,7 @@ $lighterBlue: #409EFF;
margin: 0 350px 0 260px;
box-sizing: border-box;
}
.empty-info{
.empty-info {
position: absolute;
top: 46%;
left: 0;
@ -581,7 +618,7 @@ $lighterBlue: #409EFF;
color: #ccb1ea;
letter-spacing: 4px;
}
.action-bar{
.action-bar {
position: relative;
height: 42px;
text-align: right;
@ -590,18 +627,18 @@ $lighterBlue: #409EFF;
border: 1px solid #0e5191 ;
border-top: none;
border-left: none;
.delete-btn{
color: #F56C6C;
.delete-btn {
color: #f56c6c;
}
}
.logo-wrapper{
.logo-wrapper {
position: relative;
height: 42px;
background: #4b6e91;
border-bottom: 1px solid #0e5191;
box-sizing: border-box;
}
.logo{
.logo {
position: absolute;
left: 12px;
top: 6px;
@ -610,16 +647,16 @@ $lighterBlue: #409EFF;
font-weight: 600;
font-size: 17px;
white-space: nowrap;
> img{
> img {
width: 30px;
height: 30px;
vertical-align: top;
}
.github{
.github {
display: inline-block;
vertical-align: sub;
margin-left: 15px;
> img{
> img {
height: 22px;
}
}
@ -662,32 +699,33 @@ $lighterBlue: #409EFF;
background-color: $selectedColor;
}
.active-from-item {
& > .el-form-item{
& > .el-form-item {
background: #4b6e91;
border-radius: 6px;
}
& > .drawing-item-copy, & > .drawing-item-delete{
& > .drawing-item-copy,
& > .drawing-item-delete {
display: initial;
}
& > .component-name{
& > .component-name {
color: $lighterBlue;
}
}
.el-form-item{
.el-form-item {
margin-bottom: 15px;
}
}
.drawing-item{
.drawing-item {
position: relative;
cursor: move;
&.unfocus-bordered:not(.activeFromItem) > div:first-child {
&.unfocus-bordered:not(.activeFromItem) > div:first-child {
border: 1px dashed #ccc;
}
.el-form-item{
.el-form-item {
padding: 12px 10px;
}
}
.drawing-row-item{
.drawing-row-item {
position: relative;
cursor: move;
box-sizing: border-box;
@ -698,19 +736,19 @@ $lighterBlue: #409EFF;
.drawing-row-item {
margin-bottom: 2px;
}
.el-col{
.el-col {
margin-top: 22px;
}
.el-form-item{
.el-form-item {
margin-bottom: 0;
}
.drag-wrapper{
.drag-wrapper {
min-height: 80px;
}
&.active-from-item{
&.active-from-item {
border: 1px dashed $lighterBlue;
}
.component-name{
.component-name {
position: absolute;
top: 0;
left: 0;
@ -720,17 +758,20 @@ $lighterBlue: #409EFF;
padding: 0 6px;
}
}
.drawing-item, .drawing-row-item{
.drawing-item,
.drawing-row-item {
&:hover {
& > .el-form-item{
& > .el-form-item {
background: $selectedColor;
border-radius: 6px;
}
& > .drawing-item-copy, & > .drawing-item-delete{
& > .drawing-item-copy,
& > .drawing-item-delete {
display: initial;
}
}
& > .drawing-item-copy, & > .drawing-item-delete{
& > .drawing-item-copy,
& > .drawing-item-delete {
display: none;
position: absolute;
top: -10px;
@ -744,29 +785,29 @@ $lighterBlue: #409EFF;
cursor: pointer;
z-index: 1;
}
& > .drawing-item-copy{
& > .drawing-item-copy {
right: 56px;
border-color: $lighterBlue;
color: $lighterBlue;
background: #fff;
&:hover{
&:hover {
background: $lighterBlue;
color: #fff;
}
}
& > .drawing-item-delete{
& > .drawing-item-delete {
right: 24px;
border-color: #F56C6C;
color: #F56C6C;
border-color: #f56c6c;
color: #f56c6c;
background: #fff;
&:hover{
background: #F56C6C;
&:hover {
background: #f56c6c;
color: #fff;
}
}
}
.delete-btn::before,
.delete-btn::after{
.delete-btn::after {
display: none !important;
}
</style>

Loading…
Cancel
Save