|
|
@ -1,19 +1,7 @@ |
|
|
|
import React, { useState, useEffect, useRef } from "react"; |
|
|
|
import { connect } from "react-redux"; |
|
|
|
// import { push } from "react-router-redux"; |
|
|
|
import moment from "moment"; |
|
|
|
import { |
|
|
|
Button, |
|
|
|
Form, |
|
|
|
Input, |
|
|
|
Row, |
|
|
|
Table, |
|
|
|
Pagination, |
|
|
|
Skeleton, |
|
|
|
Popconfirm, |
|
|
|
Popover, |
|
|
|
Tag, |
|
|
|
} from "@douyinfe/semi-ui"; |
|
|
|
import { Button, Form, Table, Pagination, Skeleton, Popconfirm, Popover, Tag, } from "@douyinfe/semi-ui"; |
|
|
|
import "../style.less"; |
|
|
|
import { ApiTable } from "$utils"; |
|
|
|
import NvrModal from "../components/nvrModal"; |
|
|
@ -42,6 +30,7 @@ const NvrHeader = (props) => { |
|
|
|
const [reminder, setReminder] = useState(false); //提醒弹框 |
|
|
|
const api = useRef(); |
|
|
|
const SETUPS = "setups"; |
|
|
|
const USER = "user" + props.user.id |
|
|
|
const nvrRef = useRef(); //获取子组件的设备编号 |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
@ -208,7 +197,7 @@ const NvrHeader = (props) => { |
|
|
|
height: 8, |
|
|
|
display: "inline-block", |
|
|
|
borderRadius: "50%", |
|
|
|
backgroundColor: status ?colorStatus(status.online):"", |
|
|
|
backgroundColor: status ? colorStatus(status.online) : "", |
|
|
|
margin: "0 8px 0 0", |
|
|
|
}} |
|
|
|
/> |
|
|
@ -267,19 +256,25 @@ const NvrHeader = (props) => { |
|
|
|
|
|
|
|
//表格请求数据中station属性数据的展示 |
|
|
|
function station (r, name, projects) { |
|
|
|
let data = [] |
|
|
|
if (projects == "projects") { |
|
|
|
r.station.map((v) => { |
|
|
|
if (v.structure.projects.length >0) { |
|
|
|
v.structure.projects.map((item) => data.push(item[name])) |
|
|
|
} |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
r.station.map((v, index) => data.push(v.structure[name])) |
|
|
|
} |
|
|
|
let dataSet =[...(new Set(data))] |
|
|
|
return <Popover |
|
|
|
key="updateTime" |
|
|
|
position="top" |
|
|
|
content={ |
|
|
|
<article style={{ padding: 12 }}> |
|
|
|
{projects == "projects" ? |
|
|
|
r.station.map((v) => v.structure.projects.length == 0 ? "" : v.structure.projects.map((item, index) => <div key={index}>{item[name]}</div>)) |
|
|
|
: r.station.map((v, index) => <div key={index}>{v.structure[name]}</div>) |
|
|
|
} |
|
|
|
</article> |
|
|
|
<article style={{ padding: 12 }}>{dataSet.map((v,index)=><div key={index}>{v}</div>)}</article> |
|
|
|
} |
|
|
|
> |
|
|
|
<Tag>{projects == "projects" ? r.station[0].structure.projects[0][name] : r.station[0].structure[name]}...</Tag> |
|
|
|
<Tag>{dataSet[0]}...</Tag> |
|
|
|
</Popover> |
|
|
|
|
|
|
|
} |
|
|
@ -342,7 +337,12 @@ const NvrHeader = (props) => { |
|
|
|
venderList={venderList} |
|
|
|
nvrRef={nvrRef} |
|
|
|
close={() => { |
|
|
|
const remind = localStorage.getItem(USER); |
|
|
|
console.log(remind) |
|
|
|
if (!remind) { |
|
|
|
console.log(1) |
|
|
|
setReminder(true) |
|
|
|
} |
|
|
|
equipmentGetNvr(); |
|
|
|
}} |
|
|
|
/> |
|
|
@ -607,11 +607,12 @@ const NvrHeader = (props) => { |
|
|
|
wait="再等等" |
|
|
|
toadd="去添加" |
|
|
|
visible={reminder} |
|
|
|
USER={USER} |
|
|
|
onOk={() => { |
|
|
|
history.push({ pathname: '/equipmentWarehouse/camera', query: { addNvr: true, serialNo: nvrRef.current.nvrNumber() } }); |
|
|
|
setReminder(false) |
|
|
|
}} |
|
|
|
close={()=>{ |
|
|
|
close={() => { |
|
|
|
setReminder(false) |
|
|
|
}} |
|
|
|
/> |
|
|
|