Browse Source

some

master
yinweiwen 2 years ago
parent
commit
6e7425e22c
  1. 4
      code/web/client/src/app.js
  2. 49
      code/web/client/src/layout/containers/layout/index.js
  3. 2
      code/web/client/src/sections/auth/containers/login.js
  4. 7
      code/web/client/src/sections/search/actions/index.js
  5. 15
      code/web/client/src/sections/search/actions/search.js
  6. 5
      code/web/client/src/sections/search/containers/index.js
  7. 31
      code/web/client/src/sections/search/containers/search.js
  8. 16
      code/web/client/src/sections/search/containers/style.less
  9. 15
      code/web/client/src/sections/search/index.js
  10. 16
      code/web/client/src/sections/search/nav-item.js
  11. 5
      code/web/client/src/sections/search/reducers/index.js
  12. 12
      code/web/client/src/sections/search/routes.js
  13. 3
      code/web/client/src/sections/search/style.less

4
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 (
<Layout
title={projectName}
sections={[Auth, Example]}
sections={[Auth, Search]}
/>
)
}

49
code/web/client/src/layout/containers/layout/index.js

@ -24,7 +24,7 @@ NProgress.configure({
</div>
`
});
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 => {
<Header
user={user}
pathname={location.pathname}
toggleCollapsed={() => {
setCollapsed(!collapsed);
resize(!collapsed)
}}
// toggleCollapsed={() => {
// setCollapsed(!collapsed);
// resize(!collapsed)
// }}
changeTheme={(themeName) => {
setThemeName(themeName)
}}
@ -103,29 +103,30 @@ const LayoutContainer = props => {
/>
</Layout.Header>
<Layout>
<Layout.Sider trigger={null} collapsible collapsed={collapsed} theme={themeName}>
{/* <div style={{
{
false ? (
<Layout.Sider trigger={null} collapsible collapsed={collapsed} theme={themeName}>
{/* <div style={{
height: headerHeight,
textAlign: 'center',
lineHeight: headerHeight + 'px'
}}>
LOGO
</div> */}
<Sider
sections={sections}
dispatch={dispatch}
user={user}
pathname={location.pathname}
collapsed={collapsed}
themeName={themeName}
/>
</Layout.Sider>
<Sider
sections={sections}
dispatch={dispatch}
user={user}
pathname={location.pathname}
collapsed={collapsed}
themeName={themeName}
/>
</Layout.Sider>
) : null
}
<Layout.Content id="page-content" style={contentStyle}>
<div style={{ minWidth: 520 }}>
<div style={{ padding: '0px 16px 4px', borderBottom: '1px solid #e8e8e8' }}>
<Breadcrumbs routes={routes} />
</div>
<div style={{ paddingTop: 12 }}>
<div style={{ paddingTop: 6 }}>
{children}
</div>
</div>

2
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])

7
code/web/client/src/sections/search/actions/index.js

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

15
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' }
});
}

5
code/web/client/src/sections/search/containers/index.js

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

31
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 (
<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);

16
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;
}

15
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
};

16
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 (
<SubMenu key="search" icon={<SettingOutlined />} title={'举个栗子'}>
<Menu.Item key="e1">
<Link to="/search/e1">举个棒子</Link>
</Menu.Item>
</SubMenu>
);
}

5
code/web/client/src/sections/search/reducers/index.js

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

12
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
}
}];

3
code/web/client/src/sections/search/style.less

@ -0,0 +1,3 @@
#example:hover {
font-size: larger;
}
Loading…
Cancel
Save