Browse Source

管理大屏的优化

release_0.0.4
dengyinhuan 2 years ago
parent
commit
d85d489d69
  1. 20
      web/client/src/sections/quanju/containers/footer/guanli/index.js
  2. 2
      web/client/src/sections/quanju/containers/footer/guanli/style.less

20
web/client/src/sections/quanju/containers/footer/guanli/index.js

@ -11,6 +11,7 @@ const Guanli = (props) => {
const {dispatch} = props
const [leftDatas,setleftDatas] = useState([])
const [rightDatas,setrightDatas] = useState([])
const [rightitemlist,setrightitemlist] = useState()
const requestleftDatas = async()=>{
const res = await dispatch(getjiandmanage())
res.payload.data.sort((a,b)=>{
@ -21,8 +22,19 @@ const Guanli = (props) => {
}
const requestRightDatas = async()=>{
const res = await dispatch(getjiandetail())
// let d = res.payload.data?.overSpeedList.sort((a,b)=>b.processingTime < a.processingTime ?-1:1)
var pattern = /[\u4e00-\u9fa5]*/;
let d = res.payload.data?.overSpeedList?.filter((item,index)=>{
return escape(item.processingTime).indexOf("%u")<0
})
// let d2 = d.sort((a,b)=>b.processingTime < a.processingTime ?-1:1)
let d2 = d.sort((a, b) => b.processingTime.localeCompare(a.processingTime))
setrightDatas(res.payload.data)
// console.log(res,'嘿嘿嘿')
setrightitemlist(d)
console.log(d,'对比的数据')
console.log(d2,'完美')
console.log(res.payload.data,'嘿嘿嘿')
}
useEffect(()=>{
requestleftDatas();
@ -32,7 +44,7 @@ const Guanli = (props) => {
// datalist.fill({licensePlate:"赣A44454",overrunRate:"30%",fine:"200元",processingTime:"2020年4月1日"})
const renderContent = () => {
return <div style={{height:"100%"}}>
{rightDatas && rightDatas.length!==0?rightDatas.overSpeedList.map(({ id, licensePlate, overrunRate,fine,processingTime }, index) => {
{rightitemlist && rightitemlist.length!==0?rightitemlist?.map(({ id, licensePlate, overrunRate,fine,processingTime }, index) => {
if(index<30){
return <div key={index} className='guanli-right-item'>
<span>{licensePlate}</span>
@ -74,9 +86,9 @@ const Guanli = (props) => {
<span>车牌号</span>
<span>超限</span>
<span>处罚</span>
<span>日期</span>
<span>处理日期</span>
</div>
{rightDatas && rightDatas.length!==0?<AutoRollComponent content={renderContent()}
{rightitemlist && rightitemlist.length!==0?<AutoRollComponent content={renderContent()}
containerStyle={{ position: "relative", height: "90%", }}
divHeight={"100%"} divId={"chart-overview-deviceList"} />:<NoData style={{height:"70%"}}/>}
</Module>

2
web/client/src/sections/quanju/containers/footer/guanli/style.less

@ -72,7 +72,7 @@
width: 8px;
height: 8px;
background-color: #fff;
bottom: 7.0625rem;
top:1.5%;
left: 50%;
z-index: 10;
border-radius: 4px;

Loading…
Cancel
Save