|
@ -2,458 +2,462 @@ import React, { useEffect, useState, useRef } from 'react'; |
|
|
import { connect } from 'react-redux'; |
|
|
import { connect } from 'react-redux'; |
|
|
import '../style.less' |
|
|
import '../style.less' |
|
|
import { Tree, Popconfirm, Typography, Input, Switch, Modal, Checkbox, CheckboxGroup } from "@douyinfe/semi-ui"; |
|
|
import { Tree, Popconfirm, Typography, Input, Switch, Modal, Checkbox, CheckboxGroup } from "@douyinfe/semi-ui"; |
|
|
|
|
|
import VideoScreen from '../components/videoScreen' |
|
|
|
|
|
|
|
|
const MirroringDetail = (props) => { |
|
|
const MirroringDetail = (props) => { |
|
|
const { history, dispatch, actions, user, loading, StatusPushList } = props; |
|
|
const { history, dispatch, actions, user, loading, StatusPushList } = props; |
|
|
const { openness } = actions; |
|
|
const { openness } = actions; |
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
|
|
|
|
|
|
}, []); |
|
|
}, []); |
|
|
// const = useRef(0) |
|
|
// const = useRef(0) |
|
|
|
|
|
|
|
|
const [chooseNum, setChooseNum] = useState(0);//当前选择tab |
|
|
const [chooseNum, setChooseNum] = useState(0);//当前选择tab |
|
|
const [chooseList, setChooseList] = useState(['节点', '样式', '功能']); |
|
|
const [chooseList, setChooseList] = useState(['节点', '样式', '功能']); |
|
|
const [editKey, setEditKey] = useState('') |
|
|
const [editKey, setEditKey] = useState('') |
|
|
const [comingVisible, setComingVisible] = useState(false) |
|
|
const [comingVisible, setComingVisible] = useState(false) |
|
|
const [treeData, setTreeData] = useState([//树形控件数据 |
|
|
const [treeData, setTreeData] = useState([//树形控件数据 |
|
|
{ |
|
|
{ |
|
|
label: '主要节点1', |
|
|
label: '主要节点1', |
|
|
value: '0', |
|
|
value: '0', |
|
|
key: '0', |
|
|
key: '0', |
|
|
}, |
|
|
}, |
|
|
]); |
|
|
]); |
|
|
const searchData = useRef({})//摄像头查询条件 |
|
|
const searchData = useRef({})//摄像头查询条件 |
|
|
const [search, setSearch] = useState({}); //搜索条件 |
|
|
const [search, setSearch] = useState({}); //搜索条件 |
|
|
const [indeterminate, setIndeterminate] = useState(true);//全选 |
|
|
const [indeterminate, setIndeterminate] = useState(true);//全选 |
|
|
const [checkAll, setCheckall] = useState(false);//全选是否 |
|
|
const [checkAll, setCheckall] = useState(false);//全选是否 |
|
|
const onCheckAllChange = (e) => {//全选 |
|
|
const onCheckAllChange = (e) => {//全选 |
|
|
console.log(e); |
|
|
console.log(e); |
|
|
setCheckedList(e.target.checked ? plainOptions : []); |
|
|
setCheckedList(e.target.checked ? plainOptions : []); |
|
|
setIndeterminate(false); |
|
|
setIndeterminate(false); |
|
|
setCheckall(e.target.checked); |
|
|
setCheckall(e.target.checked); |
|
|
}; |
|
|
}; |
|
|
const equipmentGetCamera = () => { |
|
|
const equipmentGetCamera = () => { |
|
|
searchData.current = { ...search } |
|
|
searchData.current = { ...search } |
|
|
dispatch(openness.getCamera(searchData.current)).then((res) => { |
|
|
dispatch(openness.getCamera(searchData.current)).then((res) => { |
|
|
// limits.current = res.payload.data.data.length |
|
|
// limits.current = res.payload.data.data.length |
|
|
console.log(res.payload.data.data); |
|
|
console.log(res.payload.data.data); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
equipmentGetCamera(); |
|
|
equipmentGetCamera(); |
|
|
}, []); |
|
|
}, []); |
|
|
function nodeDelete (item) {//删除树状子节点 |
|
|
function nodeDelete (item) {//删除树状子节点 |
|
|
let mainData = JSON.parse(JSON.stringify(treeData)) |
|
|
let mainData = JSON.parse(JSON.stringify(treeData)) |
|
|
let nodeKeyArr = item.key.split('-') |
|
|
let nodeKeyArr = item.key.split('-') |
|
|
if (nodeKeyArr.length == 1) { |
|
|
if (nodeKeyArr.length == 1) { |
|
|
mainData.splice( |
|
|
mainData.splice( |
|
|
mainData.indexOf(mainData.find(function (element) { |
|
|
mainData.indexOf(mainData.find(function (element) { |
|
|
return element.key === item.key |
|
|
return element.key === item.key |
|
|
})), 1) |
|
|
})), 1) |
|
|
} else if (nodeKeyArr.length == 2) { |
|
|
} else if (nodeKeyArr.length == 2) { |
|
|
for (let index = 0; index < mainData.length; index++) { |
|
|
for (let index = 0; index < mainData.length; index++) { |
|
|
mainData[index].children.splice( |
|
|
mainData[index].children.splice( |
|
|
mainData[index].children.indexOf(mainData[index].children.find(function (element) { |
|
|
mainData[index].children.indexOf(mainData[index].children.find(function (element) { |
|
|
return element.key === item.key |
|
|
return element.key === item.key |
|
|
})), 1) |
|
|
})), 1) |
|
|
|
|
|
} |
|
|
|
|
|
} else if (nodeKeyArr.length == 3) { |
|
|
|
|
|
for (let j = 0; j < mainData.length; j++) { |
|
|
|
|
|
for (let i = 0; i < mainData[j].children.length; i++) { |
|
|
|
|
|
mainData[j].children[i].children.splice( |
|
|
|
|
|
mainData[j].children[i].children.indexOf(mainData[j].children[i].children.find(function (element) { |
|
|
|
|
|
return element.key === item.key |
|
|
|
|
|
})), 1) |
|
|
} |
|
|
} |
|
|
} else if (nodeKeyArr.length == 3) { |
|
|
} |
|
|
for (let j = 0; j < mainData.length; j++) { |
|
|
} else if (nodeKeyArr.length == 4) { |
|
|
for (let i = 0; i < mainData[j].children.length; i++) { |
|
|
for (let k = 0; k < mainData.length; k++) { |
|
|
mainData[j].children[i].children.splice( |
|
|
for (let j = 0; j < mainData[k].children.length; j++) { |
|
|
mainData[j].children[i].children.indexOf(mainData[j].children[i].children.find(function (element) { |
|
|
for (let i = 0; i < mainData[k].children[j].children.length; i++) { |
|
|
return element.key === item.key |
|
|
mainData[k].children[j].children[i].children.splice( |
|
|
})), 1) |
|
|
mainData[k].children[j].children[i].children.indexOf(mainData[k].children[j].children[i].children.find(function (element) { |
|
|
} |
|
|
return element.key === item.key |
|
|
|
|
|
})), 1) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} else if (nodeKeyArr.length == 4) { |
|
|
} |
|
|
for (let k = 0; k < mainData.length; k++) { |
|
|
} |
|
|
for (let j = 0; j < mainData[k].children.length; j++) { |
|
|
setTreeData(mainData) |
|
|
for (let i = 0; i < mainData[k].children[j].children.length; i++) { |
|
|
} |
|
|
mainData[k].children[j].children[i].children.splice( |
|
|
function nodeAdd (item) {//添加树状子节点 |
|
|
mainData[k].children[j].children[i].children.indexOf(mainData[k].children[j].children[i].children.find(function (element) { |
|
|
let mainData = JSON.parse(JSON.stringify(treeData)) |
|
|
return element.key === item.key |
|
|
let nodeKeyArr = item.key.split('-') |
|
|
})), 1) |
|
|
if (nodeKeyArr.length == 1) { |
|
|
} |
|
|
for (let index = 0; index < mainData.length; index++) { |
|
|
} |
|
|
if (mainData[index].key == item.key) { |
|
|
|
|
|
if (mainData[index].children && mainData[index].children > 0) { |
|
|
|
|
|
let mainKey = mainData[index].children[mainData[index].children.length - 1].key |
|
|
|
|
|
let thekeyarr = mainKey.split('-') |
|
|
|
|
|
mainData[index].children.push({ |
|
|
|
|
|
label: '二级节点' + (Number(thekeyarr[1]) + 2), |
|
|
|
|
|
value: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1]) + 1), |
|
|
|
|
|
key: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1]) + 1), |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
let mainKey = mainData[index].key |
|
|
|
|
|
let thekeyarr = mainKey.split('-') |
|
|
|
|
|
mainData[index].children = [{ |
|
|
|
|
|
label: '二级节点1', |
|
|
|
|
|
value: (Number(thekeyarr[0])) + '-0', |
|
|
|
|
|
key: (Number(thekeyarr[0])) + '-0', |
|
|
|
|
|
}] |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
setTreeData(mainData) |
|
|
} else if (nodeKeyArr.length == 2) { |
|
|
} |
|
|
for (let index = 0; index < mainData.length; index++) { |
|
|
function nodeAdd (item) {//添加树状子节点 |
|
|
for (let j = 0; j < mainData[index].children.length; j++) { |
|
|
let mainData = JSON.parse(JSON.stringify(treeData)) |
|
|
if (mainData[index].children[j].key == item.key) { |
|
|
let nodeKeyArr = item.key.split('-') |
|
|
if (mainData[index].children[j].children && mainData[index].children[j].children.length > 0) { |
|
|
if (nodeKeyArr.length == 1) { |
|
|
let mainKey = mainData[index].children[j].children[mainData[index].children[j].children.length - 1].key |
|
|
for (let index = 0; index < mainData.length; index++) { |
|
|
let thekeyarr = mainKey.split('-') |
|
|
if (mainData[index].key == item.key) { |
|
|
mainData[index].children[j].children.push({ |
|
|
if (mainData[index].children && mainData[index].children > 0) { |
|
|
label: '三级节点' + (Number(thekeyarr[2]) + 2), |
|
|
let mainKey = mainData[index].children[mainData[index].children.length - 1].key |
|
|
value: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1])) + '-' + (Number(thekeyarr[2]) + 1), |
|
|
let thekeyarr = mainKey.split('-') |
|
|
key: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1])) + '-' + (Number(thekeyarr[2]) + 1), |
|
|
mainData[index].children.push({ |
|
|
}) |
|
|
label: '二级节点' + (Number(thekeyarr[1]) + 2), |
|
|
} |
|
|
value: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1]) + 1), |
|
|
else { |
|
|
key: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1]) + 1), |
|
|
let mainKey = mainData[index].children[j].key |
|
|
}) |
|
|
let thekeyarr = mainKey.split('-') |
|
|
} |
|
|
mainData[index].children[j].children = [{ |
|
|
else { |
|
|
label: '三级节点1', |
|
|
let mainKey = mainData[index].key |
|
|
value: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1])) + '-0', |
|
|
let thekeyarr = mainKey.split('-') |
|
|
key: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1])) + '-0', |
|
|
mainData[index].children = [{ |
|
|
}] |
|
|
label: '二级节点1', |
|
|
} |
|
|
value: (Number(thekeyarr[0])) + '-0', |
|
|
} |
|
|
key: (Number(thekeyarr[0])) + '-0', |
|
|
|
|
|
}] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} else if (nodeKeyArr.length == 2) { |
|
|
} |
|
|
for (let index = 0; index < mainData.length; index++) { |
|
|
} |
|
|
for (let j = 0; j < mainData[index].children.length; j++) { |
|
|
setTreeData(mainData) |
|
|
if (mainData[index].children[j].key == item.key) { |
|
|
} |
|
|
if (mainData[index].children[j].children && mainData[index].children[j].children.length > 0) { |
|
|
function changeLable (value, item) {//编辑摄像头名称 |
|
|
let mainKey = mainData[index].children[j].children[mainData[index].children[j].children.length - 1].key |
|
|
console.log('valvalval', value); |
|
|
let thekeyarr = mainKey.split('-') |
|
|
console.log('itemitem', item); |
|
|
mainData[index].children[j].children.push({ |
|
|
let mainData = JSON.parse(JSON.stringify(treeData)) |
|
|
label: '三级节点' + (Number(thekeyarr[2]) + 2), |
|
|
let nodeKeyArr = item.key.split('-') |
|
|
value: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1])) + '-' + (Number(thekeyarr[2]) + 1), |
|
|
if (nodeKeyArr.length == 1) { |
|
|
key: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1])) + '-' + (Number(thekeyarr[2]) + 1), |
|
|
for (let index = 0; index < mainData.length; index++) { |
|
|
}) |
|
|
if (mainData[index].key == item.key) { |
|
|
} |
|
|
mainData[index].label = value |
|
|
else { |
|
|
|
|
|
let mainKey = mainData[index].children[j].key |
|
|
|
|
|
let thekeyarr = mainKey.split('-') |
|
|
|
|
|
mainData[index].children[j].children = [{ |
|
|
|
|
|
label: '三级节点1', |
|
|
|
|
|
value: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1])) + '-0', |
|
|
|
|
|
key: (Number(thekeyarr[0])) + '-' + (Number(thekeyarr[1])) + '-0', |
|
|
|
|
|
}] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
setTreeData(mainData) |
|
|
} else if (nodeKeyArr.length == 2) { |
|
|
} |
|
|
for (let index = 0; index < mainData.length; index++) { |
|
|
function changeLable (value, item) {//编辑摄像头名称 |
|
|
for (let j = 0; j < mainData[index].children.length; j++) { |
|
|
console.log('valvalval', value); |
|
|
if (mainData[index].children[j].key == item.key) { |
|
|
console.log('itemitem', item); |
|
|
mainData[index].children[j].label = value |
|
|
let mainData = JSON.parse(JSON.stringify(treeData)) |
|
|
} |
|
|
let nodeKeyArr = item.key.split('-') |
|
|
|
|
|
if (nodeKeyArr.length == 1) { |
|
|
|
|
|
for (let index = 0; index < mainData.length; index++) { |
|
|
|
|
|
if (mainData[index].key == item.key) { |
|
|
|
|
|
mainData[index].label = value |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} else if (nodeKeyArr.length == 2) { |
|
|
} |
|
|
for (let index = 0; index < mainData.length; index++) { |
|
|
} else if (nodeKeyArr.length == 3) { |
|
|
for (let j = 0; j < mainData[index].children.length; j++) { |
|
|
for (let index = 0; index < mainData.length; index++) { |
|
|
if (mainData[index].children[j].key == item.key) { |
|
|
for (let j = 0; j < mainData[index].children.length; j++) { |
|
|
mainData[index].children[j].label = value |
|
|
for (let k = 0; k < mainData[index].children[j].children.length; k++) { |
|
|
} |
|
|
if (mainData[index].children[j].children[k].key == item.key) { |
|
|
} |
|
|
mainData[index].children[j].children[k].label = value |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} else if (nodeKeyArr.length == 3) { |
|
|
} |
|
|
for (let index = 0; index < mainData.length; index++) { |
|
|
} |
|
|
for (let j = 0; j < mainData[index].children.length; j++) { |
|
|
setTreeData(mainData) |
|
|
for (let k = 0; k < mainData[index].children[j].children.length; k++) { |
|
|
} |
|
|
if (mainData[index].children[j].children[k].key == item.key) { |
|
|
function lableBlur () { |
|
|
mainData[index].children[j].children[k].label = value |
|
|
setEditKey('') |
|
|
} |
|
|
} |
|
|
} |
|
|
function cameraAdd (item) {//添加摄像头 |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
setTreeData(mainData) |
|
|
|
|
|
} |
|
|
|
|
|
function lableBlur () { |
|
|
|
|
|
setEditKey('') |
|
|
|
|
|
} |
|
|
|
|
|
function cameraAdd (item) {//添加摄像头 |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
const renderLabel = (label, item) => {//树状展示 |
|
|
const renderLabel = (label, item) => {//树状展示 |
|
|
let keyArr = item.key.split('-') |
|
|
let keyArr = item.key.split('-') |
|
|
return ( |
|
|
return ( |
|
|
<div style={{ display: 'flex', justifyContent: 'space-between' }}> |
|
|
<div style={{ display: 'flex', justifyContent: 'space-between' }}> |
|
|
{ |
|
|
{ |
|
|
keyArr.length == 1 ? ( |
|
|
keyArr.length == 1 ? ( |
|
|
<div style={{ display: 'flex' }}> |
|
|
<div style={{ display: 'flex' }}> |
|
|
<div style={{ width: 13, height: 10 }}> |
|
|
<div style={{ width: 13, height: 10 }}> |
|
|
<img |
|
|
|
|
|
src="/assets/images/imageImg/folder.png" |
|
|
|
|
|
alt="设置" |
|
|
|
|
|
style={{ width: '100%' }} |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div style={{ marginLeft: 8, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}> |
|
|
|
|
|
{ |
|
|
|
|
|
editKey == item.key ? ( |
|
|
|
|
|
<Input value={label} onBlur={lableBlur} onChange={(value) => changeLable(value, item)} style={{ width: 65 }} className='inputpadding' size='small'></Input> |
|
|
|
|
|
) : |
|
|
|
|
|
( |
|
|
|
|
|
<Typography.Text |
|
|
|
|
|
ellipsis={{ showTooltip: true }} |
|
|
|
|
|
> |
|
|
|
|
|
{label} |
|
|
|
|
|
</Typography.Text>) |
|
|
|
|
|
} |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
) : ( |
|
|
|
|
|
<div style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}> |
|
|
|
|
|
{ |
|
|
|
|
|
editKey == item.key ? ( |
|
|
|
|
|
<Input value={label} onBlur={lableBlur} onChange={(value) => changeLable(value, item)} style={{ width: 65 }} className='inputpadding' size='small'></Input> |
|
|
|
|
|
) : |
|
|
|
|
|
( |
|
|
|
|
|
<Typography.Text |
|
|
|
|
|
ellipsis={{ showTooltip: true }} |
|
|
|
|
|
> |
|
|
|
|
|
{label} |
|
|
|
|
|
</Typography.Text>) |
|
|
|
|
|
} |
|
|
|
|
|
</div> |
|
|
|
|
|
) |
|
|
|
|
|
} |
|
|
|
|
|
<div style={{ display: 'flex', paddingRight: 13 }}> |
|
|
|
|
|
{ |
|
|
|
|
|
!item.children || item.children < 1 ? ( |
|
|
|
|
|
<div style={{ width: 12, height: 12, cursor: 'pointer', marginRight: 4 }} onClick={() => cameraAdd(item)}> |
|
|
|
|
|
<img |
|
|
|
|
|
src="/assets/images/imageImg/nodeCamera.png" |
|
|
|
|
|
alt="添加摄像头" |
|
|
|
|
|
style={{ width: '100%' }} |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
) : ('') |
|
|
|
|
|
} |
|
|
|
|
|
<div style={{ width: 12, height: 12, cursor: 'pointer', marginRight: 4 }} onClick={() => { setEditKey(item.key) }}> |
|
|
|
|
|
<img |
|
|
<img |
|
|
src="/assets/images/imageImg/nodeEdit.png" |
|
|
src="/assets/images/imageImg/folder.png" |
|
|
alt="编辑" |
|
|
alt="设置" |
|
|
style={{ width: '100%' }} |
|
|
style={{ width: '100%' }} |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
<Popconfirm |
|
|
<div style={{ marginLeft: 8, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}> |
|
|
title="删除节点也会删除节点下的从属节点和视频,是否继续?" |
|
|
{ |
|
|
arrowPointAtCenter={false} |
|
|
editKey == item.key ? ( |
|
|
showArrow={true} |
|
|
<Input value={label} onBlur={lableBlur} onChange={(value) => changeLable(value, item)} style={{ width: 65 }} className='inputpadding' size='small'></Input> |
|
|
position="topRight" |
|
|
) : |
|
|
onConfirm={() => nodeDelete(item)}> |
|
|
( |
|
|
<div style={{ width: 12, height: 12, cursor: 'pointer', marginRight: 4 }}> |
|
|
<Typography.Text |
|
|
<img |
|
|
ellipsis={{ showTooltip: true }} |
|
|
src="/assets/images/imageImg/nodeDel.png" |
|
|
> |
|
|
alt="删除" |
|
|
{label} |
|
|
style={{ width: '100%' }} |
|
|
</Typography.Text>) |
|
|
/> |
|
|
} |
|
|
</div> |
|
|
</div> |
|
|
</Popconfirm> |
|
|
</div> |
|
|
{ |
|
|
) : ( |
|
|
keyArr.length > 2 ? ('') : ( |
|
|
<div style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}> |
|
|
<div style={{ width: 12, height: 12, cursor: 'pointer', marginRight: 4 }} onClick={() => nodeAdd(item)}> |
|
|
{ |
|
|
<img |
|
|
editKey == item.key ? ( |
|
|
src="/assets/images/imageImg/nodeadd.png" |
|
|
<Input value={label} onBlur={lableBlur} onChange={(value) => changeLable(value, item)} style={{ width: 65 }} className='inputpadding' size='small'></Input> |
|
|
alt="添加子节点" |
|
|
) : |
|
|
style={{ width: '100%' }} |
|
|
( |
|
|
/> |
|
|
<Typography.Text |
|
|
</div> |
|
|
ellipsis={{ showTooltip: true }} |
|
|
) |
|
|
> |
|
|
} |
|
|
{label} |
|
|
</div> |
|
|
</Typography.Text>) |
|
|
</div> |
|
|
} |
|
|
) |
|
|
</div> |
|
|
}; |
|
|
) |
|
|
function toback () {//返回上一个页面 |
|
|
} |
|
|
history.goBack() |
|
|
<div style={{ display: 'flex', paddingRight: 13 }}> |
|
|
} |
|
|
{ |
|
|
function tochange (index) {//节点样式功能切换 |
|
|
!item.children || item.children < 1 ? ( |
|
|
setChooseNum(index) |
|
|
<div style={{ width: 12, height: 12, cursor: 'pointer', marginRight: 4 }} onClick={() => cameraAdd(item)}> |
|
|
} |
|
|
|
|
|
function addMainNode () {//增加主要节点 |
|
|
|
|
|
let mainData = JSON.parse(JSON.stringify(treeData)) |
|
|
|
|
|
if (mainData.length > 0) { |
|
|
|
|
|
let mainKey = mainData[mainData.length - 1].key |
|
|
|
|
|
mainKey = Number(mainKey) + 2 |
|
|
|
|
|
mainData.push({ |
|
|
|
|
|
label: '主要节点' + mainKey, |
|
|
|
|
|
value: String(mainKey - 1), |
|
|
|
|
|
key: String(mainKey - 1), |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
mainData.push({ |
|
|
|
|
|
label: '主要节点1', |
|
|
|
|
|
value: '0', |
|
|
|
|
|
key: '0', |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
setTreeData(mainData) |
|
|
|
|
|
} |
|
|
|
|
|
return ( |
|
|
|
|
|
<div style={{ background: 'rgb(246, 250, 255)', height: '100%', width: '100%' }}> |
|
|
|
|
|
<div style={{ |
|
|
|
|
|
height: 64, background: "url(/assets/images/imageImg/banner.png)", backgroundSize: "100% 100%", display: 'flex', alignItems: 'center', justifyContent: 'space-between' |
|
|
|
|
|
}}> |
|
|
|
|
|
<div style={{ display: 'flex', }}> |
|
|
|
|
|
<div style={{ width: 20, height: 20, marginLeft: 19, cursor: 'pointer' }} onClick={toback}> |
|
|
|
|
|
<img |
|
|
<img |
|
|
src="/assets/images/imageImg/toback.png" |
|
|
src="/assets/images/imageImg/nodeCamera.png" |
|
|
alt="设置" |
|
|
alt="添加摄像头" |
|
|
style={{ width: '100%' }} |
|
|
style={{ width: '100%' }} |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
<div style={{ fontSize: 16, color: '#FFFFFF', marginLeft: 20 }}> |
|
|
) : ('') |
|
|
智慧小蓝智慧排涝视频融合系统 |
|
|
} |
|
|
</div> |
|
|
<div style={{ width: 12, height: 12, cursor: 'pointer', marginRight: 4 }} onClick={() => { setEditKey(item.key) }}> |
|
|
<div style={{ width: 12, height: 12, marginLeft: 8, marginTop: 1, cursor: 'pointer' }}> |
|
|
<img |
|
|
|
|
|
src="/assets/images/imageImg/nodeEdit.png" |
|
|
|
|
|
alt="编辑" |
|
|
|
|
|
style={{ width: '100%' }} |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
<Popconfirm |
|
|
|
|
|
title="删除节点也会删除节点下的从属节点和视频,是否继续?" |
|
|
|
|
|
arrowPointAtCenter={false} |
|
|
|
|
|
showArrow={true} |
|
|
|
|
|
position="topRight" |
|
|
|
|
|
onConfirm={() => nodeDelete(item)}> |
|
|
|
|
|
<div style={{ width: 12, height: 12, cursor: 'pointer', marginRight: 4 }}> |
|
|
|
|
|
<img |
|
|
|
|
|
src="/assets/images/imageImg/nodeDel.png" |
|
|
|
|
|
alt="删除" |
|
|
|
|
|
style={{ width: '100%' }} |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
</Popconfirm> |
|
|
|
|
|
{ |
|
|
|
|
|
keyArr.length > 2 ? ('') : ( |
|
|
|
|
|
<div style={{ width: 12, height: 12, cursor: 'pointer', marginRight: 4 }} onClick={() => nodeAdd(item)}> |
|
|
<img |
|
|
<img |
|
|
src="/assets/images/imageImg/nameChange.png" |
|
|
src="/assets/images/imageImg/nodeadd.png" |
|
|
alt="设置" |
|
|
alt="添加子节点" |
|
|
style={{ width: '100%' }} |
|
|
style={{ width: '100%' }} |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
) |
|
|
<div style={{ display: 'flex', }}> |
|
|
} |
|
|
<div style={{ width: 22, height: 22, marginRight: 30, cursor: 'pointer' }}> |
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
) |
|
|
|
|
|
}; |
|
|
|
|
|
function toback () {//返回上一个页面 |
|
|
|
|
|
history.goBack() |
|
|
|
|
|
} |
|
|
|
|
|
function tochange (index) {//节点样式功能切换 |
|
|
|
|
|
setChooseNum(index) |
|
|
|
|
|
} |
|
|
|
|
|
function addMainNode () {//增加主要节点 |
|
|
|
|
|
let mainData = JSON.parse(JSON.stringify(treeData)) |
|
|
|
|
|
if (mainData.length > 0) { |
|
|
|
|
|
let mainKey = mainData[mainData.length - 1].key |
|
|
|
|
|
mainKey = Number(mainKey) + 2 |
|
|
|
|
|
mainData.push({ |
|
|
|
|
|
label: '主要节点' + mainKey, |
|
|
|
|
|
value: String(mainKey - 1), |
|
|
|
|
|
key: String(mainKey - 1), |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
mainData.push({ |
|
|
|
|
|
label: '主要节点1', |
|
|
|
|
|
value: '0', |
|
|
|
|
|
key: '0', |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
setTreeData(mainData) |
|
|
|
|
|
} |
|
|
|
|
|
return ( |
|
|
|
|
|
<div style={{ background: 'rgb(246, 250, 255)', height: '100%', width: '100%' }}> |
|
|
|
|
|
<div style={{ |
|
|
|
|
|
height: 64, background: "url(/assets/images/imageImg/banner.png)", backgroundSize: "100% 100%", display: 'flex', alignItems: 'center', justifyContent: 'space-between' |
|
|
|
|
|
}}> |
|
|
|
|
|
<div style={{ display: 'flex', }}> |
|
|
|
|
|
<div style={{ width: 20, height: 20, marginLeft: 19, cursor: 'pointer' }} onClick={toback}> |
|
|
|
|
|
<img |
|
|
|
|
|
src="/assets/images/imageImg/toback.png" |
|
|
|
|
|
alt="设置" |
|
|
|
|
|
style={{ width: '100%' }} |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div style={{ fontSize: 16, color: '#FFFFFF', marginLeft: 20 }}> |
|
|
|
|
|
智慧小蓝智慧排涝视频融合系统 |
|
|
|
|
|
</div> |
|
|
|
|
|
<div style={{ width: 12, height: 12, marginLeft: 8, marginTop: 1, cursor: 'pointer' }}> |
|
|
|
|
|
<img |
|
|
|
|
|
src="/assets/images/imageImg/nameChange.png" |
|
|
|
|
|
alt="设置" |
|
|
|
|
|
style={{ width: '100%' }} |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div style={{ display: 'flex', }}> |
|
|
|
|
|
<div style={{ width: 22, height: 22, marginRight: 30, cursor: 'pointer' }}> |
|
|
|
|
|
<img |
|
|
|
|
|
src="/assets/images/imageImg/save.png" |
|
|
|
|
|
alt="设置" |
|
|
|
|
|
style={{ width: '100%' }} |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div style={{ width: 22, height: 22, marginRight: 44, cursor: 'pointer' }}> |
|
|
|
|
|
<img |
|
|
|
|
|
src="/assets/images/imageImg/upload.png" |
|
|
|
|
|
alt="设置" |
|
|
|
|
|
style={{ width: '100%' }} |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div style={{ display: 'flex', height: '100%' }}> |
|
|
|
|
|
<div style={{ height: "100%", width: 200, background: '#FFFFFF' }}> |
|
|
|
|
|
<div style={{ display: 'flex', height: 49, background: '#1859C1', border: '1px solid #1859C1', color: 'rgba(255,255,255,0.65)', fontSize: 14, width: '100%' }}> |
|
|
|
|
|
{chooseList.map((item, index) => { |
|
|
|
|
|
return ( |
|
|
|
|
|
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', width: '33.3333%', cursor: 'pointer' }} |
|
|
|
|
|
key={index} |
|
|
|
|
|
className={index == chooseNum ? 'onchoose' : ''} |
|
|
|
|
|
onClick={() => tochange(index)} > |
|
|
|
|
|
{item} |
|
|
|
|
|
</div> |
|
|
|
|
|
) |
|
|
|
|
|
})} |
|
|
|
|
|
</div> |
|
|
|
|
|
{/* 节点 */} |
|
|
|
|
|
<div style={{ display: chooseNum == "0" ? "block" : "none", }}> |
|
|
|
|
|
<div style={{ height: 40, display: 'flex', alignItems: 'center', justifyContent: 'center', background: 'rgb(246, 250, 255)', cursor: 'pointer' }} onClick={addMainNode}> |
|
|
|
|
|
<div style={{ width: 20, height: 20 }}> |
|
|
<img |
|
|
<img |
|
|
src="/assets/images/imageImg/save.png" |
|
|
src="/assets/images/imageImg/addMainNodes.png" |
|
|
alt="设置" |
|
|
alt="设置" |
|
|
style={{ width: '100%' }} |
|
|
style={{ width: '100%' }} |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
<div style={{ width: 22, height: 22, marginRight: 44, cursor: 'pointer' }}> |
|
|
<div style={{ marginLeft: 9, fontSize: 15, color: 'rgba(0,0,0,0.65)' }}> |
|
|
|
|
|
增加主要节点 |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<Tree |
|
|
|
|
|
treeData={treeData} |
|
|
|
|
|
renderLabel={renderLabel} |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
{/* 添加视频 */} |
|
|
|
|
|
<div style={{ width: 264, height: '100%', position: 'absolute', top: 64, left: 200 }}> |
|
|
|
|
|
<div style={{ background: 'linear-gradient(180deg, #1859C1 0%, #2C66E7 100%)', display: 'flex', height: 49, padding: '0px 12px 0px 10px', alignItems: 'center', justifyContent: 'space-between', }}> |
|
|
|
|
|
<div style={{ fontSize: 14, color: '#F9F9F9' }}>添加视频</div> |
|
|
|
|
|
<div style={{ width: 16, height: 16, cursor: 'pointer' }}> |
|
|
<img |
|
|
<img |
|
|
src="/assets/images/imageImg/upload.png" |
|
|
src="/assets/images/imageImg/close.png" |
|
|
alt="设置" |
|
|
alt="设置" |
|
|
style={{ width: '100%' }} |
|
|
style={{ width: '100%' }} |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div style={{ borderBottom: '1px solid rgba(226,226,226,0.5)', background: '#FFFFFF' }}> |
|
|
<div style={{display:'flex',height:'100%'}}> |
|
|
<div style={{ display: 'flex', padding: "8px 10px 10px 10px", alignItems: 'center' }}> |
|
|
<div style={{ height: "100%", width: 200, background: '#FFFFFF' }}> |
|
|
<div style={{ fontSize: 12 }}>摄像头名称</div> |
|
|
<div style={{ display: 'flex', height: 49, background: '#1859C1', border: '1px solid #1859C1', color: 'rgba(255,255,255,0.65)', fontSize: 14, width: '100%' }}> |
|
|
<div> |
|
|
{chooseList.map((item, index) => { |
|
|
<Input placeholder='请输入摄像头名称' style={{ width: 140, marginLeft: 10 }}></Input> |
|
|
return ( |
|
|
|
|
|
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', width: '33.3333%', cursor: 'pointer' }} |
|
|
|
|
|
key={index} |
|
|
|
|
|
className={index == chooseNum ? 'onchoose' : ''} |
|
|
|
|
|
onClick={() => tochange(index)} > |
|
|
|
|
|
{item} |
|
|
|
|
|
</div> |
|
|
|
|
|
) |
|
|
|
|
|
})} |
|
|
|
|
|
</div> |
|
|
|
|
|
{/* 节点 */} |
|
|
|
|
|
<div style={{ display: chooseNum == "0" ? "block" : "none", }}> |
|
|
|
|
|
<div style={{ height: 40, display: 'flex', alignItems: 'center', justifyContent: 'center', background: 'rgb(246, 250, 255)', cursor: 'pointer' }} onClick={addMainNode}> |
|
|
|
|
|
<div style={{ width: 20, height: 20 }}> |
|
|
|
|
|
<img |
|
|
|
|
|
src="/assets/images/imageImg/addMainNodes.png" |
|
|
|
|
|
alt="设置" |
|
|
|
|
|
style={{ width: '100%' }} |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div style={{ marginLeft: 9, fontSize: 15, color: 'rgba(0,0,0,0.65)' }}> |
|
|
|
|
|
增加主要节点 |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<Tree |
|
|
<div style={{ width: 32, height: 32 }}> |
|
|
treeData={treeData} |
|
|
<img |
|
|
renderLabel={renderLabel} |
|
|
src="/assets/images/imageImg/find.png" |
|
|
/> |
|
|
alt="设置" |
|
|
</div> |
|
|
style={{ width: '100%' }} |
|
|
{/* 添加视频 */} |
|
|
/> |
|
|
<div style={{ width: 264, height: '100%', position: 'absolute', top: 64, left: 200 }}> |
|
|
|
|
|
<div style={{ background: 'linear-gradient(180deg, #1859C1 0%, #2C66E7 100%)', display: 'flex', height: 49, padding: '0px 12px 0px 10px', alignItems: 'center', justifyContent: 'space-between', }}> |
|
|
|
|
|
<div style={{ fontSize: 14, color: '#F9F9F9' }}>添加视频</div> |
|
|
|
|
|
<div style={{ width: 16, height: 16, cursor: 'pointer' }}> |
|
|
|
|
|
<img |
|
|
|
|
|
src="/assets/images/imageImg/close.png" |
|
|
|
|
|
alt="设置" |
|
|
|
|
|
style={{ width: '100%' }} |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div style={{ borderBottom: '1px solid rgba(226,226,226,0.5)', background: '#FFFFFF' }}> |
|
|
|
|
|
<div style={{ display: 'flex', padding: "8px 10px 10px 10px", alignItems: 'center' }}> |
|
|
|
|
|
<div style={{ fontSize: 12 }}>摄像头名称</div> |
|
|
|
|
|
<div> |
|
|
|
|
|
<Input placeholder='请输入摄像头名称' style={{ width: 140, marginLeft: 10 }}></Input> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div style={{ width: 32, height: 32 }}> |
|
|
|
|
|
<img |
|
|
|
|
|
src="/assets/images/imageImg/find.png" |
|
|
|
|
|
alt="设置" |
|
|
|
|
|
style={{ width: '100%' }} |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div style={{ display: 'flex' }}> |
|
|
|
|
|
<div> |
|
|
|
|
|
<Checkbox |
|
|
|
|
|
indeterminate={indeterminate} |
|
|
|
|
|
onChange={onCheckAllChange} |
|
|
|
|
|
checked={checkAll} |
|
|
|
|
|
aria-label="Checkbox 示例" |
|
|
|
|
|
> |
|
|
|
|
|
全选 |
|
|
|
|
|
</Checkbox> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div> |
|
|
|
|
|
<Checkbox onChange={checked => console.log(checked)} aria-label="Checkbox 示例">隐藏添加过的</Checkbox> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
{/* 样式 */} |
|
|
<div style={{ display: 'flex' }}> |
|
|
<div style={{ display: chooseNum == "1" ? "block" : "none", fontSize: 12 }} className="hasHeader"> |
|
|
<div> |
|
|
<div style={{ height: 41, display: 'flex', alignItems: 'center', justifyContent: 'space-between', borderBottom: '1px solid rgba(226,226,226,0.2)' }}> |
|
|
<Checkbox |
|
|
<div style={{ marginLeft: 20 }}>header</div> |
|
|
indeterminate={indeterminate} |
|
|
<div style={{ marginRight: 13 }}><Switch onChange={(v, e) => console.log(v)} size="small" aria-label="是否有头部"></Switch></div> |
|
|
onChange={onCheckAllChange} |
|
|
|
|
|
checked={checkAll} |
|
|
|
|
|
aria-label="Checkbox 示例" |
|
|
|
|
|
> |
|
|
|
|
|
全选 |
|
|
|
|
|
</Checkbox> |
|
|
</div> |
|
|
</div> |
|
|
<div style={{ height: 41, display: 'flex', alignItems: 'center', justifyContent: 'space-between', borderBottom: '1px solid rgba(226,226,226,0.2)', cursor: 'pointer' }} onClick={() => { setComingVisible(true) }}> |
|
|
<div> |
|
|
<div style={{ marginLeft: 20 }}>自定义样式</div> |
|
|
<Checkbox onChange={checked => console.log(checked)} aria-label="Checkbox 示例">隐藏添加过的</Checkbox> |
|
|
<div style={{ marginRight: 13, width: 9, height: 5, display: 'flex', alignItems: 'center', }}> |
|
|
|
|
|
<img |
|
|
|
|
|
src="/assets/images/imageImg/down.png" |
|
|
|
|
|
alt="设置" |
|
|
|
|
|
style={{ width: '100%' }} |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div style={{flex:1}}> |
|
|
</div> |
|
|
</div> |
|
|
{/* 样式 */} |
|
|
|
|
|
<div style={{ display: chooseNum == "1" ? "block" : "none", fontSize: 12 }} className="hasHeader"> |
|
|
|
|
|
<div style={{ height: 41, display: 'flex', alignItems: 'center', justifyContent: 'space-between', borderBottom: '1px solid rgba(226,226,226,0.2)' }}> |
|
|
|
|
|
<div style={{ marginLeft: 20 }}>header</div> |
|
|
|
|
|
<div style={{ marginRight: 13 }}><Switch onChange={(v, e) => console.log(v)} size="small" aria-label="是否有头部"></Switch></div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div style={{ height: 41, display: 'flex', alignItems: 'center', justifyContent: 'space-between', borderBottom: '1px solid rgba(226,226,226,0.2)', cursor: 'pointer' }} onClick={() => { setComingVisible(true) }}> |
|
|
|
|
|
<div style={{ marginLeft: 20 }}>自定义样式</div> |
|
|
|
|
|
<div style={{ marginRight: 13, width: 9, height: 5, display: 'flex', alignItems: 'center', }}> |
|
|
|
|
|
<img |
|
|
|
|
|
src="/assets/images/imageImg/down.png" |
|
|
|
|
|
alt="设置" |
|
|
|
|
|
style={{ width: '100%' }} |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div style={{ flex: 1,height:'100%'}}> |
|
|
|
|
|
|
|
|
|
|
|
<VideoScreen /> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<Modal |
|
|
</div> |
|
|
title="提醒" |
|
|
<Modal |
|
|
visible={comingVisible} |
|
|
title="提醒" |
|
|
onOk={() => { |
|
|
visible={comingVisible} |
|
|
setComingVisible(false) |
|
|
onOk={() => { |
|
|
}} |
|
|
setComingVisible(false) |
|
|
width={610} |
|
|
}} |
|
|
onCancel={() => { |
|
|
width={610} |
|
|
setComingVisible(false) |
|
|
onCancel={() => { |
|
|
}} |
|
|
setComingVisible(false) |
|
|
okText="确定" |
|
|
}} |
|
|
cancelText="取消" |
|
|
okText="确定" |
|
|
closeOnEsc={true} |
|
|
cancelText="取消" |
|
|
> |
|
|
closeOnEsc={true} |
|
|
开发中,敬请期待~ |
|
|
> |
|
|
</Modal> |
|
|
开发中,敬请期待~ |
|
|
</div> |
|
|
</Modal> |
|
|
) |
|
|
</div> |
|
|
|
|
|
) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function mapStateToProps (state) { |
|
|
function mapStateToProps (state) { |
|
|
const { auth, global } = state; |
|
|
const { auth, global } = state; |
|
|
return { |
|
|
return { |
|
|
user: auth.user, |
|
|
user: auth.user, |
|
|
actions: global.actions, |
|
|
actions: global.actions, |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
export default connect(mapStateToProps)(MirroringDetail); |
|
|
export default connect(mapStateToProps)(MirroringDetail); |
|
|