From 8cdad84735ad595471ba46b590b095b7ad225fb4 Mon Sep 17 00:00:00 2001 From: selia-zx <1771203023@qq.com> Date: Fri, 22 Aug 2025 09:30:31 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=B8=BB=E6=9C=BA=E5=8F=82=E6=95=B0=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E9=9D=A2=E5=86=B7=E6=B0=B4=E8=AE=BE=E5=AE=9A?= =?UTF-8?q?=E5=80=BC=E4=BE=BF=E5=AE=9C=E5=8F=AF=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sysMonitor/components/hostChart.vue | 2 +- .../centerairC/sysMonitor/hostDetails.vue | 140 +++++++++++++++++- 2 files changed, 138 insertions(+), 4 deletions(-) diff --git a/src/views/centerairC/sysMonitor/components/hostChart.vue b/src/views/centerairC/sysMonitor/components/hostChart.vue index 89ab7c7..7ca03d3 100644 --- a/src/views/centerairC/sysMonitor/components/hostChart.vue +++ b/src/views/centerairC/sysMonitor/components/hostChart.vue @@ -282,7 +282,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 = '{{ coldWaterControlObj.curValue }}℃ +
+ 冷水设定值偏移: + + + +
@@ -217,7 +233,14 @@
{{ subItem.otherName }}: - {{ subItem.curValue }} + {{ subItem.curValue }} {{ subItem.unit }}
@@ -241,7 +264,14 @@
{{ subItem.otherName }}: - {{ subItem.curValue }} + {{ subItem.curValue }} {{ subItem.unit }}
@@ -258,6 +288,7 @@ import { hostDetailsData, hostTemData, runTime, + operationConrol, } from "@/api/centerairC/sysMonitor"; import { alarmRecordList } from "@/api/alarm/alarmRecord"; import { cpmList } from "@/api/device/gather"; @@ -285,6 +316,7 @@ export default { timeObj: {}, //累计运行时间 coldWaterSetObj: {}, //本地出水温度设定值 coldWaterControlObj: {}, //远程出水温度设定值 + offsetValuerControlObj: {}, //偏移值设定 compressorData1: [], //压缩机1参数 compressorData2: [], compressorData3: [], @@ -445,12 +477,16 @@ export default { const isCombinedCondition2 = Number(item.paramType) === 12 && item.otherName.includes("用户冷水设定值"); + const isCombinedCondition3 = + Number(item.paramType) === 12 && + item.otherName.includes("冷水设定值偏移"); // 返回 false 表示要排除该元素 return ( !isSpecificParamType && !isCombinedCondition0 && !isCombinedCondition1 && - !isCombinedCondition2 + !isCombinedCondition2 && + !isCombinedCondition3 ); }); // 根据 ordernum 进行排序 @@ -482,6 +518,12 @@ export default { ) { // 远程出水温度设定值 this.coldWaterControlObj = item; + } else if ( + item.paramType === "12" && + item.otherName.includes("冷水设定值偏移") + ) { + // 远程出水温度设定值 + this.offsetValuerControlObj = item; } }); } @@ -658,6 +700,78 @@ export default { const specialValues = ["运行", "启动", "正常"]; return specialValues.includes(value); }, + // 处理输入事件,过滤非数字字符 + handleInput(item) { + console.log("校验"); + // 实时校验并过滤非数字和非小数点字符 + let input = String(item).replace(/[^\d.]/g, ""); + // 检查输入是否以小数点开头 + if (input.startsWith(".")) { + // 如果以小数点开头,去除小数点 + input = input.slice(1); + } + this.offsetValuerControlObj.curValue = input; + }, + // 失去焦点 + handleBlur() { + // this.currentFocusIndex = ""; + }, + handleEnter(item, event) { + console.log("请求后端", item); + if (!item) { + this.$modal.msgError("请输入偏移值"); + return; + } + // 失去焦点 + event.target.blur(); + this.$confirm( + `确定要修改冷水设定值偏移10V的温度为:${item.curValue} ℃吗?`, + "提示", + { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + } + ) + .then(() => { + this.hadleOperationConrol(item.id, item.curValue); + }) + .catch(() => { + // 用户取消操作,需要更新原来的频率 + // this.$emit("upList"); + }); + }, + // 操作 + 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.getHostDetailsData(); + this.loading = false; + }, 5000); + } else { + // this.$modal.msgError("操作失败"); + console.log("应该更新状态的"); + // 更新所有设备状态; + this.getHostDetailsData(); + } + }) + .catch((error) => { + console.log("请求发生错误,更新设备状态", error); + // 更新所有设备状态; + this.getHostDetailsData(); + }); + }, }, }; @@ -1230,3 +1344,23 @@ export default { color: #1df3e8; } +