diff --git a/web/client/src/sections/console/containers/console.jsx b/web/client/src/sections/console/containers/console.jsx index c976973..913161c 100644 --- a/web/client/src/sections/console/containers/console.jsx +++ b/web/client/src/sections/console/containers/console.jsx @@ -12,519 +12,528 @@ let memberScrollbar; let equipmentScrollbar; let webScrollbar; let problemsScrollbar; +let alarmScrollbar; const Console = (props) => { - const { dispatch, actions, user, loading, socket } = props - const stationList = [ - 'url(/assets/images/console/lan_1.png)', - 'url(/assets/images/console/lv_1.png)', - 'url(/assets/images/console/huang_1.png)', - 'url(/assets/images/console/hong_1.png)' - ] - const [timelineList, setTimelineList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])//最新动态列表 + const { dispatch, actions, user, loading, socket } = props + const stationList = [ + 'url(/assets/images/console/lan_1.png)', + 'url(/assets/images/console/lv_1.png)', + 'url(/assets/images/console/huang_1.png)', + 'url(/assets/images/console/hong_1.png)' + ] + const [timelineList, setTimelineList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])//最新动态列表 - const [memberList, setMemberList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])//相关成员列表 + const [memberList, setMemberList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])//相关成员列表 - const [equipmentList, setEquipmentList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])//平台设备接入列表 + const [equipmentList, setEquipmentList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])//平台设备接入列表 - const [webList, setWebList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])//关联web应用列表 + const [webList, setWebList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])//关联web应用列表 - const [problemsList, setProblemsList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])//异常&问题列表 - useEffect(() => { - // ACTION 示例 - // dispatch(actions.example.getMembers(user.orgId)) - }, []) - useEffect(() => { - newScrollbar = new PerfectScrollbar("#news", { - suppressScrollX: true, - }); - const domProject = document.getElementById("news"); - if (domProject && newScrollbar) { - newScrollbar.update(); - } - overviewScrollbar = new PerfectScrollbar("#overview", { - suppressScrollY: true, - }); - const domProject1 = document.getElementById("overview"); - if (domProject1 && overviewScrollbar) { - overviewScrollbar.update(); - } - memberScrollbar = new PerfectScrollbar("#member", { - suppressScrollX: true, - }); - const domProject2 = document.getElementById("member"); - if (domProject2 && memberScrollbar) { - memberScrollbar.update(); - } - equipmentScrollbar = new PerfectScrollbar("#equipment", { - suppressScrollX: true, - }); - const domProject3 = document.getElementById("equipment"); - if (domProject3 && equipmentScrollbar) { - equipmentScrollbar.update(); - } - webScrollbar = new PerfectScrollbar("#web", { - suppressScrollX: true, - }); - const domProject4 = document.getElementById("web"); - if (domProject4 && webScrollbar) { - webScrollbar.update(); - } - problemsScrollbar = new PerfectScrollbar("#problems", { - suppressScrollX: true, - }); - const domProject5 = document.getElementById("problems"); - if (domProject5 && problemsScrollbar) { - problemsScrollbar.update(); - } + const [problemsList, setProblemsList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])//异常&问题列表 + useEffect(() => { + // ACTION 示例 + // dispatch(actions.example.getMembers(user.orgId)) + }, []) + useEffect(() => { + newScrollbar = new PerfectScrollbar("#news", { + suppressScrollX: true, + }); + const domProject = document.getElementById("news"); + if (domProject && newScrollbar) { + newScrollbar.update(); + } + overviewScrollbar = new PerfectScrollbar("#overview", { + suppressScrollY: true, + }); + const domProject1 = document.getElementById("overview"); + if (domProject1 && overviewScrollbar) { + overviewScrollbar.update(); + } + memberScrollbar = new PerfectScrollbar("#member", { + suppressScrollX: true, + }); + const domProject2 = document.getElementById("member"); + if (domProject2 && memberScrollbar) { + memberScrollbar.update(); + } + equipmentScrollbar = new PerfectScrollbar("#equipment", { + suppressScrollX: true, + }); + const domProject3 = document.getElementById("equipment"); + if (domProject3 && equipmentScrollbar) { + equipmentScrollbar.update(); + } + webScrollbar = new PerfectScrollbar("#web", { + suppressScrollX: true, + }); + const domProject4 = document.getElementById("web"); + if (domProject4 && webScrollbar) { + webScrollbar.update(); + } + problemsScrollbar = new PerfectScrollbar("#problems", { + suppressScrollX: true, + }); + const domProject5 = document.getElementById("problems"); + if (domProject5 && problemsScrollbar) { + problemsScrollbar.update(); + } + alarmScrollbar = new PerfectScrollbar("#alarm", { + suppressScrollY: true, + }); + const domProject6 = document.getElementById("alarm"); + if (domProject6 && alarmScrollbar) { + alarmScrollbar.update(); + } - // ACTION 示例 - // dispatch(actions.example.getMembers(user.orgId)) - }) + // ACTION 示例 + // dispatch(actions.example.getMembers(user.orgId)) + }) - // websocket 使用测试 - // useEffect(() => { - // console.log(socket) - // if (socket) { - // socket.on('TEST', function (msg) { - // console.info(msg); - // }); - // return () => { - // socket.off("TEST"); - // } - // } + // websocket 使用测试 + // useEffect(() => { + // console.log(socket) + // if (socket) { + // socket.on('TEST', function (msg) { + // console.info(msg); + // }); + // return () => { + // socket.off("TEST"); + // } + // } - // }, [socket]) + // }, [socket]) - return ( - <> -