wenlele 1 year ago
parent
commit
d670b09fd3
  1. 258
      web/client/src/sections/projectGroup/containers/bigscreen.jsx

258
web/client/src/sections/projectGroup/containers/bigscreen.jsx

@ -63,50 +63,62 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou
}
}, [])
// const mockData=[
// {
// "name": "西",
// "id": 2957,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "-绿",
// "id": 2966,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "-绿",
// "id": 2967,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 2973,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 2975,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 2977,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 2988,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// const mockData=[
// {
// "name": "西",
// "id": 2957,
// "alarmCount": 6,
// "dealAlarmCount": 0
// },
// {
// "name": "-绿",
// "id": 2966,
// "alarmCount": 1,
// "dealAlarmCount": 0
// },
// {
// "name": "-绿",
// "id": 2967,
// "alarmCount": 3,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 2973,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 2975,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 2977,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 2988,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 3004,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "驿",
// "id": 3007,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 3004,
// "alarmCount": 0,
@ -119,132 +131,18 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 3008,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 3010,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 3023,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 3024,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 3025,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 3033,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 3034,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 3035,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 3036,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 3037,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 3038,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 3039,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 3040,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 3041,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 3042,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 3043,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 3044,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 3045,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 3047,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 3048,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "",
// "id": 3049,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// ]
// "name": "",
// "id": 3004,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "驿",
// "id": 3007,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// ]
useEffect(() => {
const overview = document.getElementById("alarmRank");
if (overview) {
@ -330,8 +228,8 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou
})
Interrupt = Interrupt?.sort((a, b) => b.offline - a.offline)
setInterruptRank(Interrupt)
setOnline(res.payload.data || [])
setValue(res.payload.data?.map(v => v.id) || [])
setOnline(res.payload.data?.slice(0, 10) || [])
setValue(res.payload.data?.map(v => v.id)?.slice(0, 10) || [])
// eChartsData(res.payload.data || [], res.payload.data?.map(v => v.id) || [])
}
})
@ -621,10 +519,10 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou
<div class='structDiv'>{mockData[0]?.name?.length > 5 ? <Tooltip content={mockData[0]?.name}>{mockData[0]?.name.substring(0, 5) + '...'}</Tooltip> : mockData[0]?.name}</div>
<div class='barChartDiv'>
<div style={{ width: '50%', display: 'flex', justifyContent: 'flex-end' }}>
<div class='alarms' style={{ width: (biggest > 0 ? ((mockData[0].alarmCount / biggest) * 100 || '%') : 0), height: '100%' }}></div>
<div class='alarms' style={{ width: (biggest > 0 ? ((mockData[0].alarmCount / biggest) * 100 + '%') : 0), height: '100%' }}></div>
</div>
<div style={{ width: '50%', display: 'flex', }}>
<div class='dealAlarms' style={{ width: (biggest > 0 ? ((mockData[0].dealAlarmCount / biggest) * 100 || '%') : 0), height: '100%' }}></div>
<div class='dealAlarms' style={{ width: (biggest > 0 ? ((mockData[0].dealAlarmCount / biggest) * 100 + '%') : 0), height: '100%' }}></div>
</div>
</div>
</div>) : ''
@ -636,10 +534,10 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou
<div class='structDiv'>{mockData[1]?.name?.length > 5 ? <Tooltip content={mockData[1]?.name}>{mockData[1]?.name.substring(0, 5) + '...'}</Tooltip> : mockData[0]?.name}</div>
<div class='barChartDiv'>
<div style={{ width: '50%', display: 'flex', justifyContent: 'flex-end' }}>
<div class='alarms' style={{ width: (biggest > 0 ? ((mockData[1].alarmCount / biggest) * 100 || '%') : 0), height: '100%' }}></div>
<div class='alarms' style={{ width: (biggest > 0 ? ((mockData[1].alarmCount / biggest) * 100 + '%') : 0), height: '100%' }}></div>
</div>
<div style={{ width: '50%', display: 'flex', }}>
<div class='dealAlarms' style={{ width: (biggest > 0 ? ((mockData[1].dealAlarmCount / biggest) * 100 || '%') : 0), height: '100%' }}></div>
<div class='dealAlarms' style={{ width: (biggest > 0 ? ((mockData[1].dealAlarmCount / biggest) * 100 + '%') : 0), height: '100%' }}></div>
</div>
</div>
</div>) : ''
@ -651,10 +549,10 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou
<div class='structDiv'>{mockData[2]?.name?.length > 5 ? <Tooltip content={mockData[2]?.name}>{mockData[2]?.name.substring(0, 5) + '...'}</Tooltip> : mockData[0]?.name}</div>
<div class='barChartDiv'>
<div style={{ width: '50%', display: 'flex', justifyContent: 'flex-end' }}>
<div class='alarms' style={{ width: (biggest > 0 ? ((mockData[2].alarmCount / biggest) * 100 || '%') : 0), height: '100%' }}></div>
<div class='alarms' style={{ width: (biggest > 0 ? ((mockData[2].alarmCount / biggest) * 100 + '%') : 0), height: '100%' }}></div>
</div>
<div style={{ width: '50%', display: 'flex', }}>
<div class='dealAlarms' style={{ width: (biggest > 0 ? ((mockData[2].dealAlarmCount / biggest) * 100 || '%') : 0), height: '100%' }}></div>
<div class='dealAlarms' style={{ width: (biggest > 0 ? ((mockData[2].dealAlarmCount / biggest) * 100 + '%') : 0), height: '100%' }}></div>
</div>
</div>
</div>) : ''
@ -668,10 +566,10 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou
<div class='structDiv'>{item.name?.length > 5 ? <Tooltip content={item.name}>{item.name.substring(0, 5) + '...'}</Tooltip> : item.name}</div>
<div class='barChartDiv'>
<div style={{ width: '50%', display: 'flex', justifyContent: 'flex-end' }}>
<div class='alarms' style={{ width: (biggest > 0 ? ((item.alarmCount / biggest) * 100 || '%') : 0), height: '100%' }}></div>
<div class='alarms' style={{ width: (biggest > 0 ? ((item.alarmCount / biggest) * 100 + '%') : 0), height: '100%' }}></div>
</div>
<div style={{ width: '50%', display: 'flex', }}>
<div class='dealAlarms' style={{ width: (biggest > 0 ? ((item.dealAlarmCount / biggest) * 100 || '%') : 0), height: '100%' }}></div>
<div class='dealAlarms' style={{ width: (biggest > 0 ? ((item.dealAlarmCount / biggest) * 100 + '%') : 0), height: '100%' }}></div>
</div>
</div>

Loading…
Cancel
Save