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
284c4297
Commit
284c4297
authored
Jun 22, 2021
by
maolipeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:每周优化。。。。
parent
9e611ef6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
44 deletions
+36
-44
src/modules/root/Menu.less
+19
-22
src/modules/root/Menu.tsx
+17
-22
No files found.
src/modules/root/Menu.less
View file @
284c4297
...
@@ -12,31 +12,28 @@
...
@@ -12,31 +12,28 @@
width: @xm-left-width;
width: @xm-left-width;
background: @menu-bakg;
background: @menu-bakg;
color: #333;
color: #333;
.topLogo {
.top-ctrl {
height: 62px;
display: flex;
background: rgba(255, 255, 255, 0.5);
align-items: center;
.img1 {
.topLogo {
width: 138px;
height: 60px;
height: 35px;
background: rgba(255, 255, 255, 0.5);
margin-left: 19px;
.img1 {
margin-top: 13px;
width: 138px;
}
height: 35px;
.img0 {
margin: 15px 0 15px 8px;
display: none;
}
width: 35px;
height: 35px;
margin-left: 10px;
margin-top: 13px;
}
}
}
.menu-type-icon{
.menu-type-icon{
margin: 8px 14px 0px 4px;
margin:4px 0 0px 150px
;
cursor: pointer
;
cursor: pointer;
.icon{
.icon{
font-size:14px;
font-size:14px
;
color:#5E606A
;
color:#5E606A;
}
}
}
}
}
.ant-menu {
.ant-menu {
padding-left: 0 !important;
padding-left: 0 !important;
color: #333;
color: #333;
...
...
src/modules/root/Menu.tsx
View file @
284c4297
...
@@ -10,7 +10,6 @@ import StoreService from "@/domains/store-domain/storeService";
...
@@ -10,7 +10,6 @@ import StoreService from "@/domains/store-domain/storeService";
import
User
from
"@/common/js/user"
;
import
User
from
"@/common/js/user"
;
import
_
from
'underscore'
;
import
_
from
'underscore'
;
import
"./Menu.less"
;
import
"./Menu.less"
;
console
.
log
(
'2021-06-17'
)
const
{
SubMenu
}
=
Menu
;
const
{
SubMenu
}
=
Menu
;
function
Aside
(
props
:
any
)
{
function
Aside
(
props
:
any
)
{
...
@@ -19,8 +18,6 @@ function Aside(props: any) {
...
@@ -19,8 +18,6 @@ function Aside(props: any) {
const
[
selectKey
,
setSelectKey
]
=
useState
();
const
[
selectKey
,
setSelectKey
]
=
useState
();
const
[
openKeys
,
setOpenKeys
]
=
useState
([
''
]);
const
[
openKeys
,
setOpenKeys
]
=
useState
([
''
]);
const
[
topLogoUrl
,
setTopLogoUrl
]
=
useState
(
""
)
const
[
topLogoUrl
,
setTopLogoUrl
]
=
useState
(
""
)
const
logoImg0Ref
=
useRef
<
any
>
()
const
logoImg1Ref
=
useRef
<
any
>
()
const
rootSubmenuKeys
=
_
.
pluck
(
menuList
,
'groupCode'
);
const
rootSubmenuKeys
=
_
.
pluck
(
menuList
,
'groupCode'
);
useEffect
(()
=>
{
useEffect
(()
=>
{
const
link
=
props
.
location
.
pathname
;
const
link
=
props
.
location
.
pathname
;
...
@@ -56,6 +53,9 @@ function Aside(props: any) {
...
@@ -56,6 +53,9 @@ function Aside(props: any) {
}
}
function
toggleMenu
(
item
:
any
)
{
function
toggleMenu
(
item
:
any
)
{
window
.
RCHistory
.
push
(
item
.
link
)
window
.
RCHistory
.
push
(
item
.
link
)
if
(
!
menuType
)
{
setOpenKeys
([])
}
}
}
function
onOpenChange
(
key
:
any
)
{
function
onOpenChange
(
key
:
any
)
{
if
(
openKeys
.
includes
(
key
))
{
if
(
openKeys
.
includes
(
key
))
{
...
@@ -64,26 +64,19 @@ function Aside(props: any) {
...
@@ -64,26 +64,19 @@ function Aside(props: any) {
setOpenKeys
([
key
]);
setOpenKeys
([
key
]);
}
}
}
}
function
handleMenu
()
{
function
onOpenChangeForHover
(
key
:
any
)
{
handleMenuType
();
if
(
menuType
)
{
}
useEffect
(()
=>
{
if
(
!
logoImg0Ref
.
current
||
!
logoImg1Ref
.
current
)
{
return
return
}
}
if
(
!
menuType
)
{
if
(
openKeys
.
includes
(
key
))
{
if
(
topLogoUrl
.
indexOf
(
"xiaomaiketang.com"
)
<
0
)
{
setOpenKeys
([]);
logoImg0Ref
.
current
.
style
.
display
=
"none"
logoImg1Ref
.
current
.
style
.
display
=
"none"
}
else
{
logoImg0Ref
.
current
.
style
.
display
=
"inline"
logoImg1Ref
.
current
.
style
.
display
=
"none"
}
}
else
{
}
else
{
logoImg0Ref
.
current
.
style
.
display
=
"none"
setOpenKeys
([
key
]);
logoImg1Ref
.
current
.
style
.
display
=
"inline"
}
}
},[
menuType
])
}
function
handleMenu
()
{
handleMenuType
();
}
return
(
return
(
<
div
<
div
...
@@ -94,9 +87,9 @@ function Aside(props: any) {
...
@@ -94,9 +87,9 @@ function Aside(props: any) {
:
"left-container left-container-vertical"
:
"left-container left-container-vertical"
}
}
>
>
<
div
className=
"top-ctrl"
>
<
div
className=
"topLogo"
>
<
div
className=
"topLogo"
>
<
img
ref=
{
logoImg0Ref
}
src=
"https://image.xiaomaiketang.com/xm/c4KiP2epBP.png"
alt=
""
className=
"img0"
></
img
>
{
menuType
&&
<
img
src=
{
topLogoUrl
}
alt=
""
className=
"img1"
></
img
>
}
<
img
ref=
{
logoImg1Ref
}
src=
{
topLogoUrl
}
alt=
""
className=
"img1"
></
img
>
</
div
>
</
div
>
<
div
className=
"menu-type-icon"
onClick=
{
handleMenu
}
>
<
div
className=
"menu-type-icon"
onClick=
{
handleMenu
}
>
{
menuType
?
(
{
menuType
?
(
...
@@ -113,6 +106,8 @@ function Aside(props: any) {
...
@@ -113,6 +106,8 @@ function Aside(props: any) {
</
span
>
</
span
>
)
}
)
}
</
div
>
</
div
>
</
div
>
<
div
className=
"left"
>
<
div
className=
"left"
>
<
div
className=
"nav"
>
<
div
className=
"nav"
>
...
@@ -129,7 +124,7 @@ function Aside(props: any) {
...
@@ -129,7 +124,7 @@ function Aside(props: any) {
return
null
;
return
null
;
}
}
if
(
item
.
children
)
{
if
(
item
.
children
)
{
return
<
SubMenu
key=
{
item
.
groupCode
}
style=
{
{
marginTop
:
0
}
}
className=
"first-menu-item"
title=
{
<
div
>
return
<
SubMenu
onTitleMouseEnter=
{
()
=>
onOpenChangeForHover
(
item
.
groupCode
)
}
key=
{
item
.
groupCode
}
style=
{
{
marginTop
:
0
}
}
className=
"first-menu-item"
title=
{
<
div
>
{
/* <span style={{ marginRight: 16 }} className="iconfont icon" dangerouslySetInnerHTML={{ __html:item.icon}}></span> */
}
{
/* <span style={{ marginRight: 16 }} className="iconfont icon" dangerouslySetInnerHTML={{ __html:item.icon}}></span> */
}
<
img
src=
{
item
.
img
}
className=
"icon-img"
></
img
>
<
img
src=
{
item
.
img
}
className=
"icon-img"
></
img
>
{
menuType
&&
{
menuType
&&
...
...
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