merge bugfix
This commit is contained in:
@@ -109,6 +109,7 @@ function WindFrequence(props) {
|
||||
},
|
||||
};
|
||||
} else {
|
||||
console.log('runstate changeD!......')
|
||||
dataList =
|
||||
runState != null
|
||||
? Object.keys(runState).map((fan) => ({
|
||||
|
||||
@@ -57,7 +57,7 @@ function WindFrequence(props) {
|
||||
currentTempList[1 + lines.indexOf(dataSource) + "#"]) ||
|
||||
[]
|
||||
);
|
||||
}, [dataSource]);
|
||||
}, [dataSource, currentTempList]);
|
||||
|
||||
return (
|
||||
<GraphBase
|
||||
|
||||
@@ -44,6 +44,7 @@ function GraphBase(props) {
|
||||
selectWidth,
|
||||
legend,
|
||||
} = props;
|
||||
const descSmall = props.descSmall || false;
|
||||
const iconSrc = useIcon(icon);
|
||||
const colors = useMemo(() => ["#ffd160", "#2760ff", "#15e8f5"], []);
|
||||
const [showChart, setShowChart] = useState(true);
|
||||
@@ -72,9 +73,9 @@ function GraphBase(props) {
|
||||
<span
|
||||
style={{
|
||||
color: "#fff",
|
||||
fontSize: "14px",
|
||||
fontSize: "calc(14px * var(--scale))",
|
||||
lineHeight: 1,
|
||||
paddingLeft: "12px",
|
||||
paddingLeft: "calc(12px * var(--scale))",
|
||||
}}
|
||||
>
|
||||
- 无 -
|
||||
@@ -105,7 +106,7 @@ function GraphBase(props) {
|
||||
<div className={cls.graphBaseTitle}>
|
||||
<img src={iconSrc} alt="#" />
|
||||
<h2>{title}</h2>
|
||||
{desc && <div className={cls.graphBaseDesc}>{desc}</div>}
|
||||
{desc && <div className={`${cls.graphBaseDesc} ${descSmall ? cls.graphBaseDescSmall : ''}`}>{desc}</div>}
|
||||
</div>
|
||||
<div className={cls.graphBaseContent}>
|
||||
{switchOptions && (
|
||||
|
||||
@@ -93,6 +93,11 @@
|
||||
color: #76fff9;
|
||||
}
|
||||
|
||||
.graphBaseDescSmall {
|
||||
font-size: 16px;
|
||||
color: #76fff9;
|
||||
}
|
||||
|
||||
.graphBaseSwitch {
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
.xc-date-selector-menu .ant-select-item-option-content {
|
||||
text-align: center;
|
||||
font-size: calc(14px * var(--scale));
|
||||
}
|
||||
|
||||
.xc-date-selector-menu .ant-select-item-option-selected {
|
||||
@@ -20,10 +21,16 @@
|
||||
background-color: #02457E !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.xc-date-selector-menu .ant-select-item-option {
|
||||
/* padding: 5px 8px; */
|
||||
padding: .3em .35em;
|
||||
min-height: unset;
|
||||
}
|
||||
/*
|
||||
.ant-select-selector::after {
|
||||
content: '\25BC' !important;
|
||||
visibility: visible !important;
|
||||
visibility: visible !important; L
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
right: 22px;
|
||||
|
||||
@@ -33,9 +33,9 @@ const SmokeTrendChart = (props) => {
|
||||
switch (period) {
|
||||
case "day":
|
||||
setDesc(
|
||||
dayjs().subtract(1, "day").format("YYYY.MM.DD") +
|
||||
dayjs().format("YYYY.MM.DD") +
|
||||
" 7点 - " +
|
||||
dayjs().format("YYYY.MM.DD") +
|
||||
dayjs().add(1, "day").format("YYYY.MM.DD") +
|
||||
" 7点"
|
||||
);
|
||||
break;
|
||||
|
||||
@@ -33,10 +33,9 @@ function FaultTotal(props) {
|
||||
|
||||
// time hint
|
||||
let timeDesc = "";
|
||||
const now = new Date();
|
||||
switch (currentSelect) {
|
||||
case "日":
|
||||
timeDesc = dayjs().subtract(1, 'day').format('YYYY.MM.DD') + " 7点 - " + dayjs().format('YYYY.MM.DD') + " 7点";
|
||||
timeDesc = dayjs().format('YYYY.MM.DD') + " 7点 - " + dayjs().add(1, 'day').format('YYYY.MM.DD') + " 7点";
|
||||
break;
|
||||
case "周":
|
||||
timeDesc = dayjs().subtract(7, 'day').format('YYYY.MM.DD') + " - " + dayjs().subtract(1, 'day').format('YYYY.MM.DD') ;
|
||||
@@ -52,7 +51,6 @@ function FaultTotal(props) {
|
||||
<GraphBase
|
||||
icon="chart"
|
||||
title="产线缺陷统计"
|
||||
dateOptions={["日", "周", "月", "年"]}
|
||||
defaultSelect={currentSelect}
|
||||
onDateChange={handleDateChange}
|
||||
size={bgSize}
|
||||
|
||||
@@ -4,6 +4,7 @@ import ReactECharts from "echarts-for-react";
|
||||
import { useSelector } from "react-redux";
|
||||
import { useEffect, useState } from "react";
|
||||
import * as echarts from "echarts";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
function FaultType(props) {
|
||||
const [init, setInit] = useState(true);
|
||||
@@ -16,6 +17,11 @@ function FaultType(props) {
|
||||
: [];
|
||||
const lines = currentStatistic.map((item) => item.name);
|
||||
const CHART_TYPE = "line"; // "pie" | "line";
|
||||
const timestr =
|
||||
dayjs().format("YYYY.MM.DD") +
|
||||
" 7点 - " +
|
||||
dayjs().add(1, "d").format("YYYY.MM.DD") +
|
||||
" 7点";
|
||||
|
||||
useEffect(() => {
|
||||
if (init == false) return;
|
||||
@@ -46,6 +52,8 @@ function FaultType(props) {
|
||||
<GraphBase
|
||||
icon="default"
|
||||
title="产线当日缺陷分类"
|
||||
desc={timestr}
|
||||
descSmall={true}
|
||||
dateOptions={[...lines]}
|
||||
defaultSelect={currentLine}
|
||||
onDateChange={handleLineChange}
|
||||
@@ -145,7 +153,7 @@ function getOptions(data, chart_type) {
|
||||
axisPointer: {
|
||||
type: "shadow",
|
||||
},
|
||||
symbol: 'rect',
|
||||
symbol: "rect",
|
||||
className: "xc-chart-tooltip",
|
||||
// backgroundColor: ''
|
||||
},
|
||||
@@ -209,7 +217,9 @@ function getOptions(data, chart_type) {
|
||||
color: "#fffc",
|
||||
},
|
||||
data: (dataList || []).map((item) =>
|
||||
item.value == null || isNaN(+item.value) ? null : (+item.value).toFixed(0)
|
||||
item.value == null || isNaN(+item.value)
|
||||
? null
|
||||
: (+item.value).toFixed(0)
|
||||
),
|
||||
},
|
||||
],
|
||||
|
||||
@@ -29,9 +29,9 @@ const GoodRateChart = (props) => {
|
||||
}
|
||||
|
||||
const [timestr, setTimestr] = useState(
|
||||
dayjs().subtract(1, "day").format("YYYY.MM.DD") +
|
||||
dayjs().format("YYYY.MM.DD") +
|
||||
" 7点 - " +
|
||||
dayjs().format("YYYY.MM.DD") +
|
||||
dayjs().add(1, "day").format("YYYY.MM.DD") +
|
||||
" 7点"
|
||||
);
|
||||
function handleDateChange(value) {
|
||||
@@ -40,9 +40,9 @@ const GoodRateChart = (props) => {
|
||||
switch (value) {
|
||||
case "日":
|
||||
setTimestr(
|
||||
dayjs().subtract(1, "day").format("YYYY.MM.DD") +
|
||||
dayjs().format("YYYY.MM.DD") +
|
||||
" 7点 - " +
|
||||
dayjs().format("YYYY.MM.DD") +
|
||||
dayjs().add(1, "day").format("YYYY.MM.DD") +
|
||||
" 7点"
|
||||
);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user