From ab8b7bc8d1c55a876835281df00457a0456e7137 Mon Sep 17 00:00:00 2001 From: wenlele Date: Wed, 15 Jun 2022 20:57:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=A7=E8=81=94=E6=91=84=E5=83=8F=E5=A4=B4?= =?UTF-8?q?=E4=BF=AE=E6=94=B950%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/cascadeCamera.jsx | 7 +++-- .../equipmentWarehouse/containers/camera.jsx | 28 +++++++++++++++---- 2 files changed, 27 insertions(+), 8 deletions(-) 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 0819e6e..d22382f 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 @@ -3,7 +3,7 @@ import { connect } from "react-redux"; import { Form, Row, Col } from "@douyinfe/semi-ui"; import "./cameraModal.less"; -function cascadeCamera({ dRef, dispatch, actions }) { +function cascadeCamera({ dRef, dispatch, actions ,cameraData}) { const form = useRef(); const { equipmentWarehouse } = actions; const [sip, setSip] = useState([]); @@ -71,7 +71,7 @@ function cascadeCamera({ dRef, dispatch, actions }) { @@ -94,6 +94,7 @@ function cascadeCamera({ dRef, dispatch, actions }) { { const [search, setearch] = useState({}); //搜索条件 const [rowId, setRowId] = useState(); //表格数据id const [cameraData, setCameraData] = useState({}); //表格数据 - const [deviceClick, setDeviceClick] = useState(false); //设备名称点击的不同效果 - const { equipmentWarehouse } = actions; const api = useRef(); + const searchb = useRef(search) + const deviceClickb = useRef(true) const CAMERAS = "cameras"; useEffect(() => { @@ -81,7 +81,24 @@ const CameraHeader = (props) => {
{row.name} 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}` : ""} @@ -190,7 +207,7 @@ const CameraHeader = (props) => { ]; const device_ = (r) => { - console.log(deviceClick) + console.log(searchb) if (deviceClick) { // if (r.type == "nvr") { // console.log(search) @@ -222,7 +239,7 @@ const CameraHeader = (props) => { key: "manufactor", render: (_, r, index) => { 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={() => { api.current.validate().then((v) => { setearch(v); + searchb.current = v }); equipmentGetCamera(); }}