diff --git a/public/img/monitoring/device_online.png b/public/img/monitoring/device_online.png new file mode 100644 index 0000000..d9626f8 Binary files /dev/null and b/public/img/monitoring/device_online.png differ diff --git a/public/img/monitoring/electricity/condition_mb.png b/public/img/monitoring/electricity/condition_mb.png new file mode 100644 index 0000000..bdacf41 Binary files /dev/null and b/public/img/monitoring/electricity/condition_mb.png differ diff --git a/src/api/garden/monitoring.js b/src/api/garden/monitoring.js index 29635a0..ff0bf7c 100644 --- a/src/api/garden/monitoring.js +++ b/src/api/garden/monitoring.js @@ -446,6 +446,61 @@ export const setConditionSpeedDown = (code, value) => { }, }); }; +//lora面板 +//设置温度 +export const setLoraTemp = (equipCode, tempVal) => { + return request({ + url: "/api/blade-desk/lora/air-conditioner/change-temp", + method: "get", + params: { + equipCode, + tempVal, + }, + }); +}; +//设置开关状态 +export const setLoraStatus = (equipCode, statusVal) => { + return request({ + url: "/api/blade-desk/lora/air-conditioner/change-status", + method: "get", + params: { + equipCode, + statusVal, + }, + }); +}; +//设置模式 +export const setLoraModel = (equipCode, value) => { + return request({ + url: "/api/blade-desk/lora/air-conditioner/change-model", + method: "get", + params: { + equipCode, + modeVal, + }, + }); +}; +//设置风速 +export const setLoraSpeed = (equipCode, speedVal) => { + return request({ + url: "/api/blade-desk/lora/air-conditioner/change-speed", + method: "get", + params: { + equipCode, + speedVal, + }, + }); +}; +//设置风速 +export const queryLoraAll = (equipCode) => { + return request({ + url: "/api/blade-desk/lora/air-conditioner/read-all", + method: "get", + params: { + equipCode, + }, + }); +}; // 获取楼平均温度 export const getFloorTemp = (area) => { diff --git a/src/components/monitoring/conditioner.vue b/src/components/monitoring/conditioner.vue index 2a4f3a0..42d07c3 100644 --- a/src/components/monitoring/conditioner.vue +++ b/src/components/monitoring/conditioner.vue @@ -22,7 +22,7 @@
{{ - normalTotal + normalTotal }}
@@ -84,7 +84,7 @@ {{ - item.warnDate.substring(5, 16) + item.warnDate.substring(5, 16) }}
@@ -126,12 +126,12 @@ @@ -139,10 +139,10 @@ @@ -179,29 +179,43 @@
{{ testObject1.name }} - {{ - testObject1.mode == 0 - ? "通风" - : testObject1.mode == 1 - ? "制热" - : "制冷" + {{ + testObject1.mode == 0 + ? "通风" + : testObject1.mode == 1 + ? "制热" + : "制冷" + }} + {{ + testObject1.mode == 0 + ? "内机制热" + : testObject1.mode == 1 + ? "内机地暖同时制热" + : testObject1.mode == 2 + ? "地暖制热" + : testObject1.mode == 3 + ? "制冷" + : testObject1.mode == 9 + ? "通风" + : "" }}
-
-
+
{{ - testObject1.temSetting + testObject1.temSetting }}
@@ -214,26 +228,36 @@
当前风速: - {{ - testObject1.speed == 0 - ? "低速" - : testObject1.speed == 1 - ? "中速" - : testObject1.speed == 2 - ? "高速" - : "自动" + {{ + testObject1.speed == 0 + ? "低速" + : testObject1.speed == 1 + ? "中速" + : testObject1.speed == 2 + ? "高速" + : "自动" + }} + {{ + testObject1.speed == 1 + ? "低速" + : testObject1.speed == 2 + ? "中速" + : testObject1.speed == 3 + ? "高速" + : "自动" }}
-
-
+
+
{{ - testObject1.temSetting + testObject1.temSetting }}
@@ -246,18 +270,32 @@
当前风速: - {{ - testObject1.speed == 0 - ? "低速" - : testObject1.windSpeed == 1 - ? "中速" - : testObject1.windSpeed == 2 - ? "高速" - : "自动" + {{ + testObject1.speed == 0 + ? "低速" + : testObject1.speed == 1 + ? "中速" + : testObject1.speed == 2 + ? "高速" + : "自动" + }} + {{ + testObject1.speed == 1 + ? "低速" + : testObject1.speed == 2 + ? "中速" + : testObject1.speed == 3 + ? "高速" + : "自动" }}
+ +
+ +
设备离线
+
@@ -279,6 +317,11 @@ import { getLifList, getAirWarnList,//报警列表 getCancelWarn,//关闭告警 + setLoraTemp,//设置lora面板温度 + setLoraStatus,//设置lora面板开关0:关机 1:开机 + setLoraModel,//设置lora面板模式0:内机制热 1:内机地暖同时制热(默认) 2::地暖制热 3:制冷模式 9:通风模式| + setLoraSpeed,//设置lora面板风速1:低速 2:中速 3:高速 4:自动 + queryLoraAll,//读取lora面板### 读取空调面板的 } from "@/api/garden/monitoring"; import clickCp from "./clickCp"; import backHome from "./backHome"; @@ -386,7 +429,7 @@ export default { bfHelper.customTag( { x: item.xmove, y: item.ymove, z: item.zmove }, null, - this.getContent(item) + item.funcCat == 1 ? this.getContent(item) : item.funcCat == 2 ? this.getOAContent(item) : this.getMbContent(item) ); }); }, @@ -396,14 +439,14 @@ export default { bfHelper.customTag( this.position, null, - this.getContent(this.testObject1) + this.testObject1.funcCat == 1 ? this.getContent(this.testObject1) : this.testObject1.funcCat == 2 ? this.getOAContent(this.testObject1) : this.getMbContent(this.testObject1) ); } else if (this.conditionNum == 2) { this.allDatas.forEach((item) => { bfHelper.customTag( { x: item.xmove, y: item.ymove, z: item.zmove }, null, - this.getContent(item) + item.funcCat == 1 ? this.getContent(item) : item.funcCat == 2 ? this.getOAContent(item) : this.getMbContent(item) ); }); } @@ -614,7 +657,7 @@ export default { z: item.zmove, }, null, - item.funcCat == 1 ? this.getContent(item) : this.getOAContent(item) + item.funcCat == 1 ? this.getContent(item) : item.funcCat == 2 ? this.getOAContent(item) : this.getMbContent(item) ); }); } else { @@ -630,6 +673,12 @@ export default { //改变空调模式 if (this.testObject1.open == 1) { this.testObject1.mode = mode; + if (this.testObject1.funcCat == 3) { + //lora面板 + setLoraModel(this.testObject1.code, this.testObject1.mode).then(res => { + }) + return; + } var arr = bfHelper.getAll(); bfHelper.clearTags(); if (arr.length < 2) { @@ -654,7 +703,7 @@ export default { z: item.zmove, }, null, - this.getContent(item) + item.funcCat == 1 ? this.getContent(item) : item.funcCat == 2 ? this.getOAContent(item) : this.getMbContent(item) ); }); } @@ -677,6 +726,18 @@ export default { if (this.testObject1.temSetting <= 16) { this.testObject1.temSetting = 16; } + if (this.testObject1.funcCat == 3) { + //lora面板 + setLoraTemp(this.testObject1.code, this.testObject1.temSetting).then(res => { + if (res.data.code == 200) { + this.$message.success('温度设置成功'); + } else { + this.$message.error('温度设置失败'); + this.testObject1.temSetting++; + } + }) + return; + } setConditionTemDown( this.testObject1.code, this.testObject1.temSetting @@ -698,6 +759,18 @@ export default { if (this.testObject1.temSetting >= 30) { this.testObject1.temSetting = 30; } + if (this.testObject1.funcCat == 3) { + //lora面板 + setLoraTemp(this.testObject1.code, this.testObject1.temSetting).then(res => { + if (res.data.code == 200) { + this.$message.success('温度设置成功'); + } else { + this.$message.error('温度设置失败'); + this.testObject1.temSetting--; + } + }) + return; + } setConditionTemUp( this.testObject1.code, this.testObject1.temSetting @@ -716,6 +789,12 @@ export default { if (this.testObject1.speed <= 0) { this.testObject1.speed = 0; } + if (this.testObject1.funcCat == 3) { + //lora面板 + setLoraSpeed(this.testObject1.code, this.testObject1.speed).then(res => { + }) + return; + } setConditionSpeedDown( this.testObject1.code, this.testObject1.speed @@ -733,6 +812,12 @@ export default { if (this.testObject1.speed >= 3) { this.testObject1.speed = 3; } + if (this.testObject1.funcCat == 3) { + //lora面板 + setLoraSpeed(this.testObject1.code, this.testObject1.speed).then(res => { + }) + return; + } setConditionSpeedUp(this.testObject1.code, this.testObject1.speed).then( (res) => { if (res.data.code == 200) { @@ -746,6 +831,13 @@ export default { if (this.testObject1.agentCtrl == 0) { this.$message.error("暂无设备控制权限!"); } else { + if (this.testObject1.funcCat == 3) { + //lora面板 + setLoraStatus(this.testObject1.code, 0).then(res => { + this.testObject1.open = 2; + }) + return; + } getConditionClose(this.testObject1.code).then((res) => { if (res.data.code == 200) { if (res.data.data) { @@ -761,7 +853,7 @@ export default { z: this.testObject1.zmove, }, null, - this.getContent(this.testObject1) + this.testObject1.funcCat == 1 ? this.getContent(this.testObject1) : this.testObject1.funcCat == 2 ? this.getOAContent(this.testObject1) : this.getMbContent(this.testObject1) ); } else { this.allDatas.forEach((item) => { @@ -775,7 +867,7 @@ export default { z: item.zmove, }, null, - this.getContent(item) + item.funcCat == 1 ? this.getContent(item) : item.funcCat == 2 ? this.getOAContent(item) : this.getMbContent(item) ); }); } @@ -790,6 +882,13 @@ export default { if (this.testObject1.agentCtrl == 0) { this.$message.error("暂无设备控制权限!"); } else { + if (this.testObject1.funcCat == 3) { + //lora面板 + setLoraStatus(this.testObject1.code, 1).then(res => { + this.testObject1.open = 1; + }) + return; + } getConditionOpen(this.testObject1.code).then((res) => { if (res.data.code == 200) { if (res.data.data) { @@ -797,8 +896,7 @@ export default { this.testObject1.open = 1; var arr = bfHelper.getAll(); bfHelper.clearTags(); - if (arr.length < 2) { - getOAContent + if (arr.length < 2) {getOAContent bfHelper.customTag( { x: this.testObject1.xmove, @@ -806,7 +904,7 @@ export default { z: this.testObject1.zmove, }, null, - this.testObject1.funcCat == 1 ? this.getContent(this.testObject1) : this.getOAContent(this.testObject1) + this.testObject1.funcCat == 1 ? this.getContent(this.testObject1) : this.testObject1.funcCat == 2 ? this.getOAContent(this.testObject1) : this.getMbContent(this.testObject1) ); } else { this.allDatas.forEach((item) => { @@ -820,7 +918,7 @@ export default { z: item.zmove, }, null, - item.funcCat == 1 ? this.getContent(item) : this.getOAContent(item) + item.funcCat == 1 ? this.getContent(item) : item.funcCat == 2 ? this.getOAContent(item) : this.getMbContent(item) ); }); } @@ -897,8 +995,9 @@ export default { bfHelper.customTag( this.position, null, - row.funcCat == 1 ? this.getContent(this.testObject1) : this.getOAContent(this.testObject1) + row.funcCat == 1 ? this.getContent(this.testObject1) : row.funcCat == 2 ? this.getOAContent(this.testObject1) : this.getMbContent(this.testObject1) ); + this.removeEvent(); window.addEventListener("click", this.addEvent); this.conditionNum = 1; } @@ -931,10 +1030,30 @@ export default { code = e.target.id.substring(7); } if (code) { + let funcCatObj = this.allDatas.find(item => { return item.code == code }); + if (funcCatObj && funcCatObj.funcCat == 3) { + //lora面板 + queryLoraAll(code).then(res => { + this.testObject1 = res.data.data; + this.testObject1.funcCat = 3; + if ( + e.target.id == "condition-" + code || + e.target.id == "temper-" + code || + e.target.id == "tempea-" + code || + e.target.id == "tempec-" + code || + e.target.id == "tempac-" + code || + e.target.id == "temped-" + code + ) { + this.isControl = true; + this.clickCode = code; + } + }) + return; + } getConditionData(code).then((res) => { if (res.data.code == 200) { this.testObject1 = res.data.data; - if (this.testObject1.getConditionData == 2) { + if(this.testObject1.getConditionData == 2){ //新风不需要控制 return; } @@ -1006,6 +1125,23 @@ export default { return content; }, + //空调面板 + getMbContent(testObject) { + // console.log('空调面板',testObject) + let bgImg1 = require("../../../public/img/monitoring/electricity/condition_mb.png"); + let content = `
+
+
+ ${testObject.name} +
+
+ +
`; + + return content; + }, //空调主机定位标签样式 getOAContent(objData) { let content = `
diff --git a/src/components/monitoring/door.vue b/src/components/monitoring/door.vue index d2d9858..0b047bb 100644 --- a/src/components/monitoring/door.vue +++ b/src/components/monitoring/door.vue @@ -1041,7 +1041,7 @@ export default { ${item.name }
-
设备状态: @@ -1066,7 +1066,7 @@ export default { ${item.location}
-
+
diff --git a/src/components/monitoring/lift.vue b/src/components/monitoring/lift.vue index 2608ef4..340dd3f 100644 --- a/src/components/monitoring/lift.vue +++ b/src/components/monitoring/lift.vue @@ -173,7 +173,7 @@ export default { pos: 0, height: 5350, offsetZ: 250, - // path: "ws://192.168.1.3/blade-datamqtt/ws", + // path: "ws://192.168.1.106/blade-datamqtt/ws", path: "ws://10.90.100.204/blade-datamqtt/ws", socket: "", arr: [], //电梯信息 @@ -432,7 +432,7 @@ export default { name = '塔楼北电梯'; this.arr[i].height = this.height * (this.arr[i].floor * 1 - 1); } - this.arr[i].floor = this.arr[i].floor ? this.arr[i].floor : '-1' + this.arr[i].floor = this.arr[i].floor ? this.arr[i].floor : '1' bfHelper.setExternalComponentZ(name, this.height * (this.arr[i].floor * 1 - 1)); } @@ -479,7 +479,7 @@ export default { this.arr.reverse() for (let i = 0; i < this.arr.length; i++) { this.arr[i].height = this.height * (this.arr[i].floor * 1 - 1); - this.arr[i].floor = this.arr[i].floor ? this.arr[i].floor : '-1' + this.arr[i].floor = this.arr[i].floor ? this.arr[i].floor : '1' bfHelper.setExternalComponentZ(this.arr[i].modelId, this.height * (this.arr[i].floor * 1 - 1)); } // console.log(this.arr) @@ -530,199 +530,13 @@ export default { if (typeof (WebSocket) === "undefined") { alert("您的浏览器不支持socket"); } else { - // this.socket = new WebSocket(this.path); - // // 监听socket连接 - // this.socket.onopen = this.open; - // // 监听socket错误信息 - // this.socket.onerror = this.error; - // // 监听socket消息 - // this.socket.onmessage = this.getMessage; - - //模拟代码 - // let test = setInterval(() => { - // let floor = "01"; - // let msg = { - // data: JSON.stringify({ - // "id": 91, - // "code": "10700000004", - // "floor": floor, - // "direction": "向上", - // "status": "90000", - // "statusMsg": "正常", - // "createTime": "2022-06-18 12:00:00", - // "name": "业务区6号楼电梯", - // "modelId": "升降电梯(6)", - // "location": "6号楼", - // "factory": "", - // "tendingTime": "", - // "tendingUser": "", - // "tendingPhone": "", - // "alarmStatus": "", - // "alarmType": "", - // "alarmTime": "", - // "alarmContext": "", - // "height": "" - // }) - // }; - // let msg2 = { - // data: JSON.stringify({ - // "id": 88, - // "code": "10700000001", - // "floor": floor, - // "direction": "向上", - // "status": "90000", - // "statusMsg": "正常", - // "createTime": "2022-06-18 12:00:00", - // "name": "业务区1号楼电梯", - // "modelId": "升降电梯(1)", - // "location": "1号楼", - // "factory": "", - // "tendingTime": "", - // "tendingUser": "", - // "tendingPhone": "", - // "alarmStatus": "", - // "alarmType": "", - // "alarmTime": "", - // "alarmContext": "", - // "height": "" - // }) - // }; - // this.getMessage(msg); - // this.getMessage(msg2); - // setTimeout(() => { - // let floor = "02"; - // let msg = { - // data: JSON.stringify({ - // "id": 91, - // "code": "10700000004", - // "floor": floor, - // "direction": "向上", - // "status": "90000", - // "statusMsg": "正常", - // "createTime": "2022-06-18 12:00:00", - // "name": "业务区6号楼电梯", - // "modelId": "升降电梯(6)", - // "location": "6号楼", - // "factory": "", - // "tendingTime": "", - // "tendingUser": "", - // "tendingPhone": "", - // "alarmStatus": "", - // "alarmType": "", - // "alarmTime": "", - // "alarmContext": "", - // "height": "" - // }) - // }; - // let msg2 = { - // data: JSON.stringify({ - // "id": 88, - // "code": "10700000001", - // "floor": floor, - // "direction": "向上", - // "status": "90000", - // "statusMsg": "正常", - // "createTime": "2022-06-18 12:00:00", - // "name": "业务区1号楼电梯", - // "modelId": "升降电梯(1)", - // "location": "1号楼", - // "factory": "", - // "tendingTime": "", - // "tendingUser": "", - // "tendingPhone": "", - // "alarmStatus": "", - // "alarmType": "", - // "alarmTime": "", - // "alarmContext": "", - // "height": "" - // }) - // }; - // this.getMessage(msg); - // this.getMessage(msg2); - // setTimeout(() => { - // let floor = "03"; - // let msg = { - // data: JSON.stringify({ - // "id": 91, - // "code": "10700000004", - // "floor": floor, - // "direction": "向下", - // "status": "90000", - // "statusMsg": "正常", - // "createTime": "2022-06-18 12:00:00", - // "name": "业务区6号楼电梯", - // "modelId": "升降电梯(6)", - // "location": "6号楼", - // "factory": "", - // "tendingTime": "", - // "tendingUser": "", - // "tendingPhone": "", - // "alarmStatus": "", - // "alarmType": "", - // "alarmTime": "", - // "alarmContext": "", - // "height": "" - // }) - // }; - // this.getMessage(msg); - // setTimeout(() => { - // let floor = "02"; - // let msg = { - // data: JSON.stringify({ - // "id": 91, - // "code": "10700000004", - // "floor": floor, - // "direction": "向下", - // "status": "90000", - // "statusMsg": "正常", - // "createTime": "2022-06-18 12:00:00", - // "name": "业务区6号楼电梯", - // "modelId": "升降电梯(6)", - // "location": "6号楼", - // "factory": "", - // "tendingTime": "", - // "tendingUser": "", - // "tendingPhone": "", - // "alarmStatus": "", - // "alarmType": "", - // "alarmTime": "", - // "alarmContext": "", - // "height": "" - // }) - // }; - // let msg2 = { - // data: JSON.stringify({ - // "id": 88, - // "code": "10700000001", - // "floor": floor, - // "direction": "向下", - // "status": "90000", - // "statusMsg": "正常", - // "createTime": "2022-06-18 12:00:00", - // "name": "业务区1号楼电梯", - // "modelId": "升降电梯(1)", - // "location": "1号楼", - // "factory": "", - // "tendingTime": "", - // "tendingUser": "", - // "tendingPhone": "", - // "alarmStatus": "", - // "alarmType": "", - // "alarmTime": "", - // "alarmContext": "", - // "height": "" - // }) - // }; - // this.getMessage(msg); - // this.getMessage(msg2); - // }, 300) - // }, 300) - // }, 300) - // }, 5000); - - // setTimeout(() => { - // clearInterval(test); - // }, 1000 * 20); + this.socket = new WebSocket(this.path); + // 监听socket连接 + this.socket.onopen = this.open; + // 监听socket错误信息 + this.socket.onerror = this.error; + // 监听socket消息 + this.socket.onmessage = this.getMessage; } }, windowClick(e) { @@ -753,26 +567,29 @@ export default { }, getMessage(msg) { let obj = JSON.parse(msg.data) - obj.createTime = dateFormat(new Date(obj.createTime), 'yyyy-MM-dd hh:mm'); - obj.tendingTime = dateFormat(new Date(obj.tendingTime), 'yyyy-MM-dd hh:mm'); + // obj.createTime = dateFormat(new Date(obj.createTime), 'yyyy-MM-dd hh:mm'); + // obj.tendingTime = dateFormat(new Date(obj.tendingTime), 'yyyy-MM-dd hh:mm'); // if(obj.status != 90000){ let idx = this.arr.findIndex(item => { return item.id == obj.id }); if (idx > -1) { - this.arr[idx].modelId = obj.modelId; - this.arr[idx].status = obj.status; - this.arr[idx].createTime = obj.createTime; - this.arr[idx].tendingTime = obj.tendingTime; - this.arr[idx].factory = obj.factory; + // this.arr[idx].modelId = obj.modelId; + // this.arr[idx].status = obj.status; + // this.arr[idx].createTime = obj.createTime; + // this.arr[idx].tendingTime = obj.tendingTime; + // this.arr[idx].factory = obj.factory; // this.arr[idx].floor = obj.floor; - this.arr[idx].statusMsg = obj.statusMsg; + // this.arr[idx].statusMsg = obj.statusMsg; this.arr[idx].direction = obj.direction; + let _obj = JSON.parse(JSON.stringify(this.arr[idx])); + _obj.floor = obj.floor; + this.setLiftColor(this.arr) if (this.bimModel == 1) { - let content = this.getContent(idx, obj); + let content = this.getContent(idx, _obj); let objectId = bfHelper.getExternalComponentId(obj.modelId); - console.log(obj.modelId, obj.floor, this.height * ((obj.floor * 1) - (this.arr[idx].floor * 1))) + // console.log(obj.modelId, obj.floor, this.height * ((obj.floor * 1) - (this.arr[idx].floor * 1))) if (this.arr[idx].floor != obj.floor) { bfHelper.setExternalComponentZ(obj.modelId, this.height * ((obj.floor * 1) - (this.arr[idx].floor * 1))); } @@ -784,7 +601,7 @@ export default { this.arr[idx].floor = obj.floor; }, 150); } else { - let content = this.getContent(idx, obj); + let content = this.getContent(idx, _obj); if (this.arr[idx].floor != obj.floor) { bfHelper.setExternalComponentZ(obj.modelId, this.height * ((obj.floor * 1) - (this.arr[idx].floor * 1))); diff --git a/src/components/monitoring/warm.vue b/src/components/monitoring/warm.vue index 7d219a0..2f8b672 100644 --- a/src/components/monitoring/warm.vue +++ b/src/components/monitoring/warm.vue @@ -632,7 +632,7 @@ export default { this.getHistoryWarm(); //历史用热统计 this.getCurWarm(); //本月用热 this.getMode(); //模式 - // this.getWarmLists(); //获取热量表列表 + this.getWarmLists(); //获取热量表列表 // this.getWarmGK(); //获取热量表概况 this.getHeatWarnList(); //告警列表 } diff --git a/src/util/bfHelper.js b/src/util/bfHelper.js index 13ad768..9d1339c 100644 --- a/src/util/bfHelper.js +++ b/src/util/bfHelper.js @@ -2862,12 +2862,12 @@ const loadModel = (i) => { // BimfaceLoaderConfig.APIHost = "http://10.90.100.203:8080"; BimfaceLoaderConfig.dataEnvType = BimfaceEnvOption.Local; BimfaceLoaderConfig.sdkPath = "static/jssdk@3.6.191/jssdk"; - // BimfaceLoaderConfig.path = i == 1 ? 'http://47.103.199.45:8000/face/ywq/viewToken.json' : - // 'http://47.103.199.45:8000/face/tt/viewToken.json'; - BimfaceLoaderConfig.path = - i == 1 - ? "http://10.90.100.203:8080/ywq/viewToken.json" - : "http://10.90.100.203:8080/tt/viewToken.json"; + BimfaceLoaderConfig.path = i == 1 ? 'http://47.103.199.45:8000/face/ywq/viewToken.json' : + 'http://47.103.199.45:8000/face/tt/viewToken.json'; + // BimfaceLoaderConfig.path = + // i == 1 + // ? "http://10.90.100.203:8080/ywq/viewToken.json" + // : "http://10.90.100.203:8080/tt/viewToken.json"; BimfaceSDKLoader.load(BimfaceLoaderConfig, onSDKLoadSucceeded); }; diff --git a/src/views/sourceAnaly/components/buildWarm.vue b/src/views/sourceAnaly/components/buildWarm.vue index 71ee7ac..ce79256 100644 --- a/src/views/sourceAnaly/components/buildWarm.vue +++ b/src/views/sourceAnaly/components/buildWarm.vue @@ -199,13 +199,13 @@ export default { ).then((res) => { let leidaData = []; let lineData = []; - const data = res.data.data; + const data = res.data.data.dataList; for (let i = 0; i < data.length; i++) { leidaData.push(data[i].consume); lineData.push(data[i].consumeMonList); } this.getWarmLeida(leidaData); - this.getWarmLine(lineData); + this.getWarmLine(lineData,res.data.data.dateList); }); }, getGaugeData() { @@ -322,19 +322,25 @@ export default { }); }, getWarmLeida(value) { + value.map(item => { + item = item.toString().split('.')[1] != undefined && item.toString().split('.')[1].length > 1 ? item.toFixed(2) : item + }) + let max = Math.max(...value); const data = [ { value: value, name: "楼宇耗热", }, ]; + max = max === 0 ? 100 : max; + console.log('max', max); const title = [ - { name: "#1", max: 2000 }, - { name: "#2", max: 2000 }, - { name: "#3", max: 2000 }, - { name: "#4", max: 2000 }, - { name: "#5", max: 2000 }, - { name: "#6", max: 2000 }, + { name: "#1", max: max }, + { name: "#2", max: max }, + { name: "#3", max: max }, + { name: "#4", max: max }, + { name: "#5", max: max }, + { name: "#6", max: max }, ]; this.$refs.radar.getLeidaChart( "耗热", @@ -344,7 +350,7 @@ export default { title ); }, - getWarmLine(value) { + getWarmLine(value,category) { const data = []; for (let i = 0; i < this.build.length; i++) { data.push({ @@ -361,7 +367,7 @@ export default { }, }); } - this.$refs.line.getLineCharts("耗热量(MJ)", data); + this.$refs.line.getLineCharts("耗热量(MJ)", data, category); }, getFloorTemper(id, value) { let myChart = this.$echarts.init(document.getElementById(id)); diff --git a/src/views/sourceAnaly/components/conditionAnaly.vue b/src/views/sourceAnaly/components/conditionAnaly.vue index b2fc700..2ac4237 100644 --- a/src/views/sourceAnaly/components/conditionAnaly.vue +++ b/src/views/sourceAnaly/components/conditionAnaly.vue @@ -63,7 +63,7 @@ @change="searchBuild" > -
+