Browse Source

NVR添加成功后弹框跳转和不再提醒功能(根据用户判断是否提醒) 100%

所有项目信息的去重重新展现问题 100%
release_0.0.2
wenlele 2 years ago
parent
commit
03fc11ead2
  1. BIN
      code/VideoAccess-VCMP/web/client/assets/images/background/building.jpg
  2. BIN
      code/VideoAccess-VCMP/web/client/assets/images/background/building.png
  3. 21
      code/VideoAccess-VCMP/web/client/src/app.jsx
  4. 6
      code/VideoAccess-VCMP/web/client/src/components/coming.jsx
  5. 17
      code/VideoAccess-VCMP/web/client/src/components/reminderBox.jsx
  6. 5
      code/VideoAccess-VCMP/web/client/src/sections/aiAbility/actions/index.js
  7. 20
      code/VideoAccess-VCMP/web/client/src/sections/aiAbility/containers/consumption.jsx
  8. 20
      code/VideoAccess-VCMP/web/client/src/sections/aiAbility/containers/hiAI.jsx
  9. 6
      code/VideoAccess-VCMP/web/client/src/sections/aiAbility/containers/index.js
  10. 15
      code/VideoAccess-VCMP/web/client/src/sections/aiAbility/index.js
  11. 16
      code/VideoAccess-VCMP/web/client/src/sections/aiAbility/nav-item.jsx
  12. 5
      code/VideoAccess-VCMP/web/client/src/sections/aiAbility/reducers/index.js
  13. 23
      code/VideoAccess-VCMP/web/client/src/sections/aiAbility/routes.js
  14. 0
      code/VideoAccess-VCMP/web/client/src/sections/aiAbility/style.less
  15. 6
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/setup.jsx
  16. 31
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx
  17. 47
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx
  18. 2
      code/VideoAccess-VCMP/web/client/src/sections/monitor/index.js
  19. 2
      code/VideoAccess-VCMP/web/client/src/sections/monitor/nav-item.jsx
  20. 2
      code/VideoAccess-VCMP/web/client/src/sections/monitor/routes.js

BIN
code/VideoAccess-VCMP/web/client/assets/images/background/building.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

21
code/VideoAccess-VCMP/web/client/src/app.jsx

@ -6,20 +6,21 @@ import Auth from './sections/auth';
import Example from './sections/example';
import EquipmentWarehouse from './sections/equipmentWarehouse';
import Monitor from './sections/monitor'
// import AiAbility from './sections/aiAbility';
const App = props => {
const { projectName } = props
const { projectName } = props
useEffect(() => {
document.title = projectName;
}, [])
useEffect(() => {
document.title = projectName;
}, [])
return (
<Layout
title={projectName}
sections={[Auth, EquipmentWarehouse, Monitor]}
/>
)
return (
<Layout
title={projectName}
sections={[Auth, Monitor, EquipmentWarehouse,]}
/>
)
}
export default App;

6
code/VideoAccess-VCMP/web/client/src/components/coming.jsx

@ -8,10 +8,10 @@ const Coming = () => {
position: 'absolute',
}}>
<img
src='/assets/images/background/building.jpg'
src='/assets/images/background/building.png'
style={{
maxHeight: 228,
maxWidth: 645,
maxHeight: 370,
maxWidth: 379,
width: '80%'
}}
/>

17
code/VideoAccess-VCMP/web/client/src/components/reminderBox.jsx

