From cb6d752abce3641d78afaf193afe8c576869f613 Mon Sep 17 00:00:00 2001 From: wenlele Date: Wed, 6 Jul 2022 16:32:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/client/src/components/textScroll.jsx | 1 + .../src/components/videoPlayer/videoPlay.jsx | 1 + .../components/videoPlayer/voiceHeader.jsx | 2 +- .../equipmentWarehouse/actions/camera.js | 2 +- .../components/nvrCamera.jsx | 2 +- .../components/sideSheet.jsx | 13 +++-- .../equipmentWarehouse/containers/camera.jsx | 49 ++++++++++++------- .../equipmentWarehouse/containers/nvr.jsx | 25 +++++++--- 8 files changed, 64 insertions(+), 31 deletions(-) diff --git a/code/VideoAccess-VCMP/web/client/src/components/textScroll.jsx b/code/VideoAccess-VCMP/web/client/src/components/textScroll.jsx index 6f3c216..e8e017e 100644 --- a/code/VideoAccess-VCMP/web/client/src/components/textScroll.jsx +++ b/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) { diff --git a/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx b/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx index c7ae998..89d4c4e 100644 --- a/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx +++ b/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx @@ -316,6 +316,7 @@ const VideoPlay = ({ null : (histroyBegain || moment()) } setProcessDisX={setProcessDisX} + content={videoObj.content} /> {/* 视频内容 */} { diff --git a/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/voiceHeader.jsx b/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/voiceHeader.jsx index e40f470..db1ba54 100644 --- a/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/voiceHeader.jsx +++ b/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(' ') diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js index 701b12b..fa0beda 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js +++ b/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: {}, }); } diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrCamera.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrCamera.jsx index be6830f..004d111 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrCamera.jsx +++ b/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()} > ) : ( - item.name.length > 8 ? `${item.name.substr(0, 8)}...` : item.name + item.name.length > 12 ? `${item.name.substr(0,12)}...` : item.name )}
{ 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); }} > diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx index 3f4eb0a..c9ea168 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx +++ b/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); //nvr页面传递参数打开NVR摄像头添加弹框 @@ -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 (
@@ -793,7 +806,7 @@ const CameraHeader = (props) => { setAddNvr(false) setNvrNumber("") setAxyData("") - dispatch(equipmentWarehouse.getCamera(searchb.current)); + equipmentGetCamera() }} modalName={modalName} /> diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx index d61a438..a84b557 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx +++ b/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={ -
{dataSet.map((v, index) =>
{v}
)}
+ dataSet.length > 1 ?
{dataSet.map((v, index) =>
{v}
)}
: "" } > - {dataSet[0]}... + {dataSet.length > 1 ? `${dataSet[0]}...` : dataSet.length > 0 ? dataSet[0] : ""} : "" } @@ -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 }} />