Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
so-manage-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
smart-operation
so-manage-ui
Commits
e74514c9
Commit
e74514c9
authored
Oct 25, 2022
by
张俊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调试登录
parent
b9c6ee44
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
178 additions
and
190 deletions
+178
-190
src/App.vue
src/App.vue
+4
-5
src/components/bg-menu.vue
src/components/bg-menu.vue
+26
-23
src/page/login/index.vue
src/page/login/index.vue
+3
-1
src/router/function.js
src/router/function.js
+145
-156
yarn.lock
yarn.lock
+0
-5
No files found.
src/App.vue
View file @
e74514c9
...
...
@@ -60,11 +60,10 @@ export default {
},
nowParent
(){
if
(
this
.
pageShow
&&
this
.
$store
.
state
.
userInfo
){
console
.
log
(
2222222
)
console
.
log
(
this
.
navMenu
)
// return this.navMenu[this.rowPath.slice(1,4)]
// return this.pathToData(this.navMenu,this.rowPath)
return
this
.
navMenu
[
1
]
// console.log(2222222)
// console.log(this.navMenu)
// console.log(this.rowPath)
return
this
.
navMenu
[
this
.
rowPath
.
slice
(
1
,
2
)]
}
else
{
return
''
...
...
src/components/bg-menu.vue
View file @
e74514c9
...
...
@@ -15,7 +15,7 @@
</router-link>
<!-- 菜单 -->
<div
class=
"main-menu"
v-if=
"userInfo&& userInfo.
user
"
>
<div
class=
"main-menu"
v-if=
"userInfo&& userInfo.
system_id
"
>
<!-- 前台菜单 -->
<div
class=
"font-menu"
v-if=
"fontMenu&&fontMenu.length"
>
<div
class=
"nav-item"
:style=
"path==item.path?
{backgroundColor:'#2b4695'}:''" v-show="item.show" v-for="(item,index) in fontMenu" :key="'font'+index">
...
...
@@ -45,16 +45,17 @@
</div>
</div>
<div
class=
"person-menu"
v-if=
"userInfo&& userInfo.
user
"
>
<div
class=
"person-menu"
v-if=
"userInfo&& userInfo.
system_id
"
>
<!-- 信息 -->
<!-- 购物车 -->
<!-- 用户中心 -->
<div
class=
"user-center nav-item"
>
<span
class=
"user-icon"
>
<img
style=
"width:24px;height:24px;border-radius:50%;vertical-align:middle;"
:src=
"userInfo&&userInfo.headPortrait?userInfo.headPortrait:'/src/assets/imgs/home_ic_user.png'"
/>
<img
style=
"width:24px;height:24px;border-radius:50%;vertical-align:middle;"
v-if=
"userInfo&&userInfo.logo"
:src=
"userInfo&&userInfo.logo"
/>
<img
style=
"width:24px;height:24px;border-radius:50%;vertical-align:middle;"
v-else
src=
"../assets/imgs/home_ic_user.png"
/>
</span>
<span
class=
"user-name"
v-if=
"userInfo && userInfo.
user
"
>
{{
userInfo
.
name
||
userInfo
.
user
}}
<span
class=
"user-name"
v-if=
"userInfo && userInfo.
system_id
"
>
{{
userInfo
.
system_account
||
userInfo
.
system_id
}}
<bg-icon
icon=
"#bg-ic-arrow-down"
style=
"font-size:8px;margin-left: 3px;"
></bg-icon>
</span>
...
...
@@ -62,9 +63,9 @@
请登录
</span>
<div
class=
"menu-virtual"
></div>
<div
v-if=
"userInfo && userInfo.
user
"
class=
"menu-list"
>
<div
v-if=
"userInfo && userInfo.
system_id
"
class=
"menu-list"
>
<div
v-for=
"(item, index) in
user_arr
"
v-for=
"(item, index) in
systemMenu
"
class=
"menu-item text_clip"
:key=
"index + 700"
@
click=
"menuAction(item.path,item)"
...
...
@@ -98,7 +99,6 @@ export default {
data
()
{
return
{
documentScrollTop
:
0
,
user_arr
:
[],
cartList
:
[],
showCart
:
true
,
showShopMenu
:
false
,
...
...
@@ -145,6 +145,15 @@ export default {
}
});
return
temp
},
systemMenu
(
state
){
let
temp
=
[]
state
.
menu
.
forEach
(
e
=>
{
if
(
e
.
menuType
==
'
manager
'
){
temp
.
push
(
e
)
}
});
return
temp
}
})
...
...
@@ -201,18 +210,13 @@ export default {
let
path
=
this
.
$route
.
path
;
window
.
location
.
href
=
`/login?redirect=
${
path
}
`
;
}
else
{
//true 同区域跳转
//false 跨系统跳转
if
(
parent
.
menuType
==
this
.
$store
.
state
.
menuObj
[
this
.
path
].
menuType
){
this
.
$router
.
push
(
n
);
//是否有子路由,有则寻找子路由的第一个进行跳转,无则直接进行跳转
//使用childMenuAction是模拟template中,子路径点击跳转使用childMenuAction,
//防止出现层级错误的问题
if
(
parent
.
children
&&
parent
.
children
.
length
){
this
.
childMenuAction
(
parent
.
children
[
0
],
parent
)
}
else
{
let
temp
=
''
if
(
this
.
$store
.
state
.
menuObj
[
n
].
menuType
==
'
font
'
||
this
.
$store
.
state
.
menuObj
[
n
].
menuType
==
'
system
'
){
temp
=
'
/apaas/ui/#
'
}
else
if
(
this
.
$store
.
state
.
menuObj
[
n
].
menuType
==
'
manager
'
){
temp
=
'
/apaas/system/ui/#
'
}
window
.
location
.
href
=
temp
+
n
this
.
pathToUrl
(
n
,
parent
)
}
}
},
...
...
@@ -238,17 +242,16 @@ export default {
if
(
path
.
includes
(
'
http
'
)){
window
.
open
(
path
,
'
_blank
'
)
}
else
{
debugger
//判断是否是同区域内跳转
//非同区域跳转需要改前缀,如apaas/ui跳转到apaas/manager
if
(
parent
.
menuType
==
this
.
$store
.
state
.
menuObj
[
this
.
path
].
menuType
){
if
(
this
.
$store
.
state
.
menuObj
[
this
.
path
]
&&
parent
.
menuType
==
this
.
$store
.
state
.
menuObj
[
this
.
path
].
menuType
){
this
.
$router
.
push
(
path
);
}
else
{
let
temp
=
''
if
(
this
.
$store
.
state
.
menuObj
[
path
].
menuType
==
'
font
'
||
this
.
$store
.
state
.
menuObj
[
path
].
menuType
==
'
system
'
){
temp
=
'
/apaas/ui/#
'
temp
=
'
/apaas/
portal/
ui/#
'
}
else
if
(
this
.
$store
.
state
.
menuObj
[
path
].
menuType
==
'
manager
'
){
temp
=
'
/apaas/
system
/ui/#
'
temp
=
'
/apaas/
manage
/ui/#
'
}
window
.
location
.
href
=
temp
+
path
}
...
...
src/page/login/index.vue
View file @
e74514c9
...
...
@@ -90,7 +90,9 @@ export default {
this
.
$store
.
commit
(
'
setMenuObj
'
,
menuObj
)
// }
generateRoutes
()
this
.
$router
.
push
(
"
/
"
);
// this.$router.push("/");
//跳转到工作台页面
window
.
location
.
href
=
'
/apaas/portal/ui/#/
'
}
});
},
...
...
src/router/function.js
View file @
e74514c9
...
...
@@ -6,7 +6,6 @@ var adminMenu = [
name
:
"
workspace
"
,
menuType
:
'
system
'
,
//system:apaas后管,能力注册页等 font:apaas前台页 manager:apaas管理中心
show
:
true
,
level
:
1
,
children
:[{
menuName
:
"
能力管理
"
,
path
:
"
/ability-manage
"
,
...
...
@@ -154,148 +153,143 @@ var adminMenu = [
}
]
},
{
menuName
:
"
管理中心
"
,
path
:
"
/manage
"
,
name
:
"
manage
"
,
parentPath
:
null
,
menuType
:
'
manager
'
,
show
:
true
,
level
:
1
,
children
:[{
menuName
:
"
开发管理
"
,
path
:
"
/develop
"
,
{
name
:
"
index
"
,
menuName
:
"
首页
"
,
path
:
"
/
"
,
parentPath
:
null
,
menuType
:
'
font
'
,
show
:
true
,
},
{
menuName
:
"
管理中心
"
,
path
:
"
/manage
"
,
name
:
"
manage
"
,
parentPath
:
null
,
menuType
:
'
manager
'
,
show
:
true
,
children
:[{
menuName
:
"
开发管理
"
,
path
:
"
/develop
"
,
parentPath
:
null
,
menuType
:
'
manager
'
,
show
:
true
,
icon
:
"
#bg-ic-ability
"
,
children
:[
{
name
:
"
account-manage
"
,
menuName
:
'
系统账号管理
'
,
parentPath
:
null
,
menuType
:
'
manager
'
,
show
:
true
,
path
:
"
/develop/account
"
,
linkPath
:
[
"
/develop/account/add
"
]
},
{
name
:
"
account-add-manage
"
,
menuName
:
'
新建账号
'
,
parentPath
:
'
/develop/account
'
,
menuType
:
'
manager
'
,
path
:
"
/develop/account/add
"
,
},
{
name
:
"
account-detail-manage
"
,
menuName
:
'
账号详情
'
,
parentPath
:
'
/develop/account
'
,
menuType
:
'
manager
'
,
path
:
"
/develop/account/detail
"
,
},
{
name
:
"
menu-manage
"
,
menuName
:
'
菜单管理
'
,
parentPath
:
null
,
menuType
:
'
manager
'
,
show
:
true
,
icon
:
"
#bg-ic-ability
"
,
children
:[
{
name
:
"
account-manage
"
,
menuName
:
'
系统账号管理
'
,
parentPath
:
null
,
menuType
:
'
manager
'
,
show
:
true
,
path
:
"
/develop/account
"
,
linkPath
:
[
"
/develop/account/add
"
]
},
{
name
:
"
account-add-manage
"
,
menuName
:
'
新建账号
'
,
parentPath
:
'
/develop/account
'
,
menuType
:
'
manager
'
,
path
:
"
/develop/account/add
"
,
},
{
name
:
"
account-detail-manage
"
,
menuName
:
'
账号详情
'
,
parentPath
:
'
/develop/account
'
,
menuType
:
'
manager
'
,
path
:
"
/develop/account/detail
"
,
},
{
name
:
"
menu-manage
"
,
menuName
:
'
菜单管理
'
,
parentPath
:
null
,
menuType
:
'
manager
'
,
show
:
true
,
path
:
"
/develop/menu
"
,
},
]
path
:
"
/develop/menu
"
,
},
]
},
{
menuName
:
"
系统管理
"
,
path
:
"
/system
"
,
parentPath
:
null
,
menuType
:
'
manager
'
,
show
:
true
,
icon
:
"
#bg-ic-ability
"
,
children
:[
{
menuName
:
"
系统管理
"
,
path
:
"
/system
"
,
name
:
"
system-manage
"
,
menuName
:
'
组织管理
'
,
parentPath
:
null
,
menuType
:
'
manager
'
,
show
:
true
,
icon
:
"
#bg-ic-ability
"
,
children
:[
{
name
:
"
system-manage
"
,
menuName
:
'
组织管理
'
,
parentPath
:
null
,
menuType
:
'
manager
'
,
show
:
true
,
path
:
"
/system/organization
"
,
},
{
name
:
"
paltform-user-manage
"
,
menuName
:
'
新增平台用户
'
,
parentPath
:
'
/system/organization
'
,
menuType
:
'
manager
'
,
show
:
false
,
path
:
"
/system/organization/platform-user
"
,
},
{
name
:
"
system-user-manage
"
,
menuName
:
'
新增组织用户
'
,
parentPath
:
'
/system/organization
'
,
menuType
:
'
manager
'
,
show
:
false
,
path
:
"
/system/organization/system-user
"
,
},
{
name
:
"
user-detail-manage
"
,
menuName
:
'
用户详情
'
,
parentPath
:
'
/system/organization
'
,
menuType
:
'
manager
'
,
show
:
false
,
path
:
"
/system/organization/user-detail
"
,
},
{
name
:
"
org-detail-manage
"
,
menuName
:
'
组织详情
'
,
parentPath
:
'
/system/organization
'
,
menuType
:
'
manager
'
,
show
:
false
,
path
:
"
/system/organization/org-detail
"
,
},
{
name
:
"
role-manage
"
,
menuName
:
'
角色管理
'
,
parentPath
:
null
,
menuType
:
'
manager
'
,
show
:
true
,
path
:
"
/system/role
"
,
},
]
path
:
"
/system/organization
"
,
},
{
name
:
"
paltform-user-manage
"
,
menuName
:
'
新增平台用户
'
,
parentPath
:
'
/system/organization
'
,
menuType
:
'
manager
'
,
show
:
false
,
path
:
"
/system/organization/platform-user
"
,
},
{
name
:
"
system-user-manage
"
,
menuName
:
'
新增组织用户
'
,
parentPath
:
'
/system/organization
'
,
menuType
:
'
manager
'
,
show
:
false
,
path
:
"
/system/organization/system-user
"
,
},
{
name
:
"
user-detail-manage
"
,
menuName
:
'
用户详情
'
,
parentPath
:
'
/system/organization
'
,
menuType
:
'
manager
'
,
show
:
false
,
path
:
"
/system/organization/user-detail
"
,
},
{
name
:
"
org-detail-manage
"
,
menuName
:
'
组织详情
'
,
parentPath
:
'
/system/organization
'
,
menuType
:
'
manager
'
,
show
:
false
,
path
:
"
/system/organization/org-detail
"
,
},
{
menuName
:
"
配置管理
"
,
path
:
"
/config
"
,
name
:
"
role-manage
"
,
menuName
:
'
角色管理
'
,
parentPath
:
null
,
menuType
:
'
manager
'
,
show
:
true
,
icon
:
"
#bg-ic-ability
"
,
children
:[
{
name
:
"
dict-manage
"
,
menuName
:
'
字典管理
'
,
parentPath
:
null
,
menuType
:
'
manager
'
,
show
:
true
,
path
:
"
/config/dict
"
,
},
]
path
:
"
/system/role
"
,
},
]
]
},
{
name
:
"
index
"
,
menuName
:
"
首页
"
,
path
:
"
/
"
,
menuName
:
"
配置管理
"
,
path
:
"
/config
"
,
parentPath
:
null
,
menuType
:
'
font
'
,
level
:
1
,
menuType
:
'
manager
'
,
show
:
true
,
icon
:
"
#bg-ic-ability
"
,
children
:[
{
name
:
"
dict-manage
"
,
menuName
:
'
字典管理
'
,
parentPath
:
null
,
menuType
:
'
manager
'
,
show
:
true
,
path
:
"
/config/dict
"
,
},
]
},
]
},
]
function
getViews
(
path
)
{
...
...
@@ -303,20 +297,20 @@ function getViews(path) {
let
pathArr
=
path
.
split
(
'
/
'
)
let
modules
=
{}
switch
(
pathArr
.
length
)
{
case
2
:
modules
=
import
.
meta
.
glob
(
'
../page/main/**/*.vue
'
)
break
;
case
3
:
modules
=
import
.
meta
.
glob
(
'
../page/main/**/*/*.vue
'
)
break
;
case
4
:
modules
=
import
.
meta
.
glob
(
'
../page/main/**/**/*/*.vue
'
)
break
;
case
5
:
modules
=
import
.
meta
.
glob
(
'
../page/main/**/**/**/*/*.vue
'
)
break
;
default
:
break
;
case
2
:
modules
=
import
.
meta
.
glob
(
'
../page/main/**/*.vue
'
)
break
;
case
3
:
modules
=
import
.
meta
.
glob
(
'
../page/main/**/*/*.vue
'
)
break
;
case
4
:
modules
=
import
.
meta
.
glob
(
'
../page/main/**/**/*/*.vue
'
)
break
;
case
5
:
modules
=
import
.
meta
.
glob
(
'
../page/main/**/**/**/*/*.vue
'
)
break
;
default
:
break
;
}
// 然后动态路由的时候这样来取
console
.
log
(
modules
[
'
../page/main
'
+
path
+
'
/index.vue
'
]);
...
...
@@ -326,29 +320,24 @@ return modules['../page/main' + path + '/index.vue']
//处理路由方法
var
menuToRouter
=
(
menu
)
=>
{
menu
.
forEach
(
e
=>
{
//第一层级是最上层菜单,有相应的菜单可以点击查看
if
(
e
.
children
&&
e
.
level
==
1
){
console
.
log
(
`@/page/main
${
e
.
path
}
/index.vue`
);
e
.
component
=
getViews
(
e
.
path
)
menuToRouter
(
e
.
children
)
}
else
if
(
e
.
children
){
// 其他层级作为文件夹,只提供父级
e
.
component
=
()
=>
import
(
'
../page/parent/parent.vue
'
)
menuToRouter
(
e
.
children
)
if
(
e
.
children
){
// 其他层级作为文件夹,只提供父级
e
.
component
=
()
=>
import
(
'
../page/parent/parent.vue
'
)
menuToRouter
(
e
.
children
)
}
else
{
console
.
log
(
`@/page/main
${
e
.
path
}
/index.vue`
);
//叶子层级需要加载到对应文件
//对首页做兼容
if
(
e
.
path
==
'
/
'
){
e
.
component
=
()
=>
import
(
'
../page/main/index/index.vue
'
)
}
else
{
console
.
log
(
`@/page/main
${
e
.
path
}
/index.vue`
);
//叶子层级需要加载到对应文件
//对首页做兼容
if
(
e
.
path
==
'
/
'
){
e
.
component
=
()
=>
import
(
'
../page/main/develop/account/index.vue
'
)
}
else
{
e
.
component
=
getViews
(
e
.
path
)
}
e
.
component
=
getViews
(
e
.
path
)
}
}
});
}
export
default
{
adminMenu
,
menuToRouter
adminMenu
,
menuToRouter
}
\ No newline at end of file
yarn.lock
View file @
e74514c9
...
...
@@ -895,11 +895,6 @@ is-url@^1.2.4:
resolved "https://registry.npmmirror.com/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52"
integrity sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==
js-md5@^0.7.3:
version "0.7.3"
resolved "https://mirrors.cloud.tencent.com/npm/js-md5/-/js-md5-0.7.3.tgz#b4f2fbb0b327455f598d6727e38ec272cd09c3f2"
integrity sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ==
lodash-es@^4.17.21:
version "4.17.21"
resolved "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.21.tgz"
...
...
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