From ac772e2caff08523ea4e4fe81a2b95a2feef5bf7 Mon Sep 17 00:00:00 2001 From: lb Date: Thu, 4 Jan 2024 10:58:20 +0800 Subject: [PATCH] fix ui --- src/components/Common/CurrentTemp/index.jsx | 132 ++++++++++++------ src/components/Common/Energy/index.jsx | 58 ++++++-- .../SmokeHandle/SmokeTrendChart/index.jsx | 15 +- .../components/GoodRateChart/index.jsx | 10 +- .../EnergyCostAnalysis/BadGas/index.jsx | 6 +- .../ElectricityCost/index.jsx | 12 +- .../EnergyCostAnalysis/Energy/index.jsx | 30 ++-- .../Energy/index.module.css | 3 +- .../Modules/EnergyCostAnalysis/NO/index.jsx | 15 +- .../Modules/EnergyCostAnalysis/NO2/index.jsx | 11 +- .../EnergyCostAnalysis/NatGas/index.jsx | 8 +- .../Modules/EnergyCostAnalysis/O/index.jsx | 12 +- .../Modules/EnergyCostAnalysis/SO2/index.jsx | 14 +- .../EnergyCostAnalysis/SmokeHandle/index.jsx | 24 ++-- src/utils/energeChartOption.js | 2 +- 15 files changed, 241 insertions(+), 111 deletions(-) diff --git a/src/components/Common/CurrentTemp/index.jsx b/src/components/Common/CurrentTemp/index.jsx index 6f14df0..9553453 100644 --- a/src/components/Common/CurrentTemp/index.jsx +++ b/src/components/Common/CurrentTemp/index.jsx @@ -53,7 +53,9 @@ function WindFrequence(props) { useEffect(() => { setCurrentLineTemp( - (currentTempList && currentTempList[1+lines.indexOf(dataSource)+'#']) || [] + (currentTempList && + currentTempList[1 + lines.indexOf(dataSource) + "#"]) || + [] ); }, [dataSource]); @@ -70,65 +72,113 @@ function WindFrequence(props) {

A1区板上

- {currentLineTemp[0] || 0} ℃ - {currentLineTemp[1] || 0} ℃ - {currentLineTemp[2] || 0} ℃ + + {(+currentLineTemp[0]).toFixed(2) || 0} ℃ + + + {(+currentLineTemp[1]).toFixed(2) || 0} ℃ + + + {(+currentLineTemp[2]).toFixed(2) || 0} ℃ +

A2区板上

- {currentLineTemp[6] || 0} ℃ - {currentLineTemp[7] || 0} ℃ - {currentLineTemp[8] || 0} ℃ + + {(+currentLineTemp[6]).toFixed(2) || 0} ℃ + + + {(+currentLineTemp[7]).toFixed(2) || 0} ℃ + + + {(+currentLineTemp[8]).toFixed(2) || 0} ℃ +

B区板上

- {currentLineTemp[12] || 0} ℃ - {currentLineTemp[13] || 0} ℃ - {currentLineTemp[14] || 0} ℃ + + {(+currentLineTemp[12]).toFixed(2) || 0} ℃ + + + {(+currentLineTemp[13]).toFixed(2) || 0} ℃ + + + {(+currentLineTemp[14]).toFixed(2) || 0} ℃ +

C区板上

- {currentLineTemp[18] || 0} ℃ - {currentLineTemp[19] || 0} ℃ - {currentLineTemp[20] || 0} ℃ + + {(+currentLineTemp[18]).toFixed(2) || 0} ℃ + + + {(+currentLineTemp[19]).toFixed(2) || 0} ℃ + + + {(+currentLineTemp[20]).toFixed(2) || 0} ℃ +

A1区板下

- {currentLineTemp[3] || 0} ℃ - {currentLineTemp[4] || 0} ℃ - {currentLineTemp[5] || 0} ℃ + + {(+currentLineTemp[3]).toFixed(2) || 0} ℃ + + + {(+currentLineTemp[4]).toFixed(2) || 0} ℃ + + + {(+currentLineTemp[5]).toFixed(2) || 0} ℃ +

A2区板下

- {currentLineTemp[9] || 0} ℃ - {currentLineTemp[10] || 0} ℃ - {currentLineTemp[11] || 0} ℃ + + {(+currentLineTemp[9]).toFixed(2) || 0} ℃ + + + {(+currentLineTemp[10]).toFixed(2) || 0} ℃ + + + {(+currentLineTemp[11]).toFixed(2) || 0} ℃ +

B区板下

- {currentLineTemp[15] || 0} ℃ - {currentLineTemp[16] || 0} ℃ - {currentLineTemp[17] || 0} ℃ + + {(+currentLineTemp[15]).toFixed(2) || 0} ℃ + + + {(+currentLineTemp[16]).toFixed(2) || 0} ℃ + + + {(+currentLineTemp[17]).toFixed(2) || 0} ℃ +

C区板下

- {currentLineTemp[21] || 0} ℃ - {currentLineTemp[22] || 0} ℃ - {currentLineTemp[23] || 0} ℃ + + {(+currentLineTemp[21]).toFixed(2) || 0} ℃ + + + {(+currentLineTemp[22]).toFixed(2) || 0} ℃ + + + {(+currentLineTemp[23]).toFixed(2) || 0} ℃ +
@@ -146,14 +196,14 @@ function WindFrequence(props) { > - - {currentLineTemp[26] || 0} ℃ + + {(+currentLineTemp[26]).toFixed(2) || 0}℃ - - {currentLineTemp[27] || 0} ℃ + + {(+currentLineTemp[27]).toFixed(2) || 0}℃ - - {currentLineTemp[28] || 0} ℃ + + {(+currentLineTemp[28]).toFixed(2) || 0}℃ @@ -173,27 +223,31 @@ function WindFrequence(props) { > - - {currentLineTemp[29] || 0} ℃ + + {(+currentLineTemp[29]).toFixed(2) || 0}℃ - - {currentLineTemp[30] || 0} ℃ + + {(+currentLineTemp[30]).toFixed(2) || 0}℃ - - {currentLineTemp[31] || 0} ℃ + + {(+currentLineTemp[31]).toFixed(2) || 0}℃

RET1区

- {currentLineTemp[24] || 0} ℃ + + {(+currentLineTemp[24]).toFixed(2) || 0} ℃ +

RET2区

- {currentLineTemp[25] || 0} ℃ + + {(+currentLineTemp[25]).toFixed(2) || 0} ℃ +
diff --git a/src/components/Common/Energy/index.jsx b/src/components/Common/Energy/index.jsx index 3fee3b7..9c06a0f 100644 --- a/src/components/Common/Energy/index.jsx +++ b/src/components/Common/Energy/index.jsx @@ -15,34 +15,76 @@ function EnergyCost(props) { className={`${cls.info__item} flex flex-col justify-center items-center`} style={{ width: "112px", padding: 0 }} > - 余热发电 - + + 余热发电 + + {(+energyInfo?.elecQty1)?.toFixed(2) || 0}kWh
- 水耗量 + + 水耗量 + {(+energyInfo?.waterQty)?.toFixed(2) || 0}Km³
- 天然气I + + 天然气I + - {energyInfo?.ngQty1 || 0} + {energyInfo?.ngQty1 || "0Nm³"}
- 电耗量 + + 电耗量 + {(+energyInfo?.elecQty2)?.toFixed(2) || 0}kWh
- 天然气II + + 天然气II + - {energyInfo?.ngQty2 || 0} + {energyInfo?.ngQty2 || "0Nm³"}
diff --git a/src/components/Common/SmokeHandle/SmokeTrendChart/index.jsx b/src/components/Common/SmokeHandle/SmokeTrendChart/index.jsx index cda4cb0..95b8312 100644 --- a/src/components/Common/SmokeHandle/SmokeTrendChart/index.jsx +++ b/src/components/Common/SmokeHandle/SmokeTrendChart/index.jsx @@ -106,7 +106,7 @@ function getOptions(source, period, trend) { if (trend[source].length === 0) return null; return { color: ["#FFD160", "#12FFF5", "#2760FF"], - grid: { top: 38, right: 12, bottom: 20, left: 48 }, + grid: { top: 40, right: 12, bottom: 20, left: 56 }, xAxis: { type: "category", // data: Array(7) @@ -133,16 +133,16 @@ function getOptions(source, period, trend) { }, }, yAxis: { - name: source == 'O2_float' ? "单位:%" : "单位mg/m³", + name: source == "O2_float" ? "单位:%" : "单位mg/m³", nameTextStyle: { color: "#fff", - fontSize: 10, + fontSize: 16, align: "right", }, type: "value", axisLabel: { color: "#fff", - fontSize: 12, + fontSize: 14, formatter: "{value} %", }, axisLine: { @@ -162,7 +162,7 @@ function getOptions(source, period, trend) { }, series: [ { - data: trend[source].map((item) => item.value), + data: trend[source].map((item) => !(item.value == null || isNaN(+item.value)) ? (+item.value).toFixed(2) : null), type: "line", areaStyle: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ @@ -208,6 +208,11 @@ function getOptions(source, period, trend) { ], tooltip: { trigger: "axis", + axisPointer: { + type: "shadow", + }, + className: "xc-chart-tooltip", + // backgroundColor: '' }, }; } diff --git a/src/components/Common/TodayGood/components/GoodRateChart/index.jsx b/src/components/Common/TodayGood/components/GoodRateChart/index.jsx index a47e65e..900134e 100644 --- a/src/components/Common/TodayGood/components/GoodRateChart/index.jsx +++ b/src/components/Common/TodayGood/components/GoodRateChart/index.jsx @@ -140,7 +140,8 @@ function getOptions(dataList, showMore, dateType) { }; const seriesTeam = [ { - data: list.map((item) => item.day * 100), + name: '白班', + data: list.map((item) => (item.day * 100).toFixed(2)), type: "line", areaStyle: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ @@ -152,7 +153,8 @@ function getOptions(dataList, showMore, dateType) { // smooth: true, }, { - data: list.map((item) => item.night * 100), + name: '夜班', + data: list.map((item) => (item.night * 100).toFixed(2)), type: "line", areaStyle: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ @@ -172,7 +174,8 @@ function getOptions(dataList, showMore, dateType) { tooltip: { trigger: "axis", color: "#fff", - formatter: "{b} {c}%", + // formatter: "{b} {c}%", + formatter: showMore ? "{a0} {c0}%
{a1} {c1}%
{a2} {c2}%" : "{b} {c}%", axisPointer: { type: "shadow", }, @@ -184,6 +187,7 @@ function getOptions(dataList, showMore, dateType) { }, series: [ { + name: '总量', data: list.map((item) => (item.sum * 100).toFixed(2)), type: "line", symbol: 'circle', diff --git a/src/components/Modules/EnergyCostAnalysis/BadGas/index.jsx b/src/components/Modules/EnergyCostAnalysis/BadGas/index.jsx index 4a104e4..e6c9ccf 100644 --- a/src/components/Modules/EnergyCostAnalysis/BadGas/index.jsx +++ b/src/components/Modules/EnergyCostAnalysis/BadGas/index.jsx @@ -93,7 +93,7 @@ function getOptions(period, trend) { ]; return { color: colors, - grid: { top: 38, right: 12, bottom: 20, left: 80 }, + grid: { top: 40, right: 12, bottom: 20, left: 80 }, legend: { show: false, icon: "roundRect", @@ -139,7 +139,7 @@ function getOptions(period, trend) { }, }, yAxis: { - name: "单位m³/h", + name: "单位/Nm³", nameTextStyle: { color: "#fff", fontSize: 16, @@ -164,7 +164,7 @@ function getOptions(period, trend) { }, }, series: { - data: trend[period], + data: trend[period].map(item => item.toFixed(2)), type: "line", symbol: "circle", symbolSize: 6, diff --git a/src/components/Modules/EnergyCostAnalysis/ElectricityCost/index.jsx b/src/components/Modules/EnergyCostAnalysis/ElectricityCost/index.jsx index e24b431..386f15a 100644 --- a/src/components/Modules/EnergyCostAnalysis/ElectricityCost/index.jsx +++ b/src/components/Modules/EnergyCostAnalysis/ElectricityCost/index.jsx @@ -80,7 +80,7 @@ function getOptions(period, trend) { ]; return { color: colors, - grid: { top: 38, right: 12, bottom: 20, left: 48 }, + grid: { top: 40, right: 12, bottom: 20, left: 80 }, legend: { show: false, icon: "roundRect", @@ -93,7 +93,7 @@ function getOptions(period, trend) { height: 8, textStyle: { color: "#DFF1FE", - fontSize: 10, + fontSize: 12, }, }, xAxis: { @@ -111,7 +111,7 @@ function getOptions(period, trend) { // .reverse(), axisLabel: { color: "#fff", - fontSize: 12, + fontSize: 14, }, axisTick: { show: false }, axisLine: { @@ -122,16 +122,16 @@ function getOptions(period, trend) { }, }, yAxis: { - name: "单位m³/h", + name: "单位/kWh", nameTextStyle: { color: "#fff", - fontSize: 10, + fontSize: 16, align: "right", }, type: "value", axisLabel: { color: "#fff", - fontSize: 12, + fontSize: 14, formatter: "{value}", }, axisLine: { diff --git a/src/components/Modules/EnergyCostAnalysis/Energy/index.jsx b/src/components/Modules/EnergyCostAnalysis/Energy/index.jsx index 7c73d1e..6cf5f61 100644 --- a/src/components/Modules/EnergyCostAnalysis/Energy/index.jsx +++ b/src/components/Modules/EnergyCostAnalysis/Energy/index.jsx @@ -25,25 +25,35 @@ function Energy(props) { gridRow: "1 / 3", }} > - 余 热 发 电 - {energyInfo?.elecQty1 || 0}kWh + 余热发电/kWh + + {(+energyInfo?.elecQty1)?.toFixed(2) || 0} +
- 水 耗 量{" "} - {energyInfo?.waterQty || 0}Km³ + 水耗量/Km³ + + {(+energyInfo?.waterQty)?.toFixed(2) || 0} + - 天 然 气 I{" "} - {energyInfo?.ngQty1 || 0} + 天然气I/Nm³ + + {energyInfo?.ngQty1?.replace("Nm³", "") || "0"} + - 电 耗 量{" "} - {energyInfo?.elecQty2 || 0}kWh + 电耗量/kWh + + {(+energyInfo?.elecQty2)?.toFixed(2) || 0} + - 天 然 气 II{" "} - {energyInfo?.ngQty2 || 0} + 天然气II/Nm³ + + {energyInfo?.ngQty2?.replace("Nm³", "") || "0"} + ); diff --git a/src/components/Modules/EnergyCostAnalysis/Energy/index.module.css b/src/components/Modules/EnergyCostAnalysis/Energy/index.module.css index d8fb53e..c0615d3 100644 --- a/src/components/Modules/EnergyCostAnalysis/Energy/index.module.css +++ b/src/components/Modules/EnergyCostAnalysis/Energy/index.module.css @@ -1,7 +1,8 @@ .layout { display: grid; gap: 6px; - grid-template-columns: 133px 158px 292px 292px; + /* grid-template-columns: 133px 158px 292px 292px; */ + grid-template-columns: 133px 210px 266px 266px; /* grid-template-rows: 60px 60px; */ grid-template-rows: 129px 129px; } diff --git a/src/components/Modules/EnergyCostAnalysis/NO/index.jsx b/src/components/Modules/EnergyCostAnalysis/NO/index.jsx index 1705f2d..0fa3a04 100644 --- a/src/components/Modules/EnergyCostAnalysis/NO/index.jsx +++ b/src/components/Modules/EnergyCostAnalysis/NO/index.jsx @@ -85,7 +85,7 @@ function getOptions(source, period, trend) { if (trend[source].length == 0) return null; return { color: ["#FFD160", "#12FFF5", "#2760FF"], - grid: { top: 38, right: 12, bottom: 20, left: 48 }, + grid: { top: 40, right: 12, bottom: 20, left: 56 }, xAxis: { type: "category", // data: Array(7) @@ -112,17 +112,17 @@ function getOptions(source, period, trend) { }, }, yAxis: { - name: "单位m³/h", + name: "单位mg/m³", nameTextStyle: { color: "#fff", - fontSize: 10, + fontSize: 12, align: "right", }, type: "value", axisLabel: { color: "#fff", fontSize: 12, - formatter: "{value} %", + formatter: "{value}", }, axisLine: { show: true, @@ -141,7 +141,7 @@ function getOptions(source, period, trend) { }, series: [ { - data: trend[source].map((item) => item.value), + data: trend[source].map((item) => !(item.value == null || isNaN(+item.value)) ? (+item.value).toFixed(2) : null), type: "line", areaStyle: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ @@ -187,6 +187,11 @@ function getOptions(source, period, trend) { ], tooltip: { trigger: "axis", + axisPointer: { + type: "shadow", + }, + className: "xc-chart-tooltip", + // backgroundColor: '' }, }; } diff --git a/src/components/Modules/EnergyCostAnalysis/NO2/index.jsx b/src/components/Modules/EnergyCostAnalysis/NO2/index.jsx index 4cfe1c6..b4618b7 100644 --- a/src/components/Modules/EnergyCostAnalysis/NO2/index.jsx +++ b/src/components/Modules/EnergyCostAnalysis/NO2/index.jsx @@ -85,7 +85,7 @@ function getOptions(source, period, trend) { if (trend[source].length == 0) return null; return { color: ["#FFD160", "#12FFF5", "#2760FF"], - grid: { top: 38, right: 12, bottom: 20, left: 48 }, + grid: { top: 40, right: 12, bottom: 20, left: 56 }, xAxis: { type: "category", // data: Array(7) @@ -112,17 +112,17 @@ function getOptions(source, period, trend) { }, }, yAxis: { - name: "单位m³/h", + name: "单位mg/m³", nameTextStyle: { color: "#fff", - fontSize: 10, + fontSize: 12, align: "right", }, type: "value", axisLabel: { color: "#fff", fontSize: 12, - formatter: "{value} %", + formatter: "{value}", }, axisLine: { show: true, @@ -141,7 +141,8 @@ function getOptions(source, period, trend) { }, series: [ { - data: trend[source].map((item) => item.value), + // (isNaN((+"f")) ? 0 : (+"f")).toFixed(2) + data: trend[source].map((item) => !(item.value == null || isNaN(+item.value)) ? (+item.value).toFixed(2) : null), type: "line", symbol: "circle", symbolSize: 6, diff --git a/src/components/Modules/EnergyCostAnalysis/NatGas/index.jsx b/src/components/Modules/EnergyCostAnalysis/NatGas/index.jsx index e9a5761..a7ca5ed 100644 --- a/src/components/Modules/EnergyCostAnalysis/NatGas/index.jsx +++ b/src/components/Modules/EnergyCostAnalysis/NatGas/index.jsx @@ -92,7 +92,7 @@ function getOptions(period, trend) { ]; return { color: colors, - grid: { top: 38, right: 12, bottom: 20, left: 80 }, + grid: { top: 40, right: 12, bottom: 20, left: 80 }, legend: { show: false, icon: "roundRect", @@ -138,10 +138,10 @@ function getOptions(period, trend) { }, }, yAxis: { - name: "单位m³/h", + name: "单位/Nm³", nameTextStyle: { color: "#fff", - fontSize: 14, + fontSize: 16, align: "right", }, type: "value", @@ -163,7 +163,7 @@ function getOptions(period, trend) { }, }, series: { - data: trend[period], + data: trend[period].map(item => item.toFixed(3)), type: "line", symbol: "circle", symbolSize: 6, diff --git a/src/components/Modules/EnergyCostAnalysis/O/index.jsx b/src/components/Modules/EnergyCostAnalysis/O/index.jsx index 437e35f..4884bc7 100644 --- a/src/components/Modules/EnergyCostAnalysis/O/index.jsx +++ b/src/components/Modules/EnergyCostAnalysis/O/index.jsx @@ -85,7 +85,7 @@ function getOptions(source, period, trend) { if (trend[source].length == 0) return null; return { color: ["#FFD160", "#12FFF5", "#2760FF"], - grid: { top: 38, right: 12, bottom: 20, left: 48 }, + grid: { top: 40, right: 12, bottom: 20, left: 80 }, xAxis: { type: "category", // data: Array(7) @@ -112,18 +112,20 @@ function getOptions(source, period, trend) { }, }, yAxis: { - name: "单位m³/h", + name: "单位/%", nameTextStyle: { color: "#fff", - fontSize: 10, + fontSize: 16, align: "right", }, type: "value", axisLabel: { color: "#fff", - fontSize: 12, + fontSize: 16, formatter: "{value} %", }, + min: 0, + max: 100, axisLine: { show: true, lineStyle: { @@ -141,7 +143,7 @@ function getOptions(source, period, trend) { }, series: [ { - data: trend[source].map((item) => item.value), + data: trend[source].map((item) => !(item.value == null || isNaN(+item.value)) ? (+item.value).toFixed(2) : null), type: "line", symbol: "circle", symbolSize: 6, diff --git a/src/components/Modules/EnergyCostAnalysis/SO2/index.jsx b/src/components/Modules/EnergyCostAnalysis/SO2/index.jsx index 65929f7..5c4ff06 100644 --- a/src/components/Modules/EnergyCostAnalysis/SO2/index.jsx +++ b/src/components/Modules/EnergyCostAnalysis/SO2/index.jsx @@ -84,7 +84,7 @@ function getOptions(source, period, trend) { if (trend[source].length == 0) return null; return { color: ["#FFD160", "#12FFF5", "#2760FF"], - grid: { top: 38, right: 12, bottom: 20, left: 48 }, + grid: { top: 40, right: 12, bottom: 20, left: 56 }, xAxis: { type: "category", // data: Array(7) @@ -111,17 +111,17 @@ function getOptions(source, period, trend) { }, }, yAxis: { - name: "单位m³/h", + name: "单位mg/m³", nameTextStyle: { color: "#fff", - fontSize: 10, + fontSize: 12, align: "right", }, type: "value", axisLabel: { color: "#fff", fontSize: 12, - formatter: "{value} %", + formatter: "{value}", }, axisLine: { show: true, @@ -140,7 +140,11 @@ function getOptions(source, period, trend) { }, series: [ { - data: trend[source].map((item) => item.value), + data: trend[source].map((item) => + !(item.value == null || isNaN(+item.value)) + ? (+item.value).toFixed(2) + : null + ), type: "line", symbol: "circle", symbolSize: 6, diff --git a/src/components/Modules/EnergyCostAnalysis/SmokeHandle/index.jsx b/src/components/Modules/EnergyCostAnalysis/SmokeHandle/index.jsx index 36c2abb..3b70dba 100644 --- a/src/components/Modules/EnergyCostAnalysis/SmokeHandle/index.jsx +++ b/src/components/Modules/EnergyCostAnalysis/SmokeHandle/index.jsx @@ -19,27 +19,29 @@ function SmokeHandle(props) {
- 氧 气 含 量{" "} - {smokeInfo?.O2_float || 0}% - - - 氮 氧 化 物 浓 度{" "} + 氧气含量 % - {smokeInfo?.NOX_float || 0}mg/m³ + {(+smokeInfo?.O2_float)?.toFixed(2) || 0} - 二 氧 化 硫 浓 度{" "} + 氮氧化物浓度 mg/m³ - {smokeInfo?.SO2_float || 0}mg/m³ + {(+smokeInfo?.NOX_float)?.toFixed(2) || 0} - 颗 粒 物 浓 度{" "} + 二氧化硫浓度 mg/m³ - {smokeInfo?.dust_float || 0}mg/m³ + {(+smokeInfo?.SO2_float)?.toFixed(2) || 0} + + + + 颗粒物浓度 mg/m³ + + {(+smokeInfo?.dust_float)?.toFixed(2) || 0} diff --git a/src/utils/energeChartOption.js b/src/utils/energeChartOption.js index cffeb2e..e60a59d 100644 --- a/src/utils/energeChartOption.js +++ b/src/utils/energeChartOption.js @@ -29,7 +29,7 @@ export function getOptions(period, source, trend, options={}) { "#8cd26d", "#2aa1ff", ], - grid: { top: 32, right: 12, bottom: 56, left: 48 }, + grid: { top: 32, right: 12, bottom: 56, left: 56 }, xAxis: { type: "category", data: