|
@ -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, |
|
|