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. 36
      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,
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) {
<span
style={{ fontWeight: "600", color: " #34383E" }}
>
{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(

36
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: "序号",
@ -159,8 +163,12 @@ const CameraHeader = (props) => {
},
{
title: "接入类型",
dataIndex: "cameraAbility.ability",
dataIndex: "cameraAbility.type",
key: "type",
render: (_, r, index) => {
let manufactorName = data.find((item) => item.id == r.venderId);
return manufactorName ? manufactorName.name : "";
},
},
{
title: "设备状态",
@ -385,7 +393,7 @@ const CameraHeader = (props) => {
>
<Form.Input
label="设备搜索:"
field="name"
field="keyword"
placeholder="请输入设备名称"
labelPosition="left"
style={screen}
@ -393,7 +401,7 @@ const CameraHeader = (props) => {
<Form.Select
label="接入类型:"
labelPosition="left"
field="type1"
field="type"
style={screen}
placeholder="全部"
showClear
@ -463,19 +471,10 @@ const CameraHeader = (props) => {
marginRight: 20,
}}
onClick={() => {
api.current.validate().then((values) => {
console.log(values);
console.log(
equipmentWarehouseNvr.data.filter((item) => {
return (
item.name.indexOf(values.name) > -1 &&
item.venderId === values.venderId
);
// return item.venderId === values.venderId;
})
);
api.current.validate().then((v) => {
setearch(v);
});
console.log(equipmentWarehouseCamera.data);
equipmentGetCamera();
}}
>
搜素
@ -606,6 +605,7 @@ const CameraHeader = (props) => {
visible={true}
rowId={rowId}
venderList={venderList}
accessType={accessType}
cameraSetup={cameraSetup}
close={() => {
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 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 { dispatch, actions, user, loading, equipmentWarehouseNvr } = props;
const { equipmentWarehouse } = actions;
@ -475,6 +482,7 @@ const NvrHeader = (props) => {
<SideSheets
visible={true}
rowId={rowId}
accessType={accessType}
venderList={venderList}
close={() => {
setSideSheet(false);
@ -488,6 +496,7 @@ const NvrHeader = (props) => {
);
};
function mapStateToProps(state) {
const { auth, global, members, equipmentWarehouseNvr } = state;
return {

Loading…
Cancel
Save