13 changed files with 446 additions and 370 deletions
After Width: | Height: | Size: 919 KiB |
@ -1,111 +1,124 @@ |
|||||
"use strict"; |
"use strict"; |
||||
|
|
||||
import { ApiTable,basicAction } from "$utils"; |
import { ApiTable, basicAction } from "$utils"; |
||||
|
|
||||
export function getCamera(query) { |
export function getCamera (query) { |
||||
return (dispatch) => |
return (dispatch) => |
||||
basicAction({ |
basicAction({ |
||||
type: "get", |
type: "get", |
||||
dispatch: dispatch, |
dispatch: dispatch, |
||||
actionType: "GET_CAMREA", |
actionType: "GET_CAMREA", |
||||
query: query, |
query: query, |
||||
url: `${ApiTable.getCamera}`, |
url: `${ApiTable.getCamera}`, |
||||
msg: { option: "获取摄像头列表信息" }, |
msg: { option: "获取摄像头列表信息" }, |
||||
reducer: { name: "equipmentWarehouseCamera", params: { noClear: true } }, |
reducer: { name: "equipmentWarehouseCamera", params: { noClear: true } }, |
||||
}); |
}); |
||||
} |
} |
||||
export function getCameraListAll() {//获取摄像头能力列表
|
export function getCameraListAll () {//获取摄像头能力列表
|
||||
return (dispatch) => |
return (dispatch) => |
||||
basicAction({ |
basicAction({ |
||||
type: "get", |
type: "get", |
||||
dispatch: dispatch, |
dispatch: dispatch, |
||||
actionType: "GET_CAMERA_LIST_ALL", |
actionType: "GET_CAMERA_LIST_ALL", |
||||
url: `${ApiTable.getCameraListAll}`, |
url: `${ApiTable.getCameraListAll}`, |
||||
msg: { option: "" }, |
msg: { option: "" }, |
||||
reducer: { name: "" }, |
reducer: { name: "" }, |
||||
}); |
}); |
||||
} |
} |
||||
export function getMirrorList() {//获取摄像头能力列表
|
export function getMirrorList () {//获取镜像信息列表
|
||||
return (dispatch) => |
return (dispatch) => |
||||
basicAction({ |
basicAction({ |
||||
type: "get", |
type: "get", |
||||
dispatch: dispatch, |
dispatch: dispatch, |
||||
actionType: "GET_MIRROR_LIST", |
actionType: "GET_MIRROR_LIST", |
||||
url: `${ApiTable.getMirrorList}`, |
url: `${ApiTable.getMirrorList}`, |
||||
msg: { option: "" }, |
msg: { option: "" }, |
||||
reducer: { name: "" }, |
reducer: { name: "" }, |
||||
}); |
}); |
||||
} |
} |
||||
export function delMirror(orgId) {//删除镜像信息
|
export function delMirror (orgId) {//删除镜像信息
|
||||
return (dispatch) => |
return (dispatch) => |
||||
basicAction({ |
basicAction({ |
||||
type: "del", |
type: "del", |
||||
dispatch: dispatch, |
dispatch: dispatch, |
||||
actionType: "DEL_MIRROR", |
actionType: "DEL_MIRROR", |
||||
url: `${ApiTable.delMirror.replace("{mirrorId}", orgId)}`, |
url: `${ApiTable.delMirror.replace("{mirrorId}", orgId)}`, |
||||
msg: { |
msg: { |
||||
option: |
option: |
||||
"删除镜像信息", |
"删除镜像信息", |
||||
}, |
}, |
||||
reducer: { name: "" }, |
reducer: { name: "" }, |
||||
}); |
}); |
||||
} |
} |
||||
export function putMirrorCopy(orgId) { //编辑推送配置
|
export function putMirrorCopy (orgId) { //编辑推送配置
|
||||
return (dispatch) => |
return (dispatch) => |
||||
basicAction({ |
basicAction({ |
||||
type: "put", |
type: "put", |
||||
dispatch: dispatch, |
dispatch: dispatch, |
||||
actionType: "PUT_MIRROR_COPY", |
actionType: "PUT_MIRROR_COPY", |
||||
url: `${ApiTable.putMirrorCopy.replace("{mirrorId}", orgId)}`, |
url: `${ApiTable.putMirrorCopy.replace("{mirrorId}", orgId)}`, |
||||
msg: { option: '复制镜像信息' }, |
msg: { option: '复制镜像信息' }, |
||||
reducer: {}, |
reducer: {}, |
||||
}); |
}); |
||||
} |
} |
||||
export function putMirrorPublish(orgId) { //编辑推送配置
|
export function putMirrorPublish (orgId) { //编辑推送配置
|
||||
return (dispatch) => |
return (dispatch) => |
||||
basicAction({ |
basicAction({ |
||||
type: "put", |
type: "put", |
||||
dispatch: dispatch, |
dispatch: dispatch, |
||||
actionType: "PUT_MIRROR_PUBLISH", |
actionType: "PUT_MIRROR_PUBLISH", |
||||
url: `${ApiTable.putMirrorPublish.replace("{mirrorId}", orgId)}`, |
url: `${ApiTable.putMirrorPublish.replace("{mirrorId}", orgId)}`, |
||||
msg: { option: '发布镜像信息' }, |
msg: { option: '发布镜像信息' }, |
||||
reducer: {}, |
reducer: {}, |
||||
}); |
}); |
||||
} |
} |
||||
|
|
||||
export function getMirrorDetail(orgId) {//获取摄像头能力列表
|
export function getMirrorDetail (orgId) {//获取摄像头能力列表
|
||||
return (dispatch) => |
return (dispatch) => |
||||
basicAction({ |
basicAction({ |
||||
type: "get", |
type: "get", |
||||
dispatch: dispatch, |
dispatch: dispatch, |
||||
actionType: "GET_MIRROR", |
actionType: "GET_MIRROR", |
||||
url: `${ApiTable.getMirror.replace("{mid}", orgId)}`, |
url: `${ApiTable.getMirror.replace("{mid}", orgId)}`, |
||||
msg: { option: "" }, |
msg: { option: "" }, |
||||
reducer: { name: "" }, |
reducer: { name: "" }, |
||||
}); |
}); |
||||
} |
} |
||||
export function putMirror(data) { //编辑推送配置
|
export function putMirror (data) { //编辑推送配置
|
||||
return (dispatch) => |
return (dispatch) => |
||||
basicAction({ |
basicAction({ |
||||
type: "put", |
type: "put", |
||||
dispatch: dispatch, |
dispatch: dispatch, |
||||
data, |
data, |
||||
actionType: "PUT_MIRROR", |
actionType: "PUT_MIRROR", |
||||
url: `${ApiTable.putMirror}`, |
url: `${ApiTable.putMirror}`, |
||||
msg: { option: '编辑镜像信息' }, |
msg: { option: '编辑镜像信息' }, |
||||
reducer: {}, |
reducer: {}, |
||||
}); |
}); |
||||
} |
} |
||||
|
|
||||
export function getErrorCode(query) {//查取指定状态码信息
|
export function getErrorCode (query) {//查取指定状态码信息
|
||||
return (dispatch) => |
return (dispatch) => |
||||
basicAction({ |
basicAction({ |
||||
type: "get", |
type: "get", |
||||
dispatch: dispatch, |
dispatch: dispatch, |
||||
query, |
query, |
||||
actionType: "GET_ERRORCODE", |
actionType: "GET_ERRORCODE", |
||||
url: `${ApiTable.getErrorCode}`, |
url: `${ApiTable.getErrorCode}`, |
||||
msg: { option: "" }, |
msg: { option: "" }, |
||||
reducer: { name: "" }, |
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