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
abb327f5
Commit
abb327f5
authored
Jun 30, 2021
by
陈浩玮
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/chw' into 'master'
角色 See merge request product/kim3-web-vue/starter-web-vue!12
parents
754ac5e9
141d7b38
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
21 deletions
+19
-21
src/api/menu.js
src/api/menu.js
+4
-1
src/components/FormMixin/index.js
src/components/FormMixin/index.js
+1
-1
src/pages/system/view/role/RoleManagement.vue
src/pages/system/view/role/RoleManagement.vue
+4
-4
src/pages/system/view/role/form.vue
src/pages/system/view/role/form.vue
+10
-15
No files found.
src/api/menu.js
View file @
abb327f5
import
{
delReq
,
getReq
,
postReq
}
from
'
@/utils
'
;
import
{
delReq
,
getReq
,
postReq
,
putReq
}
from
'
@/utils
'
;
export
function
delMenuApi
(
id
)
{
export
function
delMenuApi
(
id
)
{
return
delReq
(
`/api/v1/menus/
${
id
}
`
);
return
delReq
(
`/api/v1/menus/
${
id
}
`
);
...
@@ -15,3 +15,6 @@ export function addMenuApi(data) {
...
@@ -15,3 +15,6 @@ export function addMenuApi(data) {
export
function
addRoleApi
(
data
)
{
export
function
addRoleApi
(
data
)
{
return
postReq
(
'
/api/v1/roles
'
,
data
);
return
postReq
(
'
/api/v1/roles
'
,
data
);
}
}
export
function
updateRoleApi
(
data
)
{
return
putReq
(
'
/api/v1/roles
'
,
data
);
}
src/components/FormMixin/index.js
View file @
abb327f5
...
@@ -27,7 +27,7 @@ export default {
...
@@ -27,7 +27,7 @@ export default {
}
}
},
},
setData
(
data
,
type
)
{
setData
(
data
,
type
)
{
this
.
form
=
data
;
this
.
form
=
{
...
data
}
;
this
.
type
=
type
;
this
.
type
=
type
;
},
},
},
},
...
...
src/pages/system/view/role/RoleManagement.vue
View file @
abb327f5
...
@@ -3,9 +3,9 @@
...
@@ -3,9 +3,9 @@
<template
#drawer
>
<template
#drawer
>
<Form
ref=
"form"
/>
<Form
ref=
"form"
/>
</
template
>
</
template
>
<a-table-column
title=
"角色名称"
data-index=
"roleName"
/>
<a-table-column
title=
"
名称"
data-index=
"roleNam
e"
/>
<a-table-column
title=
"
角色编码"
data-index=
"roleCod
e"
/>
<a-table-column
title=
"说明"
data-index=
"remark"
/>
<a-table-column
title=
"
角色
说明"
data-index=
"remark"
/>
<a-table-column
title=
"操作"
>
<a-table-column
title=
"操作"
>
<
template
#default=
"row"
>
<
template
#default=
"row"
>
<a
@
click=
"() => view(row, 2)"
>
查看
</a>
<a
@
click=
"() => view(row, 2)"
>
查看
</a>
...
@@ -36,7 +36,7 @@ export default {
...
@@ -36,7 +36,7 @@ export default {
view
(
data
,
type
)
{
view
(
data
,
type
)
{
this
.
$refs
[
'
table
'
]?.
show
({
type
});
this
.
$refs
[
'
table
'
]?.
show
({
type
});
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'
form
'
].
setData
(
data
,
type
);
this
.
$refs
[
'
form
'
].
setData
(
{
...
data
}
,
type
);
});
});
},
},
},
},
...
...
src/pages/system/view/role/form.vue
View file @
abb327f5
<
template
>
<
template
>
<a-form-model
layout=
"vertical"
:model=
"form"
:rules=
"rules"
>
<a-form-model
layout=
"vertical"
:model=
"form"
:rules=
"rules"
ref=
"DrawerForm"
>
<a-form-model-item
label=
"角色名称"
>
<a-form-model-item
label=
"角色名称"
>
<a-input
v-model=
"form.roleName"
:disabled=
"isView"
/>
<a-input
v-model=
"form.roleName"
:disabled=
"isView"
/>
</a-form-model-item>
</a-form-model-item>
...
@@ -18,33 +18,28 @@
...
@@ -18,33 +18,28 @@
<
script
>
<
script
>
import
MenuTree
from
'
@/components/menu_tree/index.vue
'
;
import
MenuTree
from
'
@/components/menu_tree/index.vue
'
;
import
{
addRoleApi
}
from
'
@/api
'
;
import
FormMixin
from
'
@/components/FormMixin
'
;
import
{
addRoleApi
,
updateRoleApi
}
from
'
@/api
'
;
export
default
{
export
default
{
mixins
:
[
FormMixin
],
components
:
{
MenuTree
},
components
:
{
MenuTree
},
data
()
{
data
()
{
return
{
return
{
type
:
0
,
form
:
{},
form
:
{},
rules
:
{},
rules
:
{},
checkedKeys
:
[],
checkedKeys
:
[],
};
};
},
},
computed
:
{
computed
:
{},
isEdit
()
{
return
this
.
type
===
1
;
},
isView
()
{
return
this
.
type
===
2
;
},
},
methods
:
{
methods
:
{
submit
()
{
add
()
{
console
.
log
(
1
);
return
addRoleApi
({
...
this
.
form
,
authorityList
:
this
.
$refs
[
'
menuTree
'
].
get
()
});
return
addRoleApi
({
...
this
.
form
,
authorityList
:
this
.
$refs
[
'
menuTree
'
].
get
()
});
},
},
setData
(
data
,
type
)
{
edit
(
)
{
this
.
form
=
data
;
console
.
log
(
1
)
;
this
.
type
=
type
;
return
updateRoleApi
({
...
this
.
form
,
authorityList
:
this
.
$refs
[
'
menuTree
'
].
get
()
})
;
},
},
},
},
};
};
...
...
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