|
@ -35,6 +35,8 @@ const CameraHeader = (props) => { |
|
|
const [search, setearch] = useState({}); //搜索条件 |
|
|
const [search, setearch] = useState({}); //搜索条件 |
|
|
const [rowId, setRowId] = useState(); //表格数据id |
|
|
const [rowId, setRowId] = useState(); //表格数据id |
|
|
const [cameraData, setCameraData] = useState({}); //表格数据 |
|
|
const [cameraData, setCameraData] = useState({}); //表格数据 |
|
|
|
|
|
const [modify, setModify] = useState(false); //修改 |
|
|
|
|
|
const [parentCamera, setParentCamera] = useState(""); //级联摄像头父级设备 |
|
|
const { equipmentWarehouse } = actions; |
|
|
const { equipmentWarehouse } = actions; |
|
|
const api = useRef(); |
|
|
const api = useRef(); |
|
|
const searchb = useRef(search) |
|
|
const searchb = useRef(search) |
|
@ -42,6 +44,8 @@ const CameraHeader = (props) => { |
|
|
const CAMERAS = "cameras"; |
|
|
const CAMERAS = "cameras"; |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
|
|
|
|
|
|
|
|
|
console.log(props) |
|
|
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); |
|
@ -53,7 +57,6 @@ const CameraHeader = (props) => { |
|
|
JSON.stringify(["state", "type", "manufactor"]) |
|
|
JSON.stringify(["state", "type", "manufactor"]) |
|
|
) |
|
|
) |
|
|
: ""; |
|
|
: ""; |
|
|
console.log(equipmentWarehouseCamera); |
|
|
|
|
|
}, []); |
|
|
}, []); |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
@ -89,14 +92,14 @@ const CameraHeader = (props) => { |
|
|
} else { |
|
|
} else { |
|
|
setearch({ ...searchb.current, externalDomain: row.externalDomain }) |
|
|
setearch({ ...searchb.current, externalDomain: row.externalDomain }) |
|
|
} |
|
|
} |
|
|
deviceClickb.current=false |
|
|
deviceClickb.current = false |
|
|
} else { |
|
|
} else { |
|
|
if (row.type == "nvr") { |
|
|
if (row.type == "nvr") { |
|
|
setearch({ ...searchb.current, nvrId: null }) |
|
|
setearch({ ...searchb.current, nvrId: null }) |
|
|
} else { |
|
|
} else { |
|
|
setearch({ ...searchb.current, externalDomain: null }) |
|
|
setearch({ ...searchb.current, externalDomain: null }) |
|
|
} |
|
|
} |
|
|
deviceClickb.current=true |
|
|
deviceClickb.current = true |
|
|
} |
|
|
} |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
@ -118,8 +121,19 @@ const CameraHeader = (props) => { |
|
|
<Button |
|
|
<Button |
|
|
theme="borderless" |
|
|
theme="borderless" |
|
|
onClick={() => { |
|
|
onClick={() => { |
|
|
setCameraModal(true); |
|
|
|
|
|
setCameraData(row); |
|
|
setCameraData(row); |
|
|
|
|
|
if (row.type == "cascade") { |
|
|
|
|
|
dispatch(equipmentWarehouse.getParentCamera({ cameraSerialNo: row.serialNo })).then((res) => { |
|
|
|
|
|
setParentCamera(res.payload.data.sipip) |
|
|
|
|
|
if (res.success) { |
|
|
|
|
|
setCameraModal(true); |
|
|
|
|
|
setModify(true) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
setCameraModal(true); |
|
|
|
|
|
setModify(true) |
|
|
|
|
|
} |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
修改 |
|
|
修改 |
|
@ -290,15 +304,7 @@ const CameraHeader = (props) => { |
|
|
render: (_, r, index) => { |
|
|
render: (_, r, index) => { |
|
|
return r.station.length == 0 |
|
|
return r.station.length == 0 |
|
|
? "" |
|
|
? "" |
|
|
: r.station.map((item, index) => { |
|
|
: station(r, "name", _, "projects") |
|
|
return item.structure.projects.length == 0 |
|
|
|
|
|
? "" |
|
|
|
|
|
: station( |
|
|
|
|
|
r.station[0].structure.projects[0].name, |
|
|
|
|
|
item.structure.projects, |
|
|
|
|
|
"name" |
|
|
|
|
|
); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
@ -308,15 +314,7 @@ const CameraHeader = (props) => { |
|
|
render: (_, r, index) => { |
|
|
render: (_, r, index) => { |
|
|
return r.station.length == 0 |
|
|
return r.station.length == 0 |
|
|
? "" |
|
|
? "" |
|
|
: r.station.map((item, index) => { |
|
|
: station(r, "url", _, "projects") |
|
|
return item.structure.projects.length == 0 |
|
|
|
|
|
? "" |
|
|
|
|
|
: station( |
|
|
|
|
|
r.station[0].structure.projects[0].url, |
|
|
|
|
|
item.structure.projects, |
|
|
|
|
|
"url" |
|
|
|
|
|
); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
@ -326,7 +324,7 @@ const CameraHeader = (props) => { |
|
|
render: (_, r, index) => { |
|
|
render: (_, r, index) => { |
|
|
return r.station.length == 0 |
|
|
return r.station.length == 0 |
|
|
? "" |
|
|
? "" |
|
|
: station(r.station[0].structure.name, r.station, "structure.name"); |
|
|
: station(r, "name", r.station[0].structure.name, _, "structure") |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
@ -336,7 +334,7 @@ const CameraHeader = (props) => { |
|
|
render: (_, r, index) => { |
|
|
render: (_, r, index) => { |
|
|
return r.station.length == 0 |
|
|
return r.station.length == 0 |
|
|
? "" |
|
|
? "" |
|
|
: station(r.station[0].name, r.station, "name"); |
|
|
: station(r, "name", r.station[0].name, _, "point") |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
@ -346,7 +344,7 @@ const CameraHeader = (props) => { |
|
|
render: (_, r, index) => { |
|
|
render: (_, r, index) => { |
|
|
return r.station.length == 0 |
|
|
return r.station.length == 0 |
|
|
? "" |
|
|
? "" |
|
|
: station(r.station[0].factor.name, r.station, "factor.name"); |
|
|
: station(r, "name", r.station[0].factor.name) |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
]; |
|
|
]; |
|
@ -360,39 +358,22 @@ const CameraHeader = (props) => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//表格请求数据中station属性数据的展示 |
|
|
//表格请求数据中station属性数据的展示 |
|
|
function station (first, whole, name) { |
|
|
function station (r, name, data, projects, exhibition) { |
|
|
return ( |
|
|
return <Popover |
|
|
<Popover |
|
|
|
|
|
key="updateTime" |
|
|
key="updateTime" |
|
|
position="top" |
|
|
position="top" |
|
|
content={ |
|
|
content={ |
|
|
<article style={{ padding: 12 }}> |
|
|
<article style={{ padding: 12 }}> |
|
|
{whole.map((v, index) => { |
|
|
{projects == "projects" ? |
|
|
let names = ""; |
|
|
r.station.map((v) => v.structure.projects.length == 0 ? "" : v.structure.projects.map((item, index) => <div key={index}>{item[name]}</div>)) |
|
|
switch (name) { |
|
|
: r.station.map((v, index) => <div key={index}>{exhibition == "structure" ? v.structure.name : exhibition == "point" ? v.name : v.factor.name}</div>) |
|
|
case "name": |
|
|
|
|
|
names = v[name]; |
|
|
|
|
|
break; |
|
|
|
|
|
case "url": |
|
|
|
|
|
names = v[name]; |
|
|
|
|
|
break; |
|
|
|
|
|
case "structure.name": |
|
|
|
|
|
names = v.structure.name; |
|
|
|
|
|
break; |
|
|
|
|
|
case "factor.name": |
|
|
|
|
|
names = v.factor.name; |
|
|
|
|
|
break; |
|
|
|
|
|
default: |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
} |
|
|
return <div key={index}>{names}</div>; |
|
|
|
|
|
})} |
|
|
|
|
|
</article> |
|
|
</article> |
|
|
} |
|
|
} |
|
|
> |
|
|
> |
|
|
<Tag>{first}...</Tag> |
|
|
<Tag>{projects == "projects" && r.station[0].structure.projects.length > 0 ? r.station[0].structure.projects[0][name] : data}...</Tag> |
|
|
</Popover> |
|
|
</Popover> |
|
|
); |
|
|
|
|
|
} |
|
|
} |
|
|
//条件赛选样式 |
|
|
//条件赛选样式 |
|
|
const screen = { |
|
|
const screen = { |
|
@ -724,10 +705,15 @@ const CameraHeader = (props) => { |
|
|
visible={true} |
|
|
visible={true} |
|
|
venderList={venderList} |
|
|
venderList={venderList} |
|
|
cameraData={cameraData} |
|
|
cameraData={cameraData} |
|
|
|
|
|
modify={modify} |
|
|
|
|
|
parentCamera={parentCamera} |
|
|
close={() => { |
|
|
close={() => { |
|
|
setCameraModal(false); |
|
|
setCameraModal(false); |
|
|
setCameraData({}); |
|
|
setCameraData({}); |
|
|
|
|
|
setModify(false) |
|
|
|
|
|
setParentCamera("") |
|
|
equipmentGetCamera(); |
|
|
equipmentGetCamera(); |
|
|
|
|
|
|
|
|
}} |
|
|
}} |
|
|
modalName={modalName} |
|
|
modalName={modalName} |
|
|
/> |
|
|
/> |
|
@ -735,7 +721,7 @@ const CameraHeader = (props) => { |
|
|
"" |
|
|
"" |
|
|
)} |
|
|
)} |
|
|
{ |
|
|
{ |
|
|
<VideoPlayModal visible={true} /> |
|
|
// <VideoPlayModal visible={true} /> |
|
|
} |
|
|
} |
|
|
</> |
|
|
</> |
|
|
); |
|
|
); |
|
|