|
@ -35,10 +35,10 @@ 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 [deviceClick, setDeviceClick] = useState(false); //设备名称点击的不同效果 |
|
|
|
|
|
|
|
|
|
|
|
const { equipmentWarehouse } = actions; |
|
|
const { equipmentWarehouse } = actions; |
|
|
const api = useRef(); |
|
|
const api = useRef(); |
|
|
|
|
|
const searchb = useRef(search) |
|
|
|
|
|
const deviceClickb = useRef(true) |
|
|
const CAMERAS = "cameras"; |
|
|
const CAMERAS = "cameras"; |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
@ -81,7 +81,24 @@ const CameraHeader = (props) => { |
|
|
<div> |
|
|
<div> |
|
|
{row.name} |
|
|
{row.name} |
|
|
<sapn style={{ color: "blue" }} |
|
|
<sapn style={{ color: "blue" }} |
|
|
onClick={() =>device_(row)} |
|
|
onClick={() => { |
|
|
|
|
|
if (deviceClickb.current) { |
|
|
|
|
|
|
|
|
|
|
|
if (row.type == "nvr") { |
|
|
|
|
|
setearch({ ...searchb.current, nvrId: row.nvr.id }) |
|
|
|
|
|
} else { |
|
|
|
|
|
setearch({ ...searchb.current, externalDomain: row.externalDomain }) |
|
|
|
|
|
} |
|
|
|
|
|
deviceClickb.current=false |
|
|
|
|
|
} else { |
|
|
|
|
|
if (row.type == "nvr") { |
|
|
|
|
|
setearch({ ...searchb.current, nvrId: null }) |
|
|
|
|
|
} else { |
|
|
|
|
|
setearch({ ...searchb.current, externalDomain: null }) |
|
|
|
|
|
} |
|
|
|
|
|
deviceClickb.current=true |
|
|
|
|
|
} |
|
|
|
|
|
}} |
|
|
> |
|
|
> |
|
|
{row.type == "nvr" ? `@${row.nvr.name}` : row.type == "cascade" ? `@${row.externalDomain}` : ""} |
|
|
{row.type == "nvr" ? `@${row.nvr.name}` : row.type == "cascade" ? `@${row.externalDomain}` : ""} |
|
|
</sapn> |
|
|
</sapn> |
|
@ -190,7 +207,7 @@ const CameraHeader = (props) => { |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
const device_ = (r) => { |
|
|
const device_ = (r) => { |
|
|
console.log(deviceClick) |
|
|
console.log(searchb) |
|
|
if (deviceClick) { |
|
|
if (deviceClick) { |
|
|
// if (r.type == "nvr") { |
|
|
// if (r.type == "nvr") { |
|
|
// console.log(search) |
|
|
// console.log(search) |
|
@ -222,7 +239,7 @@ const CameraHeader = (props) => { |
|
|
key: "manufactor", |
|
|
key: "manufactor", |
|
|
render: (_, r, index) => { |
|
|
render: (_, r, index) => { |
|
|
let manufactorName = data.find((item) => item.id == r.venderId); |
|
|
let manufactorName = data.find((item) => item.id == r.venderId); |
|
|
return manufactorName ? manufactorName.name : ""; |
|
|
return manufactorName ? manufactorName.name : "未知"; |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
@ -556,6 +573,7 @@ const CameraHeader = (props) => { |
|
|
onClick={() => { |
|
|
onClick={() => { |
|
|
api.current.validate().then((v) => { |
|
|
api.current.validate().then((v) => { |
|
|
setearch(v); |
|
|
setearch(v); |
|
|
|
|
|
searchb.current = v |
|
|
}); |
|
|
}); |
|
|
equipmentGetCamera(); |
|
|
equipmentGetCamera(); |
|
|
}} |
|
|
}} |
|
|