From 5c5334ff72e759c692a668443a7b4168876dc1b6 Mon Sep 17 00:00:00 2001 From: wenlele Date: Wed, 25 May 2022 10:10:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=91=84=E5=83=8F=E5=A4=B4=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/sideSheet.jsx | 13 ++----- .../equipmentWarehouse/containers/camera.jsx | 38 +++++++++---------- .../equipmentWarehouse/containers/nvr.jsx | 9 +++++ 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx index 1605372..792596d 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx @@ -20,17 +20,12 @@ function SideSheets(props) { cameraSetup, rowId, venderList, + accessType, } = props; const { equipmentWarehouse } = actions; const [clickStyle, setclickStyle] = useState(); const [nvrDetails, setNvrDetails] = useState(""); const list = ["项目名称", "关联结构物", "关联测点", "关联监测因素"]; - const type = [ - { name: "萤石", key: "yingshi" }, - { name: "NVR摄像头", key: "nvr" }, - { name: "IPC 网络摄像头", key: "ipc" }, - { name: "级联摄像头", key: "cascade" }, - ]; const information = { nvr: [ { @@ -38,7 +33,7 @@ function SideSheets(props) { basics: [ { name: "设备名称:", key: "name" }, { name: "设备编号:", key: "serialNo" }, - { name: "接入方式:", key: "NJBJ858G68H" }, + { name: "接入方式:", key: "type" }, { name: "厂商:", key: "venderId" }, { name: "添加账号:", key: "createUser" }, { name: "添加时间:", key: "createTime" }, @@ -345,8 +340,8 @@ function SideSheets(props) { - {item.key == "type" - ? type.find((v) => v.key == nvrDetails.type) + {item.key == "typ" + ? accessType.find((v) => v.key == nvrDetails.type) .name : item.key == "venderId" ? venderList.find( diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx index f80b0ae..1ba8927 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx @@ -16,6 +16,7 @@ import CameraModal from "../components/cameraModal"; import NvrModal from "../components/nvrModal"; import Setup from "../components/setup"; import SideSheets from "../components/sideSheet"; +import { accessType } from "./nvr"; const CameraHeader = (props) => { const { dispatch, actions, user, loading, equipmentWarehouseCamera } = props; @@ -26,7 +27,8 @@ const CameraHeader = (props) => { const [cameraSetup, setcameraSetup] = useState(false); const [setupp, setSetupp] = useState([]); const [venderList, setvenderList] = useState([]); //厂商信息 - const [query, setQuery] = useState({ limit: 10, page: 0 }); + const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息 + const [search, setearch] = useState({}); //搜索条件 const [rowId, setRowId] = useState(); //表格数据id const { equipmentWarehouse } = actions; @@ -45,15 +47,17 @@ const CameraHeader = (props) => { JSON.stringify(["state", "type", "manufactor"]) ) : ""; + console.log(equipmentWarehouseCamera); }, []); useEffect(() => { equipmentGetCamera(); - }, []); + }, [query, search]); function equipmentGetCamera() { - dispatch(equipmentWarehouse.getCamera(query)); + dispatch(equipmentWarehouse.getCamera({ ...query, ...search })); } + const columns = [ { title: "序号", @@ -115,7 +119,7 @@ const CameraHeader = (props) => {