From a5f11323f3f90ccd4ddfca8aeb5beeac74156be2 Mon Sep 17 00:00:00 2001 From: deartibers <947466799@qq.com> Date: Tue, 30 Aug 2022 10:29:38 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../openness/containers/mirroring.jsx | 4 ++-- .../openness/containers/mirroringDetail.jsx | 24 +++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroring.jsx b/code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroring.jsx index 78bbf79..52b2577 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroring.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroring.jsx @@ -160,7 +160,7 @@ const Mirroring = (props) => {
{detailList.current.map((item, index) => { return ( -
+
mouseOver(index)}> {
- 最后编辑于:{getTime(item.updateTime)} + 最后编辑于:{getTime(item.updateTime)||getTime(item.createTime)}
最后发布于:{getTime(item.publishTime)} diff --git a/code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroringDetail.jsx b/code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroringDetail.jsx index f1a5bb6..0db2ba0 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroringDetail.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroringDetail.jsx @@ -378,6 +378,12 @@ const MirroringDetail = (props) => { setEditKey('') } 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)) for (let j = 0; j < treeData.length; j++) {//第一级 if (treeData[j].children) {//有没有子集 @@ -389,7 +395,9 @@ const MirroringDetail = (props) => { if (treeData[j].children[k].children[l].children[p].cameraId) { for (let i = 0; i < myplainOptions.length; i++) { if (myplainOptions[i].value == treeData[j].children[k].children[l].children[p].cameraId) { - myplainOptions.splice(i, 1) + if(myItemArr.indexOf(myplainOptions[i].value)==-1){ + myplainOptions.splice(i, 1) + } } } } @@ -398,7 +406,9 @@ const MirroringDetail = (props) => { else if (treeData[j].children[k].children[l].cameraId) {//有没有摄像头 for (let i = 0; i < myplainOptions.length; i++) { if (myplainOptions[i].value == treeData[j].children[k].children[l].cameraId) { - myplainOptions.splice(i, 1) + if(myItemArr.indexOf(myplainOptions[i].value)==-1){ + myplainOptions.splice(i, 1) + } } } } @@ -407,14 +417,17 @@ const MirroringDetail = (props) => { else if (treeData[j].children[k].cameraId) {//有没有摄像头 for (let i = 0; i < myplainOptions.length; i++) { if (myplainOptions[i].value == treeData[j].children[k].cameraId) { - myplainOptions.splice(i, 1) + if(myItemArr.indexOf(myplainOptions[i].value)==-1){ + myplainOptions.splice(i, 1) + } } } } } } } - setCheckedList([]) + onChange(myItemArr) + setCheckedList(myItemArr) setSaveShowList(myplainOptions) setShowCameraList(myplainOptions) setAddCamera(true) @@ -570,6 +583,7 @@ const MirroringDetail = (props) => { let mainData = JSON.parse(JSON.stringify(treeData)) let nodeKeyArr = addCameraKey.split('-') if (nodeKeyArr.length == 1) { + mainData[nodeKeyArr[0]].children=[] for (let q = 0; q < plainOptions.length; q++) { for (let w = 0; w < checkedList.length; w++) { if (plainOptions[q].value == checkedList[w]) { @@ -617,6 +631,7 @@ const MirroringDetail = (props) => { } } } else if (nodeKeyArr.length == 2) { + mainData[nodeKeyArr[0]].children[nodeKeyArr[1]].children=[] for (let q = 0; q < plainOptions.length; q++) { for (let w = 0; w < checkedList.length; w++) { if (plainOptions[q].value == checkedList[w]) { @@ -668,6 +683,7 @@ const MirroringDetail = (props) => { } } } 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 w = 0; w < checkedList.length; w++) { if (plainOptions[q].value == checkedList[w]) {