13 changed files with 446 additions and 370 deletions
After Width: | Height: | Size: 919 KiB |
@ -1,111 +1,124 @@ |
|||
"use strict"; |
|||
|
|||
import { ApiTable,basicAction } from "$utils"; |
|||
import { ApiTable, basicAction } from "$utils"; |
|||
|
|||
export function getCamera(query) { |
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "get", |
|||
dispatch: dispatch, |
|||
actionType: "GET_CAMREA", |
|||
query: query, |
|||
url: `${ApiTable.getCamera}`, |
|||
msg: { option: "获取摄像头列表信息" }, |
|||
reducer: { name: "equipmentWarehouseCamera", params: { noClear: true } }, |
|||
}); |
|||
export function getCamera (query) { |
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "get", |
|||
dispatch: dispatch, |
|||
actionType: "GET_CAMREA", |
|||
query: query, |
|||
url: `${ApiTable.getCamera}`, |
|||
msg: { option: "获取摄像头列表信息" }, |
|||
reducer: { name: "equipmentWarehouseCamera", params: { noClear: true } }, |
|||
}); |
|||
} |
|||
export function getCameraListAll() {//获取摄像头能力列表
|
|||
return (dispatch) => |
|||
export function getCameraListAll () {//获取摄像头能力列表
|
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "get", |
|||
dispatch: dispatch, |
|||
actionType: "GET_CAMERA_LIST_ALL", |
|||
url: `${ApiTable.getCameraListAll}`, |
|||
msg: { option: "" }, |
|||
reducer: { name: "" }, |
|||
}); |
|||
type: "get", |
|||
dispatch: dispatch, |
|||
actionType: "GET_CAMERA_LIST_ALL", |
|||
url: `${ApiTable.getCameraListAll}`, |
|||
msg: { option: "" }, |
|||
reducer: { name: "" }, |
|||
}); |
|||
} |
|||
export function getMirrorList() {//获取摄像头能力列表
|
|||
return (dispatch) => |
|||
export function getMirrorList () {//获取镜像信息列表
|
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "get", |
|||
dispatch: dispatch, |
|||
actionType: "GET_MIRROR_LIST", |
|||
url: `${ApiTable.getMirrorList}`, |
|||
msg: { option: "" }, |
|||
reducer: { name: "" }, |
|||
}); |
|||
type: "get", |
|||
dispatch: dispatch, |
|||
actionType: "GET_MIRROR_LIST", |
|||
url: `${ApiTable.getMirrorList}`, |
|||
msg: { option: "" }, |
|||
reducer: { name: "" }, |
|||
}); |
|||
} |
|||
export function delMirror(orgId) {//删除镜像信息
|
|||
return (dispatch) => |
|||
export function delMirror (orgId) {//删除镜像信息
|
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "del", |
|||
dispatch: dispatch, |
|||
actionType: "DEL_MIRROR", |
|||
url: `${ApiTable.delMirror.replace("{mirrorId}", orgId)}`, |
|||
msg: { |
|||
option: |
|||
"删除镜像信息", |
|||
}, |
|||
reducer: { name: "" }, |
|||
}); |
|||
type: "del", |
|||
dispatch: dispatch, |
|||
actionType: "DEL_MIRROR", |
|||
url: `${ApiTable.delMirror.replace("{mirrorId}", orgId)}`, |
|||
msg: { |
|||
option: |
|||
"删除镜像信息", |
|||
}, |
|||
reducer: { name: "" }, |
|||
}); |
|||
} |
|||
export function putMirrorCopy(orgId) { //编辑推送配置
|
|||
return (dispatch) => |
|||
export function putMirrorCopy (orgId) { //编辑推送配置
|
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "put", |
|||
dispatch: dispatch, |
|||
actionType: "PUT_MIRROR_COPY", |
|||
url: `${ApiTable.putMirrorCopy.replace("{mirrorId}", orgId)}`, |
|||
msg: { option: '复制镜像信息' }, |
|||
reducer: {}, |
|||
}); |
|||
type: "put", |
|||
dispatch: dispatch, |
|||
actionType: "PUT_MIRROR_COPY", |
|||
url: `${ApiTable.putMirrorCopy.replace("{mirrorId}", orgId)}`, |
|||
msg: { option: '复制镜像信息' }, |
|||
reducer: {}, |
|||
}); |
|||
} |
|||
export function putMirrorPublish(orgId) { //编辑推送配置
|
|||
return (dispatch) => |
|||
export function putMirrorPublish (orgId) { //编辑推送配置
|
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "put", |
|||
dispatch: dispatch, |
|||
actionType: "PUT_MIRROR_PUBLISH", |
|||
url: `${ApiTable.putMirrorPublish.replace("{mirrorId}", orgId)}`, |
|||
msg: { option: '发布镜像信息' }, |
|||
reducer: {}, |
|||
}); |
|||
type: "put", |
|||
dispatch: dispatch, |
|||
actionType: "PUT_MIRROR_PUBLISH", |
|||
url: `${ApiTable.putMirrorPublish.replace("{mirrorId}", orgId)}`, |
|||
msg: { option: '发布镜像信息' }, |
|||
reducer: {}, |
|||
}); |
|||
} |
|||
|
|||
export function getMirrorDetail(orgId) {//获取摄像头能力列表
|
|||
return (dispatch) => |
|||
export function getMirrorDetail (orgId) {//获取摄像头能力列表
|
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "get", |
|||
dispatch: dispatch, |
|||
actionType: "GET_MIRROR", |
|||
url: `${ApiTable.getMirror.replace("{mid}", orgId)}`, |
|||
msg: { option: "" }, |
|||
reducer: { name: "" }, |
|||
}); |
|||
type: "get", |
|||
dispatch: dispatch, |
|||
actionType: "GET_MIRROR", |
|||
url: `${ApiTable.getMirror.replace("{mid}", orgId)}`, |
|||
msg: { option: "" }, |
|||
reducer: { name: "" }, |
|||
}); |
|||
} |
|||
export function putMirror(data) { //编辑推送配置
|
|||
return (dispatch) => |
|||
export function putMirror (data) { //编辑推送配置
|
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "put", |
|||
dispatch: dispatch, |
|||
data, |
|||
actionType: "PUT_MIRROR", |
|||
url: `${ApiTable.putMirror}`, |
|||
msg: { option: '编辑镜像信息' }, |
|||
reducer: {}, |
|||
}); |
|||
type: "put", |
|||
dispatch: dispatch, |
|||
data, |
|||
actionType: "PUT_MIRROR", |
|||
url: `${ApiTable.putMirror}`, |
|||
msg: { option: '编辑镜像信息' }, |
|||
reducer: {}, |
|||
}); |
|||
} |
|||
|
|||
export function getErrorCode(query) {//查取指定状态码信息
|
|||
export function getErrorCode (query) {//查取指定状态码信息
|
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "get", |
|||
dispatch: dispatch, |
|||
query, |
|||
actionType: "GET_ERRORCODE", |
|||
url: `${ApiTable.getErrorCode}`, |
|||
msg: { option: "" }, |
|||
reducer: { name: "" }, |
|||
}); |
|||
basicAction({ |
|||
type: "get", |
|||
dispatch: dispatch, |
|||
query, |
|||
actionType: "GET_ERRORCODE", |
|||
url: `${ApiTable.getErrorCode}`, |
|||
msg: { option: "" }, |
|||
reducer: { name: "" }, |
|||
}); |
|||
} |
|||
|
|||
|
|||
export function getMirrorMid (orgId) {//获取指定镜像信息
|
|||
return (dispatch) => |
|||
basicAction({ |
|||
type: "get", |
|||
dispatch: dispatch, |
|||
actionType: "GET_MIRRORMID", |
|||
url: `${ApiTable.getMirrorMid.replace("{mid}", orgId)}`, |
|||
msg: { option: "" }, |
|||
reducer: { name: "" }, |
|||
}) |
|||
} |
@ -0,0 +1,76 @@ |
|||
import React, { useEffect, useState } from 'react'; |
|||
import { connect } from 'react-redux'; |
|||
import { tree } from './mirroringDetail'; |
|||
import VideoScreen from '../components/videoScreen'; |
|||
|
|||
|
|||
|
|||
|
|||
const CallService = (props) => { |
|||
const { dispatch, actions, user } = props |
|||
const [treeData, setTreeData] = useState([]) //树形控件数据 |
|||
const [headerName, setHeaderName] = useState('dfvbfdbe') |
|||
const [showHeader, setShowHeader] = useState(true) //是否展示头部 |
|||
const [filterGroup, setFilterGroup] = useState([]) //筛选项数据 |
|||
const [template, setTemplate] = useState('') //主题颜色 |
|||
const [videoPlay, setVideoPlay] = useState(true) //视频预览 |
|||
|
|||
useEffect(() => { |
|||
|
|||
|
|||
dispatch(actions.openness.getMirrorList()).then((res) => { |
|||
if (res?.success && res?.payload?.data?.some(v => v.mid == user?.mid)) { |
|||
dispatch(actions.openness.getMirrorMid(user?.mid)).then((r) => { |
|||
if (r?.success) { |
|||
let data = r?.payload?.data || {} |
|||
|
|||
let filterGrouplist =data.filterGroup |
|||
for (let i = 0; i < filterGrouplist.length; i++) { |
|||
filterGrouplist[i].num = i |
|||
if (filterGrouplist[i].filters.length > 0) { |
|||
for (let j = 0; j < filterGrouplist[i].filters.length; j++) { |
|||
filterGrouplist[i].filters[j].num = j |
|||
} |
|||
} |
|||
} |
|||
setTreeData(tree(data.tree)) |
|||
setHeaderName(data.title) |
|||
setShowHeader(data.showHeader) |
|||
setFilterGroup(filterGrouplist) |
|||
setTemplate(data.template) |
|||
} |
|||
}) |
|||
} else { |
|||
dispatch(push('/callService')); |
|||
} |
|||
}) |
|||
|
|||
}, []) |
|||
|
|||
return ( |
|||
<div style={{ width: '100%', height: '100%' }}> |
|||
|
|||
{treeData ? <VideoScreen |
|||
treeData={treeData} |
|||
headerName={headerName} |
|||
showHeader={showHeader} |
|||
filterGroup={filterGroup} |
|||
template={template} |
|||
videoPlay={videoPlay} /> : ""} |
|||
</div> |
|||
) |
|||
} |
|||
|
|||
function mapStateToProps (state) { |
|||
const { auth, global, members } = state; |
|||
console.log('ccccccccccc', state) |
|||
return { |
|||
loading: members.isRequesting, |
|||
user: auth.user, |
|||
actions: global.actions, |
|||
global: global, |
|||
members: members.data, |
|||
}; |
|||
} |
|||
|
|||
export default connect(mapStateToProps)(CallService); |
Loading…
Reference in new issue