Browse Source

测试

release_0.0.2
wenlele 3 years ago
parent
commit
cb6d752abc
  1. 1
      code/VideoAccess-VCMP/web/client/src/components/textScroll.jsx
  2. 1
      code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx
  3. 2
      code/VideoAccess-VCMP/web/client/src/components/videoPlayer/voiceHeader.jsx
  4. 2
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js
  5. 2
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrCamera.jsx
  6. 13
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx
  7. 49
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx
  8. 25
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx

1
code/VideoAccess-VCMP/web/client/src/components/textScroll.jsx

@ -7,6 +7,7 @@ function TextScroll (props) {
const [showContent, setShowContent] = useState('1231231') const [showContent, setShowContent] = useState('1231231')
const [timer, setTimer] = useState(null) const [timer, setTimer] = useState(null)
const showIndex = useRef(0) const showIndex = useRef(0)
console.log(content);
useEffect(() => { useEffect(() => {
if (content.length) { if (content.length) {

1
code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx

@ -316,6 +316,7 @@ const VideoPlay = ({
null : (histroyBegain || moment()) null : (histroyBegain || moment())
} }
setProcessDisX={setProcessDisX} setProcessDisX={setProcessDisX}
content={videoObj.content}
/> />
{/* 视频内容 */} {/* 视频内容 */}
{ {

2
code/VideoAccess-VCMP/web/client/src/components/videoPlayer/voiceHeader.jsx

@ -8,7 +8,7 @@ import './videoPlay.less';
const timeFormat = 'YYYY-MM-DD HH:mm:ss' const timeFormat = 'YYYY-MM-DD HH:mm:ss'
const VideoHeader = ({ operationState, changeSelectState, setProcessDisX, name, showTime, histroyTime }) => { const VideoHeader = ({ operationState, changeSelectState, setProcessDisX, name, showTime, histroyTime,content }) => {
const time = useRef(moment(showTime || undefined)) const time = useRef(moment(showTime || undefined))
const upTimeInterval = useRef(null) const upTimeInterval = useRef(null)
const [showTime_, setShowTime] = useState(' ') const [showTime_, setShowTime] = useState(' ')

2
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js

@ -36,7 +36,7 @@ export function delCamera(orgId) {
dispatch: dispatch, dispatch: dispatch,
actionType: "DEL_CAMERA", actionType: "DEL_CAMERA",
url: `${ApiTable.delCamera.replace("{cameraId}", orgId)}`, url: `${ApiTable.delCamera.replace("{cameraId}", orgId)}`,
msg: { option: "删除摄像头" }, //删除摄像头 msg: { option: "设备会被存放在“设备回收站”中,删除" }, //删除摄像头
reducer: {}, reducer: {},
}); });
} }

2
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrCamera.jsx

@ -346,7 +346,7 @@ function nvrCamera ({ dispatch, actions, nvrRef, cameraData, addNvr, nvrNumber,
onClick={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}
></Input> ></Input>
) : ( ) : (
item.name.length > 8 ? `${item.name.substr(0, 8)}...` : item.name item.name.length > 12 ? `${item.name.substr(0,12)}...` : item.name
)} )}
</div> </div>
<div <div

13
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx

@ -1,6 +1,6 @@
import React, { useState, useEffect } from "react"; import React, { useState, useEffect } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { SideSheet, Tabs, TabPane, Button } from "@douyinfe/semi-ui"; import { SideSheet, Tabs, TabPane, Button, Notification } from "@douyinfe/semi-ui";
import copy from "copy-to-clipboard"; import copy from "copy-to-clipboard";
import moment from "moment"; import moment from "moment";
import PerfectScrollbar from "perfect-scrollbar"; import PerfectScrollbar from "perfect-scrollbar";
@ -82,7 +82,7 @@ function SideSheets (props) {
{ name: "设备名称:", key: "name" }, { name: "设备名称:", key: "name" },
{ {
name: "SIP编号/设备编号:", name: "SIP编号/设备编号:",
key: nvrDetails.serialNo ? "serialNo" : "sip", key: nvrDetails?.serialNo ? "serialNo" : "sip",
}, },
{ name: "接入方式:", key: "type" }, { name: "接入方式:", key: "type" },
{ name: "厂商:", key: "venderId" }, { name: "厂商:", key: "venderId" },
@ -411,6 +411,10 @@ function SideSheets (props) {
}} }}
onClick={() => { onClick={() => {
copy(broadcast[key] ? broadcast[key] : "无相关地址"); copy(broadcast[key] ? broadcast[key] : "无相关地址");
Notification.success({
content: "复制成功",
duration: 2,
})
setclickStyle(key); setclickStyle(key);
}} }}
> >
@ -506,7 +510,10 @@ function SideSheets (props) {
}} }}
onClick={() => { onClick={() => {
copy(recovery[key] ? recovery[key] : "无相关地址"); copy(recovery[key] ? recovery[key] : "无相关地址");
// alert(""); Notification.success({
content: "复制成功",
duration: 2,
})
setclickStyle(key); setclickStyle(key);
}} }}
> >

49
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx

@ -34,7 +34,7 @@ const CameraHeader = (props) => {
const [query, setQuery] = useState({ limit: 10, page: 0 }); // const [query, setQuery] = useState({ limit: 10, page: 0 }); //
const [search, setSearch] = useState({}); // const [search, setSearch] = 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 [modify, setModify] = useState(false); //
const [parentCamera, setParentCamera] = useState(""); // const [parentCamera, setParentCamera] = useState(""); //
const [addNvr, setAddNvr] = useState(false); //nvrNVR const [addNvr, setAddNvr] = useState(false); //nvrNVR
@ -43,7 +43,9 @@ const CameraHeader = (props) => {
const [axyData, setAxyData] = useState(); const [axyData, setAxyData] = useState();
const { equipmentWarehouse } = actions; const { equipmentWarehouse } = actions;
const api = useRef(); const api = useRef();
const searchb = useRef(search) const searchData = useRef({})
const limits = useRef(); //
const page = useRef(query.page);
const deviceClickb = useRef(true) const deviceClickb = useRef(true)
const CAMERAS = "cameras"; const CAMERAS = "cameras";
@ -77,8 +79,11 @@ const CameraHeader = (props) => {
equipmentGetCamera(); equipmentGetCamera();
}, [query, search]); }, [query, search]);
function equipmentGetCamera () { const equipmentGetCamera = () => {
dispatch(equipmentWarehouse.getCamera({ ...query, ...search })); searchData.current = { ...query, ...search }
dispatch(equipmentWarehouse.getCamera(searchData.current)).then((res) => {
limits.current = res.payload.data.data.length
});
} }
function equipmentStatus (data) { function equipmentStatus (data) {
switch (data) { switch (data) {
@ -124,16 +129,16 @@ const CameraHeader = (props) => {
onClick={() => { onClick={() => {
if (deviceClickb.current) { if (deviceClickb.current) {
if (row.type == "nvr") { if (row.type == "nvr") {
setSearch({ ...searchb.current, nvrId: row.nvr.id }) setSearch({ ...search, nvrId: row.nvr.id })
} else { } else {
setSearch({ ...searchb.current, externalDomain: row.externalDomain }) setSearch({ ...search, externalDomain: row.externalDomain })
} }
deviceClickb.current = false deviceClickb.current = false
} else { } else {
if (row.type == "nvr") { if (row.type == "nvr") {
setSearch({ ...searchb.current, nvrId: null }) setSearch({ ...search, nvrId: null })
} else { } else {
setSearch({ ...searchb.current, externalDomain: null }) setSearch({ ...search, externalDomain: null })
} }
deviceClickb.current = true deviceClickb.current = true
} }
@ -150,7 +155,6 @@ const CameraHeader = (props) => {
width: "20%", width: "20%",
dataIndex: "", dataIndex: "",
render: (_, row) => { render: (_, row) => {
console.log(row);
return ( return (
<div style={{ display: "flex" }}> <div style={{ display: "flex" }}>
<Button <Button
@ -187,6 +191,8 @@ const CameraHeader = (props) => {
<Button <Button
theme="borderless" theme="borderless"
onClick={() => { onClick={() => {
let data = row?.cameraRemarks.map((item)=>item.remark)
console.log((data));
if (row.type == "yingshi") { if (row.type == "yingshi") {
setVideoObj({ setVideoObj({
type: row.type, type: row.type,
@ -194,6 +200,7 @@ const CameraHeader = (props) => {
yingshiToken: row.secretYingshi?.token, yingshiToken: row.secretYingshi?.token,
playUrlSd: row.gbCamera?.playUrl?.liveUrl?.sd?.ezopen, playUrlSd: row.gbCamera?.playUrl?.liveUrl?.sd?.ezopen,
playUrlHd: row.gbCamera?.playUrl?.liveUrl?.hd?.ezopen, playUrlHd: row.gbCamera?.playUrl?.liveUrl?.hd?.ezopen,
content:data,
}) })
} else { } else {
setVideoObj({ setVideoObj({
@ -223,7 +230,7 @@ const CameraHeader = (props) => {
row.forbidden row.forbidden
) )
).then(() => { ).then(() => {
dispatch(equipmentWarehouse.getCamera(searchb.current)); dispatch(equipmentWarehouse.getCamera(searchData.current))
}); });
}} }}
> >
@ -245,7 +252,7 @@ const CameraHeader = (props) => {
row.forbidden row.forbidden
) )
).then(() => { ).then(() => {
dispatch(equipmentWarehouse.getCamera(searchb.current)); dispatch(equipmentWarehouse.getCamera(searchData.current))
}); });
}} }}
> >
@ -254,7 +261,7 @@ const CameraHeader = (props) => {
)} )}
<Popconfirm <Popconfirm
title="删除NVR会删除端口下的所有摄像头,是否确定删除?" title="删除后设备视频流会被中断,是否确定删除?"
arrowPointAtCenter={false} arrowPointAtCenter={false}
showArrow={true} showArrow={true}
position="topRight" position="topRight"
@ -262,7 +269,11 @@ const CameraHeader = (props) => {
dispatch( dispatch(
equipmentWarehouse.delCamera(row.id) equipmentWarehouse.delCamera(row.id)
).then(() => { ).then(() => {
dispatch(equipmentWarehouse.getCamera(searchb.current)); if (page.current > 0 && limits.current < 2) {
setQuery({ limit: 10, page: page.current - 1 })
} else {
setQuery({ limit: 10, page: page.current })
}
}); });
}} }}
> >
@ -438,13 +449,14 @@ const CameraHeader = (props) => {
return dataSet.length > 0 ? <Popover return dataSet.length > 0 ? <Popover
key="updateTime" key="updateTime"
position="top" position="top"
content={ content={dataSet.length > 1 ?
<article style={{ padding: 12 }}> <article style={{ padding: 12 }}>
{dataSet.length > 0 ? dataSet.map((v, index) => <div key={index}>{v}</div>) : ""} {dataSet.map((v, index) => <div key={index}>{v}</div>)}
</article> </article>
: ""
} }
> >
<Tag>{dataSet.length > 0 ? `${dataSet[0]}...` : ""}</Tag> <Tag>{dataSet.length > 1 ? `${dataSet[0]}...` : dataSet.length > 0 ? dataSet[0] : ""}</Tag>
</Popover> : "" </Popover> : ""
} }
@ -631,7 +643,6 @@ const CameraHeader = (props) => {
api.current.validate().then((v) => { api.current.validate().then((v) => {
setSearch(v); setSearch(v);
setQuery({ limit: 10, page: 0 }) setQuery({ limit: 10, page: 0 })
searchb.current = { ...v, limit: 10, page: 0 }
}); });
}} }}
> >
@ -651,6 +662,7 @@ const CameraHeader = (props) => {
onClick={() => { onClick={() => {
api.current.reset(); api.current.reset();
setSearch({}); setSearch({});
setQuery({ limit: 10, page: 0 })
}} }}
> >
重置 重置
@ -739,6 +751,7 @@ const CameraHeader = (props) => {
pageSizeOpts={[10, 20, 30, 40]} pageSizeOpts={[10, 20, 30, 40]}
onChange={(currentPage, pageSize) => { onChange={(currentPage, pageSize) => {
setQuery({ limit: pageSize, page: currentPage - 1 }); setQuery({ limit: pageSize, page: currentPage - 1 });
page.current = currentPage - 1
}} }}
/> />
</div> </div>
@ -793,7 +806,7 @@ const CameraHeader = (props) => {
setAddNvr(false) setAddNvr(false)
setNvrNumber("") setNvrNumber("")
setAxyData("") setAxyData("")
dispatch(equipmentWarehouse.getCamera(searchb.current)); equipmentGetCamera()
}} }}
modalName={modalName} modalName={modalName}
/> />

25
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx

@ -27,10 +27,12 @@ const NvrHeader = (props) => {
const [venderList, setvenderList] = useState([]); // const [venderList, setvenderList] = useState([]); //
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 searchb = useRef(search)
const [rowId, setRowId] = useState(); //id const [rowId, setRowId] = useState(); //id
const [reminder, setReminder] = useState(false); // const [reminder, setReminder] = useState(false); //
const api = useRef(); const api = useRef();
const searchData = useRef(search)
const limits = useRef(); //
const page = useRef(query.page);
const SETUPS = "setups"; const SETUPS = "setups";
const USER = "user" + props.user.id const USER = "user" + props.user.id
const nvrRef = useRef(); // const nvrRef = useRef(); //
@ -53,8 +55,11 @@ const NvrHeader = (props) => {
equipmentGetNvr(); equipmentGetNvr();
}, [query, search]); }, [query, search]);
function equipmentGetNvr () { const equipmentGetNvr = () => {
dispatch(equipmentWarehouse.getNvr({ ...query, ...search })); searchData.current = { ...query, ...search }
dispatch(equipmentWarehouse.getNvr(searchData.current)).then((res) => {
limits.current = res.payload.data.data.length
});
} }
function equipmentStatus (data) { function equipmentStatus (data) {
@ -93,6 +98,7 @@ const NvrHeader = (props) => {
title: "设备名称", title: "设备名称",
dataIndex: "name", dataIndex: "name",
render: (_, r, index) => { render: (_, r, index) => {
console.log(r);
return r.name return r.name
}, },
}, },
@ -136,7 +142,11 @@ const NvrHeader = (props) => {
position="topRight" position="topRight"
onConfirm={() => { onConfirm={() => {
dispatch(equipmentWarehouse.delNvr(row.id)).then(() => { dispatch(equipmentWarehouse.delNvr(row.id)).then(() => {
dispatch(equipmentWarehouse.getNvr(searchb.current)); if (page.current > 0 && limits.current < 2) {
setQuery({ limit: 10, page: page.current - 1 })
} else {
setQuery({ limit: 10, page: page.current })
}
}); });
}} }}
> >
@ -270,10 +280,10 @@ const NvrHeader = (props) => {
key="updateTime" key="updateTime"
position="top" position="top"
content={ content={
<article style={{ padding: 12 }}>{dataSet.map((v, index) => <div key={index}>{v}</div>)}</article> dataSet.length > 1 ? <article style={{ padding: 12 }}>{dataSet.map((v, index) => <div key={index}>{v}</div>)}</article> : ""
} }
> >
<Tag>{dataSet[0]}...</Tag> <Tag>{dataSet.length > 1 ? `${dataSet[0]}...` : dataSet.length > 0 ? dataSet[0] : ""}</Tag>
</Popover> : "" </Popover> : ""
} }
@ -451,7 +461,6 @@ const NvrHeader = (props) => {
api.current.validate().then((v) => { api.current.validate().then((v) => {
setearch(v); setearch(v);
setQuery({ limit: 10, page: 0 }) setQuery({ limit: 10, page: 0 })
searchb.current = { ...v, limit: 10, page: 0 }
}); });
}} }}
> >
@ -471,6 +480,7 @@ const NvrHeader = (props) => {
onClick={() => { onClick={() => {
api.current.reset(); api.current.reset();
setearch({}); setearch({});
setQuery({ limit: 10, page: 0 })
}} }}
> >
重置 重置
@ -558,6 +568,7 @@ const NvrHeader = (props) => {
pageSizeOpts={[10, 20, 30, 40]} pageSizeOpts={[10, 20, 30, 40]}
onChange={(currentPage, pageSize) => { onChange={(currentPage, pageSize) => {
setQuery({ limit: pageSize, page: currentPage - 1 }); setQuery({ limit: pageSize, page: currentPage - 1 });
page.current = currentPage - 1
}} }}
/> />
</div> </div>

Loading…
Cancel
Save