|
@ -23,16 +23,15 @@ import { skeletonScreen } from "../components/skeletonScreen"; |
|
|
import { ReminderBox } from "../../../components/index"; |
|
|
import { ReminderBox } from "../../../components/index"; |
|
|
|
|
|
|
|
|
export const accessType = [ |
|
|
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([]); |
|
@ -40,13 +39,12 @@ const NvrHeader = (props) => { |
|
|
const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息 |
|
|
const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息 |
|
|
const [search, setearch] = useState({}); //搜索条件 |
|
|
const [search, setearch] = useState({}); //搜索条件 |
|
|
const [rowId, setRowId] = useState(); //表格数据id |
|
|
const [rowId, setRowId] = useState(); //表格数据id |
|
|
const [load, setLoad] = useState(); //骨架屏是否显现 |
|
|
|
|
|
const [reminder, setReminder] = useState(true); //提醒弹框 |
|
|
const [reminder, setReminder] = useState(true); //提醒弹框 |
|
|
const api = useRef(); |
|
|
const api = useRef(); |
|
|
const SETUPS = "setups"; |
|
|
const SETUPS = "setups"; |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
setLoad(loading); |
|
|
|
|
|
dispatch(actions.equipmentWarehouse.getVender()).then((res) => { |
|
|
dispatch(actions.equipmentWarehouse.getVender()).then((res) => { |
|
|
setvenderList(res.payload.data); |
|
|
setvenderList(res.payload.data); |
|
|
attribute(res.payload.data); |
|
|
attribute(res.payload.data); |
|
@ -60,11 +58,12 @@ const NvrHeader = (props) => { |
|
|
: ""; |
|
|
: ""; |
|
|
// ; |
|
|
// ; |
|
|
}, []); |
|
|
}, []); |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
equipmentGetNvr(); |
|
|
equipmentGetNvr(); |
|
|
}, [query, search]); |
|
|
}, [query, search]); |
|
|
|
|
|
|
|
|
function equipmentGetNvr() { |
|
|
function equipmentGetNvr () { |
|
|
dispatch(equipmentWarehouse.getNvr({ ...query, ...search })); |
|
|
dispatch(equipmentWarehouse.getNvr({ ...query, ...search })); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -91,7 +90,7 @@ const NvrHeader = (props) => { |
|
|
title: "设备名称", |
|
|
title: "设备名称", |
|
|
dataIndex: "name", |
|
|
dataIndex: "name", |
|
|
render: (text, r, index) => { |
|
|
render: (text, r, index) => { |
|
|
return r.name; |
|
|
return r.name |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
@ -148,7 +147,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)) |
|
|
: []; |
|
|
: []; |
|
@ -219,6 +218,7 @@ const NvrHeader = (props) => { |
|
|
dataIndex: "", |
|
|
dataIndex: "", |
|
|
key: "name", |
|
|
key: "name", |
|
|
render: (_, r, index) => { |
|
|
render: (_, r, index) => { |
|
|
|
|
|
console.log(r) |
|
|
return r.station.length == 0 |
|
|
return r.station.length == 0 |
|
|
? "" |
|
|
? "" |
|
|
: r.station.map((item, index) => { |
|
|
: r.station.map((item, index) => { |
|
@ -271,7 +271,7 @@ const NvrHeader = (props) => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//表格请求数据中station属性数据的展示 |
|
|
//表格请求数据中station属性数据的展示 |
|
|
function station(first, whole, name) { |
|
|
function station (first, whole, name) { |
|
|
return ( |
|
|
return ( |
|
|
<Popover |
|
|
<Popover |
|
|
key="updateTime" |
|
|
key="updateTime" |
|
@ -426,13 +426,14 @@ const NvrHeader = (props) => { |
|
|
<Form.Select |
|
|
<Form.Select |
|
|
label="状态查询:" |
|
|
label="状态查询:" |
|
|
labelPosition="left" |
|
|
labelPosition="left" |
|
|
field="type2" |
|
|
field="state" |
|
|
style={screen} |
|
|
style={screen} |
|
|
placeholder="全部" |
|
|
placeholder="全部" |
|
|
showClear |
|
|
showClear |
|
|
> |
|
|
> |
|
|
<Form.Select.Option value="yes">在线</Form.Select.Option> |
|
|
<Form.Select.Option value="ON">在线</Form.Select.Option> |
|
|
<Form.Select.Option value="no">离线</Form.Select.Option> |
|
|
<Form.Select.Option value="OFF">离线</Form.Select.Option> |
|
|
|
|
|
<Form.Select.Option value="UNKONW">未知</Form.Select.Option> |
|
|
</Form.Select> |
|
|
</Form.Select> |
|
|
{/* <Form.Select |
|
|
{/* <Form.Select |
|
|
label="关联项目:" |
|
|
label="关联项目:" |
|
@ -635,7 +636,7 @@ const NvrHeader = (props) => { |
|
|
); |
|
|
); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
function mapStateToProps(state) { |
|
|
function mapStateToProps (state) { |
|
|
const { auth, global, members, equipmentWarehouseNvr } = state; |
|
|
const { auth, global, members, equipmentWarehouseNvr } = state; |
|
|
return { |
|
|
return { |
|
|
loading: equipmentWarehouseNvr.isRequesting && !equipmentWarehouseNvr.data, |
|
|
loading: equipmentWarehouseNvr.isRequesting && !equipmentWarehouseNvr.data, |
|
|