From 01b9e7244825cac11146e3961cafa6525dad56f1 Mon Sep 17 00:00:00 2001 From: web <candymxq888@outlook.com> Date: 星期五, 25 四月 2025 17:24:33 +0800 Subject: [PATCH] fix:水温监控添加定时器 --- src/views/screen/temperature/graphic/index.vue | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/views/screen/temperature/graphic/index.vue b/src/views/screen/temperature/graphic/index.vue index 235ce02..8d8d853 100644 --- a/src/views/screen/temperature/graphic/index.vue +++ b/src/views/screen/temperature/graphic/index.vue @@ -1,10 +1,11 @@ <script setup> -import {ref, onMounted, watch} from "vue"; +import {ref, onMounted} from "vue"; import * as echarts from 'echarts/core'; import {getTemperaturePointList} from '@/api/screen/index.js' import Quarter from "@/components/Quarter"; import moment from "moment"; import { getGraphicData } from '@/api/screen/graphic/index.js' +import { debounce } from '@/utils/tool.js' const menuList = ref([]) @@ -163,6 +164,14 @@ }) } +// 监听页面大小变化,改变echarts的大小 +window.onresize = debounce(function () { + charts?.forEach(el => { + el.resize() + }) +}, 500, true) + + // 全屏操作 const handleFullScreen = () => { graphicRef.value.requestFullscreen() @@ -225,6 +234,7 @@ // 获取报表数据 const getChartData = (point = '') => { + chartData.value = []; //先赋值为空,强制元素重载 const data = { type: timeType.value, pointId: point, @@ -270,7 +280,7 @@ <div class="graphic-info"> <div class="graphic-tool"> <div class="tool-l"> - <div class="name">类型</div> + <div class="name">时间类型</div> <el-button-group class="ml-4"> <el-button :type="timeType === 1 ? 'primary' : ''" @click="changeType(1)">日 </el-button> @@ -448,6 +458,7 @@ border-radius: 8px; .charts { + width: 100%; height: 100%; } } -- Gitblit v1.9.3