From 6efe63389931155a6a15c6ec238df5aab9be4d3e Mon Sep 17 00:00:00 2001 From: wenlele Date: Thu, 26 May 2022 10:43:45 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=AA=A8=E6=9E=B6?= =?UTF-8?q?=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equipmentWarehouse/actions/camera.js | 90 +- .../equipmentWarehouse/actions/nvr.js | 24 +- .../components/sideSheet.jsx | 19 +- .../equipmentWarehouse/containers/camera.jsx | 47 +- .../equipmentWarehouse/containers/nvr.jsx | 946 +++++++++--------- 5 files changed, 588 insertions(+), 538 deletions(-) diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js index 5390586..c3c2450 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js +++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js @@ -4,50 +4,50 @@ import { basicAction } from "@peace/utils"; import { ApiTable } from "$utils"; export function getCamera(query) { - return (dispatch) => - basicAction({ - type: "get", - dispatch: dispatch, - actionType: "GET_CAMREA", - query: query, - url: `${ApiTable.getCamera}`, - msg: { option: "获取摄像头列表信息" }, - reducer: { name: "equipmentWarehouseCamera" }, - }); - } + return (dispatch) => + basicAction({ + type: "get", + dispatch: dispatch, + actionType: "GET_CAMREA", + query: query, + url: `${ApiTable.getCamera}`, + msg: { option: "获取摄像头列表信息" }, + reducer: { name: "equipmentWarehouseCamera", params: { noClear: true } }, + }); +} - export function putForbidden(data) { - return (dispatch) => - basicAction({ - type: "put", - dispatch: dispatch, - actionType: "PUT_FORBIDDEN", - data, - url: `${ApiTable.putForbidden}`, - msg: { option: "" }, //禁用摄像头 - reducer: {}, - }); - } +export function putForbidden(data) { + return (dispatch) => + basicAction({ + type: "put", + dispatch: dispatch, + actionType: "PUT_FORBIDDEN", + data, + url: `${ApiTable.putForbidden}`, + msg: { option: "" }, //禁用摄像头 + reducer: {}, + }); +} - export function getCameraDetails(orgId) { - return (dispatch) => - basicAction({ - type: "get", - dispatch: dispatch, - actionType: "GET_CAMREA_DETAILS", - url: `${ApiTable.getCameraDetails.replace("{cameraId}", orgId)}`, - msg: { option: "" }, //获取摄像头详情 - reducer: { name: "nvrDetails" }, - }); - } - export function getAbility() { - return (dispatch) => - basicAction({ - type: "get", - dispatch: dispatch, - actionType: "GET_ABILITY", - url: `${ApiTable.getAbility}`, - msg: { option: "获取摄像头能力列表" }, - reducer: { name: "equipmentWarehouseCamera" }, - }); - } \ No newline at end of file +export function getCameraDetails(orgId) { + return (dispatch) => + basicAction({ + type: "get", + dispatch: dispatch, + actionType: "GET_CAMREA_DETAILS", + url: `${ApiTable.getCameraDetails.replace("{cameraId}", orgId)}`, + msg: { option: "" }, //获取摄像头详情 + reducer: { name: "nvrDetails" }, + }); +} +export function getAbility() { + return (dispatch) => + basicAction({ + type: "get", + dispatch: dispatch, + actionType: "GET_ABILITY", + url: `${ApiTable.getAbility}`, + msg: { option: "获取摄像头能力列表" }, + reducer: { name: "equipmentWarehouseCamera" }, + }); +} diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js index 23b98c5..f8af572 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js +++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js @@ -24,7 +24,7 @@ export function getNvr(query) { query: query, url: `${ApiTable.getNvr}`, msg: { option: "获取nvr列表信息" }, - reducer: { name: "equipmentWarehouseNvr" }, + reducer: { name: "equipmentWarehouseNvr", params: { noClear: true } }, }); } @@ -35,21 +35,21 @@ export function getNvrDetails(orgId) { dispatch: dispatch, actionType: "GET_NVR_DETAILS", url: `${ApiTable.getNvrDetails.replace("{nvrId}", orgId)}`, - msg: { option: "" }, //获取nvr详情 + msg: { option: "" }, //获取nvr详情 reducer: { name: "nvrDetails" }, }); } export function delNvr(orgId) { - return (dispatch) => - basicAction({ - type: "del", - dispatch: dispatch, - actionType: "DEL_NVR", - url: `${ApiTable.delNvr.replace("{nvrId}", orgId)}`, - msg: { option: "删除NVR" }, - reducer: { name: "" }, - }); - } + return (dispatch) => + basicAction({ + type: "del", + dispatch: dispatch, + actionType: "DEL_NVR", + url: `${ApiTable.delNvr.replace("{nvrId}", orgId)}`, + msg: { option: "删除NVR" }, + reducer: { name: "" }, + }); +} export function addchangeNvr(data) { return (dispatch) => basicAction({ 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 792596d..8429b8c 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 @@ -33,7 +33,7 @@ function SideSheets(props) { basics: [ { name: "设备名称:", key: "name" }, { name: "设备编号:", key: "serialNo" }, - { name: "接入方式:", key: "type" }, + { name: "接入方式:", key: "accessWay" }, { name: "厂商:", key: "venderId" }, { name: "添加账号:", key: "createUser" }, { name: "添加时间:", key: "createTime" }, @@ -148,8 +148,8 @@ function SideSheets(props) { equipmentScrollbar = new PerfectScrollbar("#equipment_information", { suppressScrollX: true, }); + console.log(nvrDetails); }); - console.log(nvrDetails); }, []); useEffect(() => { @@ -340,13 +340,16 @@ function SideSheets(props) { - {item.key == "typ" - ? accessType.find((v) => v.key == nvrDetails.type) - .name - : item.key == "venderId" - ? venderList.find( - (v) => v.id == nvrDetails.venderId + {item.key == "typ" ////////////////////////////////要改 + ? accessType.find( + (v) => v.key == nvrDetails.type ).name + : item.key == "venderId" + ? nvrDetails.venderId + ? venderList.find( + (v) => v.id == nvrDetails.venderId + ).name + : "" : item.key == "createUser" ? nvrDetails.createUser.namePresent : item.key == "createTime" 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 241d396..deb3e4b 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 @@ -10,6 +10,7 @@ import { Pagination, Popover, Tag, + Skeleton, } from "@douyinfe/semi-ui"; import "../style.less"; import CameraModal from "../components/cameraModal"; @@ -100,7 +101,7 @@ const CameraHeader = (props) => { modalName="revise" venderList={venderList} close={() => { - equipmentGetNvr(); + equipmentGetCamera(); }} /> @@ -119,13 +120,13 @@ const CameraHeader = (props) => { @@ -558,16 +564,29 @@ const CameraHeader = (props) => { - s)} - dataSource={equipmentWarehouseCamera.data} - bordered={false} - empty="暂无数据" - style={{ - padding: "0px 20px", - }} - pagination={false} - /> + s)} + dataSource={[{ name: "" },{ key: "" },{ name: "" },{ name: "" },{ name: "" },{ name: "" },{ name: "" }]} + pagination={false} + style={{ background: "rgba(217, 216, 216, 1)" }} + empty="" + /> + } + > +
s)} + dataSource={equipmentWarehouseCamera.data} + bordered={false} + empty="暂无数据" + style={{ + padding: "0px 20px", + }} + pagination={false} + /> +
{ function mapStateToProps(state) { const { auth, global, members, equipmentWarehouseCamera } = state; return { - loading: members.isRequesting, + loading: equipmentWarehouseCamera.isRequesting, user: auth.user, actions: global.actions, members: members.data, diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx index f6dc509..aae9ee5 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx @@ -1,324 +1,334 @@ import React, { useState, useEffect, useRef } from "react"; import { connect } from "react-redux"; import moment from "moment"; -import { Button, Form, Input, Row, Table, Pagination } from "@douyinfe/semi-ui"; +import { + Button, + Form, + Input, + Row, + Table, + Pagination, + Skeleton, +} from "@douyinfe/semi-ui"; import "../style.less"; 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" }, + { 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; - const [setup, setSetup] = useState(false); - const [sideSheet, setSideSheet] = useState(false); - const [setupp, setSetupp] = useState([]); - const [venderList, setvenderList] = useState([]); //厂商信息 - const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息 - const [search, setearch] = useState({}); //搜索条件 - const [rowId, setRowId] = useState(); //表格数据id + const { dispatch, actions, user, loading, equipmentWarehouseNvr } = props; + const { equipmentWarehouse } = actions; + // const [loading, setLoading] = useState(false); + const [setup, setSetup] = useState(false); + const [sideSheet, setSideSheet] = useState(false); + const [setupp, setSetupp] = useState([]); + const [venderList, setvenderList] = useState([]); //厂商信息 + const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息 + const [search, setearch] = useState({}); //搜索条件 + const [rowId, setRowId] = useState(); //表格数据id - const api = useRef(); - const SETUPS = "setups"; + const api = useRef(); + const SETUPS = "setups"; - useEffect(() => { - dispatch(actions.equipmentWarehouse.getVender()).then((res) => { - setvenderList(res.payload.data); - attribute(res.payload.data); - }); - //初始化表格显示设置 - localStorage.getItem(SETUPS) == null - ? localStorage.setItem( - SETUPS, - JSON.stringify(["manufactor", "passageway", "port", "state"]) - ) - : ""; - // ; - }, []); - useEffect(() => { - equipmentGetNvr(); - }, [query, search]); + useEffect(() => { + dispatch(actions.equipmentWarehouse.getVender()).then((res) => { + setvenderList(res.payload.data); + attribute(res.payload.data); + }); + //初始化表格显示设置 + localStorage.getItem(SETUPS) == null + ? localStorage.setItem( + SETUPS, + JSON.stringify(["manufactor", "passageway", "port", "state"]) + ) + : ""; + // ; + }, []); + useEffect(() => { + equipmentGetNvr(); + }, [query, search]); + + function equipmentGetNvr() { + dispatch(equipmentWarehouse.getNvr({ ...query, ...search })); + } + const columns = [ + { + title: "序号", + render: (text, record, index) => { + return index + 1; + }, + }, + { + title: "设备名称", + dataIndex: "name", + render: (text, r, index) => { + return ( +
+ + {r.name} +
+ ); + }, + }, + { + title: "SIP地址", + dataIndex: "owner", + }, + { + title: "操作", + width: "20%", + dataIndex: "", + render: (_, row) => { + return ( +
+ + + +
+ ); + }, + }, + ]; + + //获取表格属性设置 + function attribute(data) { + const arr = localStorage.getItem(SETUPS) + ? JSON.parse(localStorage.getItem(SETUPS)) + : []; - function equipmentGetNvr () { - dispatch(equipmentWarehouse.getNvr({ ...query, ...search })); - } - const columns = [ + const column = [ { - title: "序号", - render: (text, record, index) => { - return index + 1; - }, + title: "设备厂家", + dataIndex: "venderId", + key: "manufactor", + render: (_, r, index) => { + let manufactorName = data.find((item) => item.id == r.venderId); + return manufactorName ? manufactorName.name : ""; + }, }, { - title: "设备名称", - dataIndex: "name", - render: (text, r, index) => { - return ( -
- - {r.name} -
- ); - }, + title: "添加账号", + dataIndex: "createUserId", + key: "accountNumber", }, { - title: "SIP地址", - dataIndex: "owner", + title: "通道数", + dataIndex: "channelCount", + key: "passageway", }, { - title: "操作", - width: "20%", - dataIndex: "", - render: (_, row) => { - return ( -
- - - -
- ); - }, + title: "端口", + dataIndex: "port", + key: "port", }, - ]; - - //获取表格属性设置 - function attribute (data) { - const arr = localStorage.getItem(SETUPS) - ? JSON.parse(localStorage.getItem(SETUPS)) - : []; - - const column = [ - { - title: "设备厂家", - dataIndex: "venderId", - key: "manufactor", - render: (_, r, index) => { - let manufactorName = data.find((item) => item.id == r.venderId); - return manufactorName ? manufactorName.name : ""; - }, - }, - { - title: "添加账号", - dataIndex: "createUserId", - key: "accountNumber", - }, - { - title: "通道数", - dataIndex: "channelCount", - key: "passageway", - }, - { - title: "端口", - dataIndex: "port", - key: "port", - }, - { - title: "设备状态", - dataIndex: "size", - key: "state", - }, - { - title: "创建时间", - dataIndex: "createTime", - key: "time", - render: (text, r, index) => { - return moment(r.createTime).format("YYYY-MM-DD HH:MM:SS"); - }, - }, - { - title: "项目名称", - dataIndex: "", - key: "name", - }, - { - title: "pcode", - dataIndex: "", - key: "pcode", - }, - { - title: "结构物", - dataIndex: "", - key: "structure", - }, - ]; - for (let i = 0; i < arr.length; i++) { - let colum = column.filter((item) => { - return item.key === arr[i]; - }); - columns.splice(i + 2, 0, colum[0]); - } - setSetupp(columns); - } + { + title: "设备状态", + dataIndex: "size", + key: "state", + }, + { + title: "创建时间", + dataIndex: "createTime", + key: "time", + render: (text, r, index) => { + return moment(r.createTime).format("YYYY-MM-DD HH:MM:SS"); + }, + }, + { + title: "项目名称", + dataIndex: "", + key: "name", + }, + { + title: "pcode", + dataIndex: "", + key: "pcode", + }, + { + title: "结构物", + dataIndex: "", + key: "structure", + }, + ]; + for (let i = 0; i < arr.length; i++) { + let colum = column.filter((item) => { + return item.key === arr[i]; + }); + columns.splice(i + 2, 0, colum[0]); + } + setSetupp(columns); + } - //条件赛选样式 - const screen = { - width: 193, - marginRight: 20, - marginBottom: 16, - color: "rgba(0, 0, 0, 0.65)", - }; + //条件赛选样式 + const screen = { + width: 193, + marginRight: 20, + marginBottom: 16, + color: "rgba(0, 0, 0, 0.65)", + }; - return ( - <> -
-
-
+
+
+
+
+
+
+ 设备列表 +
+
+ + +
+
+ s)} - dataSource={equipmentWarehouseNvr.data} - bordered={false} - empty="暂无数据" - style={{ - padding: "0px 20px", - }} - pagination={false} + columns={setupp.filter((s) => s)} + dataSource={[{ name: "" },{ key: "" },{ name: "" },{ name: "" },{ name: "" },{ name: "" },{ name: "" }]} + pagination={false} + style={{ background: "rgba(217, 216, 216, 1)" }} + empty="" /> -
- - 共{equipmentWarehouseNvr.total}个设备 - - { - setQuery({ limit: pageSize, page: currentPage - 1 }); - }} - /> -
+ } + > +
s)} + dataSource={equipmentWarehouseNvr.data} + bordered={false} + empty="暂无数据" + style={{ + padding: "0px 20px", + }} + pagination={false} + /> + - {setup ? ( - { - setSetup(false); - attribute(venderList); - }} - /> - ) : ( - "" - )} +
+ + 共{equipmentWarehouseNvr.total}个设备 + + { + setQuery({ limit: pageSize, page: currentPage - 1 }); + }} + /> +
- {sideSheet ? ( - { - setSideSheet(false); - }} - /> - ) : ( - [] - )} - - - ); -}; + {setup ? ( + { + setSetup(false); + attribute(venderList); + }} + /> + ) : ( + "" + )} + {sideSheet ? ( + { + setSideSheet(false); + }} + /> + ) : ( + [] + )} + + + ); +}; -function mapStateToProps (state) { - const { auth, global, members, equipmentWarehouseNvr } = state; - return { - loading: members.isRequesting, - user: auth.user, - actions: global.actions, - members: members.data, - equipmentWarehouseNvr: equipmentWarehouseNvr.data || {}, - }; +function mapStateToProps(state) { + const { auth, global, members, equipmentWarehouseNvr } = state; + return { + loading: equipmentWarehouseNvr.isRequesting, + user: auth.user, + actions: global.actions, + members: members.data, + equipmentWarehouseNvr: equipmentWarehouseNvr.data || {}, + }; } export default connect(mapStateToProps)(NvrHeader); From e632b7438794fcf655b3f1bc1ad5da626517b5a6 Mon Sep 17 00:00:00 2001 From: wenlele Date: Fri, 27 May 2022 15:19:58 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equipmentWarehouse/actions/camera.js | 4 +- .../equipmentWarehouse/actions/nvr.js | 5 +- .../components/sideSheet.jsx | 2 +- .../equipmentWarehouse/containers/camera.jsx | 143 ++++++++++++------ .../equipmentWarehouse/containers/nvr.jsx | 57 +++++-- 5 files changed, 146 insertions(+), 65 deletions(-) diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js index c3c2450..08c2e2c 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js +++ b/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) => basicAction({ type: "put", @@ -24,7 +24,7 @@ export function putForbidden(data) { actionType: "PUT_FORBIDDEN", data, url: `${ApiTable.putForbidden}`, - msg: { option: "" }, //禁用摄像头 + msg: { option: forbidden ? "启用":"禁用" }, //禁用摄像头 reducer: {}, }); } diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js index f8af572..7b47f41 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js +++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js @@ -46,7 +46,10 @@ export function delNvr(orgId) { dispatch: dispatch, actionType: "DEL_NVR", url: `${ApiTable.delNvr.replace("{nvrId}", orgId)}`, - msg: { option: "删除NVR" }, + msg: { + option: + "删除成 功!被删除的设备会被存放在“设备回收站”中。并植入“设备回收站”路径。", + }, reducer: { name: "" }, }); } 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 8429b8c..6621c77 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 @@ -340,7 +340,7 @@ function SideSheets(props) { - {item.key == "typ" ////////////////////////////////要改 + {item.key == "type" ? accessType.find( (v) => v.key == nvrDetails.type ).name 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 deb3e4b..4fab222 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 @@ -11,6 +11,7 @@ import { Popover, Tag, Skeleton, + Popconfirm, } from "@douyinfe/semi-ui"; import "../style.less"; import CameraModal from "../components/cameraModal"; @@ -116,30 +117,62 @@ const CameraHeader = (props) => { > 查看 - - - + ) : ( + { + dispatch( + equipmentWarehouse.putForbidden( + { + cameraId: row.id, + forbidden: !row.forbidden, + }, + row.forbidden + ) + ).then(() => { + equipmentGetCamera(); + }); + }} + > + + + )} + + { + dispatch(equipmentWarehouse.delNvr(row.id)).then(() => { + equipmentGetCamera(); + }); }} > - 删除 - + + ); }, @@ -204,13 +237,17 @@ const CameraHeader = (props) => { dataIndex: "updateTime", key: "name", render: (_, r, index) => { - return r.station.map((item, index) => - station( - item.structure.projects[0].name, - item.structure.projects, - "name" - ) - ); + 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" + ); + }); }, }, { @@ -218,13 +255,17 @@ const CameraHeader = (props) => { dataIndex: "updateTime", key: "pcode", render: (_, r, index) => { - return r.station.map((item, index) => - station( - item.structure.projects[0].url, - item.structure.projects, - "url" - ) - ); + return r.station.length == 0 + ? "" + : r.station.map((item, index) => { + return item.structure.projects.length == 0 + ? "" + : station( + r.station[0].structure.projects[0].url, + item.structure.projects, + "url" + ); + }); }, }, { @@ -232,11 +273,9 @@ const CameraHeader = (props) => { dataIndex: "updateTime", key: "structure", render: (_, r, index) => { - return station( - r.station[0].structure.name, - r.station, - "structure.name" - ); + return r.station.length == 0 + ? "" + : station(r.station[0].structure.name, r.station, "structure.name"); }, }, { @@ -244,7 +283,9 @@ const CameraHeader = (props) => { dataIndex: "updateTime", key: "measuringPoint", 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", key: "factor", 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) => { s)} - dataSource={[{ name: "" },{ key: "" },{ name: "" },{ name: "" },{ name: "" },{ name: "" },{ name: "" }]} + // dataSource={[ + // { name: "" }, + // { key: "" }, + // { name: "" }, + // { name: "" }, + // { name: "" }, + // { name: "" }, + // { name: "" }, + // ]} pagination={false} style={{ background: "rgba(217, 216, 216, 1)" }} - empty="" + empty=" " /> } > diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx index aae9ee5..897d61e 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx @@ -9,6 +9,7 @@ import { Table, Pagination, Skeleton, + Popconfirm, } from "@douyinfe/semi-ui"; import "../style.less"; import NvrModal from "../components/nvrModal"; @@ -19,7 +20,7 @@ export const accessType = [ { name: "萤石云平台摄像头", key: "yingshi" }, { name: "NVR摄像头", key: "nvr" }, { name: "IPC 网络摄像头", key: "ipc" }, - { name: "级联摄像头", key: "cascade" }, + { name: "不明厂家", key: "cascade" }, ]; const NvrHeader = (props) => { @@ -116,16 +117,19 @@ const NvrHeader = (props) => { > 查看 - + + ); }, @@ -172,7 +176,7 @@ const NvrHeader = (props) => { title: "创建时间", dataIndex: "createTime", key: "time", - render: (text, r, index) => { + render: (_, r, index) => { return moment(r.createTime).format("YYYY-MM-DD HH:MM:SS"); }, }, @@ -180,6 +184,20 @@ const NvrHeader = (props) => { title: "项目名称", dataIndex: "", 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", @@ -450,15 +468,24 @@ const NvrHeader = (props) => { s)} - dataSource={[{ name: "" },{ key: "" },{ name: "" },{ name: "" },{ name: "" },{ name: "" },{ name: "" }]} - pagination={false} - style={{ background: "rgba(217, 216, 216, 1)" }} - empty="" - /> + //
s)} + // dataSource={[ + // { name: "" }, + // { key: "" }, + // { name: "" }, + // { name: "" }, + // { name: "" }, + // { name: "" }, + // { name: "" }, + // ]} + // pagination={false} + // style={{ background: "rgba(217, 216, 216, 1)" }} + // empty="" + // /> + <>
} >