update 当前产线生产规格
This commit is contained in:
@@ -1,36 +1,128 @@
|
||||
import BottomBarItem from "../BottomItemBackground";
|
||||
import React, { Component } from "react";
|
||||
import cls from "./righttable.module.scss";
|
||||
|
||||
import { useSelector } from "react-redux";
|
||||
import { ScrollBoard } from "@jiaminghi/data-view-react";
|
||||
|
||||
let data = [
|
||||
["产线0", "10mm", "10mm", "10mm"],
|
||||
["产线2", "8mm", "8mm", "8mm"],
|
||||
["产线3", "15mm", "15mm", "15mm"],
|
||||
["产线4", "15mm", "15mm", "15mm"],
|
||||
["产线42", "15mm", "15mm", "15mm"],
|
||||
["产线5", "15mm", "15mm", "15mm"],
|
||||
["产线6", "15mm", "15mm", "15mm"],
|
||||
function Chart1(props) {
|
||||
const rawData = useSelector((state) => state.cutting.productData);
|
||||
|
||||
let config = {
|
||||
// headerBGC: "rgba(4, 44, 76, 0.3)",
|
||||
headerBGC: "#044A8460",
|
||||
header: [
|
||||
'<span style="color:#fff; padding-left: 8px;">产线名<span/>',
|
||||
'<span style="color:#fff; padding-left: 8px;">原板宽度<span/>',
|
||||
'<span style="color:#fff; padding-left: 8px;">净板宽<span/>',
|
||||
'<span style="color:#fff; padding-left: 8px;">玻璃厚度<span/>',
|
||||
],
|
||||
// oddRowBGC: "#042444",
|
||||
// evenRowBGC: "#042c4c",
|
||||
oddRowBGC: "#044A8460",
|
||||
evenRowBGC: "#0b549970",
|
||||
columnWidth: [128],
|
||||
headerHeight: 40,
|
||||
hoverPause: false,
|
||||
data: replaceStyle(filterData(rawData), 0.7),
|
||||
};
|
||||
|
||||
return (
|
||||
<BottomBarItem
|
||||
icon="pause"
|
||||
title="当前产线生产规格"
|
||||
className={props.className}
|
||||
style={props.style}
|
||||
>
|
||||
<div
|
||||
className={cls.CenterChart1itemDetailBorder}
|
||||
style={{ paddingTop: "6px" }}
|
||||
>
|
||||
<span className={cls.CenterFormitemDetailBorderLine1}></span>
|
||||
<span className={cls.CenterFormitemDetailBorderLine2}></span>
|
||||
<span className={cls.CenterFormitemDetailBorderLine3}></span>
|
||||
<ScrollBoard config={config} style={{}} />
|
||||
</div>
|
||||
</BottomBarItem>
|
||||
);
|
||||
}
|
||||
|
||||
export default Chart1;
|
||||
|
||||
// 测试数据
|
||||
var rawData = [
|
||||
{
|
||||
id: 1,
|
||||
length: 1209,
|
||||
productionLine: "Y61",
|
||||
square: 123.3,
|
||||
thick: 2,
|
||||
wide: 1089,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
length: 1119,
|
||||
productionLine: "Y62",
|
||||
square: 103.3,
|
||||
thick: 2,
|
||||
wide: 1339,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
length: 1019,
|
||||
productionLine: "Y63",
|
||||
square: 233,
|
||||
thick: 1,
|
||||
wide: 1111,
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
length: 2000,
|
||||
productionLine: "Y64",
|
||||
square: 233,
|
||||
thick: 1,
|
||||
wide: 1232,
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
length: 1560,
|
||||
productionLine: "Y65",
|
||||
square: 233,
|
||||
thick: 1,
|
||||
wide: 996,
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
length: 1990,
|
||||
productionLine: "Y66",
|
||||
square: 233,
|
||||
thick: 1,
|
||||
wide: 416,
|
||||
},
|
||||
];
|
||||
|
||||
let header = ["产线名", "原板宽度", "净板宽", "玻璃厚度"];
|
||||
function filterData(rawData) {
|
||||
return (rawData ?? []).map((item) => [
|
||||
// 产线名
|
||||
item.productionLine,
|
||||
// 原板宽度
|
||||
item.length,
|
||||
// 净板宽
|
||||
item.wide,
|
||||
// 玻璃厚度
|
||||
item.thick,
|
||||
]);
|
||||
}
|
||||
|
||||
let config = {
|
||||
headerBGC: "rgba(4, 44, 76, 0.3)",
|
||||
header: [
|
||||
'<span style="color:#fff">产线名<span/>',
|
||||
'<span style="color:#fff">原板宽度<span/>',
|
||||
'<span style="color:#fff">净板宽<span/>',
|
||||
'<span style="color:#fff">玻璃厚度<span/>',
|
||||
],
|
||||
oddRowBGC: "#042444",
|
||||
evenRowBGC: "#042c4c",
|
||||
columnWidth: [128],
|
||||
headerHeight: 40,
|
||||
hoverPause: false,
|
||||
data: replaceStyle(data, 0.7),
|
||||
};
|
||||
// let data = [
|
||||
// ["产线0", "10mm", "10mm", "10mm"],
|
||||
// ["产线2", "8mm", "8mm", "8mm"],
|
||||
// ["产线3", "15mm", "15mm", "15mm"],
|
||||
// ["产线4", "15mm", "15mm", "15mm"],
|
||||
// ["产线42", "15mm", "15mm", "15mm"],
|
||||
// ["产线5", "15mm", "15mm", "15mm"],
|
||||
// ["产线6", "15mm", "15mm", "15mm"],
|
||||
// ];
|
||||
|
||||
// let header = ["产线名", "原板宽度", "净板宽", "玻璃厚度"];
|
||||
|
||||
function replaceStyle(Arr, opencity) {
|
||||
let temp = [];
|
||||
@@ -38,36 +130,11 @@ function replaceStyle(Arr, opencity) {
|
||||
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})">${Arr[i][j]}<span/>`;
|
||||
temp[i][j] = `<span style="color:rgba(255, 255, 255,${opencity})">${
|
||||
Arr[i][j]
|
||||
} ${j == 0 ? "" : "mm"}<span/>`;
|
||||
}
|
||||
}
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
class Chart1 extends Component {
|
||||
render() {
|
||||
return (
|
||||
<BottomBarItem
|
||||
icon="pause"
|
||||
title="当前产线生产规格"
|
||||
className={this.props.className}
|
||||
style={Object.assign(this.props.style, { filter: "grayscale(100%)" })}
|
||||
>
|
||||
<div
|
||||
className={cls.CenterChart1itemDetailBorder}
|
||||
style={{ paddingTop: "6px" }}
|
||||
>
|
||||
<span className={cls.CenterFormitemDetailBorderLine1}></span>
|
||||
<span className={cls.CenterFormitemDetailBorderLine2}></span>
|
||||
<span className={cls.CenterFormitemDetailBorderLine3}></span>
|
||||
<ScrollBoard config={config} style={{}} />
|
||||
</div>
|
||||
</BottomBarItem>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Chart1;
|
||||
|
||||
@@ -19,7 +19,7 @@ function FaultTotal(props) {
|
||||
? isra.yearStatistic
|
||||
: [];
|
||||
|
||||
const series = preHandleStatisticData(currentStatistic, isra.checkType);
|
||||
const series = preHandleStatisticData(currentStatistic, isra.checkType ?? []);
|
||||
const options = getOptions(series, isra, currentStatistic);
|
||||
|
||||
function handleDateChange(v) {
|
||||
|
||||
Reference in New Issue
Block a user