@ -1,7 +1,7 @@
import { Button, Checkbox, Modal } from "@douyinfe/semi-ui";
import React from "react";
const ReminderBox = ({ title, wait, toadd, visible, onOk, close }) => {
const ReminderBox = ({ title, wait, toadd, visible, onOk, close, USER}) => {
return (
<Modal
title={
@ -9,6 +9,9 @@ const ReminderBox = ({ title, wait, toadd, visible, onOk, close }) => {
{title}
</div>
}
onCancel={() => {
close()
}}
icon={
<img
src="../../assets/images/logo/figure.png"
@ -24,17 +27,19 @@ const ReminderBox = ({ title, wait, toadd, visible, onOk, close }) => {
}}
>
<Checkbox
onChange={(checked) => console.log(checked)}
onChange={(checked) =>{
console.log(checked)
localStorage.setItem( USER, JSON.stringify(checked.target.checked)
)
}}
aria-label="Checkbox 示例"
style={{ width: 100 }}
>
不在提醒
</Checkbox>
<div>
<Button>{wait}</Button>
<Button theme="solid" onClick={() => {
onOk()
}}>{toadd}</Button>
<Button onClick={() => close()}>{wait}</Button>
<Button theme="solid" onClick={() => onOk()}>{toadd}</Button>
</div>
</div>
}

5
code/VideoAccess-VCMP/web/client/src/sections/aiAbility/actions/index.js

@ -0,0 +1,5 @@
'use strict';
export default {
}

20
code/VideoAccess-VCMP/web/client/src/sections/aiAbility/containers/consumption.jsx

@ -0,0 +1,20 @@
import React, { useEffect } from 'react';
import { connect } from 'react-redux';
import { Coming } from '$components'
import '../style.less'
const Consumption = (props) => {
return (
<Coming />
)
}
function mapStateToProps (state) {
const { auth } = state;
return {
user: auth.user,
};
}
export default connect(mapStateToProps)(Consumption);

20
code/VideoAccess-VCMP/web/client/src/sections/aiAbility/containers/hiAI.jsx

@ -0,0 +1,20 @@
import React, { useEffect } from 'react';
import { connect } from 'react-redux';
import { Coming } from '$components'
import '../style.less'
const HiAl = (props) => {
return (
<Coming />
)
}
function mapStateToProps (state) {
const { auth } = state;
return {
user: auth.user,
};
}
export default connect(mapStateToProps)(HiAl);

6
code/VideoAccess-VCMP/web/client/src/sections/aiAbility/containers/index.js

@ -0,0 +1,6 @@
'use strict';
import HiAl from './hiAI';
import Consumption from './consumption';
export { HiAl ,Consumption};

15
code/VideoAccess-VCMP/web/client/src/sections/aiAbility/index.js

@ -0,0 +1,15 @@
'use strict';
import reducers from './reducers';
import routes from './routes';
import actions from './actions';
import { getNavItem } from './nav-item';
export default {
key: 'aiAbilityCenter',
name: '视频AI能力',
reducers: reducers,
routes: routes,
actions: actions,
getNavItem: getNavItem
};

16
code/VideoAccess-VCMP/web/client/src/sections/aiAbility/nav-item.jsx

@ -0,0 +1,16 @@
import React from 'react';
import { IconCode } from '@douyinfe/semi-icons';
export function getNavItem (user, dispatch) {
return (
[
{
itemKey: 'aiAbility', text: '视频AI能力', to: '/aiAbility', icon: <IconCode />,
items: [
{ itemKey: 'hiAI', to: '/aiAbility/hiAI', text: 'hi AI' },
{ itemKey: 'consumption', to: '/aiAbility/consumption', text: '用量监控' }
],
},
]
);
}

5
code/VideoAccess-VCMP/web/client/src/sections/aiAbility/reducers/index.js

@ -0,0 +1,5 @@
'use strict';
export default {
}

23
code/VideoAccess-VCMP/web/client/src/sections/aiAbility/routes.js

@ -0,0 +1,23 @@
'use strict';
import { HiAI,Consumption } from './containers';
export default [{
type: 'inner',
route: {
path: '/aiAbility',
key: 'aiAbility',
breadcrumb: '视频AI能力',
// 不设置 component 则面包屑禁止跳转
childRoutes: [{
path: '/hiAI',
key: 'hiAI',
component: HiAI,
breadcrumb: 'hi AI',
}, {
path: '/consumption',
key: 'consumption',
component: Consumption,
breadcrumb: '用量监控',
}]
}
}];

0
code/VideoAccess-VCMP/web/client/src/sections/aiAbility/style.less

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

@ -3,16 +3,10 @@ import {
Modal,
CheckboxGroup,
Checkbox,
TabPane,
Tabs,
} from "@douyinfe/semi-ui";
function Setup(props) {
const {
dispatch,
actions,
user,
loading,
visible,
close,
SETUPS,

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

@ -5,8 +5,6 @@ import qs from "qs";
import {
Button,
Form,
Input,
Row,
Table,
Pagination,
Popover,
@ -17,7 +15,6 @@ import {
import { SimpleFileDownButton, VideoPlayModal } from "$components";
import "../style.less";
import CameraModal from "../components/cameraModal";
import NvrModal from "../components/nvrModal";
import Setup from "../components/setup";
import SideSheets from "../components/sideSheet";
import { skeletonScreen } from "../components/skeletonScreen";
@ -398,19 +395,37 @@ const CameraHeader = (props) => {
//station
function station (r, name, data, projects, exhibition) {
let datas = []
if (projects == "projects") {
r.station.map((v) => {
if (v.structure.projects.length > 0) {
v.structure.projects.map((item) => datas.push(item[name]))
}
})
} else {
r.station.map((v) => {
if (exhibition == "structure") {
datas.push(v.structure.name)
}else{
if(exhibition == "point"){
datas.push(v.name)
}else{
datas.push(v.factor.name)
}
}
})
}
let dataSet =[...(new Set(datas))]
return <Popover
key="updateTime"
position="top"
content={
<article style={{ padding: 12 }}>
{projects == "projects" ?
r.station.map((v) => v.structure.projects.length == 0 ? "" : v.structure.projects.map((item, index) => <div key={index}>{item[name]}</div>))
: r.station.map((v, index) => <div key={index}>{exhibition == "structure" ? v.structure.name : exhibition == "point" ? v.name : v.factor.name}</div>)
}
{dataSet.length>0?dataSet.map((v,index)=><div key={index}>{v}</div>):""}
</article>
}
>
<Tag>{projects == "projects" && r.station[0].structure.projects.length > 0 ? r.station[0].structure.projects[0][name] : data}...</Tag>
<Tag>{dataSet.length>0?`${dataSet[0]}...`:""}</Tag>
</Popover>
}

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

@ -1,19 +1,7 @@
import React, { useState, useEffect, useRef } from "react";
import { connect } from "react-redux";
// import { push } from "react-router-redux";
import moment from "moment";
import {
Button,
Form,
Input,
Row,
Table,
Pagination,
Skeleton,
Popconfirm,
Popover,
Tag,
} from "@douyinfe/semi-ui";
import { Button, Form, Table, Pagination, Skeleton, Popconfirm, Popover, Tag, } from "@douyinfe/semi-ui";
import "../style.less";
import { ApiTable } from "$utils";
import NvrModal from "../components/nvrModal";
@ -42,6 +30,7 @@ const NvrHeader = (props) => {
const [reminder, setReminder] = useState(false); //
const api = useRef();
const SETUPS = "setups";
const USER = "user" + props.user.id
const nvrRef = useRef(); //
useEffect(() => {
@ -208,7 +197,7 @@ const NvrHeader = (props) => {
height: 8,
display: "inline-block",
borderRadius: "50%",
backgroundColor: status ?colorStatus(status.online):"",
backgroundColor: status ? colorStatus(status.online) : "",
margin: "0 8px 0 0",
}}
/>
@ -267,19 +256,25 @@ const NvrHeader = (props) => {
//station
function station (r, name, projects) {
let data = []
if (projects == "projects") {
r.station.map((v) => {
if (v.structure.projects.length >0) {
v.structure.projects.map((item) => data.push(item[name]))
}
})
}else{
r.station.map((v, index) => data.push(v.structure[name]))
}
let dataSet =[...(new Set(data))]
return <Popover
key="updateTime"
position="top"
content={
<article style={{ padding: 12 }}>
{projects == "projects" ?
r.station.map((v) => v.structure.projects.length == 0 ? "" : v.structure.projects.map((item, index) => <div key={index}>{item[name]}</div>))
: r.station.map((v, index) => <div key={index}>{v.structure[name]}</div>)
}
</article>
<article style={{ padding: 12 }}>{dataSet.map((v,index)=><div key={index}>{v}</div>)}</article>
}
>
<Tag>{projects == "projects" ? r.station[0].structure.projects[0][name] : r.station[0].structure[name]}...</Tag>
<Tag>{dataSet[0]}...</Tag>
</Popover>
}
@ -342,7 +337,12 @@ const NvrHeader = (props) => {
venderList={venderList}
nvrRef={nvrRef}
close={() => {
setReminder(true)
const remind = localStorage.getItem(USER);
console.log(remind)
if (!remind) {
console.log(1)
setReminder(true)
}
equipmentGetNvr();
}}
/>
@ -607,11 +607,12 @@ const NvrHeader = (props) => {
wait="再等等"
toadd="去添加"
visible={reminder}
USER={USER}
onOk={() => {
history.push({ pathname: '/equipmentWarehouse/camera', query: { addNvr: true, serialNo: nvrRef.current.nvrNumber() } });
setReminder(false)
}}
close={()=>{
close={() => {
setReminder(false)
}}
/>

2
code/VideoAccess-VCMP/web/client/src/sections/monitor/index.js

@ -7,7 +7,7 @@ import { getNavItem } from './nav-item';
export default {
key: 'monitorCenter',
name: '监控中心',
name: '数据监控中心',
reducers: reducers,
routes: routes,
actions: actions,

2
code/VideoAccess-VCMP/web/client/src/sections/monitor/nav-item.jsx

@ -5,7 +5,7 @@ export function getNavItem (user, dispatch) {
return (
[
{
itemKey: 'monitor', text: '监控中心', to: '/monitor', icon: <IconCode />,
itemKey: 'monitor', text: '数据监控中心', to: '/monitor', icon: <IconCode />,
},
]
);

2
code/VideoAccess-VCMP/web/client/src/sections/monitor/routes.js

@ -6,7 +6,7 @@ export default [{
route: {
path: '/monitor',
key: 'monitor',
breadcrumb: '监控中心',
breadcrumb: '数据监控中心',
component: MonitorCenter,
}
}];
Loading…
Cancel
Save