|
@ -1,6 +1,6 @@ |
|
|
import React, { useState, useRef, useEffect } from "react"; |
|
|
import React, { useState, useRef, useEffect } from "react"; |
|
|
import { connect } from "react-redux"; |
|
|
import { connect } from "react-redux"; |
|
|
import { Modal, Spin,Input,Collapse ,SideSheet,Tabs, TabPane,Popover} from "@douyinfe/semi-ui"; |
|
|
import { Modal, Spin,Tag, Space,Collapse ,SideSheet,Tabs, TabPane,Popover} from "@douyinfe/semi-ui"; |
|
|
import moment from "moment"; |
|
|
import moment from "moment"; |
|
|
import './pushSideSheet.less' |
|
|
import './pushSideSheet.less' |
|
|
import { push } from "react-router-redux"; |
|
|
import { push } from "react-router-redux"; |
|
@ -13,8 +13,8 @@ function pushSideSheet (props) { |
|
|
} = props; |
|
|
} = props; |
|
|
const { offline } = actions; |
|
|
const { offline } = actions; |
|
|
const [logList, setLogList] = useState([]);//日志列表 |
|
|
const [logList, setLogList] = useState([]);//日志列表 |
|
|
const [noticeTest, setNoticeTest] = useState('');//通知列表 |
|
|
const [noticeTest, setNoticeTest] = useState([]);//通知列表 |
|
|
const [equipmentTest, setEquipmentTest] = useState();//设备列表 |
|
|
const [equipmentTest, setEquipmentTest] = useState([]);//设备列表 |
|
|
|
|
|
|
|
|
//初始化 |
|
|
//初始化 |
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
@ -30,7 +30,8 @@ function pushSideSheet (props) { |
|
|
title:getTimeTitle(journal[index].time), |
|
|
title:getTimeTitle(journal[index].time), |
|
|
time:getTimeData(journal[index].time), |
|
|
time:getTimeData(journal[index].time), |
|
|
cameraList:camerTest, |
|
|
cameraList:camerTest, |
|
|
receiverList:receiverTest |
|
|
receiverList:receiverTest, |
|
|
|
|
|
noticeWay:journal[index].noticeWay[0], |
|
|
} |
|
|
} |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
@ -56,23 +57,21 @@ function pushSideSheet (props) { |
|
|
for (let j = 0; j < showList.length; j++) { |
|
|
for (let j = 0; j < showList.length; j++) { |
|
|
for (let i = 0; i < timeList.length; i++) { |
|
|
for (let i = 0; i < timeList.length; i++) { |
|
|
if(timeList[i].title==showList[j].title){ |
|
|
if(timeList[i].title==showList[j].title){ |
|
|
showList[j].timeList.push({time:timeList[i].time,cameraList:timeList[i].cameraList,receiverList:timeList[i].receiverList}) |
|
|
showList[j].timeList.push({time:timeList[i].time,cameraList:timeList[i].cameraList,receiverList:timeList[i].receiverList,noticeWay:timeList[i].noticeWay,}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
setLogList(showList) |
|
|
setLogList(showList) |
|
|
let noticeList ='' |
|
|
let noticeList =[] |
|
|
for (let i = 0; i < pushData.cameraStatusPushReceivers.length; i++) { |
|
|
for (let i = 0; i < pushData.cameraStatusPushReceivers.length; i++) { |
|
|
noticeList=noticeList+pushData.cameraStatusPushReceivers[i].receiver+';' |
|
|
noticeList.push(pushData.cameraStatusPushReceivers[i].receiver) |
|
|
} |
|
|
} |
|
|
setNoticeTest(noticeList) |
|
|
setNoticeTest(noticeList) |
|
|
|
|
|
let equipmentList=[] |
|
|
let equipmentList='' |
|
|
|
|
|
for (let i = 0; i < pushData.cameraStatusPushMonitors.length; i++) { |
|
|
for (let i = 0; i < pushData.cameraStatusPushMonitors.length; i++) { |
|
|
noticeList=noticeList+pushData.cameraStatusPushMonitors[i].camera.name+';' |
|
|
equipmentList.push(pushData.cameraStatusPushMonitors[i].camera.name) |
|
|
} |
|
|
} |
|
|
setEquipmentTest(equipmentList) |
|
|
setEquipmentTest(equipmentList) |
|
|
console.log('pushData',pushData); |
|
|
|
|
|
}, []); |
|
|
}, []); |
|
|
function getTimeTitle(date){ |
|
|
function getTimeTitle(date){ |
|
|
let year = moment(date).year()+'年' |
|
|
let year = moment(date).year()+'年' |
|
@ -94,7 +93,7 @@ function pushSideSheet (props) { |
|
|
<SideSheet title={pushData.name} className='sideSheet' width={670} visible={true} onCancel={sideSheetChange}> |
|
|
<SideSheet title={pushData.name} className='sideSheet' width={670} visible={true} onCancel={sideSheetChange}> |
|
|
<Tabs type="line"> |
|
|
<Tabs type="line"> |
|
|
<TabPane tab="推送日志" itemKey="1"> |
|
|
<TabPane tab="推送日志" itemKey="1"> |
|
|
<Collapse> |
|
|
<Collapse defaultActiveKey="0"> |
|
|
{logList.map((item, index) => { |
|
|
{logList.map((item, index) => { |
|
|
return ( |
|
|
return ( |
|
|
<Collapse.Panel header={<div style={{width:'100%',textAlign:'center'}}>{item.title}</div>} itemKey={String(index)} key={index} > |
|
|
<Collapse.Panel header={<div style={{width:'100%',textAlign:'center'}}>{item.title}</div>} itemKey={String(index)} key={index} > |
|
@ -116,7 +115,7 @@ function pushSideSheet (props) { |
|
|
}> |
|
|
}> |
|
|
<div style={{marginRight:24,width:133,textOverflow:'ellipsis',whiteSpace:'nowrap',overflow:'hidden'}}>{itm.cameraList}</div> |
|
|
<div style={{marginRight:24,width:133,textOverflow:'ellipsis',whiteSpace:'nowrap',overflow:'hidden'}}>{itm.cameraList}</div> |
|
|
</Popover> |
|
|
</Popover> |
|
|
<div style={{marginRight:25,width:83}} className='online' >上线及时通知</div> |
|
|
<div style={{marginRight:25,width:83}} className={itm.noticeWay=='online'?'online':itm.noticeWay=='offline'?'offline':'timing'}>{itm.noticeWay=='online'?'上线及时通知':itm.noticeWay=='offline'?'离线即时通知':'24时定时统计'}</div> |
|
|
</div> |
|
|
</div> |
|
|
) |
|
|
) |
|
|
})} |
|
|
})} |
|
@ -129,9 +128,17 @@ function pushSideSheet (props) { |
|
|
<img |
|
|
<img |
|
|
src="/assets/images/background/icon_camera.png" |
|
|
src="/assets/images/background/icon_camera.png" |
|
|
alt="设置" |
|
|
alt="设置" |
|
|
style={{ width: 24, height: 24 }} |
|
|
style={{ width: 26, height: 26 }} |
|
|
/> |
|
|
/> |
|
|
<div>{equipmentTest}</div> |
|
|
<div style={{marginTop:1,background: '#F1F5FF',padding:14,minHeight:139}}> |
|
|
|
|
|
<Space wrap> |
|
|
|
|
|
{equipmentTest.map((item, index) => { |
|
|
|
|
|
return( |
|
|
|
|
|
<Tag color='blue' style={{height:33}} type='solid' key={index}>{item}</Tag> |
|
|
|
|
|
) |
|
|
|
|
|
})} |
|
|
|
|
|
</Space> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</TabPane> |
|
|
</TabPane> |
|
|
<TabPane tab="接收信息" itemKey="3"> |
|
|
<TabPane tab="接收信息" itemKey="3"> |
|
@ -139,9 +146,17 @@ function pushSideSheet (props) { |
|
|
<img |
|
|
<img |
|
|
src={pushData.pushWay=='email'?"/assets/images/background/icon_email.png":"/assets/images/background/icon_phone.png"} |
|
|
src={pushData.pushWay=='email'?"/assets/images/background/icon_email.png":"/assets/images/background/icon_phone.png"} |
|
|
alt="设置" |
|
|
alt="设置" |
|
|
style={{ width: 24, height: 24 }} |
|
|
style={{ width: 26, height: 26 }} |
|
|
/> |
|
|
/> |
|
|
<div>{noticeTest}</div> |
|
|
<div style={{marginTop:1,background: '#F1F5FF',padding:14,minHeight:139}}> |
|
|
|
|
|
<Space wrap> |
|
|
|
|
|
{noticeTest.map((item, index) => { |
|
|
|
|
|
return( |
|
|
|
|
|
<Tag color='blue' style={{height:33}} type='solid' key={index}>{item}</Tag> |
|
|
|
|
|
) |
|
|
|
|
|
})} |
|
|
|
|
|
</Space> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</TabPane> |
|
|
</TabPane> |
|
|
</Tabs> |
|
|
</Tabs> |
|
|