Browse Source

feat:fix bugs

dev
zhaobing’ 1 year ago
parent
commit
0f188eb122
  1. 215
      web/client/src/sections/projectGroup/containers/bigscreen.jsx

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

@ -64,7 +64,188 @@ 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
// },
// {
// "name": "",
// "id": 3004,
// "alarmCount": 0,
// "dealAlarmCount": 0
// },
// {
// "name": "驿",
// "id": 3007,
// "alarmCount": 0,
// "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
// },
// ]
useEffect(() => {
const overview = document.getElementById("alarmRank");
if (overview) {
@ -87,6 +268,7 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou
interrupt.update();
}
})
useEffect(() => {
const maxCombinedValue = mockData?.reduce((max, item) => {
const combinedMax = Math.max(item.alarmCount, item.dealAlarmCount);
@ -95,7 +277,6 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou
}
return max;
}, -Infinity)
console.log('setAlarmData4',maxCombinedValue)
const bigD= Math.ceil(maxCombinedValue/50)*50
if(bigD==0){
setXData([5,4,3,2,1,0,1,2,3,4,5])//0
@ -103,7 +284,16 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou
setXData([bigD,(bigD-bigD/5),(bigD-bigD*2/5),(bigD-bigD*3/5),(bigD-bigD*4/5),0,(bigD-bigD*4/5),(bigD-bigD*3/5),(bigD-bigD*2/5),(bigD-bigD/5),bigD])
}
setBiggest(bigD)
},[])
if (mockData && mockData.length > 3 && mockData.length < 21) {
const newArray = mockData.slice(3)
setAlarmData(newArray)
}
if (mockData && mockData.length > 21) {
//2020
const newArray = mockData.slice(3, 20)
setAlarmData(newArray)
}
},[mockData])
// const mockData=[
// {id: 1,name: '',alarmCount: 200,dealAlarmCount: 23},
@ -130,20 +320,6 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou
// {id: 22,name: '22',alarmCount: 27,dealAlarmCount: 22},
// {id: 23,name: '23',alarmCount: 26,dealAlarmCount: 21},
// ]
useEffect(() => {
if (mockData && mockData.length > 3 && mockData.length < 21) {
const newArray = mockData.slice(3)
setAlarmData(newArray)
}
if (mockData && mockData.length > 21) {
//2020
const newArray = mockData.slice(3, 20)
setAlarmData(newArray)
}
}, [])
let statisticOnline = (groupId) => {
dispatch(actions.projectGroup.groupStatisticOnline({ groupId })).then(res => {
@ -246,10 +422,6 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou
};
}, [proportion]);
console.log('setAlarmData3',alarmData)
console.log(groupStatisticOnline);
return (
<div className='project-group'>
<Header match={match} history={history} />
@ -444,6 +616,7 @@ console.log('setAlarmData3',alarmData)
</div>
</div>
<div id='alarmRank' style={{ height: clientHeight * 0.55 - 150, position: 'relative' }}>
{mockData && mockData[0] ? (<div style={{ display: 'flex', marginTop: 15, alignItems: 'center' }}>
<div class='rankDiv'>
<img src='/assets/images/projectGroup/first.png'></img>

Loading…
Cancel
Save