Browse Source

创建设备仓库文件

release_0.0.1
deartibers 3 years ago
parent
commit
26390a2a81
  1. 3
      code/VideoAccess-VCMP/web/client/src/app.jsx
  2. 7
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/index.js
  3. 15
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js
  4. 5
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/index.js
  5. 45
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx
  6. 15
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/index.js
  7. 5
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/reducers/index.js
  8. 23
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/routes.js
  9. 0
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/style.less
  10. 16
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/warehouse-item.jsx

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

@ -4,6 +4,7 @@ import React, { useEffect } from 'react';
import Layout from './layout'; import Layout from './layout';
import Auth from './sections/auth'; import Auth from './sections/auth';
import Example from './sections/example'; import Example from './sections/example';
import EquipmentWarehouse from './sections/equipmentWarehouse';
const App = props => { const App = props => {
const { projectName } = props const { projectName } = props
@ -15,7 +16,7 @@ const App = props => {
return ( return (
<Layout <Layout
title={projectName} title={projectName}
sections={[Auth, Example]} sections={[Auth, Example,EquipmentWarehouse]}
/> />
) )
} }

7
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/index.js

@ -0,0 +1,7 @@
'use strict';
import * as nvr from './nvr'
export default {
...nvr
}

15
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js

@ -0,0 +1,15 @@
'use strict';
import { basicAction } from '@peace/utils'
import { ApiTable } from '$utils'
export function getMembers (orgId) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
actionType: 'GET_MEMBERS',
url: `${ApiTable.getEnterprisesMembers.replace('{enterpriseId}', orgId)}`,
msg: { error: '获取用户列表失败' },
reducer: { name: 'members' }
});
}

5
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/index.js

@ -0,0 +1,5 @@
'use strict';
import Nvr from './nvr';
export { Nvr };

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

@ -0,0 +1,45 @@
import React, { useEffect } from 'react';
import { connect } from 'react-redux';
import { Spin, Card } from '@douyinfe/semi-ui';
import '../style.less'
const { Meta } = Card;
const Example = (props) => {
const { dispatch, actions, user, loading } = props
useEffect(() => {
// ACTION
dispatch(actions.example.getMembers(user.orgId))
}, [])
return (
<Spin tip="biubiubiu~" spinning={loading}>
<div id='example'>
<p>STYLE EXAMPLE</p>
</div>
<Card
style={{ maxWidth: 300 }}
cover={
<img
alt="example"
src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/root-web-sites/card-cover-docs-demo2.jpeg"
/>
}
>
<Meta title="组件示例" />
</Card>
</Spin>
)
}
function mapStateToProps (state) {
const { auth, global, members } = state;
return {
loading: members.isRequesting,
user: auth.user,
actions: global.actions,
members: members.data
};
}
export default connect(mapStateToProps)(Example);

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

@ -0,0 +1,15 @@
'use strict';
import reducers from './reducers';
import routes from './routes';
import actions from './actions';
import { getNavItem } from './warehouse-item';
export default {
key: 'equipmentWarehouse',
name: '书写示例',
reducers: reducers,
routes: routes,
actions: actions,
getNavItem: getNavItem
};

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

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

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

@ -0,0 +1,23 @@
'use strict';
import { Nvr, } from './containers';
export default [{
type: 'inner',
route: {
path: '/equipmentWarehouse',
key: 'equipmentWarehouse',
breadcrumb: '设备仓库',
// 不设置 component 则面包屑禁止跳转
childRoutes: [{
path: '/nvr',
key: 'nvr',
component: Nvr,
breadcrumb: 'NVR管理',
},{
path: '/camera',
key: 'camera',
component: Nvr,
breadcrumb: '摄像头管理',
}]
}
}];

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

16
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/warehouse-item.jsx

@ -0,0 +1,16 @@
import React from 'react';
import { IconCode } from '@douyinfe/semi-icons';
export function getNavItem (user, dispatch) {
return (
[
{
itemKey: 'equipmentWarehouse', text: '设备仓库', icon: <IconCode />,
items: [
{ itemKey: 'nvr', to: '/equipmentWarehouse/nvr', text: 'NVR管理' },
{ itemKey: 'camera', to: '/equipmentWarehouse/camera', text: '摄像头管理' },
]
},
]
);
}
Loading…
Cancel
Save