diff --git a/src/components/Common/WarnAlert/ListContainer.jsx b/src/components/Common/WarnAlert/ListContainer.jsx new file mode 100644 index 0000000..f291ed9 --- /dev/null +++ b/src/components/Common/WarnAlert/ListContainer.jsx @@ -0,0 +1,20 @@ +import WarnAlert from "."; +import { useSelector } from "react-redux"; + +function AlarmListContainer(props) { + const alarmList = useSelector((state) => state.alarm.list); + const posMap = { + A1_1_1: { x: 800, y: 200 }, + }; + return alarmList.map((alarm) => ( + + )); +} + +export default AlarmListContainer; diff --git a/src/components/Common/WarnAlert/index.jsx b/src/components/Common/WarnAlert/index.jsx index feb4893..45ce117 100644 --- a/src/components/Common/WarnAlert/index.jsx +++ b/src/components/Common/WarnAlert/index.jsx @@ -3,16 +3,14 @@ import "./warn-alert.css"; import AlertIcon from "./warn-icon.png"; function WarnAlert(props) { + const { x, y, title, content } = props; return ( -
+

icon - {props.title || "test"} + {title || "test"}

-

- {props.content || - "Lorem ipsum dolor sit amet consectetur."} -

+

{content || "Lorem ipsum dolor sit amet consectetur."}

); } diff --git a/src/pages/Home/index.jsx b/src/pages/Home/index.jsx index d851267..819cf26 100644 --- a/src/pages/Home/index.jsx +++ b/src/pages/Home/index.jsx @@ -36,8 +36,16 @@ export default function Home({ active }) { return (
+ {active == "窑炉总览" && ( -
+
)} diff --git a/src/store/features/alarmSlice.js b/src/store/features/alarmSlice.js index 371aa35..492348b 100644 --- a/src/store/features/alarmSlice.js +++ b/src/store/features/alarmSlice.js @@ -9,6 +9,7 @@ const alarmSlice = createSlice({ initialState, reducers: { setList(state, action) { + // action.payload 是 { 'A1_1_1': 'detail' } 的结构 console.log("[alarm store] setting list ---> ", action); state.list = action.payload; },