Browse Source

Merge branch 'dev_trial' of https://gitea.free-sun.vip/free-sun/FS-IOT into dev_trial

release_0.0.1
yuan_yi 3 years ago
parent
commit
29de0083a4
  1. 2
      code/VideoAccess-VCMP/web/.vscode/settings.json
  2. BIN
      code/VideoAccess-VCMP/web/client/assets/images/background/Reset.png
  3. BIN
      code/VideoAccess-VCMP/web/client/assets/images/background/cascade.png
  4. BIN
      code/VideoAccess-VCMP/web/client/assets/images/background/formchoose.png
  5. BIN
      code/VideoAccess-VCMP/web/client/assets/images/background/ipc.png
  6. BIN
      code/VideoAccess-VCMP/web/client/assets/images/background/nvr.png
  7. BIN
      code/VideoAccess-VCMP/web/client/assets/images/background/test.png
  8. BIN
      code/VideoAccess-VCMP/web/client/assets/images/background/topchoose.png
  9. BIN
      code/VideoAccess-VCMP/web/client/assets/images/background/ysy.png
  10. 202
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cameraModal.jsx
  11. 138
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/setup.jsx
  12. 74
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx
  13. 45
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx
  14. 136
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx

2
code/VideoAccess-VCMP/web/.vscode/settings.json

@ -1,4 +1,4 @@
//
{
"editor.fontSize": 16,
"editor.fontSize": 12,
}

BIN
code/VideoAccess-VCMP/web/client/assets/images/background/Reset.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

BIN
code/VideoAccess-VCMP/web/client/assets/images/background/cascade.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
code/VideoAccess-VCMP/web/client/assets/images/background/formchoose.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

BIN
code/VideoAccess-VCMP/web/client/assets/images/background/ipc.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
code/VideoAccess-VCMP/web/client/assets/images/background/nvr.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
code/VideoAccess-VCMP/web/client/assets/images/background/test.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 B

BIN
code/VideoAccess-VCMP/web/client/assets/images/background/topchoose.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
code/VideoAccess-VCMP/web/client/assets/images/background/ysy.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

202
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cameraModal.jsx

