From a32e6fb5912d35e702eeb7c7189e61a9e1b35c20 Mon Sep 17 00:00:00 2001 From: lb Date: Tue, 2 Jan 2024 14:33:21 +0800 Subject: [PATCH] update --- .../Common/Energy/EnergyCostChart/index.jsx | 18 +++++++- src/components/Common/Energy/index.jsx | 23 +++++----- .../Common/Energy/index.module.scss | 7 ++-- src/components/Common/FanInfo/index.jsx | 16 ++++++- .../SmokeHandle/SmokeTrendChart/index.jsx | 16 ++++++- .../Common/TodayFaultType/index.jsx | 4 +- .../components/TodayTableData/index.jsx | 21 +++++++++- .../EnergyCostAnalysis/BadGas/index.jsx | 28 ++++++++++--- .../ElectricityCost/index.jsx | 18 +++++++- .../Modules/EnergyCostAnalysis/NO/index.jsx | 42 +++++++++++++------ .../Modules/EnergyCostAnalysis/NO2/index.jsx | 42 +++++++++++++------ .../EnergyCostAnalysis/NatGas/index.jsx | 28 ++++++++++--- .../Modules/EnergyCostAnalysis/O/index.jsx | 42 +++++++++++++------ .../Modules/EnergyCostAnalysis/SO2/index.jsx | 42 +++++++++++++------ 14 files changed, 261 insertions(+), 86 deletions(-) diff --git a/src/components/Common/Energy/EnergyCostChart/index.jsx b/src/components/Common/Energy/EnergyCostChart/index.jsx index 66aa567..31397fc 100644 --- a/src/components/Common/Energy/EnergyCostChart/index.jsx +++ b/src/components/Common/Energy/EnergyCostChart/index.jsx @@ -64,7 +64,22 @@ const EnergyCostChart = (props) => {
- + {options && ( + + )} + {!options && ( +

+ 暂无数据 +

+ )}
); @@ -73,6 +88,7 @@ const EnergyCostChart = (props) => { export default EnergyCostChart; function getOptions(period, source, trend) { + if (trend[period].length == 0) return null; return { color: ["#FFD160", "#12FFF5", "#2760FF"], grid: { top: 32, right: 12, bottom: 56, left: 48 }, diff --git a/src/components/Common/Energy/index.jsx b/src/components/Common/Energy/index.jsx index 7a1576f..d9a63d8 100644 --- a/src/components/Common/Energy/index.jsx +++ b/src/components/Common/Energy/index.jsx @@ -13,32 +13,35 @@ function EnergyCost(props) {
- 余 热 发 电 - {energyInfo?.elecQty1 || 0}kWh + 余热发电 + + {energyInfo?.elecQty1 || 0}kWh +
- 水耗量: - + 水耗量 + {energyInfo?.waterQty || 0}Km³
- 天然气I: - + 天然气I + {energyInfo?.ngQty1 || 0}
- 电耗量: - + 电耗量 + {energyInfo?.elecQty2 || 0}kWh
- 天然气II: - + 天然气II + {energyInfo?.ngQty2 || 0}
diff --git a/src/components/Common/Energy/index.module.scss b/src/components/Common/Energy/index.module.scss index 0dcc4d4..70b3580 100644 --- a/src/components/Common/Energy/index.module.scss +++ b/src/components/Common/Energy/index.module.scss @@ -18,12 +18,13 @@ border-radius: 2px; color: hsl(0, 0%, 100%, 0.9); box-shadow: inset 0 0 17px 0px hsla(0, 0%, 100%, 0.15); - width: 190px; + // min-width: 190px; // height: 43px; font-size: 14px; - letter-spacing: 1.43px; + // letter-spacing: 1.43px; line-height: 40px; - text-align: center; + padding-left: 12px; + // text-align: center; user-select: none; } diff --git a/src/components/Common/FanInfo/index.jsx b/src/components/Common/FanInfo/index.jsx index 970fc6f..b1d7be3 100644 --- a/src/components/Common/FanInfo/index.jsx +++ b/src/components/Common/FanInfo/index.jsx @@ -33,6 +33,7 @@ function FanInfo(props) { fanInfo[key] == "运行" ? 1 : fanInfo[key] == "故障" ? 0 : 2, ]; }); + const dataRight = [...data.slice(rowNum), ...data.slice(0, rowNum)]; let config = { headerBGC: "rgba(4, 44, 76, 0.3)", @@ -43,6 +44,7 @@ function FanInfo(props) { ], oddRowBGC: "#042444", evenRowBGC: "#042c4c", + // columnWidth: data.length > 12 ? [50, 136] : [88, 256], columnWidth: [50, 136], rowNum, hoverPause: false, @@ -59,7 +61,9 @@ function FanInfo(props) { className="flex" style={{ display: "flex", + flex: 1, gap: "20px", + // gap: data.length > 12 ? "20px" : 0, height: "100%", position: "relative", }} @@ -67,9 +71,15 @@ function FanInfo(props) {
12 ? "280px" : "100%", + height: "100%", + }} />
+ {/* {data.length > 12 && ( + <> */}
+ {/* + )} */}
); diff --git a/src/components/Common/SmokeHandle/SmokeTrendChart/index.jsx b/src/components/Common/SmokeHandle/SmokeTrendChart/index.jsx index b44d741..5377d14 100644 --- a/src/components/Common/SmokeHandle/SmokeTrendChart/index.jsx +++ b/src/components/Common/SmokeHandle/SmokeTrendChart/index.jsx @@ -82,7 +82,20 @@ const SmokeTrendChart = (props) => {
- + {options && } + {!options && ( +

+ 暂无数据 +

+ )} ); }; @@ -90,6 +103,7 @@ const SmokeTrendChart = (props) => { export default SmokeTrendChart; 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 }, diff --git a/src/components/Common/TodayFaultType/index.jsx b/src/components/Common/TodayFaultType/index.jsx index a68f610..bf6bc4a 100644 --- a/src/components/Common/TodayFaultType/index.jsx +++ b/src/components/Common/TodayFaultType/index.jsx @@ -153,8 +153,8 @@ function getOptions(data, chart_type) { data: (dataList || []).map((item) => item.category), axisLabel: { color: "#fff", - fontSize: 12, - rotate: 24, + fontSize: 10, + rotate: 20, }, axisTick: { show: false }, axisLine: { diff --git a/src/components/Common/TodayGood/components/TodayTableData/index.jsx b/src/components/Common/TodayGood/components/TodayTableData/index.jsx index 6ea125e..3b18898 100644 --- a/src/components/Common/TodayGood/components/TodayTableData/index.jsx +++ b/src/components/Common/TodayGood/components/TodayTableData/index.jsx @@ -57,7 +57,26 @@ const TodayTableData = (props) => { }; return (
- + {config.data.lenght != 0 && ( + + )} + {config.data.lenght == 0 && ( +

+ 暂无数据 +

+ )}
); }; diff --git a/src/components/Modules/EnergyCostAnalysis/BadGas/index.jsx b/src/components/Modules/EnergyCostAnalysis/BadGas/index.jsx index 60b54b3..d08a121 100644 --- a/src/components/Modules/EnergyCostAnalysis/BadGas/index.jsx +++ b/src/components/Modules/EnergyCostAnalysis/BadGas/index.jsx @@ -37,12 +37,27 @@ function Gas(props) { size={["long", "short"]} > {/* real echarts here */} - + {options && ( + + )} + {!options && ( +

+ 暂无数据 +

+ )} {/* real table data here */} ); @@ -52,6 +67,7 @@ export default Gas; function getOptions(period, trend) { console.log("getOptions", period, trend); + if (trend[period].length === 0) return null; // export default function getOptions(seriesData, name) { const colors = [ "#FFD160", diff --git a/src/components/Modules/EnergyCostAnalysis/ElectricityCost/index.jsx b/src/components/Modules/EnergyCostAnalysis/ElectricityCost/index.jsx index 1f03671..867ca58 100644 --- a/src/components/Modules/EnergyCostAnalysis/ElectricityCost/index.jsx +++ b/src/components/Modules/EnergyCostAnalysis/ElectricityCost/index.jsx @@ -36,12 +36,25 @@ function ElecCost(props) { size={["long", "short"]} > {/* real echarts here */} - + />} + {!options && ( +

+ 暂无数据 +

+ )} {/* real table data here */} ); @@ -51,6 +64,7 @@ export default ElecCost; function getOptions(period, trend) { console.log("getOptions", period, trend); + if (trend[period].length === 0) return null; // export default function getOptions(seriesData, name) { const colors = [ "#FFD160", diff --git a/src/components/Modules/EnergyCostAnalysis/NO/index.jsx b/src/components/Modules/EnergyCostAnalysis/NO/index.jsx index 3c011fd..96eaa52 100644 --- a/src/components/Modules/EnergyCostAnalysis/NO/index.jsx +++ b/src/components/Modules/EnergyCostAnalysis/NO/index.jsx @@ -46,19 +46,34 @@ function NO(props) { size={["long", "middle"]} > {/* real echarts here */} - + {options && ( + + )} + {!options && ( +

+ 暂无数据 +

+ )} {/* real table data here */} ); @@ -67,6 +82,7 @@ function NO(props) { export default NO; 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 }, diff --git a/src/components/Modules/EnergyCostAnalysis/NO2/index.jsx b/src/components/Modules/EnergyCostAnalysis/NO2/index.jsx index 78a3f51..8ce9ff7 100644 --- a/src/components/Modules/EnergyCostAnalysis/NO2/index.jsx +++ b/src/components/Modules/EnergyCostAnalysis/NO2/index.jsx @@ -46,19 +46,34 @@ function Dust(props) { size={["long", "middle"]} > {/* real echarts here */} - + {options && ( + + )} + {!options && ( +

+ 暂无数据 +

+ )} {/* real table data here */} ); @@ -67,6 +82,7 @@ function Dust(props) { export default Dust; 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 }, diff --git a/src/components/Modules/EnergyCostAnalysis/NatGas/index.jsx b/src/components/Modules/EnergyCostAnalysis/NatGas/index.jsx index b8ce9a9..f180a35 100644 --- a/src/components/Modules/EnergyCostAnalysis/NatGas/index.jsx +++ b/src/components/Modules/EnergyCostAnalysis/NatGas/index.jsx @@ -37,12 +37,27 @@ function NatGas(props) { size={["long", "short"]} > {/* real echarts here */} - + {options && ( + + )} + {!options && ( +

+ 暂无数据 +

+ )} {/* real table data here */} ); @@ -52,6 +67,7 @@ export default NatGas; function getOptions(period, trend) { console.log("getOptions", period, trend); + if (trend[period].length === 0) return null; // export default function getOptions(seriesData, name) { const colors = [ "#FFD160", diff --git a/src/components/Modules/EnergyCostAnalysis/O/index.jsx b/src/components/Modules/EnergyCostAnalysis/O/index.jsx index 299e8e4..11d320d 100644 --- a/src/components/Modules/EnergyCostAnalysis/O/index.jsx +++ b/src/components/Modules/EnergyCostAnalysis/O/index.jsx @@ -46,19 +46,34 @@ function Oxygen(props) { size={["long", "middle"]} > {/* real echarts here */} - + {options && ( + + )} + {!options && ( +

+ 暂无数据 +

+ )} {/* real table data here */} ); @@ -67,6 +82,7 @@ function Oxygen(props) { export default Oxygen; 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 }, diff --git a/src/components/Modules/EnergyCostAnalysis/SO2/index.jsx b/src/components/Modules/EnergyCostAnalysis/SO2/index.jsx index 2504eef..d10edbc 100644 --- a/src/components/Modules/EnergyCostAnalysis/SO2/index.jsx +++ b/src/components/Modules/EnergyCostAnalysis/SO2/index.jsx @@ -45,19 +45,34 @@ function SO2(props) { size={["long", "middle"]} > {/* real echarts here */} - + {options && ( + + )} + {!options && ( +

+ 暂无数据 +

+ )} {/* real table data here */} ); @@ -66,6 +81,7 @@ function SO2(props) { export default SO2; 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 },