Browse Source

摄像头分页

release_0.0.2
wenlele 2 years ago
parent
commit
5c5334ff72
  1. 13
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx
  2. 38
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx
  3. 9
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx

13
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx

@ -20,17 +20,12 @@ function SideSheets(props) {
cameraSetup, cameraSetup,
rowId, rowId,
venderList, venderList,
accessType,
} = props; } = props;
const { equipmentWarehouse } = actions; const { equipmentWarehouse } = actions;
const [clickStyle, setclickStyle] = useState(); const [clickStyle, setclickStyle] = useState();
const [nvrDetails, setNvrDetails] = useState(""); const [nvrDetails, setNvrDetails] = useState("");
const list = ["项目名称", "关联结构物", "关联测点", "关联监测因素"]; const list = ["项目名称", "关联结构物", "关联测点", "关联监测因素"];
const type = [
{ name: "萤石", key: "yingshi" },
{ name: "NVR摄像头", key: "nvr" },
{ name: "IPC 网络摄像头", key: "ipc" },
{ name: "级联摄像头", key: "cascade" },
];
const information = { const information = {
nvr: [ nvr: [
{ {
@ -38,7 +33,7 @@ function SideSheets(props) {
basics: [ basics: [
{ name: "设备名称:", key: "name" }, { name: "设备名称:", key: "name" },
{ name: "设备编号:", key: "serialNo" }, { name: "设备编号:", key: "serialNo" },
{ name: "接入方式:", key: "NJBJ858G68H" }, { name: "接入方式:", key: "type" },
{ name: "厂商:", key: "venderId" }, { name: "厂商:", key: "venderId" },
{ name: "添加账号:", key: "createUser" }, { name: "添加账号:", key: "createUser" },
{ name: "添加时间:", key: "createTime" }, { name: "添加时间:", key: "createTime" },
@ -345,8 +340,8 @@ function SideSheets(props) {
<span <span
style={{ fontWeight: "600", color: " #34383E" }} style={{ fontWeight: "600", color: " #34383E" }}
> >
{item.key == "type" {item.key == "typ"
? type.find((v) => v.key == nvrDetails.type) ? accessType.find((v) => v.key == nvrDetails.type)
.name .name
: item.key == "venderId" : item.key == "venderId"
? venderList.find( ? venderList.find(

38
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 NvrModal from "../components/nvrModal";
import Setup from "../components/setup"; import Setup from "../components/setup";
import SideSheets from "../components/sideSheet"; import SideSheets from "../components/sideSheet";
import { accessType } from "./nvr";
const CameraHeader = (props) => { const CameraHeader = (props) => {
const { dispatch, actions, user, loading, equipmentWarehouseCamera } = props; const { dispatch, actions, user, loading, equipmentWarehouseCamera } = props;
@ -26,7 +27,8 @@ const CameraHeader = (props) => {
const [cameraSetup, setcameraSetup] = useState(false); const [cameraSetup, setcameraSetup] = useState(false);
const [setupp, setSetupp] = useState([]); const [setupp, setSetupp] = useState([]);
const [venderList, setvenderList] = 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 [rowId, setRowId] = useState(); //id
const { equipmentWarehouse } = actions; const { equipmentWarehouse } = actions;
@ -45,15 +47,17 @@ const CameraHeader = (props) => {
JSON.stringify(["state", "type", "manufactor"]) JSON.stringify(["state", "type", "manufactor"])
) )
: ""; : "";
console.log(equipmentWarehouseCamera);
}, []); }, []);
useEffect(() => { useEffect(() => {
equipmentGetCamera(); equipmentGetCamera();
}, []); }, [query, search]);
function equipmentGetCamera() { function equipmentGetCamera() {
dispatch(equipmentWarehouse.getCamera(query)); dispatch(equipmentWarehouse.getCamera({ ...query, ...search }));
} }
const columns = [ const columns = [
{ {
title: "序号", title: "序号",
@ -115,7 +119,7 @@ const CameraHeader = (props) => {
<Button <Button
theme="borderless" theme="borderless"
onClick={() => { onClick={() => {
console.log(row.id,!row.forbidden); console.log(row.id, !row.forbidden);
dispatch( dispatch(
equipmentWarehouse.putForbidden({ equipmentWarehouse.putForbidden({
cameraId: row.id, cameraId: row.id,
@ -159,8 +163,12 @@ const CameraHeader = (props) => {
}, },
{ {
title: "接入类型", title: "接入类型",
dataIndex: "cameraAbility.ability", dataIndex: "cameraAbility.type",
key: "type", key: "type",
render: (_, r, index) => {
let manufactorName = data.find((item) => item.id == r.venderId);
return manufactorName ? manufactorName.name : "";
},
}, },
{ {
title: "设备状态", title: "设备状态",
@ -385,7 +393,7 @@ const CameraHeader = (props) => {
> >
<Form.Input <Form.Input
label="设备搜索:" label="设备搜索:"
field="name" field="keyword"
placeholder="请输入设备名称" placeholder="请输入设备名称"
labelPosition="left" labelPosition="left"
style={screen} style={screen}
@ -393,7 +401,7 @@ const CameraHeader = (props) => {
<Form.Select <Form.Select
label="接入类型:" label="接入类型:"
labelPosition="left" labelPosition="left"
field="type1" field="type"
style={screen} style={screen}
placeholder="全部" placeholder="全部"
showClear showClear
@ -463,19 +471,10 @@ const CameraHeader = (props) => {
marginRight: 20, marginRight: 20,
}} }}
onClick={() => { onClick={() => {
api.current.validate().then((values) => { api.current.validate().then((v) => {
console.log(values); setearch(v);
console.log(
equipmentWarehouseNvr.data.filter((item) => {
return (
item.name.indexOf(values.name) > -1 &&
item.venderId === values.venderId
);
// return item.venderId === values.venderId;
})
);
}); });
console.log(equipmentWarehouseCamera.data); equipmentGetCamera();
}} }}
> >
搜素 搜素
@ -606,6 +605,7 @@ const CameraHeader = (props) => {
visible={true} visible={true}
rowId={rowId} rowId={rowId}
venderList={venderList} venderList={venderList}
accessType={accessType}
cameraSetup={cameraSetup} cameraSetup={cameraSetup}
close={() => { close={() => {
setSideSheet(false); setSideSheet(false);

9
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx

@ -7,6 +7,13 @@ import NvrModal from "../components/nvrModal";
import Setup from "../components/setup"; import Setup from "../components/setup";
import SideSheets from "../components/sideSheet"; import SideSheets from "../components/sideSheet";
export const accessType = [
{ name: "萤石", key: "yingshi" },
{ name: "NVR摄像头", key: "nvr" },
{ name: "IPC 网络摄像头", key: "ipc" },
{ name: "级联摄像头", key: "cascade" },
];
const NvrHeader = (props) => { const NvrHeader = (props) => {
const { dispatch, actions, user, loading, equipmentWarehouseNvr } = props; const { dispatch, actions, user, loading, equipmentWarehouseNvr } = props;
const { equipmentWarehouse } = actions; const { equipmentWarehouse } = actions;
@ -475,6 +482,7 @@ const NvrHeader = (props) => {
<SideSheets <SideSheets
visible={true} visible={true}
rowId={rowId} rowId={rowId}
accessType={accessType}
venderList={venderList} venderList={venderList}
close={() => { close={() => {
setSideSheet(false); setSideSheet(false);
@ -488,6 +496,7 @@ const NvrHeader = (props) => {
); );
}; };
function mapStateToProps(state) { function mapStateToProps(state) {
const { auth, global, members, equipmentWarehouseNvr } = state; const { auth, global, members, equipmentWarehouseNvr } = state;
return { return {

Loading…
Cancel
Save