Browse Source

feat:gaojing

dev
zhaobing’ 1 year ago
parent
commit
407e8de9cb
  1. 278
      web/client/src/sections/projectGroup/containers/bigscreen.jsx

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

@ -63,188 +63,86 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou
} }
}, []) }, [])
// const mockData=[ // const mockData=[
// { // {
// "name": "西", // "name": "西",
// "id": 2957, // "id": 2957,
// "alarmCount": 0, // "alarmCount": 6,
// "dealAlarmCount": 0 // "dealAlarmCount": 0
// }, // },
// { // {
// "name": "-绿", // "name": "-绿",
// "id": 2966, // "id": 2966,
// "alarmCount": 0, // "alarmCount": 1,
// "dealAlarmCount": 0 // "dealAlarmCount": 0
// }, // },
// { // {
// "name": "-绿", // "name": "-绿",
// "id": 2967, // "id": 2967,
// "alarmCount": 0, // "alarmCount": 3,
// "dealAlarmCount": 0 // "dealAlarmCount": 0
// }, // },
// { // {
// "name": "", // "name": "",
// "id": 2973, // "id": 2973,
// "alarmCount": 0, // "alarmCount": 0,
// "dealAlarmCount": 0 // "dealAlarmCount": 0
// }, // },
// { // {
// "name": "", // "name": "",
// "id": 2975, // "id": 2975,
// "alarmCount": 0, // "alarmCount": 0,
// "dealAlarmCount": 0 // "dealAlarmCount": 0
// }, // },
// { // {
// "name": "", // "name": "",
// "id": 2977, // "id": 2977,
// "alarmCount": 0, // "alarmCount": 0,
// "dealAlarmCount": 0 // "dealAlarmCount": 0
// }, // },
// { // {
// "name": "", // "name": "",
// "id": 2988, // "id": 2988,
// "alarmCount": 0, // "alarmCount": 0,
// "dealAlarmCount": 0 // "dealAlarmCount": 0
// }, // },
// { // {
// "name": "", // "name": "",
// "id": 3004, // "id": 3004,
// "alarmCount": 0, // "alarmCount": 0,
// "dealAlarmCount": 0 // "dealAlarmCount": 0
// }, // },
// { // {
// "name": "驿", // "name": "驿",
// "id": 3007, // "id": 3007,
// "alarmCount": 0, // "alarmCount": 0,
// "dealAlarmCount": 0 // "dealAlarmCount": 0
// }, // },
// { // {
// "name": "", // "name": "",
// "id": 3008, // "id": 3004,
// "alarmCount": 0, // "alarmCount": 0,
// "dealAlarmCount": 0 // "dealAlarmCount": 0
// }, // },
// { // {
// "name": "", // "name": "驿",
// "id": 3010, // "id": 3007,
// "alarmCount": 0, // "alarmCount": 0,
// "dealAlarmCount": 0 // "dealAlarmCount": 0
// }, // },
// { // {
// "name": "", // "name": "",
// "id": 3023, // "id": 3004,
// "alarmCount": 0, // "alarmCount": 0,
// "dealAlarmCount": 0 // "dealAlarmCount": 0
// }, // },
// { // {
// "name": "", // "name": "驿",
// "id": 3024, // "id": 3007,
// "alarmCount": 0, // "alarmCount": 0,
// "dealAlarmCount": 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
// },
// ]
useEffect(() => { useEffect(() => {
const overview = document.getElementById("alarmRank"); const overview = document.getElementById("alarmRank");
if (overview) { if (overview) {
@ -620,10 +518,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='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 class='barChartDiv'>
<div style={{ width: '50%', display: 'flex', justifyContent: 'flex-end' }}> <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>
<div style={{ width: '50%', display: 'flex', }}> <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> </div>
</div>) : '' </div>) : ''
@ -635,10 +533,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='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 class='barChartDiv'>
<div style={{ width: '50%', display: 'flex', justifyContent: 'flex-end' }}> <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>
<div style={{ width: '50%', display: 'flex', }}> <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> </div>
</div>) : '' </div>) : ''
@ -650,10 +548,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='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 class='barChartDiv'>
<div style={{ width: '50%', display: 'flex', justifyContent: 'flex-end' }}> <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>
<div style={{ width: '50%', display: 'flex', }}> <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> </div>
</div>) : '' </div>) : ''
@ -667,10 +565,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='structDiv'>{item.name?.length > 5 ? <Tooltip content={item.name}>{item.name.substring(0, 5) + '...'}</Tooltip> : item.name}</div>
<div class='barChartDiv'> <div class='barChartDiv'>
<div style={{ width: '50%', display: 'flex', justifyContent: 'flex-end' }}> <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>
<div style={{ width: '50%', display: 'flex', }}> <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>
</div> </div>

Loading…
Cancel
Save