Commit eeef05cd by zhangleyuan

feat:调整左侧边栏的样式

parent 75a85632
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zhangleyuan * @Author: zhangleyuan
* @Date: 2020-11-27 15:06:31 * @Date: 2020-11-27 15:06:31
* @LastEditors: zhangleyuan * @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-10 10:46:23 * @LastEditTime: 2020-12-10 19:30:57
* @Description: 描述一下 * @Description: 描述一下
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -54,6 +54,7 @@ function PersonalInfoPage() { ...@@ -54,6 +54,7 @@ function PersonalInfoPage() {
}); });
} }
function _handleUpdateAvatar(e: any): any { function _handleUpdateAvatar(e: any): any {
console.log('update');
const avatar = e.target.files[0]; const avatar = e.target.files[0];
const newUrl = URL.createObjectURL(avatar); const newUrl = URL.createObjectURL(avatar);
const $image = $('#image'); const $image = $('#image');
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2019-07-10 10:30:49 * @Date: 2019-07-10 10:30:49
* @LastEditors: zhangleyuan * @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-10 14:49:22 * @LastEditTime: 2020-12-10 19:50:59
* @Description: * @Description:
*/ */
import React, { useContext, useEffect, useState } from 'react'; import React, { useContext, useEffect, useState } from 'react';
...@@ -21,6 +21,7 @@ declare var window: any; ...@@ -21,6 +21,7 @@ declare var window: any;
const App: React.FC = (props: any) => { const App: React.FC = (props: any) => {
const ctx: any = useContext(XMContext); const ctx: any = useContext(XMContext);
const userId = User.getUserId(); const userId = User.getUserId();
const [menuType,setMenuType]=useState(true);
window.ctx = ctx; window.ctx = ctx;
useEffect(() => { useEffect(() => {
...@@ -55,15 +56,17 @@ const App: React.FC = (props: any) => { ...@@ -55,15 +56,17 @@ const App: React.FC = (props: any) => {
ctx.dispatch(setStoreGroupPermission(storePermissionGroup)) ctx.dispatch(setStoreGroupPermission(storePermissionGroup))
ctx.dispatch(setStorePermission(storeUserPermissionGroup)) ctx.dispatch(setStorePermission(storeUserPermissionGroup))
}); });
}
function handleMenuType(){
setMenuType(!menuType);
} }
return ( return (
<div id="home"> <div id="home">
<Header/> <Header handleMenuType={handleMenuType} menuType={menuType}/>
<ConfigProvider locale={zhCN} > <ConfigProvider locale={zhCN} >
<Main/> <Main/>
</ConfigProvider> </ConfigProvider>
<Menu/> <Menu menuType={menuType}/>
</div> </div>
) )
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2019-09-10 18:26:03 * @Date: 2019-09-10 18:26:03
* @LastEditors: zhangleyuan * @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-09 11:13:05 * @LastEditTime: 2020-12-10 19:48:55
* @Description: * @Description:
*/ */
import React , { useContext, useState}from 'react'; import React , { useContext, useState}from 'react';
...@@ -21,9 +21,13 @@ import { XMContext } from '@/store/context'; ...@@ -21,9 +21,13 @@ import { XMContext } from '@/store/context';
import baseImg from '@/common/images/xiaomai-IMG.png'; import baseImg from '@/common/images/xiaomai-IMG.png';
import logoImg from '@/common/images/logo.png'; import logoImg from '@/common/images/logo.png';
const { confirm } = Modal; const { confirm } = Modal;
interface headerProps {
menuType:boolean,
handleMenuType:() => void
}
function Header(){ function Header(props:headerProps){
const [menuType, setMenuType] = useState(true); const { menuType ,handleMenuType} = props;
const ctx: any = useContext(XMContext); const ctx: any = useContext(XMContext);
function userMenu() { function userMenu() {
return ( return (
...@@ -54,7 +58,7 @@ function Header(){ ...@@ -54,7 +58,7 @@ function Header(){
); );
} }
function handleMenu(){ function handleMenu(){
setMenuType(!menuType); handleMenuType();
}; };
function toPersonalInfoPage(){ function toPersonalInfoPage(){
window.RCHistory.push({ window.RCHistory.push({
...@@ -128,4 +132,4 @@ function Header(){ ...@@ -128,4 +132,4 @@ function Header(){
</div> </div>
); );
} }
export default withRouter(Header); export default Header;
...@@ -7,14 +7,11 @@ import { menuList } from '../../routes//config/menuList' ...@@ -7,14 +7,11 @@ import { menuList } from '../../routes//config/menuList'
import { XMContext } from '../../store/context'; import { XMContext } from '../../store/context';
import "./Menu.less"; import "./Menu.less";
const { SubMenu } = Menu; const { SubMenu } = Menu;
function Aside(props: any) { function Aside(props: any) {
const {menuType} = props
const ctx: any = useContext(XMContext); const ctx: any = useContext(XMContext);
const [selectKey, setSelectKey] = useState(); const [selectKey, setSelectKey] = useState();
const [openKeys, setOpenKeys] = useState(['']); const [openKeys, setOpenKeys] = useState(['']);
const [menuType,setMenuType] = useState(1);
useEffect(() => { useEffect(() => {
const link = props.location.pathname; const link = props.location.pathname;
console.log('link',link); console.log('link',link);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment