Browse Source

级联摄像头修改50%

release_0.0.2
wenlele 2 years ago
parent
commit
ab8b7bc8d1
  1. 7
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cascadeCamera.jsx
  2. 28
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx

7
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cascadeCamera.jsx

@ -3,7 +3,7 @@ import { connect } from "react-redux";
import { Form, Row, Col } from "@douyinfe/semi-ui"; import { Form, Row, Col } from "@douyinfe/semi-ui";
import "./cameraModal.less"; import "./cameraModal.less";
function cascadeCamera({ dRef, dispatch, actions }) { function cascadeCamera({ dRef, dispatch, actions ,cameraData}) {
const form = useRef(); const form = useRef();
const { equipmentWarehouse } = actions; const { equipmentWarehouse } = actions;
const [sip, setSip] = useState([]); const [sip, setSip] = useState([]);
@ -71,7 +71,7 @@ function cascadeCamera({ dRef, dispatch, actions }) {
<Form.Input <Form.Input
field="externalDomain" field="externalDomain"
label="外域名称:" label="外域名称:"
initValue={""}v initValue={cameraData.externalDomain||""}v
placeholder="请输入外域名称" placeholder="请输入外域名称"
style={{ width: 307 }} style={{ width: 307 }}
rules={[{ required: true, message: "请输入外域名称" }]} rules={[{ required: true, message: "请输入外域名称" }]}
@ -81,7 +81,7 @@ function cascadeCamera({ dRef, dispatch, actions }) {
<Form.Select <Form.Select
label="级联方式:" label="级联方式:"
field="cascadeType" field="cascadeType"
initValue="上级域" initValue={cameraData.cascadeType||"上级域"}
style={{ width: 307 }} style={{ width: 307 }}
rules={[{ required: true, message: "请选择输入级联方式" }]} rules={[{ required: true, message: "请选择输入级联方式" }]}
> >
@ -94,6 +94,7 @@ function cascadeCamera({ dRef, dispatch, actions }) {
<Form.Select <Form.Select
label="SIP编号:" label="SIP编号:"
field="sip" field="sip"
initValue={cameraData.cascadeType||""}
placeholder="请选择SIP编号" placeholder="请选择SIP编号"
style={{ width: 307 }} style={{ width: 307 }}
rules={[{ required: true, message: "请选择SIP编号" }]} rules={[{ required: true, message: "请选择SIP编号" }]}

28
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx

@ -35,10 +35,10 @@ const CameraHeader = (props) => {
const [search, setearch] = useState({}); // const [search, setearch] = useState({}); //
const [rowId, setRowId] = useState(); //id const [rowId, setRowId] = useState(); //id
const [cameraData, setCameraData] = useState({}); // const [cameraData, setCameraData] = useState({}); //
const [deviceClick, setDeviceClick] = useState(false); //
const { equipmentWarehouse } = actions; const { equipmentWarehouse } = actions;
const api = useRef(); const api = useRef();
const searchb = useRef(search)
const deviceClickb = useRef(true)
const CAMERAS = "cameras"; const CAMERAS = "cameras";
useEffect(() => { useEffect(() => {
@ -81,7 +81,24 @@ const CameraHeader = (props) => {
<div> <div>
{row.name} {row.name}
<sapn style={{ color: "blue" }} <sapn style={{ color: "blue" }}
onClick={() =>device_(row)} onClick={() => {
if (deviceClickb.current) {
if (row.type == "nvr") {
setearch({ ...searchb.current, nvrId: row.nvr.id })
} else {
setearch({ ...searchb.current, externalDomain: row.externalDomain })
}
deviceClickb.current=false
} else {
if (row.type == "nvr") {
setearch({ ...searchb.current, nvrId: null })
} else {
setearch({ ...searchb.current, externalDomain: null })
}
deviceClickb.current=true
}
}}
> >
{row.type == "nvr" ? `@${row.nvr.name}` : row.type == "cascade" ? `@${row.externalDomain}` : ""} {row.type == "nvr" ? `@${row.nvr.name}` : row.type == "cascade" ? `@${row.externalDomain}` : ""}
</sapn> </sapn>
@ -190,7 +207,7 @@ const CameraHeader = (props) => {
]; ];
const device_ = (r) => { const device_ = (r) => {
console.log(deviceClick) console.log(searchb)
if (deviceClick) { if (deviceClick) {
// if (r.type == "nvr") { // if (r.type == "nvr") {
// console.log(search) // console.log(search)
@ -222,7 +239,7 @@ const CameraHeader = (props) => {
key: "manufactor", key: "manufactor",
render: (_, r, index) => { render: (_, r, index) => {
let manufactorName = data.find((item) => item.id == r.venderId); let manufactorName = data.find((item) => item.id == r.venderId);
return manufactorName ? manufactorName.name : ""; return manufactorName ? manufactorName.name : "未知";
}, },
}, },
{ {
@ -556,6 +573,7 @@ const CameraHeader = (props) => {
onClick={() => { onClick={() => {
api.current.validate().then((v) => { api.current.validate().then((v) => {
setearch(v); setearch(v);
searchb.current = v
}); });
equipmentGetCamera(); equipmentGetCamera();
}} }}

Loading…
Cancel
Save