bugfix4.4
This commit is contained in:
@@ -86,9 +86,7 @@ function ElecCost(props) {
|
||||
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",
|
||||
"#12FFF5",
|
||||
|
||||
@@ -29,20 +29,10 @@ function NO(props) {
|
||||
|
||||
const options = getOptions("NOX_float", period, currentTrend);
|
||||
|
||||
function handleSwitch(v) {
|
||||
// console.log('switched ', v);
|
||||
}
|
||||
|
||||
function handleSwitch(v) {}
|
||||
|
||||
function handleDateChange(value) {
|
||||
setPeriod(
|
||||
{
|
||||
日: "day",
|
||||
周: "week",
|
||||
月: "month",
|
||||
年: "year",
|
||||
}[value]
|
||||
);
|
||||
setPeriod(value);
|
||||
setTimestr(
|
||||
{
|
||||
日:
|
||||
@@ -76,23 +66,13 @@ function NO(props) {
|
||||
defaultSelect={period}
|
||||
onSwitch={handleSwitch}
|
||||
dateOptions={["日", "周", "月", "年"]}
|
||||
// legend={["总量", "白班", "夜班"]}
|
||||
onDateChange={handleDateChange}
|
||||
size={["long", "middle"]}
|
||||
>
|
||||
{/* real echarts here */}
|
||||
{options && (
|
||||
<ReactECharts
|
||||
key={Math.random()}
|
||||
option={options}
|
||||
// option={getOptions(
|
||||
// [
|
||||
// [148, 110, 140, 122, 84, 153, 89],
|
||||
// [88, 79, 75, 73, 33, 54, 31],
|
||||
// [60, 31, 65, 49, 51, 99, 58],
|
||||
// ],
|
||||
// "氧气"
|
||||
// )}
|
||||
style={{ height: "100%" }}
|
||||
/>
|
||||
)}
|
||||
@@ -109,7 +89,6 @@ function NO(props) {
|
||||
暂无数据
|
||||
</p>
|
||||
)}
|
||||
{/* real table data here */}
|
||||
</GraphBase>
|
||||
);
|
||||
}
|
||||
@@ -127,16 +106,6 @@ function getOptions(source, period, trend) {
|
||||
grid: { top: 40, right: 12, bottom: 20, left: 64 },
|
||||
xAxis: {
|
||||
type: "category",
|
||||
// data: Array(7)
|
||||
// .fill(1)
|
||||
// .map((_, index) => {
|
||||
// const today = new Date();
|
||||
// const dtimestamp = today - index * 24 * 60 * 60 * 1000;
|
||||
// return `${new Date(dtimestamp).getMonth() + 1}.${new Date(
|
||||
// dtimestamp
|
||||
// ).getDate()}`;
|
||||
// })
|
||||
// .reverse(),
|
||||
data: trend[source].map((item) => item.time),
|
||||
axisLabel: {
|
||||
color: "#fff",
|
||||
@@ -174,9 +143,6 @@ function getOptions(source, period, trend) {
|
||||
color: "#213259a0",
|
||||
},
|
||||
},
|
||||
// interval: 10,
|
||||
// min: 0,
|
||||
// max: 100,
|
||||
},
|
||||
series: [
|
||||
{
|
||||
@@ -193,40 +159,7 @@ function getOptions(source, period, trend) {
|
||||
{ offset: 1, color: "#FFD16010" },
|
||||
]),
|
||||
},
|
||||
// smooth: true,
|
||||
},
|
||||
// {
|
||||
// data: Array(7)
|
||||
// .fill(1)
|
||||
// .map((_) => {
|
||||
// return randomInt(60, 100);
|
||||
// }),
|
||||
// type: "line",
|
||||
// areaStyle: {
|
||||
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
// { offset: 0, color: "#12FFF540" },
|
||||
// { offset: 0.5, color: "#12FFF520" },
|
||||
// { offset: 1, color: "#12FFF510" },
|
||||
// ]),
|
||||
// },
|
||||
// // smooth: true,
|
||||
// },
|
||||
// {
|
||||
// data: Array(7)
|
||||
// .fill(1)
|
||||
// .map((_) => {
|
||||
// return randomInt(60, 100);
|
||||
// }),
|
||||
// type: "line",
|
||||
// areaStyle: {
|
||||
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
// { offset: 0, color: "#2760FF40" },
|
||||
// { offset: 0.5, color: "#2760FF20" },
|
||||
// { offset: 1, color: "#2760FF10" },
|
||||
// ]),
|
||||
// },
|
||||
// // smooth: true,
|
||||
// },
|
||||
],
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
@@ -234,7 +167,6 @@ function getOptions(source, period, trend) {
|
||||
type: "shadow",
|
||||
},
|
||||
className: "xc-chart-tooltip",
|
||||
// backgroundColor: ''
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -28,20 +28,10 @@ function Dust(props) {
|
||||
|
||||
const options = getOptions("dust_float", period, currentTrend);
|
||||
|
||||
function handleSwitch(v) {
|
||||
// console.log('switched ', v);
|
||||
}
|
||||
|
||||
function handleSwitch(v) {}
|
||||
|
||||
function handleDateChange(value) {
|
||||
setPeriod(
|
||||
{
|
||||
日: "day",
|
||||
周: "week",
|
||||
月: "month",
|
||||
年: "year",
|
||||
}[value]
|
||||
);
|
||||
setPeriod(value);
|
||||
setTimestr(
|
||||
{
|
||||
日:
|
||||
@@ -67,7 +57,6 @@ function Dust(props) {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<GraphBase
|
||||
icon="smoke"
|
||||
@@ -77,23 +66,13 @@ function Dust(props) {
|
||||
defaultSelect={period}
|
||||
onSwitch={handleSwitch}
|
||||
dateOptions={["日", "周", "月", "年"]}
|
||||
// legend={["总量", "白班", "夜班"]}
|
||||
onDateChange={handleDateChange}
|
||||
size={["long", "middle"]}
|
||||
>
|
||||
{/* real echarts here */}
|
||||
{options && (
|
||||
<ReactECharts
|
||||
key={Math.random()}
|
||||
option={options}
|
||||
// option={getOptions(
|
||||
// [
|
||||
// [91, 164, 88, 120, 167, 158, 43],
|
||||
// [30, 75, 52, 43, 73, 66, 36],
|
||||
// [61, 89, 36, 77, 94, 92, 7],
|
||||
// ],
|
||||
// "氧气"
|
||||
// )}
|
||||
style={{ height: "100%" }}
|
||||
/>
|
||||
)}
|
||||
@@ -110,7 +89,6 @@ function Dust(props) {
|
||||
暂无数据
|
||||
</p>
|
||||
)}
|
||||
{/* real table data here */}
|
||||
</GraphBase>
|
||||
);
|
||||
}
|
||||
@@ -128,16 +106,6 @@ function getOptions(source, period, trend) {
|
||||
grid: { top: 40, right: 12, bottom: 20, left: 64 },
|
||||
xAxis: {
|
||||
type: "category",
|
||||
// data: Array(7)
|
||||
// .fill(1)
|
||||
// .map((_, index) => {
|
||||
// const today = new Date();
|
||||
// const dtimestamp = today - index * 24 * 60 * 60 * 1000;
|
||||
// return `${new Date(dtimestamp).getMonth() + 1}.${new Date(
|
||||
// dtimestamp
|
||||
// ).getDate()}`;
|
||||
// })
|
||||
// .reverse(),
|
||||
data: trend[source].map((item) => item.time),
|
||||
axisLabel: {
|
||||
color: "#fff",
|
||||
@@ -175,13 +143,9 @@ function getOptions(source, period, trend) {
|
||||
color: "#213259a0",
|
||||
},
|
||||
},
|
||||
// interval: 10,
|
||||
// min: 0,
|
||||
// max: 100,
|
||||
},
|
||||
series: [
|
||||
{
|
||||
// (isNaN((+"f")) ? 0 : (+"f")).toFixed(2)
|
||||
data: trend[source].map((item) =>
|
||||
!(item.value == null || isNaN(+item.value))
|
||||
? (+item.value).toFixed(2)
|
||||
@@ -197,40 +161,7 @@ function getOptions(source, period, trend) {
|
||||
{ offset: 1, color: "#FFD16010" },
|
||||
]),
|
||||
},
|
||||
// smooth: true,
|
||||
},
|
||||
// {
|
||||
// data: Array(7)
|
||||
// .fill(1)
|
||||
// .map((_) => {
|
||||
// return randomInt(60, 100);
|
||||
// }),
|
||||
// type: "line",
|
||||
// areaStyle: {
|
||||
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
// { offset: 0, color: "#12FFF540" },
|
||||
// { offset: 0.5, color: "#12FFF520" },
|
||||
// { offset: 1, color: "#12FFF510" },
|
||||
// ]),
|
||||
// },
|
||||
// // smooth: true,
|
||||
// },
|
||||
// {
|
||||
// data: Array(7)
|
||||
// .fill(1)
|
||||
// .map((_) => {
|
||||
// return randomInt(60, 100);
|
||||
// }),
|
||||
// type: "line",
|
||||
// areaStyle: {
|
||||
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
// { offset: 0, color: "#2760FF40" },
|
||||
// { offset: 0.5, color: "#2760FF20" },
|
||||
// { offset: 1, color: "#2760FF10" },
|
||||
// ]),
|
||||
// },
|
||||
// // smooth: true,
|
||||
// },
|
||||
],
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
@@ -238,7 +169,6 @@ function getOptions(source, period, trend) {
|
||||
type: "shadow",
|
||||
},
|
||||
className: "xc-chart-tooltip",
|
||||
// backgroundColor: ''
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -29,19 +29,10 @@ function Oxygen(props) {
|
||||
|
||||
const options = getOptions("O2_float", period, currentTrend);
|
||||
|
||||
function handleSwitch(v) {
|
||||
// console.log('switched ', v);
|
||||
}
|
||||
function handleSwitch(v) {}
|
||||
|
||||
function handleDateChange(value) {
|
||||
setPeriod(
|
||||
{
|
||||
日: "day",
|
||||
周: "week",
|
||||
月: "month",
|
||||
年: "year",
|
||||
}[value]
|
||||
);
|
||||
setPeriod(value);
|
||||
setTimestr(
|
||||
{
|
||||
日:
|
||||
@@ -75,23 +66,13 @@ function Oxygen(props) {
|
||||
defaultSelect={period}
|
||||
onSwitch={handleSwitch}
|
||||
dateOptions={["日", "周", "月", "年"]}
|
||||
// legend={["总量", "白班", "夜班"]}
|
||||
onDateChange={handleDateChange}
|
||||
size={["long", "middle"]}
|
||||
>
|
||||
{/* real echarts here */}
|
||||
{options && (
|
||||
<ReactECharts
|
||||
key={Math.random()}
|
||||
option={options}
|
||||
// option={getOptions(
|
||||
// [
|
||||
// [172, 165, 135, 35, 101, 53, 68], // 总量
|
||||
// [87, 68, 81, 33, 35, 44, 38], // 白班
|
||||
// [85, 97, 54, 2, 66, 9, 30], // 夜班
|
||||
// ],
|
||||
// "氧气"
|
||||
// )}
|
||||
style={{ height: "100%" }}
|
||||
/>
|
||||
)}
|
||||
@@ -108,7 +89,6 @@ function Oxygen(props) {
|
||||
暂无数据
|
||||
</p>
|
||||
)}
|
||||
{/* real table data here */}
|
||||
</GraphBase>
|
||||
);
|
||||
}
|
||||
@@ -175,9 +155,6 @@ function getOptions(source, period, trend) {
|
||||
color: "#213259a0",
|
||||
},
|
||||
},
|
||||
// interval: 10,
|
||||
// min: 0,
|
||||
// max: 100,
|
||||
},
|
||||
series: [
|
||||
{
|
||||
@@ -196,40 +173,7 @@ function getOptions(source, period, trend) {
|
||||
{ offset: 1, color: "#FFD16010" },
|
||||
]),
|
||||
},
|
||||
// smooth: true,
|
||||
},
|
||||
// {
|
||||
// data: Array(7)
|
||||
// .fill(1)
|
||||
// .map((_) => {
|
||||
// return randomInt(60, 100);
|
||||
// }),
|
||||
// type: "line",
|
||||
// areaStyle: {
|
||||
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
// { offset: 0, color: "#12FFF540" },
|
||||
// { offset: 0.5, color: "#12FFF520" },
|
||||
// { offset: 1, color: "#12FFF510" },
|
||||
// ]),
|
||||
// },
|
||||
// // smooth: true,
|
||||
// },
|
||||
// {
|
||||
// data: Array(7)
|
||||
// .fill(1)
|
||||
// .map((_) => {
|
||||
// return randomInt(60, 100);
|
||||
// }),
|
||||
// type: "line",
|
||||
// areaStyle: {
|
||||
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
// { offset: 0, color: "#2760FF40" },
|
||||
// { offset: 0.5, color: "#2760FF20" },
|
||||
// { offset: 1, color: "#2760FF10" },
|
||||
// ]),
|
||||
// },
|
||||
// // smooth: true,
|
||||
// },
|
||||
],
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
@@ -237,7 +181,6 @@ function getOptions(source, period, trend) {
|
||||
type: "shadow",
|
||||
},
|
||||
className: "xc-chart-tooltip",
|
||||
// backgroundColor: ''
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -28,19 +28,10 @@ function SO2(props) {
|
||||
);
|
||||
const options = getOptions("SO2_float", period, currentTrend);
|
||||
|
||||
function handleSwitch(v) {
|
||||
// console.log('switched ', v);
|
||||
}
|
||||
function handleSwitch(v) {}
|
||||
|
||||
function handleDateChange(value) {
|
||||
setPeriod(
|
||||
{
|
||||
日: "day",
|
||||
周: "week",
|
||||
月: "month",
|
||||
年: "year",
|
||||
}[value]
|
||||
);
|
||||
setPeriod(value);
|
||||
setTimestr(
|
||||
{
|
||||
日:
|
||||
@@ -75,22 +66,12 @@ function SO2(props) {
|
||||
defaultSelect={period}
|
||||
onSwitch={handleSwitch}
|
||||
dateOptions={["日", "周", "月", "年"]}
|
||||
// legend={["总量", "白班", "夜班"]}
|
||||
onDateChange={handleDateChange}
|
||||
size={["long", "middle"]}
|
||||
>
|
||||
{/* real echarts here */}
|
||||
{options && (
|
||||
<ReactECharts
|
||||
key={Math.random()}
|
||||
// option={getOptions(
|
||||
// [
|
||||
// [132, 155, 140, 83, 180, 67, 136],
|
||||
// [83, 58, 60, 22, 80, 64, 43],
|
||||
// [49, 97, 80, 61, 100, 3, 93],
|
||||
// ],
|
||||
// '氧气',
|
||||
// )}
|
||||
option={options}
|
||||
style={{ height: "100%" }}
|
||||
/>
|
||||
@@ -108,7 +89,6 @@ function SO2(props) {
|
||||
暂无数据
|
||||
</p>
|
||||
)}
|
||||
{/* real table data here */}
|
||||
</GraphBase>
|
||||
);
|
||||
}
|
||||
@@ -126,16 +106,6 @@ function getOptions(source, period, trend) {
|
||||
grid: { top: 40, right: 12, bottom: 20, left: 64 },
|
||||
xAxis: {
|
||||
type: "category",
|
||||
// data: Array(7)
|
||||
// .fill(1)
|
||||
// .map((_, index) => {
|
||||
// const today = new Date();
|
||||
// const dtimestamp = today - index * 24 * 60 * 60 * 1000;
|
||||
// return `${new Date(dtimestamp).getMonth() + 1}.${new Date(
|
||||
// dtimestamp
|
||||
// ).getDate()}`;
|
||||
// })
|
||||
// .reverse(),
|
||||
data: trend[source].map((item) => item.time),
|
||||
axisLabel: {
|
||||
color: "#fff",
|
||||
@@ -173,9 +143,6 @@ function getOptions(source, period, trend) {
|
||||
color: "#213259a0",
|
||||
},
|
||||
},
|
||||
// interval: 10,
|
||||
// min: 0,
|
||||
// max: 100,
|
||||
},
|
||||
series: [
|
||||
{
|
||||
@@ -194,40 +161,7 @@ function getOptions(source, period, trend) {
|
||||
{ offset: 1, color: "#FFD16010" },
|
||||
]),
|
||||
},
|
||||
// smooth: true,
|
||||
},
|
||||
// {
|
||||
// data: Array(7)
|
||||
// .fill(1)
|
||||
// .map((_) => {
|
||||
// return randomInt(60, 100);
|
||||
// }),
|
||||
// type: "line",
|
||||
// areaStyle: {
|
||||
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
// { offset: 0, color: "#12FFF540" },
|
||||
// { offset: 0.5, color: "#12FFF520" },
|
||||
// { offset: 1, color: "#12FFF510" },
|
||||
// ]),
|
||||
// },
|
||||
// // smooth: true,
|
||||
// },
|
||||
// {
|
||||
// data: Array(7)
|
||||
// .fill(1)
|
||||
// .map((_) => {
|
||||
// return randomInt(60, 100);
|
||||
// }),
|
||||
// type: "line",
|
||||
// areaStyle: {
|
||||
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
// { offset: 0, color: "#2760FF40" },
|
||||
// { offset: 0.5, color: "#2760FF20" },
|
||||
// { offset: 1, color: "#2760FF10" },
|
||||
// ]),
|
||||
// },
|
||||
// // smooth: true,
|
||||
// },
|
||||
],
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
@@ -235,7 +169,6 @@ function getOptions(source, period, trend) {
|
||||
type: "shadow",
|
||||
},
|
||||
className: "xc-chart-tooltip",
|
||||
// backgroundColor: ''
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user