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

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