Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ems3.3
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wuhao
ems3.3
Commits
c5029e04
Commit
c5029e04
authored
Sep 22, 2023
by
左玲玲
😬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1539
parent
d82b6972
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
44 deletions
+43
-44
app.jsx
src/app.jsx
+1
-7
index.jsx
src/components/SiderMenu/index.jsx
+42
-37
No files found.
src/app.jsx
View file @
c5029e04
...
@@ -152,16 +152,10 @@ export const layout = ({ initialState, setInitialState }) => {
...
@@ -152,16 +152,10 @@ export const layout = ({ initialState, setInitialState }) => {
noFound
:
<
div
>
noFound
</
div
>,
noFound
:
<
div
>
noFound
</
div
>,
// 增加一个 loading 的状态
// 增加一个 loading 的状态
childrenRender
:
(
children
,
props
)
=>
{
childrenRender
:
(
children
,
props
)
=>
{
let
home
,
items
=
initialState
?.
newMenu
?.
userHavePermList
??
[];
if
(
history
.
location
.
pathname
!=
"/welcome"
&&
history
.
location
.
pathname
!=
"/"
)
{
home
=
history
.
location
.
pathname
}
else
{
home
=
items
?.
length
>
0
?
items
[
0
].
path
.
indexOf
(
"/"
)
>
-
1
?
items
[
0
].
path
:
items
[
0
]?.
routes
?.
length
>
0
?
items
[
0
]?.
routes
[
0
]?.
path
:
""
:
""
;
}
return
(
return
(
<>
<>
{
initialState
?.
currentUser
&&
location
.
pathname
!==
loginPath
?
(
{
initialState
?.
currentUser
&&
location
.
pathname
!==
loginPath
?
(
<
TagView
home=
{
home
}
>
{
children
}
</
TagView
>
<
TagView
home=
'/welcome'
>
{
children
}
</
TagView
>
)
:
(
)
:
(
children
children
)
}
)
}
...
...
src/components/SiderMenu/index.jsx
View file @
c5029e04
...
@@ -21,42 +21,42 @@ function strToHump(str) {
...
@@ -21,42 +21,42 @@ function strToHump(str) {
}
}
let
CardItems
=
(
datav
,
i
,
getstar
,
addHistory
)
=>
{
let
CardItems
=
(
datav
,
i
,
getstar
,
addHistory
)
=>
{
let
name
=
datav
.
name
,
let
name
=
datav
.
name
,
collected
=
datav
.
isExist
==
'1'
,
collected
=
datav
.
isExist
==
'1'
,
icon
=
datav
.
icon
?
strToHump
(
datav
.
icon
)
:
'ToolOutlined'
,
icon
=
datav
.
icon
?
strToHump
(
datav
.
icon
)
:
'ToolOutlined'
,
ItemIcon
=
icon
?
Ant4Icons
[
icon
]
:
Ant4Icons
[
'ToolOutlined'
];
ItemIcon
=
icon
?
Ant4Icons
[
icon
]
:
Ant4Icons
[
'ToolOutlined'
];
return
(
return
(
<
div
<
div
key=
{
i
}
key=
{
i
}
className=
{
styles
.
carditem
}
className=
{
styles
.
carditem
}
onClick=
{
async
()
=>
{
onClick=
{
async
()
=>
{
history
.
push
(
datav
.
path
);
history
.
push
(
datav
.
path
);
await
addHistory
(
datav
.
key
);
await
addHistory
(
datav
.
key
);
}
}
}
}
>
>
<
a
className=
{
styles
.
diylink
}
>
<
a
className=
{
styles
.
diylink
}
>
{
' '
}
{
' '
}
{
React
.
createElement
(
Ant4Icons
[
icon
],
{
style
:
{
marginRight
:
6
}
})
}
{
React
.
createElement
(
Ant4Icons
[
icon
],
{
style
:
{
marginRight
:
6
}
})
}
{
name
}
{
name
}
</
a
>
</
a
>
{
collected
?
(
{
collected
?
(
<
Ant4Icons
.
StarFilled
<
Ant4Icons
.
StarFilled
className=
{
styles
.
collected
}
className=
{
styles
.
collected
}
onClick=
{
async
(
e
)
=>
{
onClick=
{
async
(
e
)
=>
{
getstar
(
e
,
collected
,
datav
.
key
);
getstar
(
e
,
collected
,
datav
.
key
);
}
}
}
}
/>
/>
)
:
(
)
:
(
<
Ant4Icons
.
StarOutlined
<
Ant4Icons
.
StarOutlined
className=
{
styles
.
tocollect
}
className=
{
styles
.
tocollect
}
onClick=
{
async
(
e
)
=>
{
onClick=
{
async
(
e
)
=>
{
getstar
(
e
,
collected
,
datav
.
key
);
getstar
(
e
,
collected
,
datav
.
key
);
}
}
}
}
/>
/>
)
}
)
}
</
div
>
</
div
>
);
);
},
},
coles
=
{
xs
:
24
,
sm
:
24
,
md
:
12
,
lg
:
8
,
xl
:
6
,
xxl
:
4
};
coles
=
{
xs
:
24
,
sm
:
24
,
md
:
12
,
lg
:
8
,
xl
:
6
,
xxl
:
4
};
function
SiderMenu
({
logo
,
collapsed
,
onCollapse
,
fixSiderbar
,
theme
,
isMobile
,
name
,
menuData
})
{
function
SiderMenu
({
logo
,
collapsed
,
onCollapse
,
fixSiderbar
,
theme
,
isMobile
,
name
,
menuData
})
{
...
@@ -169,7 +169,6 @@ function SiderMenu({ logo, collapsed, onCollapse, fixSiderbar, theme, isMobile,
...
@@ -169,7 +169,6 @@ function SiderMenu({ logo, collapsed, onCollapse, fixSiderbar, theme, isMobile,
};
};
});
});
},
[
collectPerm
]);
},
[
collectPerm
]);
return
(
return
(
<
Sider
<
Sider
trigger=
{
null
}
trigger=
{
null
}
...
@@ -237,6 +236,12 @@ function SiderMenu({ logo, collapsed, onCollapse, fixSiderbar, theme, isMobile,
...
@@ -237,6 +236,12 @@ function SiderMenu({ logo, collapsed, onCollapse, fixSiderbar, theme, isMobile,
label
:
'产品与服务'
,
label
:
'产品与服务'
,
type
:
'sub1'
,
type
:
'sub1'
,
},
},
{
key
:
'/welcome'
,
label
:
'首页'
,
type
:
'sub1'
,
icon
:
<
Ant4Icons
.
HomeOutlined
/>
},
...
collectList
,
...
collectList
,
]
}
]
}
/>
/>
...
...
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