personnelManage.js
2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*
* @Author: xiaomiao 1158771342@qq.com
* @Date: 2023-03-09 15:24:53
* @LastEditors: xiaomiao 1158771342@qq.com
* @LastEditTime: 2023-04-19 13:49:03
* @FilePath: \上报\bdcjg-web\src\api\personnelManage.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import {
api,
getAction,
deleteAction,
putAction
} from './manageApi'
import { getParams } from './util'
/**
* @description: updateUserPassword
* @param {*} data
* @author: renchao
*/
export const updateUserPassword = (data) => {
return putAction(`${api.users}/update-password`, data)
}
/**
* @description: 根据条件获取用户
* @param {*} params
* @author: renchao
*/
export const getUserList = (params) => {
return getAction(api.users, params)
}
/**
* @description: getUserLists
* @param {*} queryParam
* @author: renchao
*/
export const getUserLists = (queryParam) => {
const conditionGroup = {
conditions: [],
queryRelation: 'AND',
}
for (let key in queryParam) {
if (queryParam[key]) {
conditionGroup.conditions.push({
property: key,
value: queryParam[key],
operator: 'LIKE'
})
}
}
const params = getParams(conditionGroup)
return getAction(api.users, params)
}
/**
* @description: 重置用户密码
* @param {*} id
* @author: renchao
*/
// export const resetPassword = id => {
// return putAction(`${api.users}/${id}/reset-password`)
// }
/**
* @description: 重置用户密码
* @param {*} ids
* @author: renchao
*/
export const resetPassword = (ids) => {
return putAction(`${api.users}/reset-passwords?ids=${ids}`)
}
/**
* @description: 人员列表
* @param {*} id
* @author: renchao
*/
export const getUserRoles = (id) => {
return getAction(`${api.userRoles}/${id}/users`)
}
/**
* @description: 更新人员
* @param {*} id
* @param {*} data
* @author: renchao
*/
export const updateUser = (id, data) => {
return putAction(`${api.userRoles}/${id}/users`, data)
}