Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Starter Web Vue
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
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
product
kim3-web-vue
Starter Web Vue
Commits
dd8c1d90
Commit
dd8c1d90
authored
Jun 28, 2021
by
水落(YangLei)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 菜单页面基本完成
parent
9df83c42
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
17 deletions
+50
-17
package.json
package.json
+1
-1
src/components/menu_tree/select.vue
src/components/menu_tree/select.vue
+40
-0
src/components/table/index.vue
src/components/table/index.vue
+1
-1
src/pages/system/view/menu/form.vue
src/pages/system/view/menu/form.vue
+8
-15
No files found.
package.json
View file @
dd8c1d90
...
...
@@ -18,7 +18,7 @@
"
@tailwindcss/postcss7-compat
"
:
"
^2.2.2
"
,
"
animate.css
"
:
"
^4.1.0
"
,
"
ant-design-vue
"
:
"
1.7.2
"
,
"
axios
"
:
"
^0.
19.2
"
,
"
axios
"
:
"
^0.
21.1
"
,
"
clipboard
"
:
"
^2.0.6
"
,
"
core-js
"
:
"
^3.6.5
"
,
"
crypto-js
"
:
"
^4.0.0
"
,
...
...
src/components/menu_tree/select.vue
0 → 100644
View file @
dd8c1d90
<
template
>
<a-tree-select
show-search
style=
"width: 100%"
:dropdown-style=
"
{ maxHeight: '400px', overflow: 'auto' }"
placeholder="请选择"
allow-clear
tree-default-expand-all
:treeData="treeData"
:replaceFields="replaceFields"
v-bind="$attrs"
v-on="$listeners"
/>
</
template
>
<
script
>
import
{
getMenuDataApi
}
from
'
@/api
'
;
import
{
convertListToTree
}
from
'
@/utils
'
;
export
default
{
model
:
{
prop
:
'
value
'
,
event
:
'
change
'
,
},
data
()
{
return
{
treeData
:
[],
replaceFields
:
{
title
:
'
menuName
'
,
key
:
'
menuId
'
,
value
:
'
menuId
'
,
},
};
},
async
mounted
()
{
this
.
treeData
=
convertListToTree
(
await
getMenuDataApi
(),
true
);
console
.
log
(
this
.
treeData
);
},
};
</
script
>
src/components/table/index.vue
View file @
dd8c1d90
...
...
@@ -124,12 +124,12 @@ export default {
this
.
submitLoading
=
true
;
try
{
await
this
.
addBtn
?.
onOk
();
this
.
addVisible
=
false
;
this
.
getData
();
}
catch
(
error
)
{
// todo
}
this
.
submitLoading
=
false
;
this
.
addVisible
=
false
;
},
showAdd
()
{
this
.
addVisible
=
true
;
...
...
src/pages/system/view/menu/form.vue
View file @
dd8c1d90
<
template
>
<a-form-model
layout=
"vertical"
:model=
"form"
:rules=
"rules"
>
<a-form-model-item
label=
"父级"
v-if=
"isAdd"
>
<MenuTree
@
check=
"onCheck"
:value=
"checkedKeys"
checkStrictly
/>
<a-form-model
layout=
"vertical"
:model=
"form"
:rules=
"rules"
ref=
"form"
>
<a-form-model-item
label=
"父级"
extra=
"没选择代表根目录"
v-if=
"isAdd"
>
<MenuTree
v-model=
"form.parentMenuId"
/>
</a-form-model-item>
<a-form-model-item
label=
"类型"
>
<a-radio-group
v-model=
"form.menuType"
:disabled=
"isEdit"
>
...
...
@@ -32,7 +32,7 @@
<
script
>
import
{
addMenuApi
}
from
'
@/api
'
;
import
MenuTree
from
'
@/components/menu_tree/
index
.vue
'
;
import
MenuTree
from
'
@/components/menu_tree/
select
.vue
'
;
export
default
{
components
:
{
MenuTree
},
...
...
@@ -40,16 +40,12 @@ export default {
type
:
0
,
form
:
{
menuType
:
'
CATALOG
'
,
parentMenuId
:
0
,
parentMenuId
:
null
,
menuName
:
''
,
},
rules
:
{
menuUrl
:
[{
required
:
true
}],
},
checkedKeys
:
{
checked
:
[],
halfChecked
:
[],
},
}),
computed
:
{
isAdd
()
{
...
...
@@ -60,12 +56,9 @@ export default {
},
},
methods
:
{
submit
()
{
return
addMenuApi
({
...
this
.
form
,
parentMenuId
:
this
.
checkedKeys
.
checked
[
0
]
??
0
});
},
onCheck
(
checkedKeys
)
{
const
checked
=
checkedKeys
.
checked
.
slice
(
-
1
);
this
.
checkedKeys
=
{
checked
};
async
submit
()
{
await
this
.
$refs
[
'
form
'
].
validate
();
return
addMenuApi
({
...
this
.
form
,
parentMenuId
:
this
.
form
.
parentMenuId
??
0
});
},
setEdit
(
data
)
{
this
.
type
=
1
;
...
...
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