Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-system
/
micro-portal
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 84a62671
authored
Oct 29, 2020
by
冒粤蓉
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix portal
1 parent
7c1910f2
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
55 additions
and
26 deletions
src/components/DesktopLeftSider/Sub/Menu.vue
src/components/DesktopRightSider/DesktopRightSider.vue
src/components/DesktopTopSider/Sub/UserButton.vue
src/config/menuTree.js
src/micro/index.js
src/store/modules/app.js
src/components/DesktopLeftSider/Sub/Menu.vue
View file @
84a6267
...
@@ -9,11 +9,13 @@
...
@@ -9,11 +9,13 @@
:key="item.origin.menuNo"
:key="item.origin.menuNo"
@click="titleClick(item, $event)" >
@click="titleClick(item, $event)" >
<div
class=
"ant-menu-submenu-title"
style=
"padding-left: 24px;"
>
<div
class=
"ant-menu-submenu-title"
style=
"padding-left: 24px;"
>
<img
v-if=
"item.origin.icon"
:src=
"item.origin.icon"
/>
<DesktopOutlined
v-if=
"item.origin.icon === 'DesktopOutlined'"
/>
<UserOutlined
v-else
/>
<CarOutlined
v-if=
"item.origin.icon === 'CarOutlined'"
/>
<SettingOutlined
v-if=
"!item.origin.icon"
/>
<span>
{{
item
.
origin
.
menuName
}}
</span>
<span>
{{
item
.
origin
.
menuName
}}
</span>
<i
class=
"ant-menu-submenu-arrow"
></i>
<i
class=
"ant-menu-submenu-arrow"
></i>
</div>
</div>
<!-- ant-menu-item-selected ant-menu-item-active -->
<!-- ant-menu-item-selected ant-menu-item-active -->
<!-- ant-motion-collapse-legacy ant-motion-collapse-legacy-active -->
<!-- ant-motion-collapse-legacy ant-motion-collapse-legacy-active -->
<ul
class=
"ant-menu-sub ant-menu ant-menu-inline"
<ul
class=
"ant-menu-sub ant-menu ant-menu-inline"
...
@@ -35,6 +37,9 @@
...
@@ -35,6 +37,9 @@
<
script
>
<
script
>
import
{
import
{
CarOutlined
,
DesktopOutlined
,
SettingOutlined
,
UserOutlined
,
UserOutlined
,
TeamOutlined
,
TeamOutlined
,
FileOutlined
,
FileOutlined
,
...
@@ -48,9 +53,9 @@ import { menuTree as menuTreeLocalList } from 'config/menuTree';
...
@@ -48,9 +53,9 @@ import { menuTree as menuTreeLocalList } from 'config/menuTree';
export
default
{
export
default
{
name
:
'Menu'
,
name
:
'Menu'
,
components
:
{
components
:
{
Use
rOutlined
,
Ca
rOutlined
,
Team
Outlined
,
Desktop
Outlined
,
File
Outlined
,
Setting
Outlined
,
},
},
setup
(
props
,
context
)
{
setup
(
props
,
context
)
{
const
{
ctx
}
=
getCurrentInstance
();
const
{
ctx
}
=
getCurrentInstance
();
...
@@ -74,6 +79,7 @@ export default {
...
@@ -74,6 +79,7 @@ export default {
// 点击二级菜单标题
// 点击二级菜单标题
const
cItemClick
=
(
path
,
cItem
,
parentItem
)
=>
{
const
cItemClick
=
(
path
,
cItem
,
parentItem
)
=>
{
const
cOrigin
=
cItem
.
origin
;
const
cOrigin
=
cItem
.
origin
;
let
showEmpty
=
false
;
// 激活active类
// 激活active类
state
.
menuList
.
forEach
(
ele
=>
{
state
.
menuList
.
forEach
(
ele
=>
{
const
children
=
ele
.
children
;
const
children
=
ele
.
children
;
...
@@ -86,11 +92,17 @@ export default {
...
@@ -86,11 +92,17 @@ export default {
state
.
curBreadCrumb
.
parent
[
'menuName'
]
=
parentItem
.
origin
.
menuName
;
state
.
curBreadCrumb
.
parent
[
'menuName'
]
=
parentItem
.
origin
.
menuName
;
state
.
curBreadCrumb
.
children
=
[{
state
.
curBreadCrumb
.
children
=
[{
menuName
:
cOrigin
.
menuName
,
menuName
:
cOrigin
.
menuName
,
path
:
cOrigin
.
path
||
''
,
path
:
cOrigin
.
path
||
'
/404
'
,
active
:
true
active
:
true
}];
}];
localStorage
.
setItem
(
'breadCrumb'
,
JSON
.
stringify
(
state
.
curBreadCrumb
));
path
=
path
?
path
:
'/404'
;
path
=
path
?
path
:
'/404'
;
if
(
path
===
'/404'
)
{
showEmpty
=
true
;
}
store
.
dispatch
(
'app/setCommonData'
,
{
showEmpty
});
history
.
pushState
(
null
,
path
,
path
);
history
.
pushState
(
null
,
path
,
path
);
}
}
...
@@ -149,22 +161,35 @@ export default {
...
@@ -149,22 +161,35 @@ export default {
const
getNewTree
=
getMenuTree
(
res
.
data
,
menuTreeLocalList
),
const
getNewTree
=
getMenuTree
(
res
.
data
,
menuTreeLocalList
),
firstParent
=
getNewTree
[
0
].
origin
,
firstParent
=
getNewTree
[
0
].
origin
,
firstChildren
=
getNewTree
[
0
].
children
[
0
].
origin
;
firstChildren
=
getNewTree
[
0
].
children
[
0
].
origin
;
let
showEmpty
=
false
;
getNewTree
.
forEach
((
item
,
index
)
=>
{
item
.
showSubList
=
index
==
0
?
true
:
false
;
item
.
children
.
forEach
((
cItem
,
cIndex
)
=>
{
cItem
.
subItemActive
=
cIndex
==
0
&&
index
==
0
?
true
:
false
;
})
});
state
.
menuList
=
getNewTree
;
state
.
menuList
=
getNewTree
;
// 同步面包屑
// 同步面包屑
state
.
curBreadCrumb
.
parent
[
'menuName'
]
=
firstParent
.
menuName
;
const
getBreadCrumb
=
JSON
.
parse
(
localStorage
.
getItem
(
'breadCrumb'
));
const
breadChildren
=
getBreadCrumb
?
getBreadCrumb
.
children
[
0
]
:
''
;
let
parentMenuName
=
getBreadCrumb
?
getBreadCrumb
.
parent
.
menuName
:
firstParent
.
menuName
,
childrenMenuName
=
breadChildren
.
menuName
||
firstChildren
.
menuName
,
childrenPath
=
breadChildren
.
path
||
firstChildren
.
menuName
||
''
;
state
.
curBreadCrumb
.
parent
[
'menuName'
]
=
parentMenuName
;
state
.
curBreadCrumb
.
children
.
push
({
state
.
curBreadCrumb
.
children
.
push
({
menuName
:
firstChildren
.
m
enuName
,
menuName
:
childrenM
enuName
,
path
:
firstChildren
.
path
||
''
,
path
:
childrenPath
,
active
:
true
active
:
true
});
});
getNewTree
.
forEach
((
item
,
index
)
=>
{
item
.
showSubList
=
item
.
origin
.
menuName
==
parentMenuName
?
true
:
false
;
item
.
children
.
forEach
((
cItem
,
cIndex
)
=>
{
cItem
.
subItemActive
=
cItem
.
origin
.
menuName
===
childrenMenuName
?
true
:
false
;
})
});
if
(
childrenPath
===
'/404'
||
childrenPath
===
'/'
)
{
showEmpty
=
true
;
}
store
.
dispatch
(
'app/setCommonData'
,
{
showEmpty
});
history
.
pushState
(
null
,
childrenPath
,
childrenPath
);
store
.
dispatch
(
'menu/setBreadCrumb'
,
state
.
curBreadCrumb
);
store
.
dispatch
(
'menu/setBreadCrumb'
,
state
.
curBreadCrumb
);
}
}
},
err
=>
{
},
err
=>
{
...
...
src/components/DesktopRightSider/DesktopRightSider.vue
View file @
84a6267
...
@@ -50,7 +50,7 @@ export default {
...
@@ -50,7 +50,7 @@ export default {
})
})
const
showEmpty
=
computed
(()
=>
{
const
showEmpty
=
computed
(()
=>
{
return
!
state
.
el_sub_innerH
;
return
!
state
.
el_sub_innerH
||
store
.
getters
.
commonData
.
showEmpty
;
})
})
const
breadCrumbList
=
computed
(()
=>
{
const
breadCrumbList
=
computed
(()
=>
{
...
@@ -99,6 +99,9 @@ export default {
...
@@ -99,6 +99,9 @@ export default {
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
@import
'styles/variables.less'
;
@import
'styles/variables.less'
;
.ant-layout-content
{
min-height
:
unset
!important
;
}
.ant-empty
{
.ant-empty
{
margin-top
:
200px
;
margin-top
:
200px
;
}
}
...
...
src/components/DesktopTopSider/Sub/UserButton.vue
View file @
84a6267
...
@@ -33,6 +33,7 @@ export default {
...
@@ -33,6 +33,7 @@ export default {
const
logout
=
()
=>
{
const
logout
=
()
=>
{
localStorage
.
removeItem
(
'token'
);
localStorage
.
removeItem
(
'token'
);
localStorage
.
removeItem
(
'userInfo'
);
localStorage
.
removeItem
(
'userInfo'
);
localStorage
.
removeItem
(
'breadCrumb'
);
store
.
dispatch
(
'app/setToken'
,
''
);
store
.
dispatch
(
'app/setToken'
,
''
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
window
.
location
.
reload
();
window
.
location
.
reload
();
...
...
src/config/menuTree.js
View file @
84a6267
...
@@ -9,7 +9,7 @@ const menuTree = [
...
@@ -9,7 +9,7 @@ const menuTree = [
menuName
:
"设备管理"
,
menuName
:
"设备管理"
,
menuNo
:
201
,
menuNo
:
201
,
type
:
1
,
type
:
1
,
icon
:
''
icon
:
'
CarOutlined
'
},
},
children
:
[
children
:
[
{
{
...
@@ -29,7 +29,7 @@ const menuTree = [
...
@@ -29,7 +29,7 @@ const menuTree = [
menuName
:
"系统管理"
,
menuName
:
"系统管理"
,
menuNo
:
101
,
menuNo
:
101
,
type
:
1
,
type
:
1
,
icon
:
''
icon
:
'
DesktopOutlined
'
},
},
children
:
[
children
:
[
{
{
...
@@ -47,7 +47,7 @@ const menuTree = [
...
@@ -47,7 +47,7 @@ const menuTree = [
menuName
:
"用户组管理"
,
menuName
:
"用户组管理"
,
menuNo
:
10102
,
menuNo
:
10102
,
type
:
2
,
type
:
2
,
path
:
''
path
:
'
/404
'
}
}
},
},
{
{
...
...
src/micro/index.js
View file @
84a6267
...
@@ -9,16 +9,16 @@ const showLoading = status => {
...
@@ -9,16 +9,16 @@ const showLoading = status => {
registerMicroApps
(
apps
,
{
registerMicroApps
(
apps
,
{
// qiankun 生命周期钩子 - 加载前
// qiankun 生命周期钩子 - 加载前
beforeLoad
:
(
app
)
=>
{
beforeLoad
:
(
app
)
=>
{
showLoading
(
true
);
//
showLoading(true);
// 超时
// 超时
setTimeout
(()
=>
{
//
setTimeout(() => {
showLoading
(
false
);
//
showLoading(false);
},
10
000
)
// }, 1
000)
return
Promise
.
resolve
();
return
Promise
.
resolve
();
},
},
// qiankun 生命周期钩子 - 挂载后
// qiankun 生命周期钩子 - 挂载后
afterMount
:
(
app
)
=>
{
afterMount
:
(
app
)
=>
{
showLoading
(
false
);
//
showLoading(false);
return
Promise
.
resolve
();
return
Promise
.
resolve
();
},
},
});
});
...
...
src/store/modules/app.js
View file @
84a6267
...
@@ -8,7 +8,7 @@ export default {
...
@@ -8,7 +8,7 @@ export default {
userInfo
:
{},
userInfo
:
{},
showLoading
:
false
,
showLoading
:
false
,
commonData
:
{
commonData
:
{
parent
:
0
showEmpty
:
false
}
}
},
},
mutations
:
{
mutations
:
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment