|
@ -378,6 +378,12 @@ const MirroringDetail = (props) => { |
|
|
setEditKey('') |
|
|
setEditKey('') |
|
|
} |
|
|
} |
|
|
function cameraAdd (item) {//添加摄像头 |
|
|
function cameraAdd (item) {//添加摄像头 |
|
|
|
|
|
let myItemArr=[] |
|
|
|
|
|
if(item.children){ |
|
|
|
|
|
for (let q = 0; q < item.children.length; q++) { |
|
|
|
|
|
myItemArr.push(item.children[q].cameraId) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
let myplainOptions = JSON.parse(JSON.stringify(plainOptions)) |
|
|
let myplainOptions = JSON.parse(JSON.stringify(plainOptions)) |
|
|
for (let j = 0; j < treeData.length; j++) {//第一级 |
|
|
for (let j = 0; j < treeData.length; j++) {//第一级 |
|
|
if (treeData[j].children) {//有没有子集 |
|
|
if (treeData[j].children) {//有没有子集 |
|
@ -389,24 +395,29 @@ const MirroringDetail = (props) => { |
|
|
if (treeData[j].children[k].children[l].children[p].cameraId) { |
|
|
if (treeData[j].children[k].children[l].children[p].cameraId) { |
|
|
for (let i = 0; i < myplainOptions.length; i++) { |
|
|
for (let i = 0; i < myplainOptions.length; i++) { |
|
|
if (myplainOptions[i].value == treeData[j].children[k].children[l].children[p].cameraId) { |
|
|
if (myplainOptions[i].value == treeData[j].children[k].children[l].children[p].cameraId) { |
|
|
|
|
|
if(myItemArr.indexOf(myplainOptions[i].value)==-1){ |
|
|
myplainOptions.splice(i, 1) |
|
|
myplainOptions.splice(i, 1) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
else if (treeData[j].children[k].children[l].cameraId) {//有没有摄像头 |
|
|
else if (treeData[j].children[k].children[l].cameraId) {//有没有摄像头 |
|
|
for (let i = 0; i < myplainOptions.length; i++) { |
|
|
for (let i = 0; i < myplainOptions.length; i++) { |
|
|
if (myplainOptions[i].value == treeData[j].children[k].children[l].cameraId) { |
|
|
if (myplainOptions[i].value == treeData[j].children[k].children[l].cameraId) { |
|
|
|
|
|
if(myItemArr.indexOf(myplainOptions[i].value)==-1){ |
|
|
myplainOptions.splice(i, 1) |
|
|
myplainOptions.splice(i, 1) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
else if (treeData[j].children[k].cameraId) {//有没有摄像头 |
|
|
else if (treeData[j].children[k].cameraId) {//有没有摄像头 |
|
|
for (let i = 0; i < myplainOptions.length; i++) { |
|
|
for (let i = 0; i < myplainOptions.length; i++) { |
|
|
if (myplainOptions[i].value == treeData[j].children[k].cameraId) { |
|
|
if (myplainOptions[i].value == treeData[j].children[k].cameraId) { |
|
|
|
|
|
if(myItemArr.indexOf(myplainOptions[i].value)==-1){ |
|
|
myplainOptions.splice(i, 1) |
|
|
myplainOptions.splice(i, 1) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -414,7 +425,9 @@ const MirroringDetail = (props) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
setCheckedList([]) |
|
|
} |
|
|
|
|
|
onChange(myItemArr) |
|
|
|
|
|
setCheckedList(myItemArr) |
|
|
setSaveShowList(myplainOptions) |
|
|
setSaveShowList(myplainOptions) |
|
|
setShowCameraList(myplainOptions) |
|
|
setShowCameraList(myplainOptions) |
|
|
setAddCamera(true) |
|
|
setAddCamera(true) |
|
@ -570,6 +583,7 @@ const MirroringDetail = (props) => { |
|
|
let mainData = JSON.parse(JSON.stringify(treeData)) |
|
|
let mainData = JSON.parse(JSON.stringify(treeData)) |
|
|
let nodeKeyArr = addCameraKey.split('-') |
|
|
let nodeKeyArr = addCameraKey.split('-') |
|
|
if (nodeKeyArr.length == 1) { |
|
|
if (nodeKeyArr.length == 1) { |
|
|
|
|
|
mainData[nodeKeyArr[0]].children=[] |
|
|
for (let q = 0; q < plainOptions.length; q++) { |
|
|
for (let q = 0; q < plainOptions.length; q++) { |
|
|
for (let w = 0; w < checkedList.length; w++) { |
|
|
for (let w = 0; w < checkedList.length; w++) { |
|
|
if (plainOptions[q].value == checkedList[w]) { |
|
|
if (plainOptions[q].value == checkedList[w]) { |
|
@ -617,6 +631,7 @@ const MirroringDetail = (props) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} else if (nodeKeyArr.length == 2) { |
|
|
} else if (nodeKeyArr.length == 2) { |
|
|
|
|
|
mainData[nodeKeyArr[0]].children[nodeKeyArr[1]].children=[] |
|
|
for (let q = 0; q < plainOptions.length; q++) { |
|
|
for (let q = 0; q < plainOptions.length; q++) { |
|
|
for (let w = 0; w < checkedList.length; w++) { |
|
|
for (let w = 0; w < checkedList.length; w++) { |
|
|
if (plainOptions[q].value == checkedList[w]) { |
|
|
if (plainOptions[q].value == checkedList[w]) { |
|
@ -668,6 +683,7 @@ const MirroringDetail = (props) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} else if (nodeKeyArr.length == 3) { |
|
|
} else if (nodeKeyArr.length == 3) { |
|
|
|
|
|
mainData[nodeKeyArr[0]].children[nodeKeyArr[1]].children[nodeKeyArr[2]].children=[] |
|
|
for (let q = 0; q < plainOptions.length; q++) { |
|
|
for (let q = 0; q < plainOptions.length; q++) { |
|
|
for (let w = 0; w < checkedList.length; w++) { |
|
|
for (let w = 0; w < checkedList.length; w++) { |
|
|
if (plainOptions[q].value == checkedList[w]) { |
|
|
if (plainOptions[q].value == checkedList[w]) { |
|
|