import TitleBox from "../Component/TitleBox";
import ScrollBoard from "./../../Component/ScrollBoard";
import {useAppSelector} from "./../../../store/hooks"
import {selectLine1Before} from "./../../../store/LinePageSlice"
function RightUp() {
  const data = useAppSelector(selectLine1Before);
  const config = {
    header: ["序号", "工段名", "上片数据量", "成品下片数量"],
    headerHeight: 32,
    rowNum: 5,
    align: ["center", "left", "left", "left"],
    headerBGC: "rgba(79, 114, 136, 0.3)",
    oddRowBGC: "rgba(79, 114, 136, 0.3)",
    evenRowBGC: "rgba(76, 97, 123, 0.1)",
    columnWidth: [55, 115, 100, 110],
    data: [],
  };
  let arr:any = []
  // @ts-ignore
  if (data.sectionDet && data.sectionDet.length > 0) {
    // @ts-ignore
    data.sectionDet.map((item, index) => {
      let arrInner = []
      arrInner.push(index + 1, item.lineName, item.inputNum, item.outputNum)
      arr.push(arrInner)
    })
  }
  config.data = arr
  return (
    <div className="right_up">
      <TitleBox title={"right_up"} />
      <div style={{ padding: "10px", height: "213px" }}>
        {arr.length>0?<ScrollBoard
          config={config}
          style={{ width: "380px", height: "193px" }}
        />:(<p
          style={{
            color: "#cccf",
            fontSize: "24px",
            userSelect: "none",
            textAlign: "center",
            paddingTop: "50px",
            margin:0
          }}
        >
          暂无数据
        </p>)}
      </div>
    </div>
  );
}
export default RightUp;
