Browse Source

问题修改

release_1.3.0
deartibers 3 years ago
parent
commit
a479033da9
  1. 72
      code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroringDetail.jsx

72
code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroringDetail.jsx

@ -110,7 +110,8 @@ const MirroringDetail = (props) => {
const [plainOptions, setPlainOptions] = useState([]);// const [plainOptions, setPlainOptions] = useState([]);//
const [checkedList, setCheckedList] = useState([]);// const [checkedList, setCheckedList] = useState([]);//
const [mykeyword, setMykeyword] = useState('');// const [mykeyword, setMykeyword] = useState('');//
const [allCameraList, setAllCameraList] = useState([])// const [allCameraList, setAllCameraList] = useState([])//
const [labelCameraList, setLabelCameraList] = useState([])//
const [showCameraList, setShowCameraList] = useState([])// const [showCameraList, setShowCameraList] = useState([])//
const [saveShowList, setSaveShowList] = useState([])// const [saveShowList, setSaveShowList] = useState([])//
const [addCamera, setAddCamera] = useState(false);// const [addCamera, setAddCamera] = useState(false);//
@ -749,6 +750,61 @@ const MirroringDetail = (props) => {
setAddScreen(true) setAddScreen(true)
} }
function addLabelGroup (index) {// function addLabelGroup (index) {//
let myAllCameraList=[]
for (let j = 0; j < treeData.length; j++) {//
if (treeData[j].children) {//
for (let k = 0; k < treeData[j].children.length; k++) {//
if (treeData[j].children[k].children) {//
for (let l = 0; l < treeData[j].children[k].children.length; l++) {//
if (treeData[j].children[k].children[l].children) {//
for (let p = 0; p < treeData[j].children[k].children[l].children.length; p++) {//
if (treeData[j].children[k].children[l].children[p].cameraId) {
for (let i = 0; i < allCameraList.length; i++) {
if (allCameraList[i].id == treeData[j].children[k].children[l].children[p].cameraId) {
myAllCameraList.push(allCameraList[i])
}
}
}
}
}
else if (treeData[j].children[k].children[l].cameraId) {//
for (let i = 0; i < allCameraList.length; i++) {
if (allCameraList[i].value == treeData[j].children[k].children[l].cameraId) {
myAllCameraList.push(allCameraList[i])
}
}
}
}
}
else if (treeData[j].children[k].cameraId) {//
for (let i = 0; i < allCameraList.length; i++) {
if (allCameraList[i].value == treeData[j].children[k].cameraId) {
myAllCameraList.push(allCameraList[i])
}
}
}
}
}
}
let myFilterGroupList=JSON.parse(JSON.stringify(filterGroup))
for (let i = 0; i < myFilterGroupList.length; i++) {
if(myFilterGroupList[i].filters){
for (let j = 0; j < myFilterGroupList[i].filters.length; j++) {
let idArr=JSON.parse(JSON.stringify(myFilterGroupList[i].filters[j].cameraIds))
let newArr=[]
for (let k = 0; k < idArr.length; k++) {
for (let l = 0; l < myAllCameraList.length; l++) {
if(idArr[k]==myAllCameraList[l].id){
newArr.push(idArr[k])
}
}
}
myFilterGroupList[i].filters[j].cameraIds=newArr
}
}
}
setFilterGroup(myFilterGroupList)
setLabelCameraList(myAllCameraList)
setAddLabelNum(index) setAddLabelNum(index)
setAddLabel(true) setAddLabel(true)
} }
@ -1022,7 +1078,7 @@ const MirroringDetail = (props) => {
<div style={{ display: chooseNum == "1" ? "block" : "none", fontSize: 12 }} className="hasHeader"> <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={{ 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={{ marginLeft: 20 }}>header</div>
<div style={{ marginRight: 13 }}><Switch checked={showHeader} onChange={(v, e) => setShowHeader(v)} size="small" aria-label="是否有头部"></Switch></div> <div style={{ marginRight: 13 }}><Switch checked={showHeader} onChange={(v, e) => {setShowHeader(v);sethasModify(true)}} size="small" aria-label="是否有头部"></Switch></div>
</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={{ 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={{ marginLeft: 20 }}>自定义样式</div>
@ -1099,13 +1155,20 @@ const MirroringDetail = (props) => {
style={{ width: '100%' }} style={{ width: '100%' }}
/> />
</div> </div>
<div style={{ width: 12, height: 12, cursor: 'pointer', marginLeft: 4, display: 'flex' }} onClick={() => { screenDel(index) }}> <Popconfirm
title="是否确认删除该选项组?"
arrowPointAtCenter={false}
showArrow={true}
position="topRight"
onConfirm={() => screenDel(index)}>
<div style={{ width: 12, height: 12, cursor: 'pointer', marginLeft: 4, display: 'flex' }}>
<img <img
src="/assets/images/imageImg/nodeDel.png" src="/assets/images/imageImg/nodeDel.png"
alt="设置" alt="设置"
style={{ width: '100%' }} style={{ width: '100%' }}
/> />
</div> </div>
</Popconfirm>
<div style={{ width: 12, height: 12, cursor: 'pointer', marginLeft: 4, display: 'flex' }} onClick={() => { addLabelGroup(index) }}> <div style={{ width: 12, height: 12, cursor: 'pointer', marginLeft: 4, display: 'flex' }} onClick={() => { addLabelGroup(index) }}>
<img <img
src="/assets/images/imageImg/install.png" src="/assets/images/imageImg/install.png"
@ -1178,7 +1241,7 @@ const MirroringDetail = (props) => {
<div style={{ padding: '0px 20px 10px 10px' }}> <div style={{ padding: '0px 20px 10px 10px' }}>
<Select multiple value={item.cameraIds} style={{ width: '234px' }} onChange={(val) => { addFiltersCamera(val, index) }} maxTagCount={2} size='large'> <Select multiple value={item.cameraIds} style={{ width: '234px' }} onChange={(val) => { addFiltersCamera(val, index) }} maxTagCount={2} size='large'>
{ {
allCameraList.map((itm, idx) => { labelCameraList.map((itm, idx) => {
return ( return (
<Select.Option value={itm.id} key={idx}>{itm.label}</Select.Option> <Select.Option value={itm.id} key={idx}>{itm.label}</Select.Option>
) )
@ -1209,7 +1272,6 @@ const MirroringDetail = (props) => {
width={610} width={610}
onCancel={() => { onCancel={() => {
setComingVisible(false) setComingVisible(false)
history.goBack()
}} }}
okText="确定" okText="确定"
cancelText="取消" cancelText="取消"

Loading…
Cancel
Save