Browse Source

数据修改

release_0.0.2
wenlele 3 years ago
parent
commit
e632b74387
  1. 4
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js
  2. 5
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js
  3. 2
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx
  4. 143
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx
  5. 57
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx

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

@ -16,7 +16,7 @@ export function getCamera(query) {
}); });
} }
export function putForbidden(data) { export function putForbidden(data, forbidden) {
return (dispatch) => return (dispatch) =>
basicAction({ basicAction({
type: "put", type: "put",
@ -24,7 +24,7 @@ export function putForbidden(data) {
actionType: "PUT_FORBIDDEN", actionType: "PUT_FORBIDDEN",
data, data,
url: `${ApiTable.putForbidden}`, url: `${ApiTable.putForbidden}`,
msg: { option: "" }, //禁用摄像头 msg: { option: forbidden ? "启用":"禁用" }, //禁用摄像头
reducer: {}, reducer: {},
}); });
} }

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

@ -46,7 +46,10 @@ 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: "" },
}); });
} }

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

@ -340,7 +340,7 @@ function SideSheets(props) {
<span <span
style={{ fontWeight: "600", color: " #34383E" }} style={{ fontWeight: "600", color: " #34383E" }}
> >
{item.key == "typ" //////////////////////////////// {item.key == "type"
? accessType.find( ? accessType.find(
(v) => v.key == nvrDetails.type (v) => v.key == nvrDetails.type
).name ).name

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

@ -11,6 +11,7 @@ import {
Popover, Popover,
Tag, Tag,
Skeleton, 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";
@ -116,30 +117,62 @@ const CameraHeader = (props) => {
> >
查看 查看
</Button> </Button>
<Button theme="borderless">播放</Button> {row.forbidden ? (
<Button <Button
theme="borderless" theme="borderless"
onClick={() => { onClick={() => {
dispatch( dispatch(
equipmentWarehouse.putForbidden({ equipmentWarehouse.putForbidden(
cameraId: row.id, {
forbidden: !row.forbidden, cameraId: row.id,
}) forbidden: !row.forbidden,
); },
equipmentGetCamera(); row.forbidden
}} )
> ).then(() => {
{row.forbidden ? "启用" : "禁用"} equipmentGetCamera();
</Button> });
<Button }}
theme="borderless" >
onClick={() => { 启用
dispatch(equipmentWarehouse.delNvr(row.id)); </Button>
equipmentGetCamera(); ) : (
<Popconfirm
title="禁用后下级业务系统将无法获取该视频流的所有信息。"
arrowPointAtCenter={false}
showArrow={true}
position="topRight"
onConfirm={() => {
dispatch(
equipmentWarehouse.putForbidden(
{
cameraId: row.id,
forbidden: !row.forbidden,
},
row.forbidden
)
).then(() => {
equipmentGetCamera();
});
}}
>
<Button theme="borderless">禁用</Button>
</Popconfirm>
)}
<Popconfirm
title="删除NVR会删除端口下的所有摄像头,是否确定删除?"
arrowPointAtCenter={false}
showArrow={true}
position="topRight"
onConfirm={() => {
dispatch(equipmentWarehouse.delNvr(row.id)).then(() => {
equipmentGetCamera();
});
}} }}
> >
删除 <Button theme="borderless">删除</Button>
</Button> </Popconfirm>
</div> </div>
); );
}, },
@ -204,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) => {
item.structure.projects, return item.structure.projects.length == 0
"name" ? ""
) : station(
); r.station[0].structure.projects[0].name,
item.structure.projects,
"name"
);
});
}, },
}, },
{ {
@ -218,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) => {
item.structure.projects, return item.structure.projects.length == 0
"url" ? ""
) : station(
); r.station[0].structure.projects[0].url,
item.structure.projects,
"url"
);
});
}, },
}, },
{ {
@ -232,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"
);
}, },
}, },
{ {
@ -244,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");
}, },
}, },
{ {
@ -252,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");
}, },
}, },
]; ];
@ -565,14 +608,22 @@ const CameraHeader = (props) => {
</div> </div>
</div> </div>
<Skeleton <Skeleton
loading={loading} loading={!loading}
placeholder={ placeholder={
<Table <Table
columns={setupp.filter((s) => s)} columns={setupp.filter((s) => s)}
dataSource={[{ name: "" },{ key: "" },{ name: "" },{ name: "" },{ name: "" },{ name: "" },{ name: "" }]} // dataSource={[
// { name: "" },
// { key: "" },
// { name: "" },
// { name: "" },
// { name: "" },
// { name: "" },
// { name: "" },
// ]}
pagination={false} pagination={false}
style={{ background: "rgba(217, 216, 216, 1)" }} style={{ background: "rgba(217, 216, 216, 1)" }}
empty="" empty=" "
/> />
} }
> >

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

@ -9,6 +9,7 @@ import {
Table, Table,
Pagination, Pagination,
Skeleton, Skeleton,
Popconfirm,
} from "@douyinfe/semi-ui"; } from "@douyinfe/semi-ui";
import "../style.less"; import "../style.less";
import NvrModal from "../components/nvrModal"; import NvrModal from "../components/nvrModal";
@ -19,7 +20,7 @@ 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) => {
@ -116,16 +117,19 @@ const NvrHeader = (props) => {
> >
查看 查看
</Button> </Button>
<Button <Popconfirm
theme="borderless" title="删除NVR会删除端口下的所有摄像头,是否确定删除?"
onClick={() => { arrowPointAtCenter={false}
showArrow={true}
position="topRight"
onConfirm={() => {
dispatch(equipmentWarehouse.delNvr(row.id)).then(() => { dispatch(equipmentWarehouse.delNvr(row.id)).then(() => {
equipmentGetNvr(); equipmentGetNvr();
}); });
}} }}
> >
删除 <Button theme="borderless">删除</Button>
</Button> </Popconfirm>
</div> </div>
); );
}, },
@ -172,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");
}, },
}, },
@ -180,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",
@ -450,15 +468,24 @@ const NvrHeader = (props) => {
</div> </div>
</div> </div>
<Skeleton <Skeleton
loading={loading} loading={!loading}
placeholder={ placeholder={
<Table // <Table
columns={setupp.filter((s) => s)} // columns={setupp.filter((s) => s)}
dataSource={[{ name: "" },{ key: "" },{ name: "" },{ name: "" },{ name: "" },{ name: "" },{ name: "" }]} // dataSource={[
pagination={false} // { name: "" },
style={{ background: "rgba(217, 216, 216, 1)" }} // { key: "" },
empty="" // { name: "" },
/> // { name: "" },
// { name: "" },
// { name: "" },
// { name: "" },
// ]}
// pagination={false}
// style={{ background: "rgba(217, 216, 216, 1)" }}
// empty=""
// />
<><div style></div></>
} }
> >
<Table <Table

Loading…
Cancel
Save