From b6b184c2a1b1a4bfca774c80706bc7bfccd1a0d9 Mon Sep 17 00:00:00 2001 From: "1378012178@qq.com" <1378012178@qq.com> Date: Thu, 28 Aug 2025 11:04:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=8A=E5=8E=BF=E7=AE=A1?= =?UTF-8?q?=E7=BD=91=E6=A3=80=E6=B5=8B=E6=8C=87=E6=A0=87=E6=8A=98=E7=BA=BF?= =?UTF-8?q?=E5=9B=BE=EF=BC=9A=E6=B8=A9=E5=BA=A6=E6=8C=87=E6=A0=87=E6=8A=98?= =?UTF-8?q?=E7=BA=BF=E5=9B=BE=20-=20=E5=8A=A8=E6=80=81=E5=8F=96=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../heatanalysis/HeatanalysisListJx.vue | 4 +- .../heating/heatanalysis/components/ZxtJX.vue | 47 +++++++++++-------- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/src/views/heating/heatanalysis/HeatanalysisListJx.vue b/src/views/heating/heatanalysis/HeatanalysisListJx.vue index 391b255..052ae72 100644 --- a/src/views/heating/heatanalysis/HeatanalysisListJx.vue +++ b/src/views/heating/heatanalysis/HeatanalysisListJx.vue @@ -72,12 +72,12 @@ diff --git a/src/views/heating/heatanalysis/components/ZxtJX.vue b/src/views/heating/heatanalysis/components/ZxtJX.vue index 570fc14..4ad5afb 100644 --- a/src/views/heating/heatanalysis/components/ZxtJX.vue +++ b/src/views/heating/heatanalysis/components/ZxtJX.vue @@ -76,20 +76,31 @@ function initChartsOptions(records: any[]) { return (isNaN(ta) ? 0 : ta) - (isNaN(tb) ? 0 : tb); }); - // 横坐标使用 view032 或 datatime const xAxis = records.map((r: any) => r.view032 || r.datatime || ''); + // ⚡ 只改温度指标:根据每条记录的 fromFlow 判断取值 const tempSeries = [ - { name: '供水温度', key: 'view005' }, - { name: '回水温度', key: 'view006' }, - ].map(s => ({ - name: s.name, - type: 'line', - showSymbol: false, - connectNulls: false, - data: records.map((r: any) => safeNum(r[s.key])), - })); + { + name: '供水温度', + type: 'line', + showSymbol: false, + connectNulls: false, + data: records.map((r: any) => { + return safeNum(r.fromFlow == 1 ? r.view035 : r.view005); + }), + }, + { + name: '回水温度', + type: 'line', + showSymbol: false, + connectNulls: false, + data: records.map((r: any) => { + return safeNum(r.fromFlow == 1 ? r.view036 : r.view006); + }), + }, + ]; + // 压力指标(不变) const pressSeries = [ { name: '供水压力', key: 'view007' }, { name: '回水压力', key: 'view008' }, @@ -101,7 +112,7 @@ function initChartsOptions(records: any[]) { data: records.map((r: any) => safeNum(r[s.key])), })); - // 热量指标: 瞬时热量 view041,正累积热量 view042 + // 热量指标(不变) const heatSeries = [ { name: '瞬时热量', key: 'view041' }, { name: '正累积热量', key: 'view042' }, @@ -113,7 +124,7 @@ function initChartsOptions(records: any[]) { data: records.map((r: any) => safeNum(r[s.key])), })); - // 流量指标: 瞬时流量 view037,正累积流量 view038 + // 流量指标(不变) const flowSeries = [ { name: '瞬时流量', key: 'view037' }, { name: '正累积流量', key: 'view038' }, @@ -133,20 +144,18 @@ function initChartsOptions(records: any[]) { type: 'category', data: xAxis, boundaryGap: false, - axisLabel: { - interval: 0, - formatter: (val: string) => val ? val.replace(' ', '\n') : val, - }, + axisLabel: { interval: 0, formatter: (v: string) => (v ? v.replace(' ', '\n') : v) }, }, yAxis: { type: 'value', scale: true }, }; - tempOption = { ...baseOption, title: { text: '温度指标', left: 'center', top: 8 }, series: tempSeries }; + tempOption = { ...baseOption, title: { text: '温度指标', left: 'center', top: 8 }, series: tempSeries }; pressOption = { ...baseOption, title: { text: '压力指标', left: 'center', top: 8 }, series: pressSeries }; - heatOption = { ...baseOption, title: { text: '热量指标', left: 'center', top: 8 }, series: heatSeries }; - flowOption = { ...baseOption, title: { text: '流量指标', left: 'center', top: 8 }, series: flowSeries }; + heatOption = { ...baseOption, title: { text: '热量指标', left: 'center', top: 8 }, series: heatSeries }; + flowOption = { ...baseOption, title: { text: '流量指标', left: 'center', top: 8 }, series: flowSeries }; } + let resizeAdded = false; function ensureResizeListener() { if (resizeAdded) return;