Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
9
91isoft_web_vue3
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张伯涛
91isoft_web_vue3
Commits
39860647
Commit
39860647
authored
Feb 04, 2024
by
张伯涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
角色管理增删改查功能完善
parent
0e22d060
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
349 additions
and
141 deletions
+349
-141
index.ts
src/api/role/index.ts
+42
-7
types.ts
src/api/role/types.ts
+37
-29
types.ts
src/api/user/types.ts
+1
-1
commonField.ts
src/utils/commonField.ts
+2
-2
index.vue
src/views/system/role/index.vue
+258
-99
index.vue
src/views/system/user/index.vue
+9
-3
No files found.
src/api/role/index.ts
View file @
39860647
...
...
@@ -11,7 +11,7 @@ export function getRolePage(
queryParams
?:
RoleQuery
):
AxiosPromise
<
RolePageResult
>
{
return
request
({
url
:
"/api/v1/roles/page"
,
url
:
'/system/role/list'
,
method
:
"get"
,
params
:
queryParams
,
});
...
...
@@ -43,7 +43,32 @@ export function getRoleMenuIds(roleId: number): AxiosPromise<number[]> {
method
:
"get"
,
});
}
/**
* 查询菜单下拉树结构
*
*/
export
function
treeSelect
()
{
return
request
({
url
:
'/system/menu/treeSelect'
,
method
:
'get'
})
}
/**
* 用户状态修改
*
*/
export
function
changeRoleStatus
(
businessId
:
number
,
flag
:
string
)
{
const
data
=
{
businessId
,
flag
}
return
request
({
url
:
'/system/role/changeStatus'
,
method
:
'put'
,
params
:
data
});
}
/**
* 分配菜单权限给角色
*
...
...
@@ -67,11 +92,21 @@ export function updateRoleMenus(
*/
export
function
getRoleForm
(
id
:
number
):
AxiosPromise
<
RoleForm
>
{
return
request
({
url
:
"/api/v1/roles/"
+
id
+
"/form"
,
url
:
'/system/role/detail/'
+
id
,
method
:
"get"
,
});
}
/**
* 根据角色ID查询菜单下拉树结构
*
* @param id
*/
export
function
roleMenuTreeSelect
(
roleId
)
{
return
request
({
url
:
'/system/menu/roleMenuTreeSelect/'
+
roleId
,
method
:
'get'
})
}
/**
* 添加角色
*
...
...
@@ -79,7 +114,7 @@ export function getRoleForm(id: number): AxiosPromise<RoleForm> {
*/
export
function
addRole
(
data
:
RoleForm
)
{
return
request
({
url
:
"/api/v1/roles"
,
url
:
'/system/role/add'
,
method
:
"post"
,
data
:
data
,
});
...
...
@@ -93,7 +128,7 @@ export function addRole(data: RoleForm) {
*/
export
function
updateRole
(
id
:
number
,
data
:
RoleForm
)
{
return
request
({
url
:
"/api/v1/roles/"
+
id
,
url
:
'/system/role/update/'
+
id
,
method
:
"put"
,
data
:
data
,
});
...
...
@@ -104,9 +139,9 @@ export function updateRole(id: number, data: RoleForm) {
*
* @param ids
*/
export
function
deleteRoles
(
ids
:
string
)
{
export
function
deleteRoles
(
roleId
:
any
)
{
return
request
({
url
:
"/api/v1/roles/"
+
ids
,
url
:
'/system/role/deleteLogical/'
+
roleId
,
method
:
"delete"
,
});
}
src/api/role/types.ts
View file @
39860647
...
...
@@ -2,42 +2,48 @@
* 角色查询参数
*/
export
interface
RoleQuery
extends
PageQuery
{
keywords
?:
string
;
/**
* 角色名称
*/
roleName
?:
string
;
/**
* 权限字符
*/
roleKey
?:
string
;
/**
* 角色状态
*/
flag
?:
string
;
}
/**
* 角色分页对象
*/
export
interface
RolePageVO
{
/**
* 角色编码
*/
code
?:
string
;
/**
* 角色ID
*/
i
d
?:
number
;
businessI
d
?:
number
;
/**
*
角色
名称
* 名称
*/
n
ame
?:
string
;
roleN
ame
?:
string
;
/**
*
排序
*
权限字符
*/
sort
?:
number
;
roleKey
?:
string
;
/**
*
角色状态
*
显示顺序
*/
status
?:
number
;
roleSort
?:
number
;
/**
*
创建时间
*
状态
*/
createTime
?:
Date
;
flag
?:
string
;
/**
*
修改
时间
*
创建
时间
*/
updateTim
e
?:
Date
;
createDat
e
?:
Date
;
}
/**
...
...
@@ -52,27 +58,29 @@ export interface RoleForm {
/**
* 角色ID
*/
id
?:
number
;
businessId
?:
number
|
undefined
;
/**
*
角色编码
*
名称
*/
code
:
string
;
roleName
?
:
string
;
/**
*
数据权限
*
权限字符
*/
dataScope
?:
number
;
roleKey
?:
string
;
/**
* 角色名称
* 排序
*/
roleSort
?:
number
;
/**
* 排序
*/
name
:
string
;
flag
?
:
string
;
/**
* 排序
*/
sort
?:
number
;
menuIds
?:
number
[]
;
/**
*
角色状态(1-正常;0-停用)
*
备注
*/
status
?:
number
;
remarks
?:
string
;
}
src/api/user/types.ts
View file @
39860647
...
...
@@ -102,7 +102,7 @@ export interface UserPageVO {
/**
* 创建时间
*/
create
Tim
e
?:
Date
;
create
Dat
e
?:
Date
;
}
/**
...
...
src/utils/commonField.ts
View file @
39860647
import
{
Plus
,
Delete
,
Edit
,
Search
,
Share
,
Upload
}
from
'@element-plus/icons-vue'
import
{
Plus
,
Delete
,
Edit
,
Search
,
Share
,
Upload
,
Download
}
from
'@element-plus/icons-vue'
/** 公共字段*/
export
const
commonField
=
{
typeParent
:
'primary'
,
// typeParent: 'text', type="text" 已在3.00移除,用了typeParent这个字段的需要在按钮用link设置链接按钮
...
...
@@ -32,7 +32,7 @@ export const commonField = {
addIcon
:
Plus
,
delIcon
:
'el-icon-delete'
,
importIcon
:
Upload
,
exportIcon
:
'el-icon-download'
,
exportIcon
:
Download
,
deleteTypePrimary
:
'danger'
,
deleteSize
:
'small'
,
deleteDisabled
:
'ids.length === 0'
,
...
...
src/views/system/role/index.vue
View file @
39860647
This diff is collapsed.
Click to expand it.
src/views/system/user/index.vue
View file @
39860647
...
...
@@ -467,9 +467,15 @@ onMounted(() => {
:size=
"commonField.smallSize"
@
click=
"openDialog('user-import')"
>
{{
commonField
.
importName
}}
</el-button>
<el-button
class=
"ml-3"
@
click=
"handleExport"
><template
#
icon
><i-ep-download
/></
template
>
导出
</el-button
>
<!-- //导出-->
<el-button
v-hasPermi=
"hasExportPerm"
:class=
"commonField.exportClass"
:type=
"commonField.typeSuccess"
:icon=
"commonField.exportIcon"
:size=
"commonField.smallSize"
@
click=
"handleExport"
>
{{
commonField
.
exportName
}}
</el-button>
</div>
</div>
</
template
>
...
...
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