|
|
@ -1,6 +1,7 @@ |
|
|
|
import React, { useEffect, useRef, useState } from 'react'; |
|
|
|
import { Skeleton, Button, Pagination, Select, Popconfirm, Table, Tooltip } from '@douyinfe/semi-ui'; |
|
|
|
import { connect } from 'react-redux'; |
|
|
|
import { push } from 'react-router-redux'; |
|
|
|
import Header from '../components/header'; |
|
|
|
import Body from '../components/body' |
|
|
|
import Card from '../components/card' |
|
|
@ -13,7 +14,8 @@ import AutoRollComponent from '../components/AutoRollComponent' |
|
|
|
let interrupt |
|
|
|
let repair |
|
|
|
let overviewScrollbar; |
|
|
|
const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, groupStatisticOnline }) => { |
|
|
|
const Bigscreen = (props) => { |
|
|
|
const { dispatch, actions, user, match, history, clientHeight, groupStatisticOnline, ...restProps } = props |
|
|
|
|
|
|
|
const [InterruptRank, setInterruptRank] = useState([]) |
|
|
|
const [online, setOnline] = useState([]) |
|
|
@ -30,27 +32,37 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou |
|
|
|
const [xData, setXData] = useState([])//横坐标 |
|
|
|
const self = useRef({ myChart: null }); |
|
|
|
|
|
|
|
// const [queryUserId, setQueryUserId] = useState('') |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
let groupId = JSON.parse(localStorage.getItem('project_group'))?.find(v => user?.id == v.userId)?.projectGroupId |
|
|
|
statisticOnline(groupId) |
|
|
|
|
|
|
|
let groupIdLocal = JSON.parse(localStorage.getItem('project_group'))?.find(v => user?.id == v.userId)?.projectGroupId |
|
|
|
|
|
|
|
let search = restProps?.location?.search || ''; |
|
|
|
let params = new URLSearchParams(search); |
|
|
|
// let userId = params.get('pomsU') |
|
|
|
let groupId = params.get('pomsPG') |
|
|
|
|
|
|
|
// setQueryUserId(userId) |
|
|
|
|
|
|
|
let groupId_ = groupId || groupIdLocal |
|
|
|
|
|
|
|
statisticOnline(groupId_) |
|
|
|
//计算当前时间,定时更新 |
|
|
|
timeRequest(groupId) |
|
|
|
dispatch(actions.projectGroup.groupStatisticAlarm({ groupId })).then(res => { |
|
|
|
timeRequest(groupId_) |
|
|
|
dispatch(actions.projectGroup.groupStatisticAlarm({ groupId: groupId_ })).then(res => { |
|
|
|
if (res.success) { |
|
|
|
setMockData(res.payload.data) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
dispatch(actions.projectGroup.groupProject({ groupId })).then(res => { |
|
|
|
dispatch(actions.projectGroup.groupProject({ groupId: groupId_ })).then(res => { |
|
|
|
if (res.success) { |
|
|
|
setGroupProject(res.payload.data?.map(v => ({ ...v, value: (Math.random() * 20).toFixed(0) })) || []) |
|
|
|
setProportion([...res.payload.data?.slice(0, 3)?.map(v => ({ name: v.name || v.pepProjectName, value: (Math.random() * 20).toFixed(0) })), { value: 20, name: '其它' }]) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const interruptDom = document.getElementById("interrupt"); |
|
|
|
if (interruptDom) { |
|
|
|
interrupt = new PerfectScrollbar("#interrupt", { |
|
|
@ -65,6 +77,7 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou |
|
|
|
} |
|
|
|
|
|
|
|
}, []) |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
const overview = document.getElementById("alarmRank"); |
|
|
|
if (overview) { |
|
|
@ -182,7 +195,7 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou |
|
|
|
|
|
|
|
return ( |
|
|
|
<div className='project-group'> |
|
|
|
<Header match={match} history={history} /> |
|
|
|
<Header match={match} history={history} {...props} /> |
|
|
|
<Body> |
|
|
|
<div style={{ width: "100%", height: '100%' }}> |
|
|
|
<div style={{ width: '100%', height: "45%", display: 'flex' }}> |
|
|
|