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
8df0af8f
Commit
8df0af8f
authored
Jul 01, 2021
by
水落(YangLei)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 菜单管理新增组件完成
parent
527507a8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
8 deletions
+53
-8
src/components/index.js
src/components/index.js
+2
-1
src/components/table/tableDrawer.vue
src/components/table/tableDrawer.vue
+22
-0
src/pages/system/view/menu/MenuManagement.vue
src/pages/system/view/menu/MenuManagement.vue
+24
-6
src/pages/system/view/menu/add_com.vue
src/pages/system/view/menu/add_com.vue
+3
-0
src/plugins/index.js
src/plugins/index.js
+2
-1
No files found.
src/components/index.js
View file @
8df0af8f
...
...
@@ -2,5 +2,6 @@ import Table from './table/index.vue';
import
WhiteCard
from
'
./white_card/index.vue
'
;
import
Upload
from
'
./upload/index.vue
'
;
import
MyFormItem
from
'
./table/my_item.vue
'
;
import
ActionButoon
from
'
./action_button/index.vue
'
;
export
{
Table
,
WhiteCard
,
Upload
,
MyFormItem
};
export
{
Table
,
WhiteCard
,
Upload
,
MyFormItem
,
ActionButoon
};
src/components/table/tableDrawer.vue
0 → 100644
View file @
8df0af8f
<
template
>
<div>
<Drawer
/>
<Table>
<template
#search
="
query
"
>
<slot
name=
"search"
:query=
"query"
/>
</
template
>
<slot
name=
"table"
/>
</Table>
</div>
</template>
<
script
>
import
Table
from
'
./table.vue
'
;
import
Drawer
from
'
./drawer.vue
'
;
export
default
{
components
:
{
Table
,
Drawer
},
};
</
script
>
src/pages/system/view/menu/MenuManagement.vue
View file @
8df0af8f
...
...
@@ -8,7 +8,8 @@
ref=
"table"
>
<template
#drawer
>
<Form
ref=
"addForm"
/>
<AddCom
v-if=
"addCom"
/>
<Form
ref=
"addForm"
v-else
/>
</
template
>
<a-table-column
title=
"名称"
data-index=
"menuName"
/>
...
...
@@ -18,9 +19,7 @@
<a-table-column
title=
"模块URL"
data-index=
"menuUrl"
/>
<a-table-column
title=
"操作"
>
<
template
#default=
"row"
>
<a
@
click=
"() => edit(row)"
>
编辑
</a>
<a-divider
type=
"vertical"
/>
<PopconfirmDelete
:url=
"`/api/v1/menus/$
{row.menuId}`" :cb="refreshTable" />
<my-ac-btn
:row=
"row"
:buttons=
"buttons"
/>
</
template
>
</a-table-column>
</my-table>
...
...
@@ -28,21 +27,37 @@
<
script
>
import
{
convertListToTree
}
from
'
@/utils
'
;
import
PopconfirmDelete
from
'
@/components/popconfirm_delete/index.vue
'
;
import
Form
from
'
./form.vue
'
;
import
AddCom
from
'
./add_com.vue
'
;
export
default
{
data
:
vm
=>
({
addCom
:
false
,
addBtn
:
{
text
:
'
新建
'
,
onOk
()
{
return
vm
.
$refs
[
'
addForm
'
]?.
submit
();
},
onCancel
()
{
vm
.
addCom
=
false
;
},
},
sortOrder
:
'
ascend
'
,
buttons
:
[
{
label
:
'
新增组件
'
,
click
()
{
vm
.
show
();
vm
.
addCom
=
true
;
},
isHidden
:
row
=>
row
.
menuType
===
'
MENU
'
,
},
{
label
:
'
编辑
'
,
click
:
vm
.
edit
},
{
type
:
'
confirm
'
,
url
:
row
=>
`/api/v1/menus/
${
row
.
menuId
}
`
,
after
:
vm
.
refreshTable
},
],
}),
components
:
{
PopconfirmDelete
,
For
m
},
components
:
{
Form
,
AddCo
m
},
methods
:
{
formatData
:
convertListToTree
,
...
...
@@ -58,6 +73,9 @@ export default {
this
.
$refs
[
'
addForm
'
].
setEdit
({
...
data
});
});
},
show
()
{
this
.
$refs
[
'
table
'
].
show
();
},
},
};
</
script
>
src/pages/system/view/menu/add_com.vue
0 → 100644
View file @
8df0af8f
<
template
>
<h1>
addCom
</h1>
</
template
>
src/plugins/index.js
View file @
8df0af8f
import
VueI18nPlugin
from
'
./vueI18nPlugin
'
;
import
AuthorityPlugin
from
'
./authorityPlugin
'
;
import
TabsPagePlugin
from
'
./tabsPagePlugin
'
;
import
{
Table
,
WhiteCard
,
Upload
,
MyFormItem
}
from
'
@/components
'
;
import
{
Table
,
WhiteCard
,
Upload
,
MyFormItem
,
ActionButoon
}
from
'
@/components
'
;
const
Plugins
=
{
install
:
function
(
Vue
)
{
...
...
@@ -12,6 +12,7 @@ const Plugins = {
Vue
.
component
(
'
my-card
'
,
WhiteCard
);
Vue
.
component
(
'
my-upload
'
,
Upload
);
Vue
.
component
(
'
my-form-item
'
,
MyFormItem
);
Vue
.
component
(
'
my-ac-btn
'
,
ActionButoon
);
},
};
export
default
Plugins
;
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