Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wms
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
wms
Commits
ec67e9bd
Commit
ec67e9bd
authored
1 year ago
by
krysent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nihao
parent
bb9822fb
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
13 deletions
+71
-13
proxy.js
config/proxy.js
+1
-0
package.json
package.json
+1
-1
app.jsx
src/app.jsx
+32
-2
SiderMenu.js
src/components/SiderMenu/SiderMenu.js
+12
-0
index.jsx
src/components/TagView/index.jsx
+24
-9
request.js
src/utils/request.js
+1
-1
No files found.
config/proxy.js
View file @
ec67e9bd
...
...
@@ -11,6 +11,7 @@ export default {
// localhost:8000/api/** -> https://preview.pro.ant.design/api/**
"/wmspro/"
:
{
// 要代理的地址
// target: "http://wms-demo.nangaoyun.com", //39:28040 18/wms/
target
:
"http://192.168.40.203:8000"
,
//39:28040 18/wms/
// target: "http://192.168.40.18/wms/", //39:28040 18/wms/
// target: "http://192.168.40.18/wms/", //39:28040 18/wms/
...
...
This diff is collapsed.
Click to expand it.
package.json
View file @
ec67e9bd
...
...
@@ -5,7 +5,7 @@
"description"
:
"An out-of-box UI solution for enterprise applications"
,
"scripts"
:
{
"analyze"
:
"cross-env ANALYZE=1 umi build"
,
"build"
:
"umi build"
,
"build"
:
"
set NODE_OPTIONS=--openssl-legacy-provider &&
umi build"
,
"deploy"
:
"npm run build && npm run gh-pages"
,
"dev"
:
"npm run start:dev"
,
"gh-pages"
:
"gh-pages -d dist"
,
...
...
This diff is collapsed.
Click to expand it.
src/app.jsx
View file @
ec67e9bd
...
...
@@ -142,6 +142,7 @@ export const layout = async (props) => {
},
menuRender
:
(
props
,
defaultDom
)
=>
{
console
.
log
(
props
);
if
(
props
.
isMobile
)
{
return
defaultDom
;
}
else
{
...
...
@@ -153,11 +154,40 @@ export const layout = async (props) => {
// unAccessible: <div>unAccessible</div>,
// 增加一个 loading 的状态
childrenRender
:
(
children
,
props
)
=>
{
// if (initialState?.loading) return <PageLoading />;
if
(
initialState
?.
loading
)
return
<
PageLoading
/>;
let
items
=
[...(
initialState
?.
newMenu
?.
userHavePermList
??
[])];
items
?.
unshift
({
path
:
"/welcome"
,
name
:
"首页"
,
icon
:
"smile"
,
component
:
"./Welcome"
,
haveChildren
:
false
,
key
:
"000000"
,
parentKey
:
"0"
,
routes
:
[],
children
:
null
,
title
:
null
,
});
let
home
;
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
(
<>
{
initialState
?.
currentUser
&&
location
.
pathname
!==
loginPath
?
(
<
TagView
home=
"/welcome"
>
{
children
}
</
TagView
>
<
TagView
home=
{
home
}
>
{
children
}
</
TagView
>
)
:
(
children
)
}
...
...
This diff is collapsed.
Click to expand it.
src/components/SiderMenu/SiderMenu.js
View file @
ec67e9bd
...
...
@@ -72,6 +72,7 @@ function Diymenu({
const
getMenuData
=
newMenu
?.
userHavePermList
??
[],
collectPerm
=
newMenu
?.
collectPerm
??
[],
recentUsePermList
=
newMenu
?.
recentUsePermList
??
[];
console
.
log
(
getMenuData
)
let
scrollToAnchor
=
(
anchorName
)
=>
{
if
(
anchorName
)
{
setanchor
(
anchorName
);
...
...
@@ -196,6 +197,17 @@ function Diymenu({
<
Icon
type
=
{
alive
?
"fullscreen"
:
"fullscreen-exit"
}
/
>
<
span
>
产品与服务
<
/span
>
<
/Menu.Item
>
<
Menu
.
Item
key
=
"/welcome"
style
=
{{
userSelect
:
"none"
,
backgroundColor
:
"#000"
,
marginTop
:
8
,
}}
>
<
Icon
type
=
"home"
/>
<
span
>
首页
<
/span
>
<
/Menu.Item
>
{
collectPerm
&&
collectPerm
.
map
((
item
,
i
)
=>
{
return
(
...
...
This diff is collapsed.
Click to expand it.
src/components/TagView/index.jsx
View file @
ec67e9bd
...
...
@@ -23,20 +23,20 @@ const TagView = ({ children, home }) => {
const
initTags
=
(
routeContext
)
=>
{
const
{
menuData
}
=
routeContext
;
if
(
tagList
.
length
===
0
&&
menuData
)
{
const
firstTag
=
menuData
.
filter
((
el
)
=>
el
.
path
===
home
)[
0
]
;
const
firstTag
=
getHome
(
menuData
);
;
if
(
firstTag
)
{
const
title
=
(
<
FormattedMessage
key=
{
firstTag
.
name
}
id=
{
`menu.${firstTag.name}`
}
defaultMessage=
"首页"
/>
);
//
const title = (
//
<FormattedMessage
//
key={firstTag.name}
//
id={`menu.${firstTag.name}`}
//
defaultMessage="首页"
//
/>
//
);
const
path
=
firstTag
.
path
;
history
.
push
({
pathname
:
firstTag
.
path
,
query
:
firstTag
.
query
});
setTagList
([
{
title
,
title
:
firstTag
.
name
,
path
,
children
:
firstTag
.
children
,
refresh
:
0
,
...
...
@@ -127,6 +127,21 @@ const TagView = ({ children, home }) => {
});
setTagList
(
tagsCopy
);
};
function
getHome
(
data
)
{
let
obj
;
function
loop
(
data
)
{
data
.
map
(
it
=>
{
if
(
it
.
path
==
home
)
{
obj
=
it
;
}
if
(
it
.
children
?.
length
>
0
)
{
loop
(
it
.
children
);
}
});
}
loop
(
data
);
return
obj
;
}
return
(
<>
...
...
This diff is collapsed.
Click to expand it.
src/utils/request.js
View file @
ec67e9bd
...
...
@@ -149,7 +149,7 @@ request.interceptors.response.use(async (response, options) => {
if
(
data
?.
code
!=
"0000"
)
{
message
.
destroy
();
if
(
data
?.
code
==
"9999"
)
{
if
(
data
?.
code
==
"9999"
||
data
?.
code
==
"0003"
)
{
message
.
warn
(
data
?.
msg
);
}
if
(
data
?.
code
==
"0001"
&&
window
.
location
.
href
.
indexOf
(
"login"
)
==
-
1
)
{
...
...
This diff is collapsed.
Click to expand it.
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