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 [timer, setTimer] = useState(null)
const showIndex = useRef(0)
console.log(content);
useEffect(() => {
if (content.length) {

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

@ -316,6 +316,7 @@ const VideoPlay = ({
null : (histroyBegain || moment())
}
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 VideoHeader = ({ operationState, changeSelectState, setProcessDisX, name, showTime, histroyTime }) => {
const VideoHeader = ({ operationState, changeSelectState, setProcessDisX, name, showTime, histroyTime,content }) => {
const time = useRef(moment(showTime || undefined))
const upTimeInterval = useRef(null)
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,
actionType: "DEL_CAMERA",
url: `${ApiTable.delCamera.replace("{cameraId}", orgId)}`,
msg: { option: "删除摄像头" }, //删除摄像头
msg: { option: "设备会被存放在“设备回收站”中,删除" }, //删除摄像头
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()}
></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

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

@ -1,6 +1,6 @@
import React, { useState, useEffect } from "react";
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 moment from "moment";
import PerfectScrollbar from "perfect-scrollbar";
@ -82,7 +82,7 @@ function SideSheets (props) {
{ name: "设备名称:", key: "name" },
{
name: "SIP编号/设备编号:",
key: nvrDetails.serialNo ? "serialNo" : "sip",
key: nvrDetails?.serialNo ? "serialNo" : "sip",
},
{ name: "接入方式:", key: "type" },
{ name: "厂商:", key: "venderId" },
@ -411,6 +411,10 @@ function SideSheets (props) {
}}
onClick={() => {
copy(broadcast[key] ? broadcast[key] : "无相关地址");
Notification.success({
content: "复制成功",
duration: 2,
})
setclickStyle(key);
}}
>
@ -506,7 +510,10 @@ function SideSheets (props) {
}}
onClick={() => {
copy(recovery[key] ? recovery[key] : "无相关地址");
// alert("");
Notification.success({
content: "复制成功",
duration: 2,
})
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 [search, setSearch] = useState({}); //
const [rowId, setRowId] = useState(); //id
const [cameraData, setCameraData] = useState({}); //
const [cameraData, setCameraData] = useState({}); //
const [modify, setModify] = useState(false); //
const [parentCamera, setParentCamera] = useState(""); //
const [addNvr, setAddNvr] = useState(false); //nvrNVR
@ -43,7 +43,9 @@ const CameraHeader = (props) => {
const [axyData, setAxyData] = useState();
const { equipmentWarehouse } = actions;
const api = useRef();
const searchb = useRef(search)
const searchData = useRef({})
const limits = useRef(); //
const page = useRef(query.page);
const deviceClickb = useRef(true)
const CAMERAS = "cameras";
@ -77,8 +79,11 @@ const CameraHeader = (props) => {
equipmentGetCamera();
}, [query, search]);
function equipmentGetCamera () {
dispatch(equipmentWarehouse.getCamera({ ...query, ...search }));
const equipmentGetCamera = () => {
searchData.current = { ...query, ...search }
dispatch(equipmentWarehouse.getCamera(searchData.current)).then((res) => {
limits.current = res.payload.data.data.length
});
}
function equipmentStatus (data) {
switch (data) {
@ -124,16 +129,16 @@ const CameraHeader = (props) => {
onClick={() => {
if (deviceClickb.current) {
if (row.type == "nvr") {
setSearch({ ...searchb.current, nvrId: row.nvr.id })
setSearch({ ...search, nvrId: row.nvr.id })
} else {
setSearch({ ...searchb.current, externalDomain: row.externalDomain })
setSearch({ ...search, externalDomain: row.externalDomain })
}
deviceClickb.current = false
} else {
if (row.type == "nvr") {
setSearch({ ...searchb.current, nvrId: null })
setSearch({ ...search, nvrId: null })
} else {
setSearch({ ...searchb.current, externalDomain: null })
setSearch({ ...search, externalDomain: null })
}
deviceClickb.current = true
}
@ -150,7 +155,6 @@ const CameraHeader = (props) => {
width: "20%",
dataIndex: "",
render: (_, row) => {
console.log(row);
return (
<div style={{ display: "flex" }}>
<Button
@ -187,6 +191,8 @@ const CameraHeader = (props) => {
<Button
theme="borderless"
onClick={() => {
let data = row?.cameraRemarks.map((item)=>item.remark)
console.log((data));
if (row.type == "yingshi") {
setVideoObj({
type: row.type,
@ -194,6 +200,7 @@ const CameraHeader = (props) => {
yingshiToken: row.secretYingshi?.token,
playUrlSd: row.gbCamera?.playUrl?.liveUrl?.sd?.ezopen,
playUrlHd: row.gbCamera?.playUrl?.liveUrl?.hd?.ezopen,
content:data,
})
} else {
setVideoObj({
@ -223,7 +230,7 @@ const CameraHeader = (props) => {
row.forbidden
)
).then(() => {
dispatch(equipmentWarehouse.getCamera(searchb.current));
dispatch(equipmentWarehouse.getCamera(searchData.current))
});
}}
>
@ -245,7 +252,7 @@ const CameraHeader = (props) => {
row.forbidden
)
).then(() => {
dispatch(equipmentWarehouse.getCamera(searchb.current));
dispatch(equipmentWarehouse.getCamera(searchData.current))
});
}}
>
@ -254,7 +261,7 @@ const CameraHeader = (props) => {
)}
<Popconfirm
title="删除NVR会删除端口下的所有摄像头,是否确定删除?"
title="删除后设备视频流会被中断,是否确定删除?"
arrowPointAtCenter={false}
showArrow={true}
position="topRight"
@ -262,7 +269,11 @@ const CameraHeader = (props) => {
dispatch(
equipmentWarehouse.delCamera(row.id)
).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
key="updateTime"
position="top"
content={
content={dataSet.length > 1 ?
<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>
: ""
}
>
<Tag>{dataSet.length > 0 ? `${dataSet[0]}...` : ""}</Tag>
<Tag>{dataSet.length > 1 ? `${dataSet[0]}...` : dataSet.length > 0 ? dataSet[0] : ""}</Tag>
</Popover> : ""
}
@ -631,7 +643,6 @@ const CameraHeader = (props) => {
api.current.validate().then((v) => {
setSearch(v);
setQuery({ limit: 10, page: 0 })
searchb.current = { ...v, limit: 10, page: 0 }
});
}}
>
@ -651,6 +662,7 @@ const CameraHeader = (props) => {
onClick={() => {
api.current.reset();
setSearch({});
setQuery({ limit: 10, page: 0 })
}}
>
重置
@ -739,6 +751,7 @@ const CameraHeader = (props) => {
pageSizeOpts={[10, 20, 30, 40]}
onChange={(currentPage, pageSize) => {
setQuery({ limit: pageSize, page: currentPage - 1 });
page.current = currentPage - 1
}}
/>
</div>
@ -793,7 +806,7 @@ const CameraHeader = (props) => {
setAddNvr(false)
setNvrNumber("")
setAxyData("")
dispatch(equipmentWarehouse.getCamera(searchb.current));
equipmentGetCamera()
}}
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 [query, setQuery] = useState({ limit: 10, page: 0 }); //
const [search, setearch] = useState({}); //
const searchb = useRef(search)
const [rowId, setRowId] = useState(); //id
const [reminder, setReminder] = useState(false); //
const api = useRef();
const searchData = useRef(search)
const limits = useRef(); //
const page = useRef(query.page);
const SETUPS = "setups";
const USER = "user" + props.user.id
const nvrRef = useRef(); //
@ -53,8 +55,11 @@ const NvrHeader = (props) => {
equipmentGetNvr();
}, [query, search]);
function equipmentGetNvr () {
dispatch(equipmentWarehouse.getNvr({ ...query, ...search }));
const equipmentGetNvr = () => {
searchData.current = { ...query, ...search }
dispatch(equipmentWarehouse.getNvr(searchData.current)).then((res) => {
limits.current = res.payload.data.data.length
});
}
function equipmentStatus (data) {
@ -93,6 +98,7 @@ const NvrHeader = (props) => {
title: "设备名称",
dataIndex: "name",
render: (_, r, index) => {
console.log(r);
return r.name
},
},
@ -136,7 +142,11 @@ const NvrHeader = (props) => {
position="topRight"
onConfirm={() => {
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"
position="top"
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> : ""
}
@ -451,7 +461,6 @@ const NvrHeader = (props) => {
api.current.validate().then((v) => {
setearch(v);
setQuery({ limit: 10, page: 0 })
searchb.current = { ...v, limit: 10, page: 0 }
});
}}
>
@ -471,6 +480,7 @@ const NvrHeader = (props) => {
onClick={() => {
api.current.reset();
setearch({});
setQuery({ limit: 10, page: 0 })
}}
>
重置
@ -558,6 +568,7 @@ const NvrHeader = (props) => {
pageSizeOpts={[10, 20, 30, 40]}
onChange={(currentPage, pageSize) => {
setQuery({ limit: pageSize, page: currentPage - 1 });
page.current = currentPage - 1
}}
/>
</div>

Loading…
Cancel
Save