@ -0,0 +1,202 @@
import React, { useState ,useRef} from 'react'
import { Modal,Form,Row,Col,Spin,Notification,Button } from '@douyinfe/semi-ui';
import { IconChevronLeft,IconChevronRight } from '@douyinfe/semi-icons';
function nvrModal(props){
const {modalName,visible,close}=props
const form = useRef();
// const [visible, setVisible] = useState(false);//
const [isloading,setloading] = useState(false);//loading
const [loadingTip,setloadingTip] = useState('获取中...请稍后...');//loading tip
const [step,setstep] = useState(0)//
const [okText,setokText] = useState('测试校验')//oktext
const [cancelText,setcancelText] = useState('取消')//text
const opts ={//
title:'Hi',
content:'添加成功',
duration:3
}
const [clickNum,setclickNum] = useState(1);//
const cameraList=[//
{
id:1,
img:'/assets/images/background/ysy.png',
title:'萤石云平台摄像头',
text:'通过萤石云平台rtmp地址配置完成推流的平台摄像头。'
},{
id:2,
img:'/assets/images/background/nvr.png',
title:'NVR摄像头',
text:'通过连接NVR(网络硬盘录像机)进行视频流推送的摄像头'
},{
id:3,
img:'/assets/images/background/ipc.png',
title:'IPC网络摄像头',
text:'通过网络与监控设备直连完成视频流推送的摄像头设备'
},{
id:4,
img:'/assets/images/background/cascade.png',
title:'级联摄像头',
text:'通过GB/T28181协议级联的平台摄像头,常用于平台对接推送'
},
]
const [showcameraList,setcameraList]=useState(cameraList.slice(0,3));
function handleOk() {//
if(step==0){
form.current.validate()
.then(values=>{//
setloading(true);
setTimeout(() => {
setloadingTip('...接受成功')
setTimeout(()=>{
setloadingTip('已完成')
setTimeout(() => {
setstep(1);
setokText('确认');
setcancelText('上一步');
setloading(false);
}, 2000);
},2000)
}, 2000);
})
.catch(errors=>{//
console.log('errors',errors);
})
}
else{
Notification.success(opts)
// setVisible(false);
close();
}
}
function handleAfterClose(){//
setstep(0);
setokText('测试校验');
setcancelText('取消');
}
function handleCancel() {//
if(step==0){
// setVisible(false);
close();
}
else{
setstep(0);
setokText('测试校验');
setcancelText('取消');
}
}
function handleLocation(){//
console.log('handleLocationhandleLocation');
}
function handleChoose(id){//
setclickNum(id);
}
function turnLift(){
setcameraList(cameraList.slice(0,3))
}
function turnRight(){
setcameraList(cameraList.slice(1,4))
}
return (
<>
{/* <div onClick={showDialog}>{modalName=='add'?'添加NVR':'修改'}</div> */}
<Modal
title={modalName=='add'?'添加摄像头':'修改摄像头'}
okText={okText}
cancelText={cancelText} //
visible={visible}
onOk={handleOk}
width={921}
afterClose={handleAfterClose}
onCancel={handleCancel}
>
<Spin tip={loadingTip} spinning={isloading}>
<div style={{marginLeft:'-24px',marginRight:'-24px',marginTop:8}}>
<div style={{marginLeft:29,color:'#1859C1',fontSize:14,fontWeight:500}}>接入类型</div>
<div style={{marginTop:5,display:'flex',alignItems:'center',justifyContent:'space-between'}}>
<IconChevronLeft
style={{color:'rgba(0, 0, 0, 0.45)',fontSize:16,marginLeft:29,cursor: "pointer",}}
onClick={turnLift}/>
<div
style={{display:'flex',alignItems:'center',height:146}}>
{showcameraList.map((item,index)=>(
<div
key={item.id}
style={{
width:266,
height:146,
marginRight:12,
border:clickNum===item.id?'1px solid #1859C1':'1px solid #F9F9F9',
borderRadius:3,
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
cursor: "pointer",
position: 'relative'}}
onClick={()=>handleChoose(item.id)}>
<div
style={{marginTop:5,
height:65,
width:116,
display: 'flex',
justifyContent: 'center',
alignItems: 'center'}}>
<img
src={item.img}
alt="设置"
/>
</div>
<div style={{marginTop:2,fontSize:14,color:'rgba(0, 0, 0, 0.85)',}}>{item.title}</div>
<div style={{width:210,height:34,marginTop:9,fontSize:12,color:'rgba(0, 0, 0, 0.45)',textAlign:'center'}}>{item.text}</div>
{clickNum===item.id?<div style={{ position: 'absolute', top: '-3px', right: '-5px'}}>
<img src="/assets/images/background/topchoose.png" alt="1" />
</div>:''}
</div>
))}
</div>
<IconChevronRight
style={{color:'rgba(0, 0, 0, 0.45)',fontSize:16,marginRight:18,cursor: "pointer",}}
onClick={turnRight}/>
</div>
</div>
<div style={{marginLeft:'-24px',marginRight:'-24px',marginTop:48,display:'flex',alignItems: 'center',justifyContent: 'space-between'}}>
<div style={{marginLeft:29,color:'#1859C1',fontSize:14,fontWeight:500}}>配置属性</div>
<div style={{display:'flex',marginRight:43,}}>
<div style={{
height:30,
width:64,
border:'1px solid #D9D9D9',
borderRadius: '3px',
color:'rgba(0, 0, 0, 0.65)',
display:'flex',
justifyContent: 'center',
alignItems: 'center',
cursor: "pointer",
marginRight:16
}}>
<img src="/assets/images/background/Reset.png" alt="1" style={{marginRight:4}}/>
重置
</div>
<div style={{
height:30,
width:64,
border:'1px solid #1859C1',
borderRadius: '3px',
color:'#1859C1',
display:'flex',
justifyContent: 'center',
alignItems: 'center',
cursor: "pointer",
}}>
<img src="/assets/images/background/test.png" alt="1" style={{marginRight:4}} />
测试
</div>
</div>
</div>
</Spin>
</Modal>
</>
);
}
export default nvrModal

