|
|
@ -4,33 +4,134 @@ import Header from '../components/header'; |
|
|
|
import Body from '../components/body' |
|
|
|
import Card from '../components/card' |
|
|
|
import '../style.less' |
|
|
|
import ReactECharts from 'echarts-for-react'; |
|
|
|
import moment from 'moment' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, groupStatisticOnline }) => { |
|
|
|
|
|
|
|
const Bigscreen = ({ dispatch, actions, user, history, clientHeight }) => { |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
let projectGroupId = localStorage.getItem('project_group_id') |
|
|
|
console.log(projectGroupId); |
|
|
|
}) |
|
|
|
let groupId = JSON.parse(localStorage.getItem('project_group'))?.find(v => user?.id == v.userId)?.projectGroupId |
|
|
|
console.log(); |
|
|
|
dispatch(actions.projectGroup.groupStatisticOnline({ groupId })) |
|
|
|
}, []) |
|
|
|
|
|
|
|
console.log(groupStatisticOnline); |
|
|
|
|
|
|
|
return ( |
|
|
|
<div className='project-group'> |
|
|
|
<Header /> |
|
|
|
<Header match={match} history={history} /> |
|
|
|
<Body> |
|
|
|
<Card> |
|
|
|
123 |
|
|
|
</Card> |
|
|
|
<div style={{ width: "100%", height: '100%' }}> |
|
|
|
<div style={{ width: '100%', height: "45%", display: 'flex' }}> |
|
|
|
<div style={{ width: "calc(50% - 8px)", height: "100%", marginRight: 16, display: 'flex' }}> |
|
|
|
<Card title='项目工单占比' style={{ width: "calc(50% - 8px)", height: "100%", marginRight: 16 }}> |
|
|
|
<div style={{ height: '100%' }}> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
</Card> |
|
|
|
<Card title='修复排名' style={{ width: "calc(50% - 8px)", height: "100%" }}> |
|
|
|
<div style={{ height: '100%' }}> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
</Card> |
|
|
|
</div> |
|
|
|
<Card title='数据在线率' style={{ width: "calc(50% - 8px)", height: "100%", }}> |
|
|
|
<div style={{ height: '100%' }}> |
|
|
|
|
|
|
|
<ReactECharts |
|
|
|
option={{ |
|
|
|
title: { |
|
|
|
// text: v.name, |
|
|
|
}, |
|
|
|
grid: { |
|
|
|
// width: 300, |
|
|
|
// height: 200 |
|
|
|
}, |
|
|
|
// dataZoom: [ |
|
|
|
// { |
|
|
|
// type: 'slider', |
|
|
|
// showDetail: false |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// type: 'inside', |
|
|
|
|
|
|
|
// }, |
|
|
|
// ], |
|
|
|
tooltip: { |
|
|
|
trigger: 'axis' |
|
|
|
}, |
|
|
|
legend: { |
|
|
|
data: groupStatisticOnline?.map(v => v.name) || [], |
|
|
|
right: '10%', |
|
|
|
textStyle: { |
|
|
|
color: '#FFF', |
|
|
|
}, |
|
|
|
}, |
|
|
|
xAxis: { |
|
|
|
type: 'time', |
|
|
|
// name: "时间", |
|
|
|
boundaryGap: false, |
|
|
|
minInterval: 1000 * 60, |
|
|
|
|
|
|
|
}, |
|
|
|
yAxis: { |
|
|
|
type: 'value', |
|
|
|
name: "单位:A", |
|
|
|
areaStyle: { |
|
|
|
color: '#FFF', |
|
|
|
}, |
|
|
|
}, |
|
|
|
series: groupStatisticOnline?.map(v => ({ |
|
|
|
type: 'line', |
|
|
|
name: v.name, |
|
|
|
smooth: true, |
|
|
|
areaStyle: { |
|
|
|
color: '#0e9cff26', |
|
|
|
}, |
|
|
|
data: v.online?.map(f => [moment(f.collect_time).format('YYYY-MM-DD HH'), f.rate]) || [] |
|
|
|
})) || [] |
|
|
|
}} |
|
|
|
notMerge={true} |
|
|
|
lazyUpdate={true} |
|
|
|
style={{ width: "100%", height: "100%" }} |
|
|
|
theme={'ReactEChart'} |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</Card> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div style={{ width: '100%', height: "calc(55% - 24px)", display: 'flex', marginTop: 24 }}> |
|
|
|
<Card title='告警排名TOP20' style={{ width: "calc(50% - 8px)", height: "100%", marginRight: 16, }}> |
|
|
|
<div style={{ height: '100%' }}> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
</Card> |
|
|
|
<Card title='中断排名' style={{ width: "calc(50% - 8px)", height: "100%", }}> |
|
|
|
<div style={{ height: '100%' }}> |
|
|
|
|
|
|
|
</div> |
|
|
|
</Card> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</Body> |
|
|
|
</div> |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
function mapStateToProps (state) { |
|
|
|
const { auth, global, } = state; |
|
|
|
const { auth, global, groupStatisticOnline } = state; |
|
|
|
return { |
|
|
|
user: auth.user, |
|
|
|
actions: global.actions, |
|
|
|
clientHeight: global.clientHeight, |
|
|
|
groupStatisticOnline: groupStatisticOnline?.data |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|