From ea551cff3a9cdd963da9fc4b39e858243c73ec7b Mon Sep 17 00:00:00 2001 From: JINGYJ <1458671527@qq.com> Date: Thu, 4 Jul 2024 15:02:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B4=A6=E6=88=B7=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system.ts | 10 +++++++ .../accountManagement/index.vue | 29 +++++++++++++++---- vite.config.ts | 2 +- 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/src/api/system.ts b/src/api/system.ts index 720bfc3..f54a075 100644 --- a/src/api/system.ts +++ b/src/api/system.ts @@ -228,3 +228,13 @@ export const deleteRole = (data?: object) => { params: data }); }; + +/** + * + * @returns 修改用户状态 + */ +export const updateUserStatus = (data?: object) => { + return http.request("post", "/know-sub/user/updateUserStatus", { + data + }); +}; diff --git a/src/views/systemManagement/accountManagement/index.vue b/src/views/systemManagement/accountManagement/index.vue index 7ef892c..a2db25b 100644 --- a/src/views/systemManagement/accountManagement/index.vue +++ b/src/views/systemManagement/accountManagement/index.vue @@ -10,7 +10,8 @@ import { deletePW, deleteDeptManage, queryRoleDateList, - deleteRole + deleteRole, + updateUserStatus } from "@/api/system"; import { message } from "@/utils/message"; import accountDrawer from "./compontents/accountDrawer.vue"; @@ -89,7 +90,7 @@ const getUserTableData = async () => { const res: any = await getUserList({ userName: accountForm.userName, deptId: accountForm.deptId, - roleId: accountForm.roleId, + roleName: accountForm.roleId, pageNum: pagination.currentPage, pageSize: pagination.pageSize }); @@ -130,7 +131,7 @@ const reset = () => { accountForm.userName = ""; accountForm.roleId = ""; accountForm.deptId = ""; - // search(); + search(); }; const createFlag = ref(false); const createDeptFlag = ref(false); @@ -299,10 +300,23 @@ const deleteName = (type: any) => { const handleRolePermission = row => { console.log(row); }; +//状态切换 +const changeUserStatus = async row => { + console.log(row); + const res: any = await updateUserStatus({ + id: row.id, + status: row.status ? 0 : 1 + }); + if (res.code === 200) { + message("修改成功", { type: "success" }); + getUserTableData(); + } +}; onMounted(() => { getDeptData(); - getUserTableData(); - getRoleTableData(); + // getUserTableData(); + // getRoleTableData(); + search(); }); @@ -379,7 +393,10 @@ onMounted(() => { >