From b16ee86def13b8601317ec7c3b686de991d6d60b Mon Sep 17 00:00:00 2001 From: lb Date: Thu, 11 Jan 2024 16:03:33 +0800 Subject: [PATCH] bugfix 20240111 --- .../Common/CurrentLineSpec/index.jsx | 21 ++++++++-- .../CurrentLineSpec/righttable.module.scss | 2 +- src/components/Common/CurrentTemp/index.jsx | 4 +- src/components/Common/FanInfo/index.jsx | 2 +- .../Common/FanInfoStretch/index.jsx | 2 +- src/components/Common/GasFlow/index.jsx | 19 +++++++++- .../SmokeHandle/SmokeTrendChart/index.jsx | 7 +++- .../Common/TodayFaultTotal/index.jsx | 7 +++- .../Common/TodayFaultType/index.jsx | 3 +- .../components/GoodRateChart/index.jsx | 38 +++++++++++++++---- .../components/TodayTableData/index.jsx | 6 +-- .../Modules/EnergyCostAnalysis/NO/index.jsx | 12 +++++- .../Modules/EnergyCostAnalysis/NO2/index.jsx | 12 +++++- .../Modules/EnergyCostAnalysis/O/index.jsx | 12 +++++- .../Modules/EnergyCostAnalysis/SO2/index.jsx | 6 ++- .../Home/CenterTop/RightTable/index.jsx | 15 +++++++- src/store/features/cuttingSlice.js | 3 ++ 17 files changed, 139 insertions(+), 32 deletions(-) diff --git a/src/components/Common/CurrentLineSpec/index.jsx b/src/components/Common/CurrentLineSpec/index.jsx index b904a5f..12d8bfa 100644 --- a/src/components/Common/CurrentLineSpec/index.jsx +++ b/src/components/Common/CurrentLineSpec/index.jsx @@ -21,7 +21,7 @@ function Chart1(props) { evenRowBGC: "#0b549970", columnWidth: [128], headerHeight: 40, - hoverPause: false, + hoverPause: true, data: replaceStyle(filterData(rawData), 0.7), }; @@ -39,7 +39,20 @@ function Chart1(props) { - + {config.data.length !== 0 && } + {config.data.length === 0 && ( +

+ 暂无数据 +

+ )} ); @@ -124,13 +137,13 @@ function filterData(rawData) { // let header = ["产线名", "原板宽度", "净板宽", "玻璃厚度"]; -function replaceStyle(Arr, opencity) { +function replaceStyle(Arr, opacity) { let temp = []; for (let i = 0; i < Arr.length; i++) { temp[i] = []; for (let j = 0; j < Arr[i].length; j++) { - temp[i][j] = `${ + temp[i][j] = `${ Arr[i][j] } ${j == 0 ? "" : "mm"}`; } diff --git a/src/components/Common/CurrentLineSpec/righttable.module.scss b/src/components/Common/CurrentLineSpec/righttable.module.scss index 299a80e..550fa3b 100644 --- a/src/components/Common/CurrentLineSpec/righttable.module.scss +++ b/src/components/Common/CurrentLineSpec/righttable.module.scss @@ -5,7 +5,7 @@ flex-direction: column; justify-content: flex-start; - background-color: rgba(4, 44, 76, 0.2); + // background-color: rgba(4, 44, 76, 0.2); .CenterChart1itemTXT { width: 100%; height: 10%; diff --git a/src/components/Common/CurrentTemp/index.jsx b/src/components/Common/CurrentTemp/index.jsx index 9553453..a25d0da 100644 --- a/src/components/Common/CurrentTemp/index.jsx +++ b/src/components/Common/CurrentTemp/index.jsx @@ -185,7 +185,7 @@ function WindFrequence(props) {
- + {options && } + {!options && ( +

+ 暂无数据 +

+ )}
); }; @@ -79,6 +92,13 @@ export default GoodRateChart; function getOptions(dataList, showMore, dateType) { const list = [...dataList].sort((a, b) => a.dataTime - b.dataTime); + + console.log( + "list ", + list.filter((item) => item.sum) + ); + if (list.length === 0 || list.filter((item) => item.sum).length == 0) + return null; // data: Array(7) // .fill(1) // .map((_, index) => { @@ -140,7 +160,7 @@ function getOptions(dataList, showMore, dateType) { }; const seriesTeam = [ { - name: '白班', + name: "白班", data: list.map((item) => (item.day * 100).toFixed(2)), type: "line", areaStyle: { @@ -153,7 +173,7 @@ function getOptions(dataList, showMore, dateType) { // smooth: true, }, { - name: '夜班', + name: "夜班", data: list.map((item) => (item.night * 100).toFixed(2)), type: "line", areaStyle: { @@ -175,7 +195,9 @@ function getOptions(dataList, showMore, dateType) { trigger: "axis", color: "#fff", // formatter: "{b} {c}%", - formatter: showMore ? "{a0} {c0}%
{a1} {c1}%
{a2} {c2}%" : "{b} {c}%", + formatter: showMore + ? "{a0} {c0}%
{a1} {c1}%
{a2} {c2}%" + : "{b} {c}%", axisPointer: { type: "shadow", }, @@ -187,10 +209,12 @@ function getOptions(dataList, showMore, dateType) { }, series: [ { - name: '总量', - data: list.map((item) => (item.sum * 100).toFixed(2)), + name: "总量", + data: list.map((item) => + item.sum != null ? (item.sum * 100).toFixed(2) : "-- " + ), type: "line", - symbol: 'circle', + symbol: "circle", symbolSize: 6, areaStyle: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ diff --git a/src/components/Common/TodayGood/components/TodayTableData/index.jsx b/src/components/Common/TodayGood/components/TodayTableData/index.jsx index 3b18898..8997a73 100644 --- a/src/components/Common/TodayGood/components/TodayTableData/index.jsx +++ b/src/components/Common/TodayGood/components/TodayTableData/index.jsx @@ -4,7 +4,7 @@ import { ScrollBoard } from "@jiaminghi/data-view-react"; import { useSelector } from "react-redux"; function getRate(decimal) { - return (decimal.toFixed(2) * 100).toFixed(2) + "%"; + return decimal != null ? (decimal.toFixed(2) * 100).toFixed(2) + "%" : undefined; } const TodayTableData = (props) => { @@ -57,14 +57,14 @@ const TodayTableData = (props) => { }; return (
- {config.data.lenght != 0 && ( + {config.data.length != 0 && ( )} - {config.data.lenght == 0 && ( + {config.data.length == 0 && (

item.value).length == 0 + ) + return null; return { color: ["#FFD160", "#12FFF5", "#2760FF"], grid: { top: 40, right: 12, bottom: 20, left: 64 }, @@ -141,7 +145,11 @@ function getOptions(source, period, trend) { }, series: [ { - data: trend[source].map((item) => !(item.value == null || isNaN(+item.value)) ? (+item.value).toFixed(2) : null), + 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, [ diff --git a/src/components/Modules/EnergyCostAnalysis/NO2/index.jsx b/src/components/Modules/EnergyCostAnalysis/NO2/index.jsx index 3725446..3326eee 100644 --- a/src/components/Modules/EnergyCostAnalysis/NO2/index.jsx +++ b/src/components/Modules/EnergyCostAnalysis/NO2/index.jsx @@ -82,7 +82,11 @@ function Dust(props) { export default Dust; function getOptions(source, period, trend) { - if (trend[source].length == 0) return null; + if ( + trend[source].length == 0 || + trend[source].filter((item) => item.value).length == 0 + ) + return null; return { color: ["#FFD160", "#12FFF5", "#2760FF"], grid: { top: 40, right: 12, bottom: 20, left: 64 }, @@ -142,7 +146,11 @@ function getOptions(source, period, trend) { series: [ { // (isNaN((+"f")) ? 0 : (+"f")).toFixed(2) - data: trend[source].map((item) => !(item.value == null || isNaN(+item.value)) ? (+item.value).toFixed(2) : null), + 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/O/index.jsx b/src/components/Modules/EnergyCostAnalysis/O/index.jsx index 4884bc7..3a48ca4 100644 --- a/src/components/Modules/EnergyCostAnalysis/O/index.jsx +++ b/src/components/Modules/EnergyCostAnalysis/O/index.jsx @@ -82,7 +82,11 @@ function Oxygen(props) { export default Oxygen; function getOptions(source, period, trend) { - if (trend[source].length == 0) return null; + if ( + trend[source].length == 0 || + trend[source].filter((item) => item.value).length == 0 + ) + return null; return { color: ["#FFD160", "#12FFF5", "#2760FF"], grid: { top: 40, right: 12, bottom: 20, left: 80 }, @@ -143,7 +147,11 @@ function getOptions(source, period, trend) { }, series: [ { - data: trend[source].map((item) => !(item.value == null || isNaN(+item.value)) ? (+item.value).toFixed(2) : null), + 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 0345a23..37881b7 100644 --- a/src/components/Modules/EnergyCostAnalysis/SO2/index.jsx +++ b/src/components/Modules/EnergyCostAnalysis/SO2/index.jsx @@ -81,7 +81,11 @@ function SO2(props) { export default SO2; function getOptions(source, period, trend) { - if (trend[source].length == 0) return null; + if ( + trend[source].length == 0 || + trend[source].filter((item) => item.value).length == 0 + ) + return null; return { color: ["#FFD160", "#12FFF5", "#2760FF"], grid: { top: 40, right: 12, bottom: 20, left: 64 }, diff --git a/src/components/Modules/Home/CenterTop/RightTable/index.jsx b/src/components/Modules/Home/CenterTop/RightTable/index.jsx index ef81040..c15d1d4 100644 --- a/src/components/Modules/Home/CenterTop/RightTable/index.jsx +++ b/src/components/Modules/Home/CenterTop/RightTable/index.jsx @@ -28,7 +28,20 @@ function CurrentSpec(props) {

当前产线生产规格

- + {config.data.length !== 0 && } + {config.data.length === 0 && ( +

+ 暂无数据 +

+ )}
); diff --git a/src/store/features/cuttingSlice.js b/src/store/features/cuttingSlice.js index 8ef19b7..184a669 100644 --- a/src/store/features/cuttingSlice.js +++ b/src/store/features/cuttingSlice.js @@ -3,6 +3,7 @@ import { createSlice } from "@reduxjs/toolkit"; export const initialState = { table: [], productData: [], + productHourData: [], chart: { year: [], week: [], @@ -17,6 +18,8 @@ const cuttingSlice = createSlice({ reducers: { setCuttingTable: (state, action) => { if ("data" in action.payload) state.table = action.payload.data; + if ("productHourData" in action.payload) + state.productHourData = action.payload.productHourData; if ("productData" in action.payload) state.productData = action.payload.productData; },