|
|
@ -15,6 +15,7 @@ import { IconEdit, IconPlayCircle, IconTickCircle } from "@douyinfe/semi-icons"; |
|
|
|
import "./cameraModal.less"; |
|
|
|
import PerfectScrollbar from "perfect-scrollbar"; |
|
|
|
import { isIndexed } from "immutable"; |
|
|
|
import { useId } from "react"; |
|
|
|
|
|
|
|
let equipmentScrollbar; |
|
|
|
function nvrCamera ({ dispatch, actions, nvrRef, cameraData, addNvr, nvrNumber }) { |
|
|
@ -52,24 +53,18 @@ function nvrCamera ({ dispatch, actions, nvrRef, cameraData, addNvr, nvrNumber } |
|
|
|
streamId: cameraDataNvr.serialNo, |
|
|
|
}) |
|
|
|
).then((res) => { |
|
|
|
console.log(res) |
|
|
|
let oneData = res.payload.data[0]; |
|
|
|
let modifyData = res.payload.data.find( |
|
|
|
(item) => item.camera == null ? false : item.camera.name == cameraData.name |
|
|
|
); |
|
|
|
(item) =>item.id == cameraData.gbId); |
|
|
|
let data = res.payload.data.map((item, index) => { |
|
|
|
if (index == 0) { |
|
|
|
item = modifyData; |
|
|
|
if (item.camera) { |
|
|
|
item.name = item.camera.name; |
|
|
|
} |
|
|
|
if ( |
|
|
|
item.camera |
|
|
|
? item.camera.name == cameraData.name && index > 0 |
|
|
|
: index < 0 |
|
|
|
) { |
|
|
|
if (item.id == cameraData.gbId) { |
|
|
|
item = oneData; |
|
|
|
} |
|
|
|
if (item.camera) { |
|
|
|
item.name = item.camera.name; |
|
|
|
if (index == 0) { |
|
|
|
item = modifyData; |
|
|
|
} |
|
|
|
return item; |
|
|
|
}); |
|
|
@ -121,10 +116,10 @@ function nvrCamera ({ dispatch, actions, nvrRef, cameraData, addNvr, nvrNumber } |
|
|
|
} |
|
|
|
|
|
|
|
}, []); |
|
|
|
function NvrChangeName (e, index, name) { |
|
|
|
function NvrChangeName (e, index, id) { |
|
|
|
//nvr摄像头视频流获取修改名称 |
|
|
|
let NvrchangeList = JSON.parse(JSON.stringify(NVRcameraList)); |
|
|
|
if (!cameraDataNvr || cameraData.name == name) { |
|
|
|
if (!cameraData.gbId || cameraData.gbId == id) { |
|
|
|
NvrchangeList[index].change = true; |
|
|
|
setNVRcameraList(NvrchangeList); |
|
|
|
} |
|
|
@ -209,8 +204,8 @@ function nvrCamera ({ dispatch, actions, nvrRef, cameraData, addNvr, nvrNumber } |
|
|
|
console.log("22222222222222222"); |
|
|
|
e.stopPropagation(); |
|
|
|
} |
|
|
|
function onDisabled (name) { |
|
|
|
if ((cameraDataNvr && cameraData.name == name) || !cameraDataNvr) { |
|
|
|
function onDisabled (id) { |
|
|
|
if (cameraData.gbId == id || !cameraData.gbId) { |
|
|
|
return false; |
|
|
|
} else { |
|
|
|
return true; |
|
|
@ -269,7 +264,7 @@ function nvrCamera ({ dispatch, actions, nvrRef, cameraData, addNvr, nvrNumber } |
|
|
|
<Radio |
|
|
|
checked={isAllChoose} |
|
|
|
mode="advanced" |
|
|
|
disabled={cameraDataNvr ? true : false} |
|
|
|
disabled={cameraData.gbId ? true : false} |
|
|
|
onChange={(e) => allChoose(e)} |
|
|
|
aria-label="全选" |
|
|
|
> |
|
|
@ -314,7 +309,7 @@ function nvrCamera ({ dispatch, actions, nvrRef, cameraData, addNvr, nvrNumber } |
|
|
|
> |
|
|
|
<Checkbox |
|
|
|
value={item.id} |
|
|
|
disabled={onDisabled(item.name)} |
|
|
|
disabled={onDisabled(item.id)} |
|
|
|
extra={ |
|
|
|
<div> |
|
|
|
<div |
|
|
@ -354,7 +349,7 @@ function nvrCamera ({ dispatch, actions, nvrRef, cameraData, addNvr, nvrNumber } |
|
|
|
color: "#1859C1", |
|
|
|
}} |
|
|
|
onClick={(e) => |
|
|
|
NvrChangeName(e, index, item.name) |
|
|
|
NvrChangeName(e, index, item.id) |
|
|
|
} |
|
|
|
/> |
|
|
|
</div> |
|
|
@ -378,7 +373,7 @@ function nvrCamera ({ dispatch, actions, nvrRef, cameraData, addNvr, nvrNumber } |
|
|
|
<Radio |
|
|
|
checked={item.support} |
|
|
|
mode="advanced" |
|
|
|
disabled={onDisabled(item.name)} |
|
|
|
disabled={onDisabled(item.id)} |
|
|
|
onChange={(e) => toggle(e, index)} |
|
|
|
aria-label="单选" |
|
|
|
> |
|
|
|