138
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/setup.jsx

@ -8,65 +8,117 @@ import {
} from "@douyinfe/semi-ui";
function Setup(props) {
const { dispatch, actions, user, loading, visible, close, editData } = props;
const { dispatch, actions, user, loading, visible, close, SETUPS } = props;
const [checkeds, setCheckeds] = useState([]);
const [check, setCheck] = useState([]);
const checkboxcss = { width: "21%", height: 16, marginBottom: "20px" };
useEffect(() => {
//
const ISgetItem = localStorage.getItem(SETUPS);
setCheck(ISgetItem ? JSON.parse(ISgetItem):[]);
}, []);
return (
<Modal
title="表格属性设置"
visible={visible}
style={{ width: 580 }}
onOk={() => {
localStorage.setItem(SETUPS, JSON.stringify(checkeds));
close();
}}
onCancel={() => {
close();
}}
>
<div
style={{
width: 529,
height: 121,
border: "1px solid #EAEAEA",
padding: "0px 5px",
borderRadius: 4,
<CheckboxGroup
style={{ width: "100%", fontSize: 14 }}
key="primary1"
direction="horizontal"
defaultValue={check}
aria-label="表格属性设置"
onChange={(checked) => {
setCheckeds(checked);
}}
>
<div style={{ borderBottom: "1px solid #EAEAEA", fontSize: 14,marginLeft:"10px",padding: "8px 0px",}}>
设备信息
</div>
<CheckboxGroup
options={[
{ label: "设备厂家", value: "a" },
{ label: "添加账号", value: "b" },
{ label: "通道数", value: "c" },
{ label: "端口", value: "d" },
{ label: "设备状态", value: "e" },
{ label: "创建时间", value: "f" },
]}
style={{ width: "100%",fontSize: 14 }}
direction="horizontal"
defaultValue={["hotsoon"]}
// name={style}
onChange={(checked) => {
console.log(checked);
<div
style={{
width: 529,
height: 121,
border: "1px solid #EAEAEA",
padding: "0px 5px",
borderRadius: 4,
marginBottom: "20px",
}}
/>
</div>
<div style={{ width: 529, height: 92 ,borderRadius: 4,border: "1px solid #EAEAEA",}}>
<div>项目信息</div>
<CheckboxGroup
options={[
{ label: "项目名称", value: "g" },
{ label: "things名称", value: "h" },
{ label: "things数量", value: "i" },
]}
style={{ width: "100%", }}
direction="horizontal"
defaultValue={["hotsoon"]}
onChange={(checked) => {
console.log(checked);
>
<div
style={{
borderBottom: "1px solid #EAEAEA",
marginLeft: "10px",
padding: "8px 0px",
}}
>
设备信息
</div>
<div style={{ padding: "15px 30px" }}>
<Checkbox value="a" style={checkboxcss}>
设备厂家
</Checkbox>
<Checkbox value="b" style={checkboxcss}>
添加账号
</Checkbox>
<Checkbox value="c" style={checkboxcss}>
通道数
</Checkbox>
<Checkbox value="d" style={checkboxcss}>
端口
</Checkbox>
<Checkbox value="e" style={checkboxcss}>
设备状态
</Checkbox>
<Checkbox value="f" style={checkboxcss}>
创建时间
</Checkbox>
</div>
</div>
<div
style={{
width: 529,
height: 92,
border: "1px solid #EAEAEA",
padding: "0px 5px",
borderRadius: 4,
}}
/>
</div>
>
<div
style={{
borderBottom: "1px solid #EAEAEA",
marginLeft: "10px",
padding: "8px 0px",
}}
>
项目信息
</div>
<div style={{ padding: "15px 30px" }}>
<Checkbox value="g" style={checkboxcss}>
项目名称
</Checkbox>
<Checkbox value="h" style={checkboxcss}>
things名称
</Checkbox>
<Checkbox value="i" style={checkboxcss}>
things数量
</Checkbox>
</div>
</div>
</CheckboxGroup>
</Modal>
);
}

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

@ -0,0 +1,74 @@
import React, { useState, useEffect } from "react";
import { SideSheet, Tabs, TabPane } from "@douyinfe/semi-ui";
function SideSheets(props) {
const { dispatch, actions, user, loading, visible, close, SETUPS } = props;
const [checkeds, setCheckeds] = useState([]);
const [check, setCheck] = useState([]);
const list = [
{ name: "1111", a: "a", b: "B", c: "C", d: "C" },
{ name: "2222", a: "a", b: "B", c: "C", d: "C" },
{ name: "3333", a: "a", b: "B", c: "C", d: "C" },
{ name: "4444", a: "a", b: "B", c: "C", d: "C" },
];
const styles = {
width: 180,
textAlign: "center",
background: "#FFFFFF",
padding: "12px 17px",
margin: "30px 0 0 10px",
lineHeight: "20px",
};
useEffect(() => {}, []);
return (
<SideSheet
visible={visible}
title="智慧设备NVR"
style={{ background: "#F9FBFF" }}
size="large"
onCancel={() => {
close();
}}
>
<Tabs type="line">
<TabPane tab="项目信息" itemKey="1">
{list.map((item) => {
return (
<div
key={item.name}
style={{
display: "inline-block",
width: 200,
margin: "12px 8px",
}}
>
<div
style={{
lineHeight: "32px",
background: "#1859C1",
borderRadius: 3,
textAlign: "center",
}}
>
{item.name}
</div>
<div style={styles}>{item.a}</div>
<div style={styles}>{item.b}</div>
<div style={styles}>{item.c}</div>
<div style={styles}>{item.d}</div>
</div>
);
})}
</TabPane>
<TabPane tab="设备信息" itemKey="2">
快速起步
</TabPane>
</Tabs>
</SideSheet>
);
}
export default SideSheets;

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

@ -2,57 +2,72 @@ import React, { useState, useEffect } from "react";
import { connect } from "react-redux";
import { Button, Form, Input, Row, Table } from "@douyinfe/semi-ui";
import "../style.less";
import CameraModal from "../components/cameraModal";
const CameraHeader = (props) => {
const [cameraModal,setCameraModal] = useState(false)
const [modalName,setModalName] = useState('')
return (
<>
<div style={{ position: "" }}>
<video
id="nvrBanner"
id="cameraBanner"
autoPlay
loop
muted
style={{ width: "100%", objectFit: "cover", height: 171 }}
src="/assets/video/nvr_banner.mp4"
src="/assets/video/camera_banner.mp4"
type="video/mp4"
/>
<div style={{ position: "absolute", top: 12 }}>
<div
style={{
fontSize: 22 + "px",
paddingTop: 15 + "px",
marginLeft: 21 + "px",
fontSize: 22,
paddingTop: 15,
marginLeft: 21,
}}
>
摄像头管理
</div>
<div
style={{
fontSize: 14 + "px",
paddingTop: 18 + "px",
marginLeft: 20 + "px",
fontSize: 14,
paddingTop: 18,
marginLeft: 20,
}}
>
NVR网络硬盘录像机设备节点的管理
监控摄像设备设备添加修改删除的硬件管理页面
</div>
<div
style={{
fontSize: 14 + "px",
marginTop: 28 + "px",
marginLeft: 21 + "px",
width: 89 + "px",
height: 32 + "px",
fontSize: 14,
marginTop: 28,
marginLeft: 21,
width: 89,
height: 32,
lineHeight: 32 + "px",
textAlign: "center",
backgroundColor: "#D9EAFF",
color: "#1859C1",
cursor: "pointer",
}}
onClick={() => {
setModalName('add')
setCameraModal(true);
}}
>
{/* <NvrModal modalName="add" /> */}
添加摄像头
</div>
</div>
</div>
{cameraModal?
<CameraModal
visible={true}
close={() => {
setCameraModal(false);
// setEditData(null)
}}
modalName={modalName} />:''}
</>
);
};

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

@ -4,20 +4,19 @@ import { Button, Form, Input, Row, Table } from "@douyinfe/semi-ui";
import "../style.less";
import NvrModal from "../components/nvrModal";
import Setup from "../components/setup";
import SideSheets from "../components/sideSheet";
const NvrHeader = (props) => {
const { dispatch, actions, user, loading } = props;
const [setup, setSetup] = useState(false);
const [sideSheet, setSideSheet] = useState(false);
const [setupp, setSetupp] = useState([]);
const SETUPS = "setups";
const screen = {
width: 193,
marginRight: 20,
marginBottom: 16,
color: "rgba(0, 0, 0, 0.65)",
};
const columns = [
{
title: "序号",
render: (text, record, index) => {
return index + 1;
},
@ -36,29 +35,19 @@ const NvrHeader = (props) => {
width: "10px",
height: "10px",
borderRadius: "50%",
display: "inline-block",marginRight:"10px"
}} />
display: "inline-block",
marginRight: "10px",
}}
/>
{record.name}
</div>
);
},
},
{
title: "设备厂家",
dataIndex: "size",
},
{
title: "SIP地址",
dataIndex: "owner",
},
{
title: "端口号",
dataIndex: "updateTime",
},
{
title: "通道数",
dataIndex: "nameIconSrc",
},
{
title: "操作",
width: "20%",
@ -67,14 +56,96 @@ const NvrHeader = (props) => {
// console.log(row);
return (
<>
<Button theme="borderless"><NvrModal nvrData={row} modalName="revise" /></Button>
<Button theme="borderless">查看</Button>
<Button theme="borderless">
<NvrModal nvrData={row} modalName="revise" />
</Button>
<Button
theme="borderless"
onClick={() => {
setSideSheet(true);
}}
>
查看
</Button>
<Button theme="borderless">删除</Button>
</>
);
},
},
];
useEffect(() => {
attribute();
}, []);
//
function attribute() {
const arr = localStorage.getItem(SETUPS)
? JSON.parse(localStorage.getItem(SETUPS))
: [];
const column = [
{
title: "设备厂家",
dataIndex: "size",
key: "a",
},
{
title: "添加张账号",
dataIndex: "size",
key: "b",
},
{
title: "通道数",
dataIndex: "size",
key: "c",
},
{
title: "端口",
dataIndex: "size",
key: "d",
},
{
title: "设备状态",
dataIndex: "size",
key: "e",
},
{
title: "创建时间",
dataIndex: "size",
key: "f",
},
{
title: "项目名称",
dataIndex: "size",
key: "g",
},
{
title: "things名称",
dataIndex: "updateTime",
key: "h",
},
{
title: "things数量",
dataIndex: "updateTime",
key: "i",
},
];
for (let i = 0; i < arr.length; i++) {
let colum = column.filter((item) => {
return item.key === arr[i];
});
columns.splice(i + 2, 0, colum[0]);
}
setSetupp(columns);
}
const screen = {
width: 193,
marginRight: 20,
marginBottom: 16,
color: "rgba(0, 0, 0, 0.65)",
};
const data = [
{
key: "1",
@ -295,7 +366,7 @@ const NvrHeader = (props) => {
}}
>
<img
src="../../../../assets/images/background/setup.png"
src="/assets/images/background/setup.png"
alt="设置"
style={{ width: 18, height: 18 }}
/>
@ -314,18 +385,22 @@ const NvrHeader = (props) => {
</div>
</div>
<Table
columns={columns}
columns={setupp}
dataSource={data}
pagination={false}
bordered={false}
empty="暂无数据"
style={{ padding: "0px 20px" }}
style={{
padding: "0px 20px",
}}
/>
{setup ? (
<Setup
visible={true}
SETUPS={SETUPS}
close={() => {
setSetup(false);
attribute();
// setEditData(null)
}}
// reportType={reportType}
@ -334,6 +409,17 @@ const NvrHeader = (props) => {
) : (
""
)}
{sideSheet ? (
<SideSheets
visible={true}
close={() => {
setSideSheet(false);
}}
/>
) : (
[]
)}
</div>
</>
);

Loading…
Cancel
Save