From 7a6d71613b5e96de264e22ccebb94e9dbdce5ccd Mon Sep 17 00:00:00 2001 From: he wei <858544502@qq.com> Date: 星期六, 09 十一月 2024 16:17:16 +0800 Subject: [PATCH] U 历史数据格式化排序问题 --- src/views/test/jhyRtInfo.vue | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/views/test/jhyRtInfo.vue b/src/views/test/jhyRtInfo.vue index a2e39bd..a8067cc 100644 --- a/src/views/test/jhyRtInfo.vue +++ b/src/views/test/jhyRtInfo.vue @@ -1,5 +1,5 @@ <script setup> -import { ref, computed, watch, onMounted } from "vue"; +import { ref, computed, watch, onMounted, nextTick } from "vue"; import ycCard from "@/components/ycCard.vue"; import jhyInfo from "./jhyInfo.vue"; import useWebSocket from "@/hooks/useWebSocket.js"; @@ -126,6 +126,18 @@ changeTab(); }); +watch( + () => props.onlyOneGroup, + (val) => { + nextTick(() => { + if (battVolChart.value) { + battVolChart.value[0].resize(); + battVolChart.value[1]?.resize(); + } + }); + } +); + function changeTab() { if (infoTab.value == 2) { updateChart(); @@ -155,7 +167,12 @@ } onMounted(() => { - // sendData(JSON.stringify({ devId: props.devId, devType: 1 })); + // console.log('devId,' , props.devId, 'onMounted', '============='); + + let reg = /^2/; + if (reg.test(props.devId)) { + sendData(JSON.stringify({ devId: props.devId, devType: 2 })); + } }); </script> -- Gitblit v1.9.1