diff --git a/src/components/Common/FanInfoStretch/index.jsx b/src/components/Common/FanInfoStretch/index.jsx new file mode 100644 index 0000000..d190c93 --- /dev/null +++ b/src/components/Common/FanInfoStretch/index.jsx @@ -0,0 +1,248 @@ +import GraphBase from "../GraphBase"; +import "./index.module.scss"; +import { useSelector } from "react-redux"; +import { ScrollBoard } from "@jiaminghi/data-view-react"; +import { useMemo } from "react"; + +function attachStyle(data) { + return data.map((arr) => { + return arr.map((item, index) => { + if (index == arr.length - 1) { + return `
+ ${item == 1 ? "运行" : item == 0 ? "故障" : "未运行"}
`; + } + return `${item}`; + }); + }); +} + +function FanInfo(props) { + // 默认使用风机信息,可以使用 source 来调整该组件使用 annealFanInfo 的数据 + const fanInfo = useSelector((state) => state[props.source ?? "fanInfo"].data); + + const data = Object.keys(fanInfo).map((key, index) => { + return [ + index + 1, + key, + fanInfo[key] == "运行" ? 1 : fanInfo[key] == "故障" ? 0 : 2, + ]; + }); + + const y61 = useMemo( + () => data.filter((item) => item[1].startsWith("1#")) || [], + [data] + ); + const y62 = useMemo( + () => data.filter((item) => item[1].startsWith("2#")) || [], + [data] + ); + const y63 = useMemo( + () => data.filter((item) => item[1].startsWith("3#")) || [], + [data] + ); + const y64 = useMemo( + () => data.filter((item) => item[1].startsWith("4#")) || [], + [data] + ); + const y65 = useMemo( + () => data.filter((item) => item[1].startsWith("5#")) || [], + [data] + ); + const y66 = useMemo(() => [...y65.slice(5), ...y65.slice(0, 5)], [y65]); + + let config = { + headerBGC: "rgba(4, 44, 76, 0.3)", + header: [ + '序号', + '风机名称', + '故障情况', + ], + oddRowBGC: "#042444", + evenRowBGC: "#042c4c", + // columnWidth: data.length > 12 ? [50, 136] : [88, 256], + columnWidth: [50, 136], + rowNum: 6, + hoverPause: false, + data: [], + }; + + return ( + +
+
+
+

+ 产线Y61 +

+ +
+
+

+ 产线Y62 +

+ +
+
+ +
+ +
+
+

+ 产线Y63 +

+ +
+
+ {/*
*/} +

+ 产线Y64 +

+ +
+
+ +
+ +
+

+ 产线Y65 +

+
+ + +
+
+
+ + ); +} + +export default FanInfo; diff --git a/src/components/Common/FanInfoStretch/index.module.scss b/src/components/Common/FanInfoStretch/index.module.scss new file mode 100644 index 0000000..299a80e --- /dev/null +++ b/src/components/Common/FanInfoStretch/index.module.scss @@ -0,0 +1,50 @@ +.CenterChart1itemDetailBorder { + width: 100%; + height: 240px; + display: flex; + flex-direction: column; + justify-content: flex-start; + + background-color: rgba(4, 44, 76, 0.2); + .CenterChart1itemTXT { + width: 100%; + height: 10%; + font-size: 20px; + color: rgba(255, 255, 255, 0.8); + text-align: center; + margin-top: 2%; + } + .CenterChart1itemContainer { + width: 95%; + height: 100px; + position: relative; + + .CenterFormitemDetailBorderLine1 { + width: 1px; + height: 200px; + background-color: #041c2c; + float: left; + margin-left: 18%; + z-index: 10; + position: absolute; + } + .CenterFormitemDetailBorderLine2 { + width: 1px; + height: 200px; + background-color: #041c2c; + float: left; + margin-left: 46%; + z-index: 10; + position: absolute; + } + .CenterFormitemDetailBorderLine3 { + width: 1px; + height: 200px; + background-color: #041c2c; + float: left; + margin-left: 72%; + z-index: 10; + position: absolute; + } + } +} diff --git a/src/components/Modules/FireCheck/RightSide/index.jsx b/src/components/Modules/FireCheck/RightSide/index.jsx index cae4b09..3ecbc8a 100644 --- a/src/components/Modules/FireCheck/RightSide/index.jsx +++ b/src/components/Modules/FireCheck/RightSide/index.jsx @@ -1,5 +1,5 @@ import { motion } from 'framer-motion'; -import FanInfo from '../../../Common/FanInfo'; +import FanInfo from '../../../Common/FanInfoStretch'; import cls from './index.module.scss'; export default function index() { @@ -18,7 +18,7 @@ export default function index() { transition={{ type: 'tween' }} >
- +
);