diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cascadeCamera.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cascadeCamera.jsx index 2ffe25d..0819e6e 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cascadeCamera.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cascadeCamera.jsx @@ -99,8 +99,8 @@ function cascadeCamera({ dRef, dispatch, actions }) { rules={[{ required: true, message: "请选择SIP编号" }]} > {sip.map((item, index) => ( - - {item.streamid} + + {item.sipip} ))} diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/fluoriteCamera.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/fluoriteCamera.jsx index b246bb4..952e06e 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/fluoriteCamera.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/fluoriteCamera.jsx @@ -2,484 +2,483 @@ import React, { useState, useRef, useEffect, useImperativeHandle } from "react"; import { connect } from "react-redux"; import { Form, Row, Col } from "@douyinfe/semi-ui"; import "./cameraModal.less"; -function fluoriteCamera({ cRef, CameraKind, CameraAbility, cameraData }) { - const { TextArea } = Form; - const form = useRef(); - const [cloud, setcloud] = useState(""); //云台支持 - const [voice, setvoice] = useState(""); //语音支持 - const [switching, setSwitching] = useState(""); //高清切换 - const [memoryList, setMemoryList] = useState([ - { - id: 1, - value: "8g", - }, - { - id: 2, - value: "16g", - }, - { - id: 3, - value: "32g", - }, - { - id: 4, - value: "64g", - }, - { - id: 5, - value: "128g", - }, - { - id: 6, - value: "256g", - }, - { - id: 7, - value: ">256g", - }, - ]); //内存卡列表 +function fluoriteCamera ({ cRef, CameraKind, CameraAbility, cameraData }) { + const { TextArea } = Form; + const form = useRef(); + const [cloud, setcloud] = useState(""); //云台支持 + const [voice, setvoice] = useState(""); //语音支持 + const [switching, setSwitching] = useState(""); //高清切换 + const [memoryList, setMemoryList] = useState([ + { + id: 1, + value: "8g", + }, + { + id: 2, + value: "16g", + }, + { + id: 3, + value: "32g", + }, + { + id: 4, + value: "64g", + }, + { + id: 5, + value: "128g", + }, + { + id: 6, + value: "256g", + }, + { + id: 7, + value: ">256g", + }, + ]); //内存卡列表 - useEffect(() => { - setcloud(cameraData.cloudControl || ""); - setvoice(cameraData.voice || ""); - setSwitching(cameraData.highDefinition || ""); - }, []); - function handleLocation() { - //高德经纬度 - window.open("https://lbs.amap.com/tools/picker", "_blank"); - } - function positionForm(val) { - //安装位置校验 - let zz = /^(-?\d+)(\.\d+)?$/; - if (!val) { - return "请输入或拾取高德经纬度坐标"; - } else if (val.split(",").length != 2) { - return "请输入格式为116.354169,39.835452的经纬度坐标"; - } else if (!zz.test(val.split(",")[0])) { - return "只能填写数字"; - } else if (!zz.test(val.split(",")[1])) { - return "只能填写数字"; - } else { - return ""; + useEffect(() => { + setcloud(cameraData.cloudControl || ""); + setvoice(cameraData.voice || ""); + setSwitching(cameraData.highDefinition || ""); + }, []); + function handleLocation () { + //高德经纬度 + window.open("https://lbs.amap.com/tools/picker", "_blank"); } - } - useImperativeHandle(cRef, () => ({ - //传给父组件方法 - //子组件暴露给父组件的方法 - fluoriteCameraForm: form.current.validate, - resetFluoriteCamera: form.current.reset, - toempty: empty, - })); - function empty() { - setcloud(""); - setvoice(""); - setSwitching(""); - } - return ( - <> -
console.log(values)} - initValues={{ - name: cameraData ? cameraData.name : "", - highDefinition: cameraData ? cameraData.highDefinition : "", - memoryCard: cameraData ? cameraData.memoryCard : "", - position: cameraData.longitude - ? `${cameraData.longitude},${cameraData.latitude}` - : "", - kindId: cameraData ? cameraData.kindId : "", - abilityId: cameraData - ? cameraData.cameraAbilities - ? cameraData.cameraAbilities.map((item) => item.id) - : "" - : "", - cloudControl: cameraData ? cameraData.cloudControl : "", - voice: cameraData ? cameraData.voice : "", - serialNo: cameraData ? cameraData.serialNo : "", - rtmp: cameraData ? cameraData.rtmp : "", - }} - getFormApi={(formApi) => (form.current = formApi)} - > - - - {/* 设备名称 */} - - {/* 高清切换 */} - { - if (checked.target.value == true) { - setSwitching(true); - } else { - setSwitching(false); - } - }} - > - -
- 支持 -
- {switching == true ? ( -
- 1 -
- ) : ( - "" - )} -
- ({ + //传给父组件方法 + //子组件暴露给父组件的方法 + fluoriteCameraForm: form.current.validate, + resetFluoriteCamera: form.current.reset, + toempty: empty, + })); + function empty () { + setcloud(""); + setvoice(""); + setSwitching(""); + } + return ( + <> + console.log(values)} + initValues={{ + name: cameraData.name || "", + highDefinition: cameraData.highDefinition || "", + memoryCard: cameraData.memoryCard || "", + position: cameraData.longitude + ? `${cameraData.longitude},${cameraData.latitude}` + : "", + kindId: cameraData.kindId || "", + abilityId: cameraData.cameraAbilities + ? cameraData.cameraAbilities.map((item) => item.id) + : "" + , + cloudControl: cameraData.cloudControl || "", + voice: cameraData.voice || "", + serialNo: cameraData.serialNo || "", + rtmp: cameraData.rtmp || "", }} - > -
- 不支持 -
- {switching == false && switching !== "" ? ( -
- 1 -
- ) : ( - "" - )} -
-
- {/* 内存 */} - (form.current = formApi)} > - {memoryList.map((item, index) => ( - - {item.value} - - ))} - - {/* 安装位置 */} -
- -
- -
-
- {/* 设备类型 */} + + + {/* 设备名称 */} + + {/* 高清切换 */} + { + if (checked.target.value == true) { + setSwitching(true); + } else { + setSwitching(false); + } + }} + > + +
+ 支持 +
+ {switching == true ? ( +
+ 1 +
+ ) : ( + "" + )} +
+ +
+ 不支持 +
+ {switching == false && switching !== "" ? ( +
+ 1 +
+ ) : ( + "" + )} +
+
+ {/* 内存 */} + + {memoryList.map((item, index) => ( + + {item.value} + + ))} + + {/* 安装位置 */} +
+ +
+ +
+
+ {/* 设备类型 */} - - {CameraKind.map((item, index) => ( - - {item.kind} - - ))} - + + {CameraKind.map((item, index) => ( + + {item.kind} + + ))} + - - {CameraAbility.map((item, index) => ( - - {item.ability} - - ))} - - - - {/* 云台支持 */} - { - if (checked.target.value == true) { - setcloud(true); - } else { - setcloud(false); - } - }} - > - -
- 支持 -
- {cloud == true ? ( -
- 1 -
- ) : ( - "" - )} -
- -
- 不支持 -
- {cloud == false && cloud !== "" ? ( -
- 1 -
- ) : ( - "" - )} -
-
- {/* 语音支持 */} - { - if (checked.target.value == true) { - setvoice(true); - } else { - setvoice(false); - } - }} - > - -
- 支持 -
- {voice == true ? ( -
- 1 -
- ) : ( - "" - )} -
- -
- 不支持 -
- {voice == false && voice !== "" ? ( -
- 1 -
- ) : ( - "" - )} -
-
- {/* 设备名称 */} - - {/* RTMP地址接入 */} -