deartibers
3 years ago
10 changed files with 133 additions and 1 deletions
@ -0,0 +1,7 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
import * as nvr from './nvr' |
||||
|
|
||||
|
export default { |
||||
|
...nvr |
||||
|
} |
@ -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' } |
||||
|
}); |
||||
|
} |
@ -0,0 +1,5 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
import Nvr from './nvr'; |
||||
|
|
||||
|
export { Nvr }; |
@ -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); |
@ -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 |
||||
|
}; |
@ -0,0 +1,5 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
export default { |
||||
|
|
||||
|
} |
@ -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,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…
Reference in new issue