|
|
@ -14,7 +14,7 @@ import { request } from 'screenfull'; |
|
|
|
import { useRef } from 'react'; |
|
|
|
import { render } from 'less'; |
|
|
|
|
|
|
|
const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { |
|
|
|
const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb }) => { |
|
|
|
let route = match.url.substring(match.url.lastIndexOf("/") + 1, match.url.length) |
|
|
|
|
|
|
|
const { problem } = actions |
|
|
@ -36,6 +36,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { |
|
|
|
const [tableData, setTableData] = useState([]) //表格数据 |
|
|
|
const [videoModal, setVideoModal] = useState(false) //视频播放弹框 |
|
|
|
const [videoData, setVideoData] = useState({}) //视频播放参数 |
|
|
|
const [videoToken, setVideoToken] = useState() //视频token |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -57,9 +58,14 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { |
|
|
|
: ""; |
|
|
|
} |
|
|
|
attribute(tableType[route], route); |
|
|
|
|
|
|
|
//视频平台token |
|
|
|
dispatch(problem.getVcmpAuth({})).then((res) => { |
|
|
|
if (res.success) setVideoToken(res.payload.data?.token) |
|
|
|
}) |
|
|
|
}, []) |
|
|
|
|
|
|
|
// console.log(selected); |
|
|
|
// console.log(videoData); |
|
|
|
|
|
|
|
//搜索结构 |
|
|
|
const collectData = { |
|
|
@ -277,7 +283,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { |
|
|
|
}, |
|
|
|
{ name: '设备厂家', sort: 10, value: 'venderName', render: (_, r, index) => r.platform ? '未知' : r.venderName }, |
|
|
|
{ name: '通道号', sort: 10.1, value: 'cameraChannelNo' }, |
|
|
|
{ name: '系列号', sort: 10.2, value: 'cameraSerialNo' }, |
|
|
|
{ name: '序列号', sort: 10.2, value: 'cameraSerialNo' }, |
|
|
|
{ |
|
|
|
name: '接入方式', sort: 9, value: 'platform', render: (_, r, index) => { |
|
|
|
let accessType = { yingshi: "萤石云", nvr: "NVR", ipc: "IPC", cascade: "级联" } |
|
|
@ -288,7 +294,12 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { |
|
|
|
{ name: 'URL地址', sort: 16, value: 'url' }, |
|
|
|
{ name: '异常类型', sort: 6, value: 'type' }, |
|
|
|
{ name: '解决方案', sort: 17, value: 'resolve', render: (_, r, index) => r.resolve?.map(v => <div key={v.resolve + v.id} style={{ lineHeight: "22px" }}>{v.resolve}</div>) }, |
|
|
|
{ name: '在离线', sort: 18, value: 'camerOnline' }, |
|
|
|
{ |
|
|
|
name: '在离线', sort: 18, value: 'camerOnline', render: (_, r, index) => { |
|
|
|
let data = { ON: '在线', ONLINE: "在线", OFF: "离线" } |
|
|
|
return data[r.camerOnline] || '未知' |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: '操作', sort: 25, value: 'text', render: (_, r, index) => { |
|
|
|
return <div style={{ width: 195 }}> |
|
|
@ -312,7 +323,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { |
|
|
|
<Button theme='borderless' style={{ width: 65 }} disabled>已派单</Button> |
|
|
|
<Button theme='borderless' style={{ width: 65 }} onClick={() => { |
|
|
|
setVideoModal(true) |
|
|
|
setVideoData({ channeNo: r.cameraChannelNo, serialNo: r.cameraSerialNo, type: r.platform }) |
|
|
|
setVideoData({ channeNo: r.cameraChannelNo, serialNo: r.cameraSerialNo, type: r.platform, yingshiToken: r.yingshiToken }) |
|
|
|
}}>播放</Button> |
|
|
|
</> : "" |
|
|
|
} |
|
|
@ -322,7 +333,6 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const attribute = (name, route) => { |
|
|
|
let arr = localStorage.getItem(name) |
|
|
|
? JSON.parse(localStorage.getItem(name)) |
|
|
@ -505,12 +515,13 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { |
|
|
|
<div style={{ width: 918, height: 460, marginLeft: -24 }}> |
|
|
|
<iframe |
|
|
|
allowFullScreen |
|
|
|
src={`https://mediaconsole.ngaiot.com/video_play_cross?slideDown=true&videoObj=${encodeURIComponent(JSON.stringify({ |
|
|
|
channelNo: 1, |
|
|
|
content: ['5442542542', '452345', '234524525'], |
|
|
|
serialNo: "F61504020", |
|
|
|
type: "yingshi", |
|
|
|
yingshiToken: "at.7tj6k9mzcwmn112xag96e23tcdsta8nn-7p2qvqv6zq-1k500nr-tsd9bn01o" |
|
|
|
src={`${iotVcmpWeb}/video_play_cross?videoObj=${encodeURIComponent(JSON.stringify({ |
|
|
|
channelNo: videoData.channeNo, |
|
|
|
// content: ['5442542542', '452345', '234524525'], |
|
|
|
serialNo: videoData.serialNo, |
|
|
|
type: videoData.type, |
|
|
|
yingshiToken: videoData.yingshiToken, |
|
|
|
videoToken: videoToken, |
|
|
|
// type: 'cascade', |
|
|
|
// serialNo: '34020000001310000003', // 设备序列号 必须 |
|
|
|
// topSerialNo: '34020000001110000079', // 设备顶级序列号 必须 |
|
|
@ -548,6 +559,7 @@ function mapStateToProps (state) { |
|
|
|
// loading: members.isRequesting, |
|
|
|
user: auth.user, |
|
|
|
actions: global.actions, |
|
|
|
iotVcmpWeb: global.iotVcmpWeb, |
|
|
|
// members: members.data, |
|
|
|
// socket: webSocket.socket |
|
|
|
} |
|
|
|