Browse Source

添加数据源

master
dengyinhuan 2 years ago
parent
commit
35ff9309c2
  1. 15
      web/client/src/sections/shouye/containers/shouye.js

15
web/client/src/sections/shouye/containers/shouye.js

@ -12,6 +12,7 @@ const Information = (props) => {
const { patrolManage, issueHandle } = actions
const [planedata,setplandata] = useState([])
const [xunjiandata,setxunjiandata] = useState([])
const [shijiandata,setshijiandata] = useState([])
const topdata =[]
const format = 'YYYY-MM-DD HH:mm:ss'
const times = [moment().subtract(70, 'years').format(format), moment().format(format)]
@ -19,6 +20,7 @@ const Information = (props) => {
dispatch(getPatrolPlan()).then(async (res)=>{
const res2 = await dispatch(patrolManage.records(`patrolRecord/all/${times[0]}/${times[1]}/null/null`))
console.log(res2,'res2')
setshijiandata(res2?.payload?.data)
setxunjiandata(res2?.payload?.data.filter(i=>parseInt(moment().format('YYYYMMDD'))=== parseInt(moment(i.inspectionTime ).format('YYYYMMDD'))))
const count = res?.payload?.data?.rows?.filter(i=>{
// console.log(i?.frequency?.match(/^[0-9]*$/),'jjj')
@ -59,22 +61,21 @@ const Information = (props) => {
</div>
<div className='shouyetopitem'>
<div className='shouyetopitem-left' >
<div>今日巡检</div>
<div>0</div>
<div>今日事件</div>
<div>{xunjiandata.filter(i=>i?.alarm===true).length}</div>
</div>
<div className='shouyetopitem-right'>
<div>完成巡检2</div>
<div>巡检上报2</div>
<div>已处理</div>
<div>未处理2</div>
</div>
</div>
<div className='shouyetopitem'>
<div className='shouyetopitem-left' >
<div>今日巡检</div>
<div>今日预警</div>
<div>0</div>
</div>
<div className='shouyetopitem-right'>
<div>完成巡检2</div>
<div>巡检上报2</div>
<div>已下发2</div>
</div>
</div>
</div>

Loading…
Cancel
Save