Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bill-manager-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
赵啸非
bill-manager-ui
Commits
5beea730
Commit
5beea730
authored
Sep 10, 2024
by
“yiyousong”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加菜单图标选择框
parent
bebefae2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
126 additions
and
19 deletions
+126
-19
admin_2/src/pages/system/menu/Menu.vue
admin_2/src/pages/system/menu/Menu.vue
+10
-5
admin_2/src/pages/system/menu/components/AddMenu.vue
admin_2/src/pages/system/menu/components/AddMenu.vue
+14
-5
admin_2/src/pages/system/menu/components/IconSelect.vue
admin_2/src/pages/system/menu/components/IconSelect.vue
+93
-0
admin_2/src/router/index.js
admin_2/src/router/index.js
+9
-9
No files found.
admin_2/src/pages/system/menu/Menu.vue
View file @
5beea730
...
@@ -99,11 +99,11 @@ export default {
...
@@ -99,11 +99,11 @@ export default {
// return (this.current - 1) * this.size + index + 1;
// return (this.current - 1) * this.size + index + 1;
// },
// },
// },
// },
{
//
{
label
:
"
树形展开
"
,
//
label: "树形展开",
width
:
"
80
"
,
//
width: "80",
align
:
"
center
"
,
//
align: "center",
},
//
},
{
{
label
:
"
菜单名称
"
,
label
:
"
菜单名称
"
,
prop
:
"
name
"
,
prop
:
"
name
"
,
...
@@ -118,6 +118,11 @@ export default {
...
@@ -118,6 +118,11 @@ export default {
label
:
"
图标
"
,
label
:
"
图标
"
,
align
:
"
center
"
,
align
:
"
center
"
,
prop
:
"
imgPath
"
,
prop
:
"
imgPath
"
,
formatter
:
(
row
)
=>
{
if
(
row
.
imgPath
)
{
return
<
i
class
=
{
row
.
imgPath
}
><
/i>
;
}
},
},
},
{
{
label
:
"
权限类型
"
,
label
:
"
权限类型
"
,
...
...
admin_2/src/pages/system/menu/components/AddMenu.vue
View file @
5beea730
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
:title=
"title"
:title=
"title"
:destroy-on-close=
"true"
:destroy-on-close=
"true"
:visible.sync=
"Visible"
:visible.sync=
"Visible"
width=
"
40%
"
width=
"
610px
"
@
close=
"handleClose"
@
close=
"handleClose"
:close-on-click-modal=
"false"
:close-on-click-modal=
"false"
top=
"10vh"
top=
"10vh"
...
@@ -17,7 +17,11 @@
...
@@ -17,7 +17,11 @@
label-width=
"100px"
label-width=
"100px"
>
>
<el-form-item
label=
"菜单名称"
prop=
"name"
>
<el-form-item
label=
"菜单名称"
prop=
"name"
>
<el-input
placeholder=
"请输入系统名称"
v-model=
"form.name"
></el-input>
<el-input
placeholder=
"请输入系统名称"
v-model=
"form.name"
clearable
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"父级菜单"
prop=
"parentId"
>
<el-form-item
label=
"父级菜单"
prop=
"parentId"
>
<el-select
<el-select
...
@@ -51,6 +55,7 @@
...
@@ -51,6 +55,7 @@
</el-form-item>
</el-form-item>
<el-form-item
label=
"访问地址"
prop=
"url"
>
<el-form-item
label=
"访问地址"
prop=
"url"
>
<el-input
<el-input
clearable
placeholder=
"请输入菜单访问地址"
placeholder=
"请输入菜单访问地址"
v-model=
"form.url"
v-model=
"form.url"
></el-input>
></el-input>
...
@@ -77,7 +82,8 @@
...
@@ -77,7 +82,8 @@
</el-form-item>
</el-form-item>
<el-form-item
label=
"图标"
prop=
"imgPath"
>
<el-form-item
label=
"图标"
prop=
"imgPath"
>
<div
class=
"icon-box grid grid-cols-2 gap-1"
>
<IconSelect
v-model=
"form.imgPath"
></IconSelect>
<!--
<div
class=
"icon-box grid grid-cols-2 gap-1"
>
<div
<div
:class=
"[
:class=
"[
'icon-item',
'icon-item',
...
@@ -101,7 +107,7 @@
...
@@ -101,7 +107,7 @@
<i
:class=
"v"
></i>
<i
:class=
"v"
></i>
<span
class=
"ml-2"
>
{{
v
}}
</span>
<span
class=
"ml-2"
>
{{
v
}}
</span>
</div>
</div>
</div>
</div>
-->
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<span
slot=
"footer"
class=
"dialog-footer"
>
...
@@ -116,9 +122,12 @@
...
@@ -116,9 +122,12 @@
<
script
>
<
script
>
import
{
saveMenu
}
from
"
@/api/system
"
;
import
{
saveMenu
}
from
"
@/api/system
"
;
import
IconSelect
from
"
./IconSelect.vue
"
;
import
iconJson
from
"
@/assets/icon.json
"
;
import
iconJson
from
"
@/assets/icon.json
"
;
export
default
{
export
default
{
components
:
{},
components
:
{
IconSelect
,
},
props
:
{
props
:
{
title
:
{
title
:
{
type
:
String
,
type
:
String
,
...
...
admin_2/src/pages/system/menu/components/IconSelect.vue
0 → 100644
View file @
5beea730
<
template
>
<el-popover
placement=
"bottom-start"
trigger=
"click"
width=
"100%"
>
<div
class=
"content grid max-h-[300px] w-full grid-cols-2 gap-x-4 gap-y-2 overflow-auto"
>
<div
:class=
"['cursor-pointer indent-8',
{ active: value === '' }]"
@click="handleChange('')"
>
不需要图标
</div>
<div
v-for=
"(v, i) in iconJson"
:key=
"i"
>
<div
:class=
"[
'flex',
'cursor-pointer',
'items-center',
'gap-4',
{ active: v === value },
]"
@click="handleChange(v)"
>
<i
:class=
"v"
></i>
<span>
{{
v
}}
</span>
</div>
</div>
</div>
<el-input
slot=
"reference"
v-bind=
"$attrs"
v-on=
"$listeners"
:value=
"value"
readonly
:placeholder=
"placeholder"
>
<i
v-if=
"value"
slot=
"prefix"
:class=
"value"
/>
<i
v-else
slot=
"prefix"
class=
"el-icon-search"
/>
</el-input>
</el-popover>
</
template
>
<
script
>
import
iconJson
from
"
@/assets/icon.json
"
;
export
default
{
model
:
{
prop
:
"
value
"
,
event
:
"
change
"
,
},
props
:
{
value
:
{
type
:
String
,
default
:
""
,
},
placeholder
:
{
type
:
String
,
default
:
"
点击选择图标
"
,
},
},
data
()
{
return
{
iconJson
,
};
},
methods
:
{
handleChange
(
v
)
{
this
.
$emit
(
"
change
"
,
v
);
},
},
};
</
script
>
<
style
lang=
"less"
scoped
>
.content {
&::-webkit-scrollbar {
width: 6px;
height: 6px;
overflow-y: auto;
}
&::-webkit-scrollbar-thumb {
border-radius: 6px;
background-color: rgba(144, 147, 153, 0.5);
}
&::-webkit-scrollbar-track {
border-radius: 6px;
background: rbga(0, 0, 0, 0);
}
.active {
color: var(--primary);
}
}
</
style
>
admin_2/src/router/index.js
View file @
5beea730
...
@@ -186,15 +186,15 @@ const routes = [
...
@@ -186,15 +186,15 @@ const routes = [
icon
:
"
el-icon-box
"
,
icon
:
"
el-icon-box
"
,
},
},
},
},
//
{
{
//
path: "/system/menu",
path
:
"
/system/menu
"
,
//
component: () => import("@/pages/system/menu/Menu.vue"),
component
:
()
=>
import
(
"
@/pages/system/menu/Menu.vue
"
),
//
meta: {
meta
:
{
//
activeMenu: "/system",
activeMenu
:
"
/system
"
,
//
title: "菜单管理",
title
:
"
菜单管理
"
,
//
icon: "el-icon-guide",
icon
:
"
el-icon-guide
"
,
//
},
},
//
},
},
{
{
path
:
"
/system/parameter
"
,
path
:
"
/system/parameter
"
,
component
:
()
=>
import
(
"
@/pages/system/parameter/Parameter.vue
"
),
component
:
()
=>
import
(
"
@/pages/system/parameter/Parameter.vue
"
),
...
...
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