From e295922209fb87c6dcd68ea1560fd16c3e6d808c Mon Sep 17 00:00:00 2001 From: dongyukun <1208714201@qq.com> Date: 星期五, 27 六月 2025 09:36:51 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/feature/ai' --- src/views/model/sche/suggest/suggestSnapshot.vue | 19 +++++++++++-------- 1 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/views/model/sche/suggest/suggestSnapshot.vue b/src/views/model/sche/suggest/suggestSnapshot.vue index 62c6405..801a654 100644 --- a/src/views/model/sche/suggest/suggestSnapshot.vue +++ b/src/views/model/sche/suggest/suggestSnapshot.vue @@ -16,10 +16,10 @@ </el-checkbox-group> <div - v-for="(chart, index) in charts" + v-for="chart in charts" :key="chart.id" class="chart-container" - :ref="el => chartDoms[index] = el" + :ref="el => chartDoms[chart.id] = el" v-loading="loading" ></div> </el-dialog> @@ -34,8 +34,8 @@ const visible = ref(false) const dataList = ref([]) const selectedData = ref([]) - const charts = ref([]) - const chartDoms = ref([]) + const charts = ref() + const chartDoms = ref({}) const chartInstances = ref([]) const loading = ref(false) @@ -106,10 +106,10 @@ /** 渲染图表 */ const renderCharts = () => { - chartInstances.value = chartDoms.value.map((dom, index) => { + chartInstances.value = charts.value.map((chartInfo, index) => { + const dom = chartDoms.value[chartInfo.id] if (!dom) return null const chart = echarts.init(dom) - const chartInfo = charts.value[index] if (!chartInfo) return chart @@ -211,9 +211,12 @@ textStyle: { fontSize: 14 } }, tooltip: { trigger: 'axis' }, - grid: { top: 30, left: '3%', right: '5%', bottom: 20 }, + grid: { top: '10%', left: '3%', right: '5%', bottom: 20 }, xAxis: {type: 'category'}, - yAxis: { type: 'value' }, + yAxis: { type: 'value', + max: (value) => chartInfo.data?.limitH && value.max < chartInfo.data.limitH ? chartInfo.data?.limitH : null, + min: (value) => chartInfo.data?.limitL && value.min > chartInfo.data.limitL ? chartInfo.data?.limitL : null, + }, dataZoom: [{ type: 'inside' }], series: [{ type: 'line', -- Gitblit v1.9.3