From afdc5ca4e5691a10748d70262471b6a526d139e2 Mon Sep 17 00:00:00 2001 From: whyczyk <525500596@qq.com> Date: 星期六, 25 六月 2022 11:03:06 +0800 Subject: [PATCH] 电源通讯报错处理 --- src/pages/dataTest/movingRingSystem/powerBox.vue | 34 +++++++++++++++++++++------------- 1 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/pages/dataTest/movingRingSystem/powerBox.vue b/src/pages/dataTest/movingRingSystem/powerBox.vue index bd8974a..80d4e12 100644 --- a/src/pages/dataTest/movingRingSystem/powerBox.vue +++ b/src/pages/dataTest/movingRingSystem/powerBox.vue @@ -279,6 +279,7 @@ let acDcSignalData = getAcDcSignalData(); let dcSignalData = getDcSignalData(); return { + battFullName: "鐢垫睜缁勫叏绉�", layout: { gutter: 16, span: 8, @@ -466,7 +467,7 @@ }); }, changeDcData(config) { - console.log(config); + // console.log(config); let outputSWCount = config.outputSWCount; let list = {}; for (let i = 1; i <= outputSWCount; i++) { @@ -518,11 +519,17 @@ powerDeviceId: powerDeviceId, }) .then((res) => { - console.log(res); + // console.log(res); let rs = JSON.parse(res.data.result); if (rs.code == 1) { this.powerData.info = rs.data; this.batt.StationName = this.powerData.info.stationName; + this.battFullName = + this.batt.StationName + + "-" + + this.powerData.info.powerDeviceName + + "-" + + "閫氫俊鐢垫簮"; } else { this.powerData.info = { powerDeviceId: 0, @@ -833,7 +840,7 @@ let res = getItemByKey(item, data); return res == 0 ? ["鏈煡", 0] : [res.label1, res.value]; }); - option.refs.setOption(opt); + option?.refs?.setOption(opt); }, resize() { this.$nextTick(() => { @@ -908,13 +915,14 @@ }, }, computed: { - battFullName() { - let batt = this.batt; - if (batt.StationName && batt.BattGroupName) { - return batt.StationName + "-" + "閫氫俊鐢垫簮"; - } - return "鐢垫睜缁勫叏绉�"; - }, + // battFullName() { + // let batt = this.batt; + // console.log("batt", JSON.stringify(batt)); + // if (batt.StationName) { + // return batt.StationName + "-" + "閫氫俊鐢垫簮"; + // } + // return "鐢垫睜缁勫叏绉�"; + // }, }, mounted() { // 鑾峰彇鐢垫簮淇℃伅 @@ -924,14 +932,14 @@ } // 璁剧疆閰嶇疆椤� - this.setOption(); + // this.setOption(); // 娣诲姞绐楀彛鑷姩缂╂斁 - window.addEventListener("resize", this.resize); + window.addEventListener("resize", this.resize, 20); }, destroyed() { this.timer.stop(); // 娣诲姞绐楀彛鑷姩缂╂斁 - window.removeEventListener("resize", this.resize); + window.removeEventListener("resize", this.resize, 20); }, }; </script> -- Gitblit v1.9.1