13 changed files with 153 additions and 27 deletions
@ -0,0 +1,7 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
import * as search from './search' |
||||
|
|
||||
|
export default { |
||||
|
...search |
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
import { basicAction } from '@peace/utils' |
||||
|
import { ApiTable } from '$utils' |
||||
|
|
||||
|
export function getMembersW(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 Search from './search'; |
||||
|
|
||||
|
export { Search }; |
@ -0,0 +1,31 @@ |
|||||
|
import React, { useEffect } from 'react'; |
||||
|
import { connect } from 'react-redux'; |
||||
|
import { Spin, Card, Input } from 'antd'; |
||||
|
import '../style.less'; |
||||
|
import './style.less'; |
||||
|
|
||||
|
const Search = (props) => { |
||||
|
const { dispatch, actions, user, loading } = props |
||||
|
|
||||
|
useEffect(() => { |
||||
|
// dispatch(actions.search.getMembersW(user.orgId))
|
||||
|
}, []) |
||||
|
|
||||
|
return ( |
||||
|
<div className="parent"> |
||||
|
<Input className="search" type="text" placeholder=" "></Input> |
||||
|
</div> |
||||
|
) |
||||
|
} |
||||
|
|
||||
|
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)(Search); |
@ -0,0 +1,16 @@ |
|||||
|
.search { |
||||
|
width: 200px; |
||||
|
height: 30px; |
||||
|
font: 16px arial,sans-serif; |
||||
|
// margin:auto; |
||||
|
} |
||||
|
.search:hover, .search:focus { |
||||
|
outline: none; |
||||
|
box-shadow: 0 3px 8px 0 rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.08); |
||||
|
} |
||||
|
|
||||
|
.parent{ |
||||
|
display:flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
} |
@ -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: 'search', |
||||
|
name: '搜索', |
||||
|
reducers: reducers, |
||||
|
routes: routes, |
||||
|
actions: actions, |
||||
|
getNavItem: getNavItem |
||||
|
}; |
@ -0,0 +1,16 @@ |
|||||
|
import React from 'react'; |
||||
|
import { Link } from 'react-router-dom'; |
||||
|
import { Menu } from 'antd'; |
||||
|
import { SettingOutlined } from '@ant-design/icons'; |
||||
|
|
||||
|
const SubMenu = Menu.SubMenu; |
||||
|
|
||||
|
export function getNavItem(user, dispatch) { |
||||
|
return ( |
||||
|
<SubMenu key="search" icon={<SettingOutlined />} title={'举个栗子'}> |
||||
|
<Menu.Item key="e1"> |
||||
|
<Link to="/search/e1">举个棒子</Link> |
||||
|
</Menu.Item> |
||||
|
</SubMenu> |
||||
|
); |
||||
|
} |
@ -0,0 +1,5 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
export default { |
||||
|
|
||||
|
} |
@ -0,0 +1,12 @@ |
|||||
|
'use strict'; |
||||
|
import { Search, } from './containers'; |
||||
|
|
||||
|
export default [{ |
||||
|
type: 'inner', |
||||
|
route: { |
||||
|
path: '/search', |
||||
|
key: 'search', |
||||
|
breadcrumb: '搜索引擎', |
||||
|
component: Search |
||||
|
} |
||||
|
}]; |
@ -0,0 +1,3 @@ |
|||||
|
#example:hover { |
||||
|
font-size: larger; |
||||
|
} |
Loading…
Reference in new issue