diff --git a/code/web/client/src/app.js b/code/web/client/src/app.js index a4fcd60..d5d17ca 100644 --- a/code/web/client/src/app.js +++ b/code/web/client/src/app.js @@ -3,7 +3,7 @@ import React, { useEffect } from 'react'; import Layout from './layout'; import Auth from './sections/auth'; -import Example from './sections/example'; +import Search from './sections/search'; const App = props => { const { projectName } = props @@ -15,7 +15,7 @@ const App = props => { return ( ) } diff --git a/code/web/client/src/layout/containers/layout/index.js b/code/web/client/src/layout/containers/layout/index.js index 568de35..42ebd88 100644 --- a/code/web/client/src/layout/containers/layout/index.js +++ b/code/web/client/src/layout/containers/layout/index.js @@ -24,7 +24,7 @@ NProgress.configure({ ` }); -const headerHeight = 64 +const headerHeight = 32 const footerHeight = 0 let scrollbar @@ -32,7 +32,7 @@ const LayoutContainer = props => { const { dispatch, msg, user, copyright, children, sections, clientWidth, clientHeight, location, match, routes, history } = props const [themeName, setThemeName] = useState(localStorage.getItem("theme-name") || 'light') - const [collapsed, setCollapsed] = useState(false) + const [collapsed, setCollapsed] = useState(true) NProgress.start(); @@ -77,9 +77,9 @@ const LayoutContainer = props => { let contentStyle = { position: 'relative', - margin: '12px 12px 0px', - padding: '8px', - height: clientHeight - 16 + 68, + margin: '1px 1px 0px', + padding: '1px', + height: clientHeight + 68, } if (themeName == 'light') { contentStyle.background = '#fff'; @@ -91,10 +91,10 @@ const LayoutContainer = props => {
{ - setCollapsed(!collapsed); - resize(!collapsed) - }} + // toggleCollapsed={() => { + // setCollapsed(!collapsed); + // resize(!collapsed) + // }} changeTheme={(themeName) => { setThemeName(themeName) }} @@ -103,29 +103,30 @@ const LayoutContainer = props => { /> - - {/*
+ {/*
LOGO
*/} - - + + + ) : null + }
-
- -
-
+
{children}
diff --git a/code/web/client/src/sections/auth/containers/login.js b/code/web/client/src/sections/auth/containers/login.js index 764f6f9..bfcc85c 100644 --- a/code/web/client/src/sections/auth/containers/login.js +++ b/code/web/client/src/sections/auth/containers/login.js @@ -27,7 +27,7 @@ const Login = props => { useEffect(() => { if (user && user.authorized) { - dispatch(push('/workflow/application')); + dispatch(push('/search')); } }, [user]) diff --git a/code/web/client/src/sections/search/actions/index.js b/code/web/client/src/sections/search/actions/index.js new file mode 100644 index 0000000..81ae81c --- /dev/null +++ b/code/web/client/src/sections/search/actions/index.js @@ -0,0 +1,7 @@ +'use strict'; + +import * as search from './search' + +export default { + ...search +} \ No newline at end of file diff --git a/code/web/client/src/sections/search/actions/search.js b/code/web/client/src/sections/search/actions/search.js new file mode 100644 index 0000000..6cb79ea --- /dev/null +++ b/code/web/client/src/sections/search/actions/search.js @@ -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' } + }); +} diff --git a/code/web/client/src/sections/search/containers/index.js b/code/web/client/src/sections/search/containers/index.js new file mode 100644 index 0000000..f931028 --- /dev/null +++ b/code/web/client/src/sections/search/containers/index.js @@ -0,0 +1,5 @@ +'use strict'; + +import Search from './search'; + +export { Search }; \ No newline at end of file diff --git a/code/web/client/src/sections/search/containers/search.js b/code/web/client/src/sections/search/containers/search.js new file mode 100644 index 0000000..242bb23 --- /dev/null +++ b/code/web/client/src/sections/search/containers/search.js @@ -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 ( +
+ +
+ ) +} + +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); diff --git a/code/web/client/src/sections/search/containers/style.less b/code/web/client/src/sections/search/containers/style.less new file mode 100644 index 0000000..18873da --- /dev/null +++ b/code/web/client/src/sections/search/containers/style.less @@ -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; + } \ No newline at end of file diff --git a/code/web/client/src/sections/search/index.js b/code/web/client/src/sections/search/index.js new file mode 100644 index 0000000..cc5718a --- /dev/null +++ b/code/web/client/src/sections/search/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: 'search', + name: '搜索', + reducers: reducers, + routes: routes, + actions: actions, + getNavItem: getNavItem +}; \ No newline at end of file diff --git a/code/web/client/src/sections/search/nav-item.js b/code/web/client/src/sections/search/nav-item.js new file mode 100644 index 0000000..c616f28 --- /dev/null +++ b/code/web/client/src/sections/search/nav-item.js @@ -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 ( + } title={'举个栗子'}> + + 举个棒子 + + + ); +} \ No newline at end of file diff --git a/code/web/client/src/sections/search/reducers/index.js b/code/web/client/src/sections/search/reducers/index.js new file mode 100644 index 0000000..7ed1088 --- /dev/null +++ b/code/web/client/src/sections/search/reducers/index.js @@ -0,0 +1,5 @@ +'use strict'; + +export default { + +} \ No newline at end of file diff --git a/code/web/client/src/sections/search/routes.js b/code/web/client/src/sections/search/routes.js new file mode 100644 index 0000000..83ed93b --- /dev/null +++ b/code/web/client/src/sections/search/routes.js @@ -0,0 +1,12 @@ +'use strict'; +import { Search, } from './containers'; + +export default [{ + type: 'inner', + route: { + path: '/search', + key: 'search', + breadcrumb: '搜索引擎', + component: Search + } +}]; \ No newline at end of file diff --git a/code/web/client/src/sections/search/style.less b/code/web/client/src/sections/search/style.less new file mode 100644 index 0000000..3323452 --- /dev/null +++ b/code/web/client/src/sections/search/style.less @@ -0,0 +1,3 @@ +#example:hover { + font-size: larger; +} \ No newline at end of file