deartibers
2 years ago
18 changed files with 295 additions and 35 deletions
After Width: | Height: | Size: 226 KiB |
After Width: | Height: | Size: 576 B |
@ -0,0 +1,14 @@ |
|||
'use strict'; |
|||
|
|||
import { ApiTable ,basicAction} 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,7 @@ |
|||
'use strict'; |
|||
|
|||
import * as example from './example' |
|||
|
|||
export default { |
|||
...example |
|||
} |
@ -0,0 +1,60 @@ |
|||
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, socket } = props |
|||
|
|||
useEffect(() => { |
|||
// ACTION 示例 |
|||
// dispatch(actions.example.getMembers(user.orgId)) |
|||
}, []) |
|||
|
|||
// websocket 使用测试 |
|||
// useEffect(() => { |
|||
// console.log(socket) |
|||
// if (socket) { |
|||
// socket.on('TEST', function (msg) { |
|||
// console.info(msg); |
|||
// }); |
|||
// return () => { |
|||
// socket.off("TEST"); |
|||
// } |
|||
// } |
|||
|
|||
// }, [socket]) |
|||
|
|||
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, webSocket } = state; |
|||
return { |
|||
// loading: members.isRequesting, |
|||
// user: auth.user, |
|||
// actions: global.actions, |
|||
// members: members.data, |
|||
// socket: webSocket.socket |
|||
}; |
|||
} |
|||
|
|||
export default connect(mapStateToProps)(Example); |
@ -0,0 +1,5 @@ |
|||
'use strict'; |
|||
|
|||
import Example from './example'; |
|||
|
|||
export { Example }; |
@ -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: 'example', |
|||
name: '书写示例', |
|||
reducers: reducers, |
|||
routes: routes, |
|||
actions: actions, |
|||
getNavItem: getNavItem |
|||
}; |
@ -0,0 +1,41 @@ |
|||
import React from 'react'; |
|||
import { IconCode } from '@douyinfe/semi-icons'; |
|||
|
|||
export function getNavItem (user, dispatch) { |
|||
return ( |
|||
[ |
|||
{ |
|||
itemKey: 'example1', |
|||
text: '举个栗子1', |
|||
icon: <IconCode />, |
|||
items: [ |
|||
{ |
|||
itemKey: 'e3', |
|||
text: '举个棒子3', |
|||
icon: <IconCode />, |
|||
items: [{ |
|||
itemKey: 'c3', to: '/example/e3/c3', text: '举个锤子3' |
|||
}] |
|||
}, { |
|||
itemKey: 'e4', |
|||
text: '举个棒子4', |
|||
icon: <IconCode />, |
|||
items: [{ |
|||
itemKey: 'c4', to: '/example/e4/c4', text: '举个锤子4' |
|||
}] |
|||
}, |
|||
] |
|||
}, |
|||
] |
|||
// ,[ |
|||
// { |
|||
// itemKey: 'equipmentWarehouse', text: '设备仓库', icon:<iconpark-icon style={{width:20,height:20}} name="she-1"></iconpark-icon>, |
|||
// items: [ |
|||
// { itemKey: 'nvr', to: '/equipmentWarehouse/nvr', text: 'NVR管理' }, |
|||
// { itemKey: 'camera', to: '/equipmentWarehouse/camera', text: '摄像头管理' }, |
|||
// { itemKey: 'recycle', to: '/equipmentWarehouse/recycle', text: '回收站' }, |
|||
// ] |
|||
// }, |
|||
// ] |
|||
); |
|||
} |
@ -0,0 +1,5 @@ |
|||
'use strict'; |
|||
|
|||
export default { |
|||
|
|||
} |
@ -0,0 +1,35 @@ |
|||
'use strict'; |
|||
import { Example, } from './containers'; |
|||
|
|||
export default [{ |
|||
type: 'inner', |
|||
route: { |
|||
path: '/example1', |
|||
key: 'example1', |
|||
breadcrumb: '栗子1', |
|||
// 不设置 component 则面包屑禁止跳转
|
|||
childRoutes: [{ |
|||
path: '/e3', |
|||
key: 'e3', |
|||
// component: Example,
|
|||
breadcrumb: '棒子3', |
|||
childRoutes:[{ |
|||
path: '/c3', |
|||
key: 'c3', |
|||
component: Example, |
|||
breadcrumb: '锤子3', |
|||
}] |
|||
},{ |
|||
path: '/e4', |
|||
key: 'e4', |
|||
// component: Example,
|
|||
breadcrumb: '棒子4', |
|||
childRoutes:[{ |
|||
path: '/c4', |
|||
key: 'c4', |
|||
component: Example, |
|||
breadcrumb: '锤子4', |
|||
}] |
|||
}] |
|||
} |
|||
}]; |
@ -0,0 +1,7 @@ |
|||
#example { |
|||
box-shadow: 3px 3px 2px black; |
|||
} |
|||
|
|||
#example:hover { |
|||
color: yellowgreen; |
|||
} |
Loading…
Reference in new issue