Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
93c161cf
Commit
93c161cf
authored
May 24, 2021
by
zhangleyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:调整左边栏
parent
41842c8b
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
99 additions
and
76 deletions
+99
-76
src/index.html
+3
-3
src/modules/home/Home.less
+1
-1
src/modules/root/App.tsx
+3
-3
src/modules/root/Header.jsx
+1
-16
src/modules/root/Header.less
+1
-0
src/modules/root/Main.less
+1
-0
src/modules/root/Menu.less
+58
-40
src/modules/root/Menu.tsx
+22
-4
src/routes/config/menuList.tsx
+9
-9
No files found.
src/index.html
View file @
93c161cf
<!--
<!--
* @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.
...
...
src/modules/home/Home.less
View file @
93c161cf
.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;
...
...
src/modules/root/App.tsx
View file @
93c161cf
/*
/*
* @Author: 吴文洁
* @Author: 吴文洁
* @Date: 2019-07-10 10:30:49
* @Date: 2019-07-10 10:30:49
* @LastEditors:
wufan
* @LastEditors:
Please set LastEditors
* @LastEditTime: 2021-0
3-26 16:13:48
* @LastEditTime: 2021-0
5-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
>
)
)
}
}
...
...
src/modules/root/Header.jsx
View file @
93c161cf
...
@@ -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 1
1:25:56
* @LastEditTime: 2021-05-24 1
6: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
}
>

</
span
>
)
:
(
<
span
className=
"icon iconfont cursor ml20 handLike"
onClick=
{
handleMenu
}
>

</
span
>
)
}
<
div
className=
"message-help"
>
<
div
className=
"message-help"
>
{
list
.
length
?
(
{
list
.
length
?
(
<
ClickOutside
<
ClickOutside
...
...
src/modules/root/Header.less
View file @
93c161cf
...
@@ -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;
...
...
src/modules/root/Main.less
View file @
93c161cf
...
@@ -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;
...
...
src/modules/root/Menu.less
View file @
93c161cf
...
@@ -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;
}
}
}
}
}
}
}
src/modules/root/Menu.tsx
View file @
93c161cf
...
@@ -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"
>

</
span
>
)
:
(
<
span
className=
"icon iconfont"
>

</
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
:
1
6
}
}
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
:
1
6
}
}
className=
"iconfont icon"
dangerouslySetInnerHTML=
{
{
__html
:
item
.
icon
}
}
></
span
>
{
menuType
&&
{
menuType
&&
<
span
>
{
item
.
groupName
}
</
span
>
<
span
>
{
item
.
groupName
}
</
span
>
}
}
...
...
src/routes/config/menuList.tsx
View file @
93c161cf
/*
/*
* @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-0
3-27 15:20:42
* @LastEditTime: 2021-0
5-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
:
'
6b
7;'
,
icon
:
'
8a
7;'
,
link
:
'/home'
link
:
'/home'
},
},
{
{
groupName
:
"课程管理"
,
groupName
:
"课程管理"
,
groupCode
:
"CloudCourse"
,
groupCode
:
"CloudCourse"
,
icon
:
'è
31
;'
,
icon
:
'è
a5
;'
,
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
:
'è
40
;'
,
icon
:
'è
a8
;'
,
link
:
'/knowledge-base'
link
:
'/knowledge-base'
},
},
{
{
groupName
:
"资料云盘"
,
groupName
:
"资料云盘"
,
groupCode
:
"CloudDisk"
,
groupCode
:
"CloudDisk"
,
icon
:
'è
3b
;'
,
icon
:
'è
aa
;'
,
link
:
'/resource-disk'
link
:
'/resource-disk'
},
},
{
{
groupName
:
"培训管理"
,
groupName
:
"培训管理"
,
groupCode
:
"TrainManage"
,
groupCode
:
"TrainManage"
,
icon
:
'è
63
;'
,
icon
:
'è
a6
;'
,
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
:
'è
28
;'
,
icon
:
'è
a9
;'
,
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
:
'è
2e
;'
,
icon
:
'è
a4
;'
,
children
:
[
children
:
[
{
{
groupName
:
"学院信息"
,
groupName
:
"学院信息"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment