Browse Source

Merge branch 'dev_trial' of https://gitea.free-sun.vip/free-sun/FS-IOT into dev_trial

release_0.0.2
yuan_yi 3 years ago
parent
commit
b009f18bc2
  1. 18
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js
  2. 9
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js
  3. 13
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx
  4. 132
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx
  5. 85
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx

18
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js

@ -12,11 +12,11 @@ export function getCamera(query) {
query: query, query: query,
url: `${ApiTable.getCamera}`, url: `${ApiTable.getCamera}`,
msg: { option: "获取摄像头列表信息" }, msg: { option: "获取摄像头列表信息" },
reducer: { name: "equipmentWarehouseCamera" }, reducer: { name: "equipmentWarehouseCamera", params: { noClear: true } },
}); });
} }
export function putForbidden(data) { export function putForbidden(data, forbidden) {
return (dispatch) => return (dispatch) =>
basicAction({ basicAction({
type: "put", type: "put",
@ -24,12 +24,12 @@ export function getCamera(query) {
actionType: "PUT_FORBIDDEN", actionType: "PUT_FORBIDDEN",
data, data,
url: `${ApiTable.putForbidden}`, url: `${ApiTable.putForbidden}`,
msg: { option: "" }, //禁用摄像头 msg: { option: forbidden ? "启用":"禁用" }, //禁用摄像头
reducer: {}, reducer: {},
}); });
} }
export function getCameraDetails(orgId) { export function getCameraDetails(orgId) {
return (dispatch) => return (dispatch) =>
basicAction({ basicAction({
type: "get", type: "get",
@ -39,8 +39,8 @@ export function getCamera(query) {
msg: { option: "" }, //获取摄像头详情 msg: { option: "" }, //获取摄像头详情
reducer: { name: "nvrDetails" }, reducer: { name: "nvrDetails" },
}); });
} }
export function getAbility() { export function getAbility() {
return (dispatch) => return (dispatch) =>
basicAction({ basicAction({
type: "get", type: "get",
@ -50,4 +50,4 @@ export function getCamera(query) {
msg: { option: "获取摄像头能力列表" }, msg: { option: "获取摄像头能力列表" },
reducer: { name: "equipmentWarehouseCamera" }, reducer: { name: "equipmentWarehouseCamera" },
}); });
} }

9
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js

@ -24,7 +24,7 @@ export function getNvr(query) {
query: query, query: query,
url: `${ApiTable.getNvr}`, url: `${ApiTable.getNvr}`,
msg: { option: "获取nvr列表信息" }, msg: { option: "获取nvr列表信息" },
reducer: { name: "equipmentWarehouseNvr" }, reducer: { name: "equipmentWarehouseNvr", params: { noClear: true } },
}); });
} }
@ -46,10 +46,13 @@ export function delNvr(orgId) {
dispatch: dispatch, dispatch: dispatch,
actionType: "DEL_NVR", actionType: "DEL_NVR",
url: `${ApiTable.delNvr.replace("{nvrId}", orgId)}`, url: `${ApiTable.delNvr.replace("{nvrId}", orgId)}`,
msg: { option: "删除NVR" }, msg: {
option:
"删除成 功!被删除的设备会被存放在“设备回收站”中。并植入“设备回收站”路径。",
},
reducer: { name: "" }, reducer: { name: "" },
}); });
} }
export function addchangeNvr(data) { export function addchangeNvr(data) {
return (dispatch) => return (dispatch) =>
basicAction({ basicAction({

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

@ -33,7 +33,7 @@ function SideSheets(props) {
basics: [ basics: [
{ name: "设备名称:", key: "name" }, { name: "设备名称:", key: "name" },
{ name: "设备编号:", key: "serialNo" }, { name: "设备编号:", key: "serialNo" },
{ name: "接入方式:", key: "type" }, { name: "接入方式:", key: "accessWay" },
{ name: "厂商:", key: "venderId" }, { name: "厂商:", key: "venderId" },
{ name: "添加账号:", key: "createUser" }, { name: "添加账号:", key: "createUser" },
{ name: "添加时间:", key: "createTime" }, { name: "添加时间:", key: "createTime" },
@ -148,8 +148,8 @@ function SideSheets(props) {
equipmentScrollbar = new PerfectScrollbar("#equipment_information", { equipmentScrollbar = new PerfectScrollbar("#equipment_information", {
suppressScrollX: true, suppressScrollX: true,
}); });
});
console.log(nvrDetails); console.log(nvrDetails);
});
}, []); }, []);
useEffect(() => { useEffect(() => {
@ -340,13 +340,16 @@ function SideSheets(props) {
<span <span
style={{ fontWeight: "600", color: " #34383E" }} style={{ fontWeight: "600", color: " #34383E" }}
> >
{item.key == "typ" {item.key == "type"
? accessType.find((v) => v.key == nvrDetails.type) ? accessType.find(
.name (v) => v.key == nvrDetails.type
).name
: item.key == "venderId" : item.key == "venderId"
? nvrDetails.venderId
? venderList.find( ? venderList.find(
(v) => v.id == nvrDetails.venderId (v) => v.id == nvrDetails.venderId
).name ).name
: ""
: item.key == "createUser" : item.key == "createUser"
? nvrDetails.createUser.namePresent ? nvrDetails.createUser.namePresent
: item.key == "createTime" : item.key == "createTime"

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

@ -10,6 +10,8 @@ import {
Pagination, Pagination,
Popover, Popover,
Tag, Tag,
Skeleton,
Popconfirm,
} from "@douyinfe/semi-ui"; } from "@douyinfe/semi-ui";
import "../style.less"; import "../style.less";
import CameraModal from "../components/cameraModal"; import CameraModal from "../components/cameraModal";
@ -100,7 +102,7 @@ const CameraHeader = (props) => {
modalName="revise" modalName="revise"
venderList={venderList} venderList={venderList}
close={() => { close={() => {
equipmentGetNvr(); equipmentGetCamera();
}} }}
/> />
</Button> </Button>
@ -115,30 +117,62 @@ const CameraHeader = (props) => {
> >
查看 查看
</Button> </Button>
<Button theme="borderless">播放</Button> {row.forbidden ? (
<Button <Button
theme="borderless" theme="borderless"
onClick={() => { onClick={() => {
console.log(row.id, !row.forbidden);
dispatch( dispatch(
equipmentWarehouse.putForbidden({ equipmentWarehouse.putForbidden(
{
cameraId: row.id, cameraId: row.id,
forbidden: !row.forbidden, forbidden: !row.forbidden,
}) },
); row.forbidden
)
).then(() => {
equipmentGetCamera();
});
}} }}
> >
{row.forbidden ? "启用" : "禁用"} 启用
</Button> </Button>
<Button ) : (
theme="borderless" <Popconfirm
onClick={() => { title="禁用后下级业务系统将无法获取该视频流的所有信息。"
dispatch(equipmentWarehouse.delNvr(row.id)); arrowPointAtCenter={false}
equipmentGetNvr(); showArrow={true}
position="topRight"
onConfirm={() => {
dispatch(
equipmentWarehouse.putForbidden(
{
cameraId: row.id,
forbidden: !row.forbidden,
},
row.forbidden
)
).then(() => {
equipmentGetCamera();
});
}} }}
> >
删除 <Button theme="borderless">禁用</Button>
</Button> </Popconfirm>
)}
<Popconfirm
title="删除NVR会删除端口下的所有摄像头,是否确定删除?"
arrowPointAtCenter={false}
showArrow={true}
position="topRight"
onConfirm={() => {
dispatch(equipmentWarehouse.delNvr(row.id)).then(() => {
equipmentGetCamera();
});
}}
>
<Button theme="borderless">删除</Button>
</Popconfirm>
</div> </div>
); );
}, },
@ -203,13 +237,17 @@ const CameraHeader = (props) => {
dataIndex: "updateTime", dataIndex: "updateTime",
key: "name", key: "name",
render: (_, r, index) => { render: (_, r, index) => {
return r.station.map((item, index) => return r.station.length == 0
station( ? ""
item.structure.projects[0].name, : r.station.map((item, index) => {
return item.structure.projects.length == 0
? ""
: station(
r.station[0].structure.projects[0].name,
item.structure.projects, item.structure.projects,
"name" "name"
)
); );
});
}, },
}, },
{ {
@ -217,13 +255,17 @@ const CameraHeader = (props) => {
dataIndex: "updateTime", dataIndex: "updateTime",
key: "pcode", key: "pcode",
render: (_, r, index) => { render: (_, r, index) => {
return r.station.map((item, index) => return r.station.length == 0
station( ? ""
item.structure.projects[0].url, : r.station.map((item, index) => {
return item.structure.projects.length == 0
? ""
: station(
r.station[0].structure.projects[0].url,
item.structure.projects, item.structure.projects,
"url" "url"
)
); );
});
}, },
}, },
{ {
@ -231,11 +273,9 @@ const CameraHeader = (props) => {
dataIndex: "updateTime", dataIndex: "updateTime",
key: "structure", key: "structure",
render: (_, r, index) => { render: (_, r, index) => {
return station( return r.station.length == 0
r.station[0].structure.name, ? ""
r.station, : station(r.station[0].structure.name, r.station, "structure.name");
"structure.name"
);
}, },
}, },
{ {
@ -243,7 +283,9 @@ const CameraHeader = (props) => {
dataIndex: "updateTime", dataIndex: "updateTime",
key: "measuringPoint", key: "measuringPoint",
render: (_, r, index) => { render: (_, r, index) => {
return station(r.station[0].name, r.station, "name"); return r.station.length == 0
? ""
: station(r.station[0].name, r.station, "name");
}, },
}, },
{ {
@ -251,7 +293,9 @@ const CameraHeader = (props) => {
dataIndex: "updateTime", dataIndex: "updateTime",
key: "factor", key: "factor",
render: (_, r, index) => { render: (_, r, index) => {
return station(r.station[0].factor.name, r.station, "factor.name"); return r.station.length == 0
? ""
: station(r.station[0].factor.name, r.station, "factor.name");
}, },
}, },
]; ];
@ -495,6 +539,11 @@ const CameraHeader = (props) => {
border: "1px solid #D9D9D9", border: "1px solid #D9D9D9",
marginBottom: 20, marginBottom: 20,
}} }}
onClick={() => {
api.current.reset();
setearch({});
equipmentGetCamera();
}}
> >
重置 重置
</Button> </Button>
@ -558,8 +607,28 @@ const CameraHeader = (props) => {
</Button> </Button>
</div> </div>
</div> </div>
<Skeleton
loading={!loading}
placeholder={
<Table
columns={setupp.filter((s) => s)}
// dataSource={[
// { name: "" },
// { key: "" },
// { name: "" },
// { name: "" },
// { name: "" },
// { name: "" },
// { name: "" },
// ]}
pagination={false}
style={{ background: "rgba(217, 216, 216, 1)" }}
empty=" "
/>
}
>
<Table <Table
columns={setupp.filter(s => s)} columns={setupp.filter((s) => s)}
dataSource={equipmentWarehouseCamera.data} dataSource={equipmentWarehouseCamera.data}
bordered={false} bordered={false}
empty="暂无数据" empty="暂无数据"
@ -568,6 +637,7 @@ const CameraHeader = (props) => {
}} }}
pagination={false} pagination={false}
/> />
</Skeleton>
<div <div
style={{ style={{
display: "flex", display: "flex",
@ -641,7 +711,7 @@ const CameraHeader = (props) => {
function mapStateToProps(state) { function mapStateToProps(state) {
const { auth, global, members, equipmentWarehouseCamera } = state; const { auth, global, members, equipmentWarehouseCamera } = state;
return { return {
loading: members.isRequesting, loading: equipmentWarehouseCamera.isRequesting,
user: auth.user, user: auth.user,
actions: global.actions, actions: global.actions,
members: members.data, members: members.data,

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

@ -1,7 +1,16 @@
import React, { useState, useEffect, useRef } from "react"; import React, { useState, useEffect, useRef } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import moment from "moment"; import moment from "moment";
import { Button, Form, Input, Row, Table, Pagination } from "@douyinfe/semi-ui"; import {
Button,
Form,
Input,
Row,
Table,
Pagination,
Skeleton,
Popconfirm,
} from "@douyinfe/semi-ui";
import "../style.less"; import "../style.less";
import NvrModal from "../components/nvrModal"; import NvrModal from "../components/nvrModal";
import Setup from "../components/setup"; import Setup from "../components/setup";
@ -11,12 +20,13 @@ export const accessType = [
{ name: "萤石云平台摄像头", key: "yingshi" }, { name: "萤石云平台摄像头", key: "yingshi" },
{ name: "NVR摄像头", key: "nvr" }, { name: "NVR摄像头", key: "nvr" },
{ name: "IPC 网络摄像头", key: "ipc" }, { name: "IPC 网络摄像头", key: "ipc" },
{ name: "级联摄像头", key: "cascade" }, { 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;
// const [loading, setLoading] = useState(false);
const [setup, setSetup] = useState(false); const [setup, setSetup] = useState(false);
const [sideSheet, setSideSheet] = useState(false); const [sideSheet, setSideSheet] = useState(false);
const [setupp, setSetupp] = useState([]); const [setupp, setSetupp] = useState([]);
@ -46,7 +56,7 @@ const NvrHeader = (props) => {
equipmentGetNvr(); equipmentGetNvr();
}, [query, search]); }, [query, search]);
function equipmentGetNvr () { function equipmentGetNvr() {
dispatch(equipmentWarehouse.getNvr({ ...query, ...search })); dispatch(equipmentWarehouse.getNvr({ ...query, ...search }));
} }
const columns = [ const columns = [
@ -107,15 +117,19 @@ const NvrHeader = (props) => {
> >
查看 查看
</Button> </Button>
<Button <Popconfirm
theme="borderless" title="删除NVR会删除端口下的所有摄像头,是否确定删除?"
onClick={() => { arrowPointAtCenter={false}
dispatch(equipmentWarehouse.delNvr(row.id)); showArrow={true}
position="topRight"
onConfirm={() => {
dispatch(equipmentWarehouse.delNvr(row.id)).then(() => {
equipmentGetNvr(); equipmentGetNvr();
});
}} }}
> >
删除 <Button theme="borderless">删除</Button>
</Button> </Popconfirm>
</div> </div>
); );
}, },
@ -123,7 +137,7 @@ const NvrHeader = (props) => {
]; ];
// //
function attribute (data) { function attribute(data) {
const arr = localStorage.getItem(SETUPS) const arr = localStorage.getItem(SETUPS)
? JSON.parse(localStorage.getItem(SETUPS)) ? JSON.parse(localStorage.getItem(SETUPS))
: []; : [];
@ -162,7 +176,7 @@ const NvrHeader = (props) => {
title: "创建时间", title: "创建时间",
dataIndex: "createTime", dataIndex: "createTime",
key: "time", key: "time",
render: (text, r, index) => { render: (_, r, index) => {
return moment(r.createTime).format("YYYY-MM-DD HH:MM:SS"); return moment(r.createTime).format("YYYY-MM-DD HH:MM:SS");
}, },
}, },
@ -170,6 +184,20 @@ const NvrHeader = (props) => {
title: "项目名称", title: "项目名称",
dataIndex: "", dataIndex: "",
key: "name", key: "name",
// render: (_, r, index) => {
// console.log(r);
// return r.station.length == 0
// ? ""
// : r.station.map((item, index) => {
// return item.structure.projects.length == 0
// ? ""
// : station(
// r.station[0].structure.projects[0].name,
// item.structure.projects,
// "name"
// );
// });
// },
}, },
{ {
title: "pcode", title: "pcode",
@ -372,6 +400,11 @@ const NvrHeader = (props) => {
border: "1px solid #D9D9D9", border: "1px solid #D9D9D9",
marginBottom: 20, marginBottom: 20,
}} }}
onClick={() => {
api.current.reset();
setearch({});
equipmentGetNvr();
}}
> >
重置 重置
</Button> </Button>
@ -434,8 +467,29 @@ const NvrHeader = (props) => {
</Button> </Button>
</div> </div>
</div> </div>
<Skeleton
loading={!loading}
placeholder={
// <Table
// columns={setupp.filter((s) => s)}
// dataSource={[
// { name: "" },
// { key: "" },
// { name: "" },
// { name: "" },
// { name: "" },
// { name: "" },
// { name: "" },
// ]}
// pagination={false}
// style={{ background: "rgba(217, 216, 216, 1)" }}
// empty=""
// />
<><div style></div></>
}
>
<Table <Table
columns={setupp.filter(s => s)} columns={setupp.filter((s) => s)}
dataSource={equipmentWarehouseNvr.data} dataSource={equipmentWarehouseNvr.data}
bordered={false} bordered={false}
empty="暂无数据" empty="暂无数据"
@ -444,6 +498,8 @@ const NvrHeader = (props) => {
}} }}
pagination={false} pagination={false}
/> />
</Skeleton>
<div <div
style={{ style={{
display: "flex", display: "flex",
@ -496,11 +552,10 @@ const NvrHeader = (props) => {
); );
}; };
function mapStateToProps(state) {
function mapStateToProps (state) {
const { auth, global, members, equipmentWarehouseNvr } = state; const { auth, global, members, equipmentWarehouseNvr } = state;
return { return {
loading: members.isRequesting, loading: equipmentWarehouseNvr.isRequesting,
user: auth.user, user: auth.user,
actions: global.actions, actions: global.actions,
members: members.data, members: members.data,

Loading…
Cancel
Save