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
73cde75d
Commit
73cde75d
authored
Jan 02, 2024
by
张俊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
菜单处理及跳转
parent
26d00834
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
168 additions
and
5 deletions
+168
-5
src/App.vue
src/App.vue
+1
-1
src/components/bg-menu/index.vue
src/components/bg-menu/index.vue
+18
-4
src/components/bg-menu/menu-list.vue
src/components/bg-menu/menu-list.vue
+149
-0
No files found.
src/App.vue
View file @
73cde75d
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
bgMenu
from
"
@/components/bg-menu.vue
"
;
import
bgMenu
from
"
@/components/bg-menu
/index
.vue
"
;
import
login
from
"
@/page/login/index.vue
"
;
import
login
from
"
@/page/login/index.vue
"
;
import
page404
from
"
@/page/404.vue
"
;
import
page404
from
"
@/page/404.vue
"
;
import
register
from
"
@/page/register/index.vue
"
;
import
register
from
"
@/page/register/index.vue
"
;
...
...
src/components/bg-menu.vue
→
src/components/bg-menu
/index
.vue
View file @
73cde75d
...
@@ -26,7 +26,16 @@
...
@@ -26,7 +26,16 @@
@click="menuAction(item, item)">
@click="menuAction(item, item)">
<span>
<span>
{{
item
.
menuName
}}
{{
item
.
menuName
}}
<bg-icon
v-if=
"item.children && item.children.length && item.menuType !== 1"
icon=
"#bg-ic-arrow-down"
style=
"font-size: 8px; margin-left: 3px"
></bg-icon>
</span>
</span>
<menu-list
v-if=
"item.children && item.children.length"
:p_level=
"item.level"
:children=
"item.children"
:parent=
"item"
></menu-list>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -68,14 +77,16 @@
...
@@ -68,14 +77,16 @@
<
script
>
<
script
>
import
{
mapState
,
mapMutations
}
from
"
vuex
"
;
import
{
mapState
,
mapMutations
}
from
"
vuex
"
;
import
{
clearCookie
}
from
"
..
/services/cookie.js
"
;
import
{
clearCookie
}
from
"
@
/services/cookie.js
"
;
import
{
resetRouter
}
from
"
..
/router/index
"
;
import
{
resetRouter
}
from
"
@
/router/index
"
;
import
{
getImageUrl
}
from
"
@/services/helper.js
"
;
import
{
getImageUrl
}
from
"
@/services/helper.js
"
;
import
{
normalizeProps
}
from
"
vue-demi
"
;
import
menuList
from
"
./menu-list.vue
"
;
export
default
{
export
default
{
name
:
"
BgMenu
"
,
name
:
"
BgMenu
"
,
components
:
{},
components
:
{
menuList
,
},
props
:
{
props
:
{
path
:
{
path
:
{
type
:
String
,
type
:
String
,
...
@@ -506,6 +517,9 @@ export default {
...
@@ -506,6 +517,9 @@ export default {
&
:hover
{
&
:hover
{
background-color
:
#3753a4
;
background-color
:
#3753a4
;
>
.menu-list-main
{
display
:
block
;
}
}
}
}
}
}
}
...
...
src/components/bg-menu/menu-list.vue
0 → 100644
View file @
73cde75d
<
template
>
<div
class=
"menu-list-main"
:class=
"[p_level > 2 ? 'right' : 'bottom']"
>
<div
class=
"menu-list"
v-if=
"children && children.length > 0 && p_level
<
=
3
"
>
<div
class=
"menu-item"
:class=
"
{ hasChildren: item.children
&&
item.children.length > 0 }"
@click.stop="childMenuAction(item)"
v-show="item.menuType !== 2"
v-for="item in children"
:key="item.id">
<div
:title=
"item.menuName"
>
<span>
{{
item
.
menuName
}}
</span>
<div
class=
"menu-icon"
v-if=
"item.children && item.children.length > 0 && item.level
<
=
3
"
>
<bg-icon
style=
"font-size: 10px"
v-if=
"item.menuType == 0"
icon=
"#bg-ic-arrow-right"
/>
</div>
</div>
<menu-list
v-if=
"children && children.length > 0"
:p_level=
"item.level"
:children=
"item.children"
:parent=
"item"
>
</menu-list>
</div>
</div>
</div>
</
template
>
<
script
>
export
default
{
name
:
"
menuList
"
,
//给组件命名
};
</
script
>
<
script
setup
>
import
{
ElMessage
}
from
"
element-plus
"
;
import
{
useRouter
}
from
"
vue-router
"
;
const
router
=
useRouter
();
const
props
=
defineProps
({
parent
:
{
type
:
Object
,
default
:
()
=>
({}),
},
children
:
{
type
:
Array
,
default
:
()
=>
[],
},
p_level
:
{
type
:
Number
,
default
:
0
,
},
});
const
childMenuAction
=
(
item
)
=>
{
// if (isDeveloping(item.path)) return;
// window.open(item.path);
router
.
push
(
item
.
path
);
};
</
script
>
<
style
lang=
"scss"
scoped
>
.menu-list-main
{
height
:
auto
;
position
:
absolute
;
z-index
:
9
;
display
:
none
;
&
.right
{
width
:
auto
;
left
:
100%
;
padding-left
:
5px
;
top
:
-4px
;
>
.menu-list
{
width
:
auto
!
important
;
}
}
&
.bottom
{
min-width
:
100%
;
width
:
auto
;
padding-top
:
5px
;
top
:
100%
;
left
:
0
;
>
.menu-list
{
width
:
100%
;
}
}
}
.menu-list
{
box-shadow
:
0
4px
12px
0
rgba
(
18
,
30
,
63
,
0
.1
);
background-color
:
#ffffff
;
border-radius
:
4px
;
padding
:
4px
0
;
// z-index: 9;
text-align
:
center
;
.menu-item
{
width
:
auto
;
height
:
34px
;
font-size
:
14px
;
line-height
:
34px
;
padding
:
0
16px
;
background-color
:
#fff
;
color
:
#202531
;
text-align
:
left
;
white-space
:
nowrap
;
position
:
relative
;
&
.hasChildren
{
padding
:
0
34px
0
16px
;
}
.menu-icon
{
width
:
34px
;
height
:
34px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
position
:
absolute
;
right
:
0
;
top
:
0
;
transform
:
rotate
(
0
);
transition
:
all
300ms
;
}
&
:hover
{
background-color
:
#eff2fa
;
>
.menu-list-main
{
display
:
block
;
}
>
div
>
.menu-icon
{
transform
:
rotate
(
180deg
);
}
}
.width-num
{
display
:
inline-block
;
vertical-align
:
middle
;
min-width
:
30px
;
background-color
:
#ff6a00
;
font-size
:
10px
;
line-height
:
16px
;
color
:
#fff
;
padding
:
0
8px
;
margin-left
:
5px
;
box-sizing
:
border-box
;
border-radius
:
8px
;
text-align
:
center
;
overflow
:
hidden
;
}
}
.menu-item
{
cursor
:
pointer
;
}
}
</
style
>
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