bugfix 20240111

This commit is contained in:
lb 2024-01-11 16:03:33 +08:00
parent c8d392ce51
commit b16ee86def
17 changed files with 139 additions and 32 deletions

View File

@ -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) {
<span className={cls.CenterFormitemDetailBorderLine1}></span>
<span className={cls.CenterFormitemDetailBorderLine2}></span>
<span className={cls.CenterFormitemDetailBorderLine3}></span>
<ScrollBoard config={config} style={{}} />
{config.data.length !== 0 && <ScrollBoard config={config} style={{}} />}
{config.data.length === 0 && (
<p
style={{
color: "#cccf",
fontSize: "24px",
userSelect: "none",
textAlign: "center",
paddingTop: "72px",
}}
>
暂无数据
</p>
)}
</div>
</BottomBarItem>
);
@ -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] = `<span style="color:rgba(255, 255, 255,${opencity})">${
temp[i][j] = `<span style="color:rgba(255, 255, 255,${opacity})">${
Arr[i][j]
} ${j == 0 ? "" : "mm"}<span/>`;
}

View File

@ -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%;

View File

@ -185,7 +185,7 @@ function WindFrequence(props) {
<div className={cls.areaPureContent}>
<div
className="hint"
style={{ position: "absolute", top: "0", right: "0" }}
style={{ position: "absolute", top: "3px", right: "3px" }}
>
<Tooltip title="红外温度">
<Button
@ -212,7 +212,7 @@ function WindFrequence(props) {
<div className={cls.areaPureContent}>
<div
className="hint"
style={{ position: "absolute", top: "0", right: "0" }}
style={{ position: "absolute", top: "3px", right: "3px" }}
>
<Tooltip title="压延机冷却水温度 | 过度辊台冷却水温度 | 唇砖冷却水温度">
<Button

View File

@ -47,7 +47,7 @@ function FanInfo(props) {
// columnWidth: data.length > 12 ? [50, 136] : [88, 256],
columnWidth: [50, 136],
rowNum,
hoverPause: false,
hoverPause: true,
data: attachStyle(data),
};

View File

@ -68,7 +68,7 @@ function FanInfo(props) {
// columnWidth: data.length > 12 ? [50, 136] : [88, 256],
columnWidth: [50, 136],
rowNum: 6,
hoverPause: false,
hoverPause: true,
data: [],
};

View File

@ -87,7 +87,22 @@ function getOptions(showChart, hisState, runState) {
options = {
color: colors,
grid: { top: 32, right: 12, bottom: 20, left: 48 },
grid: { top: 36, right: 12, bottom: 20, left: 48 },
legend: {
show: true,
icon: "roundRect",
top: 10,
right: 10,
padding: 0,
itemWidth: 8,
itemHeight: 8,
itemGap: 3,
height: 8,
textStyle: {
color: "#DFF1FE",
fontSize: 10,
},
},
xAxis: {
type: "category",
data: Array(7)
@ -140,7 +155,7 @@ function getOptions(showChart, hisState, runState) {
// max: 100,
},
series: seriesData.map((v, i) => ({
name: i + 1 + "#助燃风流量",
name: i + 1 + "#流量",
data: v,
type: "line",
symbol: "circle",

View File

@ -103,7 +103,12 @@ const SmokeTrendChart = (props) => {
export default SmokeTrendChart;
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: {

View File

@ -120,7 +120,12 @@ function preHandleStatisticData(data, legend) {
function getOptions(series, isra, currentStatistic) {
return {
color: ["#2760FF", "#8167F6", "#5B9BFF", "#99D66C", "#FFD160", "#FF8A40"],
grid: { top: 80, right: 12, bottom: 20, left: 48 },
grid: {
top: (isra.checkType || []).length <= 10 ? 80 : 100,
right: 12,
bottom: 20,
left: 48,
},
legend: {
top: 10,
left: 60,

View File

@ -145,6 +145,7 @@ function getOptions(data, chart_type) {
axisPointer: {
type: "shadow",
},
symbol: 'rect',
className: "xc-chart-tooltip",
// backgroundColor: ''
},
@ -208,7 +209,7 @@ function getOptions(data, chart_type) {
color: "#fffc",
},
data: (dataList || []).map((item) =>
item.value == null || isNaN(+item.value) ? null : (+item.value).toFixed(2)
item.value == null || isNaN(+item.value) ? null : (+item.value).toFixed(0)
),
},
],

View File

@ -70,7 +70,20 @@ const GoodRateChart = (props) => {
</Radio.Button>
</Radio.Group>
</div>
<ReactECharts key={updateKey} option={options} />
{options && <ReactECharts key={updateKey} option={options} />}
{!options && (
<p
style={{
paddingTop: "88px",
color: "#fffc",
textAlign: "center",
fontSize: "24px",
userSelect: "none",
}}
>
暂无数据
</p>
)}
</div>
);
};
@ -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}%<br />{a1} {c1}%<br />{a2} {c2}%" : "{b} {c}%",
formatter: showMore
? "{a0} {c0}%<br />{a1} {c1}%<br />{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, [

View File

@ -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 (
<div className={cls.todayTableData}>
{config.data.lenght != 0 && (
{config.data.length != 0 && (
<ScrollBoard
className={cls.paddingCeil}
config={config}
style={{ width: "100%", color: "#fffc" }}
/>
)}
{config.data.lenght == 0 && (
{config.data.length == 0 && (
<p
style={{
color: "#cccf",

View File

@ -82,7 +82,11 @@ function NO(props) {
export default NO;
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 },
@ -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, [

View File

@ -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,

View File

@ -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,

View File

@ -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 },

View File

@ -28,7 +28,20 @@ function CurrentSpec(props) {
<div className={cls.CenterChart1itemDetailBorder} style={{ opacity: 0.75 }}>
<h2 className={cls.CenterChart1itemTXT}>当前产线生产规格</h2>
<div className={cls.TableContainer}>
<ScrollBoard config={config} />
{config.data.length !== 0 && <ScrollBoard config={config} style={{}} />}
{config.data.length === 0 && (
<p
style={{
color: "#cccf",
fontSize: "24px",
userSelect: "none",
textAlign: "center",
paddingTop: "36px",
}}
>
暂无数据
</p>
)}
</div>
</div>
);

View File

@ -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;
},