diff --git a/src/api/system/user/index.ts b/src/api/system/user/index.ts
index a083baa..a3135e2 100644
--- a/src/api/system/user/index.ts
+++ b/src/api/system/user/index.ts
@@ -12,7 +12,7 @@ export interface UserVO {
avatar: string
loginIp: string
status: number
- inUse: number
+ hireStatus: number
remark: string
loginDate: Date
createTime: Date
@@ -64,12 +64,17 @@ export const resetUserPwd = (id: number, password: string) => {
}
// 用户状态修改
-export const updateUserStatus = (id: number, status: number, retireDate: string, inUse: number) => {
+export const updateUserStatus = (
+ id: number,
+ status: number,
+ retireDate: string,
+ hireStatus: number
+) => {
const data = {
id,
status,
retireDate,
- inUse
+ hireStatus
}
return request.put({ url: '/admin-api/system/user/update-status', data: data })
}
diff --git a/src/views/Basic/User/index.vue b/src/views/Basic/User/index.vue
index 607ec08..c340bf6 100644
--- a/src/views/Basic/User/index.vue
+++ b/src/views/Basic/User/index.vue
@@ -51,10 +51,10 @@
-
+
-
+
@@ -195,7 +195,7 @@ const openForm = (type: string, id?: number) => {
const handleStatusChange = async (row: UserApi.UserVO) => {
try {
// 修改状态的二次确认
- const text = row.status === CommonStatusEnum.ENABLE ? '入职' : '离职'
+ const text = row.hireStatus === CommonStatusEnum.ENABLE ? '入职' : '离职'
let result = { value: '' }
if (text == '入职') {
await message.confirm('确认要"' + text + '""' + row.nickname + '"吗?')
@@ -212,14 +212,16 @@ const handleStatusChange = async (row: UserApi.UserVO) => {
}
}
// 发起修改状态
- await UserApi.updateUserStatus(row.id, row.status, result.value, row.inUse)
+ await UserApi.updateUserStatus(row.id, row.status, result.value, row.hireStatus)
message.success('修改成功')
// 刷新列表
await getList()
} catch {
// 取消后,进行恢复按钮
- row.status =
- row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE
+ row.hireStatus =
+ row.hireStatus === CommonStatusEnum.ENABLE
+ ? CommonStatusEnum.DISABLE
+ : CommonStatusEnum.ENABLE
}
}
@@ -230,7 +232,7 @@ const handleUseChange = async (row: UserApi.UserVO) => {
const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '禁用'
await message.confirm('确认要"' + text + '""' + row.nickname + '"吗?')
// 发起修改状态
- await UserApi.updateUserStatus(row.id, row.status, row.retireDate, row.inUse)
+ await UserApi.updateUserStatus(row.id, row.status, row.retireDate, row.hireStatus)
message.success('修改成功')
// 刷新列表
await getList()