Commit 93c161cf by zhangleyuan

feat:调整左边栏

parent 41842c8b
<!-- <!--
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-24 12:20:57 * @Date: 2020-08-24 12:20:57
* @LastEditors: zhangleyuan * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-05-10 13:41:52 * @LastEditTime: 2021-05-24 15:39:59
* @Description: * @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
--> -->
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
--> -->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="stylesheet" href="//at.alicdn.com/t/font_2223403_vs61tfrogho.css"> <link rel="stylesheet" href="//at.alicdn.com/t/font_2223403_jnqch2ijn6e.css">
<!-- <!--
Notice the use of %PUBLIC_URL% in the tags above. Notice the use of %PUBLIC_URL% in the tags above.
......
.home-page { .home-page {
padding: 0 16px 16px; // padding: 0 16px 16px;
min-width: 1100px; min-width: 1100px;
position: relative; position: relative;
z-index:3; z-index:3;
......
/* /*
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2019-07-10 10:30:49 * @Date: 2019-07-10 10:30:49
* @LastEditors: wufan * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-03-26 16:13:48 * @LastEditTime: 2021-05-24 16:29:05
* @Description: * @Description:
*/ */
import React, { useContext, useEffect, useState } from 'react'; import React, { useContext, useEffect, useState } from 'react';
...@@ -127,7 +127,7 @@ const App: React.FC = (props: any) => { ...@@ -127,7 +127,7 @@ const App: React.FC = (props: any) => {
<ConfigProvider locale={zhCN} autoInsertSpaceInButton={false}> <ConfigProvider locale={zhCN} autoInsertSpaceInButton={false}>
<Main menuType={menuType} /> <Main menuType={menuType} />
</ConfigProvider> </ConfigProvider>
<Menu menuType={menuType} /> <Menu menuType={menuType} handleMenuType={handleMenuType}/>
</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: Please set LastEditors * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-05-24 11:25:56 * @LastEditTime: 2021-05-24 16:51:01
* @Description: * @Description:
*/ */
import React, { useRef, useContext, useEffect, useState } from "react"; import React, { useRef, useContext, useEffect, useState } from "react";
...@@ -221,21 +221,6 @@ function Header(props) { ...@@ -221,21 +221,6 @@ function Header(props) {
<div> <div>
<img src='https://image.xiaomaiketang.com/xm/WEsMPAYxAs.png' className="logo" alt="" /> <img src='https://image.xiaomaiketang.com/xm/WEsMPAYxAs.png' className="logo" alt="" />
</div> </div>
{menuType ? (
<span
className="icon iconfont cursor ml20 handLike"
onClick={handleMenu}
>
&#xe83d;
</span>
) : (
<span
className="icon iconfont cursor ml20 handLike"
onClick={handleMenu}
>
&#xe615;
</span>
)}
<div className="message-help"> <div className="message-help">
{list.length ? ( {list.length ? (
<ClickOutside <ClickOutside
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
background: linear-gradient(180deg, #2966FF 0%, rgba(41, 102, 255, 0.82) 29%, rgba(41, 102, 255, 0.58) 55%, rgba(41, 102, 255, 0.27) 77%, rgba(7, 78, 255, 0) 100%); background: linear-gradient(180deg, #2966FF 0%, rgba(41, 102, 255, 0.82) 29%, rgba(41, 102, 255, 0.58) 55%, rgba(41, 102, 255, 0.27) 77%, rgba(7, 78, 255, 0) 100%);
position:absolute; position:absolute;
z-index:2; z-index:2;
top:59px;
} }
.logo { .logo {
display: inline-block; display: inline-block;
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
bottom: 0; bottom: 0;
background-color: #f0f2f5; background-color: #f0f2f5;
overflow-x: scroll; overflow-x: scroll;
padding:0 16px;
// z-index: 1; // z-index: 1;
&.right-container-vertical{ &.right-container-vertical{
left:@xm-left-min-width; left:@xm-left-min-width;
......
...@@ -12,9 +12,27 @@ ...@@ -12,9 +12,27 @@
width: @xm-left-width; width: @xm-left-width;
background: @menu-bakg; background: @menu-bakg;
color: #333; color: #333;
.menu-type-icon{
position: absolute;
display:inline-block;
width: 24px;
height: 24px;
background: #FFFFFF;
border-radius: 50%;
border: 1px solid #F1F3F6;
right:-12px;
top:29px;
text-align:center;
z-index:3;
cursor: pointer;
.icon{
font-size:11px;
}
display:none;
}
.ant-menu { .ant-menu {
padding-left: 0 !important; padding-left: 0 !important;
// background: transparent; color: #333;
background: #FFF !important; background: #FFF !important;
} }
.left { .left {
...@@ -50,12 +68,31 @@ ...@@ -50,12 +68,31 @@
left: 38px; left: 38px;
position: absolute; position: absolute;
} }
.ant-menu-item{
padding-left: 13px !important;
padding-right: 0px;
margin: 6px 8px;
width: calc(100% - 15px);
&:hover{
background: #F3F6FA;
border-radius: 2px;
color:#333;
}
}
.ant-menu-item-selected{ .ant-menu-item-selected{
color:@active-color; background-color:@active-color;
color:#FFF;
&:hover{
color:#FFF;
}
} }
.ant-menu-sub{ .ant-menu-submenu{
.ant-menu-submenu-title{
margin:6px 8px;
padding-left:13px !important;
}
.ant-menu-item{ .ant-menu-item{
padding-left:58px padding-left:46px !important;
} }
} }
...@@ -84,10 +121,14 @@ ...@@ -84,10 +121,14 @@
} }
.shink-footer { .shink-footer {
left: 74px; left: 74px;
&:hover{
.menu-type-icon{
display:inline-block;
}
} }
} }
.ant-menu-dark.ant-menu-dark:not(.ant-menu-horizontal) .ant-menu-item-selected { .ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected {
background:@menu-bakg !important; background:@active-color !important;
} }
.ant-menu.ant-menu-dark, .ant-menu-dark .ant-menu-sub, .ant-menu.ant-menu-dark .ant-menu-sub{ .ant-menu.ant-menu-dark, .ant-menu-dark .ant-menu-sub, .ant-menu.ant-menu-dark .ant-menu-sub{
...@@ -96,55 +137,32 @@ ...@@ -96,55 +137,32 @@
.ant-menu-submenu-popup>.ant-menu { .ant-menu-submenu-popup>.ant-menu {
background: @menu-bakg !important; background: @menu-bakg !important;
color: #9A9DA7; color: #333;
padding-left: 15px; padding-left: 15px;
width: 132px; width: 132px;
min-width: auto; min-width: auto;
li { li {
padding-left: 22px; width: calc(100% - 16px);
padding-right: 0; padding-left: 20px;
width: 117px; margin:12px 8px !important;
margin-bottom:0 !important; &:hover{
&:first-child{ background: #F3F6FA;
margin-top:8px !important; border-radius: 2px;
color:#333 !important;
} }
&:last-child{
margin-bottom:8px !important;
}
}
.listType {
width: 5px;
height: 5px;
background: #9A9DA7;
border-radius: 50%;
top: 18px;
left: 10px;
position: absolute;
} }
.ant-menu-item-selected { .ant-menu-item-selected {
background: @menu-bakg; background: @active-color;
color: #fff; color: #fff;
&:hover{
.listType { color: #fff !important;
background: @active-color;
} }
} }
&:hover { &:hover {
.ant-menu-item-active { .ant-menu-item-active {
color: #fff; color: #fff;
.listType {
background: #fff;
}
}
.ant-menu-item-selected {
.listType {
background: @active-color;
}
} }
} }
} }
...@@ -10,7 +10,7 @@ import "./Menu.less"; ...@@ -10,7 +10,7 @@ import "./Menu.less";
const { SubMenu } = Menu; const { SubMenu } = Menu;
function Aside(props: any) { function Aside(props: any) {
const {menuType} = props const {menuType,handleMenuType}= 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(['']);
...@@ -38,6 +38,10 @@ function Aside(props: any) { ...@@ -38,6 +38,10 @@ function Aside(props: any) {
function onOpenChange(openKeys:any){ function onOpenChange(openKeys:any){
setOpenKeys(_.last(openKeys, 1)) setOpenKeys(_.last(openKeys, 1))
} }
function handleMenu() {
handleMenuType();
}
return ( return (
<div <div
id="left-container" id="left-container"
...@@ -47,6 +51,21 @@ function Aside(props: any) { ...@@ -47,6 +51,21 @@ function Aside(props: any) {
: "left-container left-container-vertical" : "left-container left-container-vertical"
} }
> >
<span className="menu-type-icon" onClick={handleMenu}>
{menuType ? (
<span
className="icon iconfont"
>
&#xe83d;
</span>
) : (
<span
className="icon iconfont"
>
&#xe615;
</span>
)}
</span>
<div className="left"> <div className="left">
<div className="nav"> <div className="nav">
...@@ -66,7 +85,7 @@ function Aside(props: any) { ...@@ -66,7 +85,7 @@ function Aside(props: any) {
} }
if (item.children) { if (item.children) {
return <SubMenu key={item.groupCode} style={{ marginTop: 0 }} className="first-menu-item" title={<div > return <SubMenu key={item.groupCode} style={{ marginTop: 0 }} className="first-menu-item" title={<div >
<span style={{ marginRight: 6 }} className="iconfont icon" dangerouslySetInnerHTML={{ __html:item.icon}}></span> <span style={{ marginRight: 16 }} className="iconfont icon" dangerouslySetInnerHTML={{ __html:item.icon}}></span>
{menuType && {menuType &&
<span>{item.groupName}</span> <span>{item.groupName}</span>
}</div> }</div>
...@@ -77,7 +96,6 @@ function Aside(props: any) { ...@@ -77,7 +96,6 @@ function Aside(props: any) {
return null; return null;
} }
return <Menu.Item onClick={() => { toggleMenu(_item) }} style={{ marginTop: 0 }} key={_item.groupCode + index + _index}> return <Menu.Item onClick={() => { toggleMenu(_item) }} style={{ marginTop: 0 }} key={_item.groupCode + index + _index}>
<span className="listType"></span>
<span className="name">{_item.groupName}</span> <span className="name">{_item.groupName}</span>
</Menu.Item> </Menu.Item>
...@@ -87,7 +105,7 @@ function Aside(props: any) { ...@@ -87,7 +105,7 @@ function Aside(props: any) {
} else { } else {
return <Menu.Item onClick={() => { toggleMenu(item) }} key={item.groupCode} className="first-menu-item"> return <Menu.Item onClick={() => { toggleMenu(item) }} key={item.groupCode} className="first-menu-item">
<span style={{ marginRight: 6 }} className="iconfont icon" dangerouslySetInnerHTML={{ __html:item.icon}}></span> <span style={{ marginRight: 16 }} className="iconfont icon" dangerouslySetInnerHTML={{ __html:item.icon}}></span>
{menuType && {menuType &&
<span>{item.groupName}</span> <span>{item.groupName}</span>
} }
......
/* /*
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-21 15:53:31 * @Date: 2021-02-21 15:53:31
* @LastEditors: yuananting * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-03-27 15:20:42 * @LastEditTime: 2021-05-24 15:45:36
* @Description: 描述一下咯 * @Description: 描述一下咯
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -10,13 +10,13 @@ export const menuList: any = [ ...@@ -10,13 +10,13 @@ export const menuList: any = [
{ {
groupName: "中心首页", groupName: "中心首页",
groupCode: "CloudPage", groupCode: "CloudPage",
icon: '&#xe6b7;', icon: '&#xe8a7;',
link: '/home' link: '/home'
}, },
{ {
groupName: "课程管理", groupName: "课程管理",
groupCode: "CloudCourse", groupCode: "CloudCourse",
icon: '&#xe831;', icon: '&#xe8a5;',
children: [ children: [
{ {
groupName: "直播课", groupName: "直播课",
...@@ -38,19 +38,19 @@ export const menuList: any = [ ...@@ -38,19 +38,19 @@ export const menuList: any = [
{ {
groupName: "知识库", groupName: "知识库",
groupCode: "CloudKnowledge", groupCode: "CloudKnowledge",
icon: '&#xe840;', icon: '&#xe8a8;',
link: '/knowledge-base' link: '/knowledge-base'
}, },
{ {
groupName: "资料云盘", groupName: "资料云盘",
groupCode: "CloudDisk", groupCode: "CloudDisk",
icon: '&#xe83b;', icon: '&#xe8aa;',
link: '/resource-disk' link: '/resource-disk'
}, },
{ {
groupName: "培训管理", groupName: "培训管理",
groupCode: "TrainManage", groupCode: "TrainManage",
icon: '&#xe863;', icon: '&#xe8a6;',
children: [ children: [
{ {
groupName: "培训计划", groupName: "培训计划",
...@@ -62,7 +62,7 @@ export const menuList: any = [ ...@@ -62,7 +62,7 @@ export const menuList: any = [
{ {
groupName: "助学工具", groupName: "助学工具",
groupCode: "AidTool", groupCode: "AidTool",
icon: '&#xe828;', icon: '&#xe8a9;',
children: [ children: [
{ {
groupName: "题库", groupName: "题库",
...@@ -84,7 +84,7 @@ export const menuList: any = [ ...@@ -84,7 +84,7 @@ export const menuList: any = [
{ {
groupName: "学院管理", groupName: "学院管理",
groupCode: "CloudShop", groupCode: "CloudShop",
icon: '&#xe82e;', icon: '&#xe8a4;',
children: [ children: [
{ {
groupName: "学院信息", groupName: "学院信息",
......
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