Browse Source

1.系统控制-添加频率手自动

2.1、2号主机详情添加远程开关机、冷冻水设定值、电流负载限制值,优化页面。
dev
selia-zx 3 weeks ago
parent
commit
60cb809cf1
  1. 31
      src/views/centerairC/sysControl/index.vue
  2. 159
      src/views/centerairC/sysControl/listHeader.vue
  3. 107
      src/views/centerairC/sysControl/vavleheader.vue
  4. 37
      src/views/centerairC/sysMonitor/components/hostChart.vue
  5. 14
      src/views/centerairC/sysMonitor/components/loadData.vue
  6. 213
      src/views/centerairC/sysMonitor/hostDetails.vue

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>

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

@ -100,11 +100,11 @@ export default {
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);
// 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,
@ -264,6 +264,7 @@ export default {
if (chartRef) {
//
this.chartInstance = echarts.init(this.$refs.chart_ref);
const titleFontSize = this.$refs.chart_ref.offsetWidth / 130;
this.option = {
tooltip: {
trigger: "axis",
@ -273,7 +274,7 @@ export default {
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)
// 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 +
@ -303,12 +304,16 @@ export default {
}
return res;
},
textStyle: {
fontSize: titleFontSize * 1.5,
},
},
legend: {
show: true,
top: 0,
textStyle: {
color: "white",
fontSize: titleFontSize * 1.5,
},
},
grid: {
@ -327,6 +332,9 @@ export default {
// interval: 0, //x
// rotate: 30, //x30
color: "rgba(255, 255, 255, 1)",
textStyle: {
fontSize: titleFontSize * 1.5,
},
},
axisTick: {
show: false, // 线
@ -354,13 +362,16 @@ export default {
// name
nameTextStyle: {
color: "rgba(255, 255, 255, 1)",
fontSize: 12,
fontSize: titleFontSize * 2,
},
miniInterval: 5,
type: "value",
// y
axisLabel: {
color: "rgba(255, 255, 255, 1)",
textStyle: {
fontSize: titleFontSize * 1.5,
},
},
// y
axisLine: {
@ -387,18 +398,17 @@ export default {
// name
nameTextStyle: {
color: "rgba(255, 255, 255, 1)",
fontSize: 12,
fontSize: titleFontSize * 1.5,
},
miniInterval: 5,
type: "value",
name: "负载", // y
// y
axisLabel: {
color: "#ffffff",
},
// y
axisLabel: {
color: "rgba(255, 255, 255, 1)",
textStyle: {
fontSize: titleFontSize * 1.5,
},
},
// y
axisLine: {
@ -506,6 +516,7 @@ export default {
<style lang="scss" scoped>
.historyCharts {
width: 100%;
height: 4rem;
height: 4.4rem;
}
</style>

14
src/views/centerairC/sysMonitor/components/loadData.vue

@ -3,12 +3,8 @@
<div class="sys_charts" ref="sys_charts"></div>
</div>
</template>
<script>
import * as echarts from "echarts";
import { eventBus } from "@/utils/evenBus";
import { overView } from "@/api/bigScreen";
import { getDay, getMonth, getYear } from "@/utils/datetime";
export default {
props: {
hostData: {
@ -65,7 +61,6 @@ export default {
//
// 0.75使
const threshold = maxData * 0.75;
//
if (useData > threshold) {
return [
@ -99,6 +94,7 @@ export default {
//
const dataArr = this.loadPercent; //
const dataX = 100;
const titleFontSize = this.$refs.sys_charts.offsetWidth / 20;
this.chartInstance = echarts.init(this.$refs.sys_charts);
this.option = {
backgroundStyle: {
@ -108,17 +104,16 @@ export default {
title: [
{
text: `${dataArr} %`,
bottom: "8%",
bottom: titleFontSize,
left: "center",
textStyle: {
fontSize: "16", //
fontSize: titleFontSize * 1.5, //
color: "#ffff",
fontWeight: 800,
},
triggerEvent: true,
},
],
legend: {
show: false,
},
@ -374,7 +369,6 @@ export default {
show: false,
},
},
//
{
type: "gauge",
@ -443,10 +437,10 @@ export default {
},
};
</script>
<style lang="scss" scoped>
.sys_charts {
width: 2rem;
height: 2rem;
}
</style>

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

@ -90,7 +90,14 @@
alt=""
/>
<!-- 启停状态 -->
<div class="startClass" v-if="hostListClass('2')"></div>
<div
class="startClass"
:class="{
startClass1: isMagnetic === 'true',
startClass2: isMagnetic === 'false',
}"
v-if="hostListClass('2')"
></div>
<!-- 冷冻冷却水流信号 -->
<div class="water-flow3">
<div class="water-flow-li">
@ -122,18 +129,33 @@
</div>
<div class="detail-bottom">
<div class="hostStatus">
<div class="hostStatus-li">
<span style="">冷冻供水温度:</span>
<div class="hostStatus-li" v-if="isMagnetic === 'false'">
<span style="">远程开关机:</span>
<el-switch
style="display: block"
v-model="remoteSwitch"
active-color="#13ce66"
inactive-color="#ff4949"
active-text="开机"
inactive-text="关机"
@change="
handleControlText(remoteSwitch, remoteSwitchId, '开机', '关机')
"
>
</el-switch>
</div>
<div class="hostStatus-li" v-if="isMagnetic === 'false'">
<span style="">冷冻水设定值:</span>
<el-input
size="mini"
style="width: 40%"
v-model="frozenupply"
@keyup.enter.native="
handleEnter(
'冷冻供水温度',
'冷冻水设定值',
'℃',
frozenupply,
frozenupplIdy,
frozenupplyId,
$event
)
"
@ -142,14 +164,20 @@
></el-input>
<span></span>
</div>
<div class="hostStatus-li">
<span>需求设定:</span>
<div class="hostStatus-li" v-if="isMagnetic === 'false'">
<span>电流负载限制:</span>
<el-input
size="mini"
style="width: 40%"
v-model="requireSet"
v-model="electLoadSet"
@keyup.enter.native="
handleEnter('需求设定值', '%', requireSet, requireSetId, $event)
handleEnter(
'电流负载限制值',
'%',
electLoadSet,
electLoadSetId,
$event
)
"
@input="handleInput(children)"
@blur="handleBlur()"
@ -252,10 +280,12 @@ export default {
condenserPre: "", //
evaporatorPre: "", //
rightHostData: [], //
frozenupply: "", //
remoteSwitch: false, //
remoteSwitchId: "",
frozenupply: "", //
frozenupplyId: "",
requireSet: "", //
requireSetId: "",
electLoadSet: "", //
electLoadSetId: "",
automaticObj: {}, //
localObj: {}, //
badObj: {}, //
@ -447,19 +477,27 @@ export default {
item.showValue = item.curValue;
this.timeObj = item;
} else if (
item.paramType === "12" &&
item.otherName.includes("冷冻供水温度")
item.paramType === "2" &&
item.otherName.includes("远程开关机")
) {
//
//
this.remoteSwitch =
Number(item.curValue) === 1 ? true : false;
this.remoteSwitchId = item.id;
} else if (
item.paramType === "14" &&
item.otherName.includes("冷冻出水温度设定值")
) {
//
this.frozenupply = item.curValue;
this.frozenupplyId = item.id;
} else if (
item.paramType === "0" &&
item.otherName.includes("需求设定值")
item.paramType === "32" &&
item.otherName.includes("电流限制设定值")
) {
//
this.requireSet = item.curValue;
this.requireSetId = id;
//
this.electLoadSet = item.curValue;
this.electLoadSetId = item.id;
}
});
}
@ -609,37 +647,67 @@ export default {
// this.getOperationList();
});
},
///
handleControlText(item, itemId, name1, name2) {
this.$confirm(
`确定要切换远程开关机的状态为:${item ? name1 : name2}吗?`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
let param = null;
if (item) {
param = 1;
} else {
param = 0;
}
this.hadleOperationConrol(itemId, param);
})
.catch(() => {
//
console.log("item后", item);
item = !item;
console.log("item原始", item);
this.remoteSwitch = item;
console.log("this.remoteSwitch", this.remoteSwitch);
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.getPolicyList().finally(() => {
// loading
this.loading = false;
});
}, 5000);
} else {
// this.$modal.msgError("");
console.log("应该更新状态的");
// ;
this.getPolicyList();
}
})
.catch((error) => {
console.log("请求发生错误,更新设备状态", error);
// ;
this.getPolicyList();
});
// operationConrol([data])
// .then((res) => {
// if (res.code == 200) {
// this.$modal.msgSuccess("!");
// // loading
// this.loading = true;
// // ;
// setTimeout(() => {
// this.getPolicyList().finally(() => {
// // loading
// this.loading = false;
// });
// }, 5000);
// } else {
// // this.$modal.msgError("");
// console.log("");
// // ;
// this.getPolicyList();
// }
// })
// .catch((error) => {
// console.log("", error);
// // ;
// this.getPolicyList();
// });
},
},
};
@ -837,14 +905,20 @@ export default {
.startClass {
z-index: 10;
position: absolute;
top: 2.9rem;
left: 3.4rem;
width: 0.18rem;
height: 0.18rem;
border-radius: 50%;
animation: blink 1s infinite;
background-color: #38fc52 !important;
}
.startClass1 {
top: 2.9rem;
left: 3.4rem;
}
.startClass2 {
top: 2.3rem;
left: 3.2rem;
}
.water-flow3 {
z-index: 10;
position: absolute;
@ -1195,3 +1269,48 @@ export default {
}
}
</style>
<style scoped>
@media (min-width: 0px) and (max-width: 1430px) {
.hostStatus-li >>> .el-input--mini .el-input__inner {
height: 0.28rem !important;
line-height: 0.28rem !important;
padding: 0.1rem !important;
}
.hostStatus-li >>> .el-switch {
height: 0.2rem !important;
line-height: 0.2rem !important;
font-size: 0.18rem !important;
}
.hostStatus-li >>> .el-switch__label {
height: 0.2rem !important;
line-height: 0.2rem !important;
font-size: 0.18rem !important;
}
.hostStatus-li >>> .el-switch__label * {
font-size: 0.18rem !important;
}
.hostStatus-li >>> .el-switch__core {
width: 0.4rem !important;
height: 0.2rem !important;
border-radius: 0.1rem !important;
}
.hostStatus-li >>> .el-switch__core:after {
width: 0.16rem !important;
height: 0.16rem !important;
top: 0.01rem !important;
}
.hostStatus-li >>> .el-switch.is-checked .el-switch__core::after {
margin-left: -0.17rem !important;
}
.hostStatus-li >>> .el-input--mini {
font-size: 0.14rem !important;
}
.hostStatus-li >>> .el-input--mini .el-input__icon {
line-height: 0.28rem !important;
}
.hostStatus-li >>> .el-input__icon {
width: 0.25rem !important;
}
}
</style>

Loading…
Cancel
Save