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
29448d8c
Commit
29448d8c
authored
Feb 01, 2024
by
张伯涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户管理页面调整
parent
5616bb9a
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
351 additions
and
313 deletions
+351
-313
index.ts
src/api/dept/index.ts
+1
-1
index.ts
src/api/role/index.ts
+1
-1
index.ts
src/api/user/index.ts
+19
-17
types.ts
src/api/user/types.ts
+58
-51
common.ts
src/utils/common.ts
+7
-1
dept-tree.vue
src/views/system/user/components/dept-tree.vue
+1
-1
index.vue
src/views/system/user/index.vue
+264
-241
No files found.
src/api/dept/index.ts
View file @
29448d8c
...
@@ -20,7 +20,7 @@ export function listDepts(queryParams?: DeptQuery): AxiosPromise<DeptVO[]> {
...
@@ -20,7 +20,7 @@ export function listDepts(queryParams?: DeptQuery): AxiosPromise<DeptVO[]> {
*/
*/
export
function
getDeptOptions
():
AxiosPromise
<
OptionType
[]
>
{
export
function
getDeptOptions
():
AxiosPromise
<
OptionType
[]
>
{
return
request
({
return
request
({
url
:
"/api/v1/dept/options"
,
url
:
'/system/dept/treeSelect'
,
method
:
"get"
,
method
:
"get"
,
});
});
}
}
...
...
src/api/role/index.ts
View file @
29448d8c
...
@@ -26,7 +26,7 @@ export function getRoleOptions(
...
@@ -26,7 +26,7 @@ export function getRoleOptions(
queryParams
?:
RoleQuery
queryParams
?:
RoleQuery
):
AxiosPromise
<
OptionType
[]
>
{
):
AxiosPromise
<
OptionType
[]
>
{
return
request
({
return
request
({
url
:
"/api/v1/roles/options"
,
url
:
'system/role/listAll'
,
method
:
"get"
,
method
:
"get"
,
params
:
queryParams
,
params
:
queryParams
,
});
});
...
...
src/api/user/index.ts
View file @
29448d8c
import
request
from
"@/utils/request"
;
import
request
from
"@/utils/request"
;
import
{
AxiosPromise
}
from
"axios"
;
import
{
AxiosPromise
}
from
"axios"
;
import
{
User
,
UserForm
,
UserInfo
,
UserPageVO
,
UserQuery
}
from
"./types"
;
import
{
User
,
UserForm
,
UserInfo
,
UserPageVO
,
UserQuery
}
from
"./types"
;
import
{
praseStrEmpty
}
from
'@/utils/common'
/**
/**
* 登录成功后获取用户信息(昵称、头像、权限集合和角色集合)
* 登录成功后获取用户信息(昵称、头像、权限集合和角色集合)
*/
*/
...
@@ -17,11 +17,9 @@ export function getUserInfoApi() {
...
@@ -17,11 +17,9 @@ export function getUserInfoApi() {
*
*
* @param queryParams
* @param queryParams
*/
*/
export
function
getUserPage
(
export
function
getUserPage
(
queryParams
:
UserQuery
):
AxiosPromise
<
PageResult
<
UserPageVO
[]
>>
{
queryParams
:
UserQuery
):
AxiosPromise
<
PageResult
<
UserPageVO
[]
>>
{
return
request
({
return
request
({
url
:
"/api/v1/users/page"
,
url
:
'/system/user/list'
,
method
:
"get"
,
method
:
"get"
,
params
:
queryParams
,
params
:
queryParams
,
});
});
...
@@ -34,7 +32,7 @@ export function getUserPage(
...
@@ -34,7 +32,7 @@ export function getUserPage(
*/
*/
export
function
getUserForm
(
userId
:
number
):
AxiosPromise
<
UserForm
>
{
export
function
getUserForm
(
userId
:
number
):
AxiosPromise
<
UserForm
>
{
return
request
({
return
request
({
url
:
"/api/v1/users/"
+
userId
+
"/form"
,
url
:
'/system/user/'
+
praseStrEmpty
(
userId
)
,
method
:
"get"
,
method
:
"get"
,
});
});
}
}
...
@@ -46,7 +44,7 @@ export function getUserForm(userId: number): AxiosPromise<UserForm> {
...
@@ -46,7 +44,7 @@ export function getUserForm(userId: number): AxiosPromise<UserForm> {
*/
*/
export
function
addUser
(
data
:
any
)
{
export
function
addUser
(
data
:
any
)
{
return
request
({
return
request
({
url
:
"/api/v1/users"
,
url
:
'/system/user/add'
,
method
:
"post"
,
method
:
"post"
,
data
:
data
,
data
:
data
,
});
});
...
@@ -58,9 +56,9 @@ export function addUser(data: any) {
...
@@ -58,9 +56,9 @@ export function addUser(data: any) {
* @param id
* @param id
* @param data
* @param data
*/
*/
export
function
updateUser
(
id
:
number
,
data
:
UserForm
)
{
export
function
updateUser
(
data
:
UserForm
)
{
return
request
({
return
request
({
url
:
"/api/v1/users/"
+
id
,
url
:
'/system/user/update'
,
method
:
"put"
,
method
:
"put"
,
data
:
data
,
data
:
data
,
});
});
...
@@ -72,11 +70,15 @@ export function updateUser(id: number, data: UserForm) {
...
@@ -72,11 +70,15 @@ export function updateUser(id: number, data: UserForm) {
* @param id
* @param id
* @param password
* @param password
*/
*/
export
function
updateUserPassword
(
id
:
number
,
password
:
string
)
{
export
function
updateUserPassword
(
businessId
:
number
,
password
:
string
)
{
const
data
=
{
businessId
,
password
}
return
request
({
return
request
({
url
:
"/api/v1/users/"
+
id
+
"/password"
,
url
:
'/system/user/resetPassword'
,
method
:
"patch"
,
method
:
'put'
,
params
:
{
password
:
password
},
params
:
data
});
});
}
}
...
@@ -85,9 +87,9 @@ export function updateUserPassword(id: number, password: string) {
...
@@ -85,9 +87,9 @@ export function updateUserPassword(id: number, password: string) {
*
*
* @param ids
* @param ids
*/
*/
export
function
deleteUsers
(
id
s
:
string
)
{
export
function
deleteUsers
(
id
:
number
)
{
return
request
({
return
request
({
url
:
"/api/v1/users/"
+
ids
,
url
:
'/system/user/deleteLogical/'
+
id
,
method
:
"delete"
,
method
:
"delete"
,
});
});
}
}
...
@@ -99,7 +101,7 @@ export function deleteUsers(ids: string) {
...
@@ -99,7 +101,7 @@ export function deleteUsers(ids: string) {
*/
*/
export
function
downloadTemplateApi
()
{
export
function
downloadTemplateApi
()
{
return
request
({
return
request
({
url
:
"/api/v1/users/template"
,
url
:
'/system/user/importTemplate'
,
method
:
"get"
,
method
:
"get"
,
responseType
:
"arraybuffer"
,
responseType
:
"arraybuffer"
,
});
});
...
@@ -113,7 +115,7 @@ export function downloadTemplateApi() {
...
@@ -113,7 +115,7 @@ export function downloadTemplateApi() {
*/
*/
export
function
exportUser
(
queryParams
:
UserQuery
)
{
export
function
exportUser
(
queryParams
:
UserQuery
)
{
return
request
({
return
request
({
url
:
"/api/v1/users/_export"
,
url
:
'/system/user/export'
,
method
:
"get"
,
method
:
"get"
,
params
:
queryParams
,
params
:
queryParams
,
responseType
:
"arraybuffer"
,
responseType
:
"arraybuffer"
,
...
...
src/api/user/types.ts
View file @
29448d8c
...
@@ -60,11 +60,19 @@ export interface UserInfo {
...
@@ -60,11 +60,19 @@ export interface UserInfo {
* 用户查询对象类型
* 用户查询对象类型
*/
*/
export
interface
UserQuery
extends
PageQuery
{
export
interface
UserQuery
extends
PageQuery
{
keywords
?:
string
;
/**
status
?:
number
;
* 部门ID
deptId
?:
number
;
*/
startTime
?:
string
;
deptId
?:
number
|
undefined
;
endTime
?:
string
;
/**
* 登录名
*/
username
?:
string
;
/**
* 状态
*/
flag
?:
string
;
}
}
/**
/**
...
@@ -72,90 +80,89 @@ export interface UserQuery extends PageQuery {
...
@@ -72,90 +80,89 @@ export interface UserQuery extends PageQuery {
*/
*/
export
interface
UserPageVO
{
export
interface
UserPageVO
{
/**
/**
* 用户
头像地址
* 用户
ID
*/
*/
avatar
?:
string
;
businessId
?:
number
;
/**
/**
*
创建时间
*
登录名
*/
*/
createTime
?:
Date
;
username
?:
string
;
/**
/**
*
部门名称
*
姓名
*/
*/
deptN
ame
?:
string
;
n
ame
?:
string
;
/**
/**
*
用户邮箱
*
手机号
*/
*/
email
?:
string
;
phone
?:
string
;
/**
/**
*
性别
*
状态
*/
*/
genderLabel
?:
string
;
flag
?:
string
;
/**
* 创建时间
*/
createTime
?:
Date
;
}
/**
* 用户表单类型
*/
export
interface
UserForm
{
/**
/**
* 用户ID
* 用户ID
*/
*/
id
?:
number
;
businessId
?:
number
|
undefined
;
/**
/**
*
手机号
*
登录名
*/
*/
mobil
e
?:
string
;
usernam
e
?:
string
;
/**
/**
*
用户昵称
*
密码
*/
*/
nickname
?:
string
;
password
?:
string
;
/**
/**
*
角色名称,多个使用英文逗号(,)分割
*
姓名
*/
*/
roleNames
?:
string
;
name
?:
string
;
/**
/**
*
用户状态(1:启用;0:禁用)
*
昵称
*/
*/
status
?:
number
;
nickName
?:
string
;
/**
/**
*
用户名
*
性别
*/
*/
username
?:
string
;
sex
?:
string
;
}
/**
* 用户表单类型
*/
export
interface
UserForm
{
/**
/**
*
用户头像
*
手机号码
*/
*/
avatar
?:
string
;
phone
?:
string
;
/**
/**
*
部门ID
*
身份证号
*/
*/
deptId
?:
number
;
idNumber
?:
string
;
/**
/**
* 邮箱
* 邮箱
*/
*/
email
?:
string
;
email
?:
string
;
/**
/**
* 性别
* 状态(1:启用;0:停用)
*/
gender
?:
number
;
/**
* 用户ID
*/
*/
id
?:
number
;
flag
?:
string
;
mobile
?:
string
;
/**
/**
*
昵称
*
部门ID
*/
*/
nickname
?:
string
;
deptId
?:
number
|
null
;
/**
/**
* 角色
ID集合
* 角色
*/
*/
role
Ids
?:
number
[];
role
List
?:
number
[];
/**
/**
*
用户状态(1:正常;0:禁用)
*
角色返参字符串
*/
*/
status
?:
number
;
roleIds
?:
string
;
/**
/**
*
用户名
*
备注
*/
*/
username
?:
string
;
remarks
?:
string
;
}
}
src/utils/common.ts
View file @
29448d8c
...
@@ -22,4 +22,10 @@ export function handleTree(data, id, parentId, children, rootId) {
...
@@ -22,4 +22,10 @@ export function handleTree(data, id, parentId, children, rootId) {
})
})
return
treeData
!==
''
?
treeData
:
data
return
treeData
!==
''
?
treeData
:
data
}
}
// 转换字符串,undefined,null等转化为""
export
function
praseStrEmpty
(
str
)
{
if
(
!
str
||
str
===
'undefined'
||
str
===
'null'
)
{
return
''
}
return
str
}
src/views/system/user/components/dept-tree.vue
View file @
29448d8c
...
@@ -57,7 +57,7 @@ function handleFilter(value: string, data: any) {
...
@@ -57,7 +57,7 @@ function handleFilter(value: string, data: any) {
/** 部门树节点 Click */
/** 部门树节点 Click */
function
handleNodeClick
(
data
:
{
[
key
:
string
]:
any
})
{
function
handleNodeClick
(
data
:
{
[
key
:
string
]:
any
})
{
deptId
.
value
=
data
.
value
;
deptId
.
value
=
data
.
id
;
emits
(
"node-click"
);
emits
(
"node-click"
);
}
}
...
...
src/views/system/user/index.vue
View file @
29448d8c
This diff is collapsed.
Click to expand it.
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