diff --git a/web/client/assets/images/projectGroup/first.png b/web/client/assets/images/projectGroup/first.png new file mode 100644 index 0000000..9b8a315 Binary files /dev/null and b/web/client/assets/images/projectGroup/first.png differ diff --git a/web/client/assets/images/projectGroup/second.png b/web/client/assets/images/projectGroup/second.png new file mode 100644 index 0000000..6f8af3b Binary files /dev/null and b/web/client/assets/images/projectGroup/second.png differ diff --git a/web/client/assets/images/projectGroup/third.png b/web/client/assets/images/projectGroup/third.png new file mode 100644 index 0000000..996d8fd Binary files /dev/null and b/web/client/assets/images/projectGroup/third.png differ diff --git a/web/client/src/sections/projectGroup/containers/bigscreen.jsx b/web/client/src/sections/projectGroup/containers/bigscreen.jsx index 9eea52a..754bbb3 100644 --- a/web/client/src/sections/projectGroup/containers/bigscreen.jsx +++ b/web/client/src/sections/projectGroup/containers/bigscreen.jsx @@ -6,17 +6,84 @@ import Card from '../components/card' import '../style.less' import ReactECharts from 'echarts-for-react'; import moment from 'moment' +import { Tooltip, Tag } from '@douyinfe/semi-ui'; +import PerfectScrollbar from "perfect-scrollbar"; - +let overviewScrollbar; const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, groupStatisticOnline }) => { + const [alarmData,setAlarmData]=useState()//第三项之后的数据 + const [biggest,setBiggest]=useState()//最大的刻度值 useEffect(() => { let groupId = JSON.parse(localStorage.getItem('project_group'))?.find(v => user?.id == v.userId)?.projectGroupId console.log(); dispatch(actions.projectGroup.groupStatisticOnline({ groupId })) }, []) + useEffect(()=>{ + const domProject1 = document.getElementById("alarmRank"); + if (domProject1) { + overviewScrollbar = new PerfectScrollbar("#alarmRank", { + suppressScrollX: true, + }); + } + if (overviewScrollbar&&domProject1) { + overviewScrollbar.update(); + + } + }) + useEffect(()=>{ + const maxCombinedValue = mockData.reduce((max, item) => { + const combinedMax = Math.max(item.alarmCount, item.dealAlarmCount); + if (combinedMax > max) { + return combinedMax; + } + return max; + }, -Infinity) + setBiggest(maxCombinedValue) + + },[]) + const mockData=[ + {id: 1,name: '测试结构物测试结构物',alarmCount: 200,dealAlarmCount: 23}, + {id: 2,name: '测试结构物2',alarmCount: 150,dealAlarmCount: 22}, + {id: 3,name: '测试结构物3',alarmCount: 140,dealAlarmCount: 21}, + {id: 4,name: '测试结构物4',alarmCount: 120,dealAlarmCount: 23}, + {id: 5,name: '测试结构物5',alarmCount: 110,dealAlarmCount: 22}, + {id: 6,name: '测试结构物6',alarmCount: 109,dealAlarmCount: 21}, + {id: 7,name: '测试结构物7',alarmCount: 100,dealAlarmCount: 23}, + {id: 8,name: '测试结构物8',alarmCount: 99,dealAlarmCount: 22}, + {id: 9,name: '测试结构物9',alarmCount: 98,dealAlarmCount: 21}, + {id: 10,name: '测试结构物10',alarmCount: 97,dealAlarmCount: 23}, + {id: 11,name: '测试结构物11',alarmCount: 96,dealAlarmCount: 22}, + {id: 12,name: '测试结构物12',alarmCount: 95,dealAlarmCount: 21}, + {id: 13,name: '测试结构物13',alarmCount: 100,dealAlarmCount: 23}, + {id: 14,name: '测试结构物14',alarmCount: 49,dealAlarmCount: 22}, + {id: 15,name: '测试结构物15',alarmCount: 48,dealAlarmCount: 21}, + {id: 16,name: '测试结构物16',alarmCount: 47,dealAlarmCount: 23}, + {id: 17,name: '测试结构物17',alarmCount: 46,dealAlarmCount: 22}, + {id: 18,name: '测试结构物18',alarmCount: 45,dealAlarmCount: 21}, + {id: 19,name: '测试结构物19',alarmCount: 30,dealAlarmCount: 22}, + {id: 20,name: '测试结构物20',alarmCount: 29,dealAlarmCount: 21}, + {id: 21,name: '测试结构物21',alarmCount: 28,dealAlarmCount: 23}, + {id: 22,name: '测试结构物22',alarmCount: 27,dealAlarmCount: 22}, + {id: 23,name: '测试结构物23',alarmCount: 26,dealAlarmCount: 21}, + ] +useEffect(()=>{ + if(mockData.length>3&&mockData.length<21){ + const newArray = mockData.slice(3) + setAlarmData(newArray) + } + if(mockData.length>21){ + //数据大于20的话,取前20 + const newArray = mockData.slice(3,20) + setAlarmData(newArray) + } + +},[]) + + + console.log(groupStatisticOnline); return ( @@ -28,7 +95,7 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou