|
|
@ -18,6 +18,7 @@ const CallService = (props) => { |
|
|
|
const [videoPlay, setVideoPlay] = useState(true) //视频预览 |
|
|
|
const [listOpen, setlistOpen] = useState(false)//是否展开列表 |
|
|
|
const [loading, setLoading] = useState(false) |
|
|
|
const [treeValue, setTreeValue] = useState([]) |
|
|
|
|
|
|
|
|
|
|
|
useEffect(async () => { |
|
|
@ -40,6 +41,58 @@ const CallService = (props) => { |
|
|
|
setlistOpen(data.listOpen || false) |
|
|
|
setFilterGroup(filterGrouplist) |
|
|
|
setTemplate(data.template) |
|
|
|
|
|
|
|
if (data?.check?.length > 0) { |
|
|
|
let checks = data?.check |
|
|
|
let vlaue = [] |
|
|
|
data?.tree?.map(f => { |
|
|
|
if (f.children?.length > 0) { //1 |
|
|
|
f.children?.map(d => { |
|
|
|
if (checks.includes(d.cameraId)) { |
|
|
|
vlaue.push(d.key); |
|
|
|
} else if (d.children?.length > 0) { //2 |
|
|
|
d.children?.map(s => { |
|
|
|
if (checks.includes(s.cameraId)) { |
|
|
|
vlaue.push(s.key); |
|
|
|
} else if (s.children?.length > 0) { |
|
|
|
s.children?.map(g => { //3 |
|
|
|
if (checks.includes(g.cameraId)) { |
|
|
|
vlaue.push(g.key); |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
setTreeValue(vlaue) |
|
|
|
} else { |
|
|
|
let vlaue = [] |
|
|
|
data?.tree?.map(f => { |
|
|
|
if (f.children?.length > 0) { //1 |
|
|
|
f.children?.map(d => { |
|
|
|
if (d.cameraId) { |
|
|
|
vlaue.push(d.key); |
|
|
|
} else if (d.children?.length > 0) { //2 |
|
|
|
d.children?.map(s => { |
|
|
|
if (s.cameraId) { |
|
|
|
vlaue.push(s.key); |
|
|
|
} else if (s.children?.length > 0) { |
|
|
|
s.children?.map(g => { //3 |
|
|
|
if (g.cameraId) { |
|
|
|
vlaue.push(g.key); |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log(vlaue); |
|
|
|
setTreeValue(vlaue) |
|
|
|
} |
|
|
|
} else { |
|
|
|
dispatch(push('/noMatch')) |
|
|
|
Notification.error({ |
|
|
@ -57,6 +110,7 @@ const CallService = (props) => { |
|
|
|
|
|
|
|
{treeData && loading ? <VideoScreen |
|
|
|
treeData={treeData} |
|
|
|
treeValue={treeValue} |
|
|
|
headerName={headerName} |
|
|
|
showHeader={showHeader} |
|
|
|
filterGroup={filterGroup} |
|
|
|