From 14b4508b91bcfe232c67ba994d2a191c19a5df18 Mon Sep 17 00:00:00 2001 From: LiuHao Date: Wed, 12 Apr 2023 10:29:51 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E7=94=A8=E6=88=B7=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8C=89=E9=92=AE=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/user/index.vue | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index c911bd9..bbe8137 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -303,7 +303,7 @@ import { treeselect } from "@/api/system/dept"; import { DeptVO } from "@/api/system/dept/types"; import { RoleVO } from "@/api/system/role/types"; import { PostVO } from "@/api/system/post/types"; -import { DateModelType, ElTree, ElUpload, UploadFile, UploadFiles, ElForm } from 'element-plus'; +import { DateModelType, ElTree, ElUpload, UploadFile, ElForm } from 'element-plus'; import { to } from "await-to-js"; const router = useRouter(); const { proxy } = getCurrentInstance() as ComponentInternalInstance @@ -457,14 +457,13 @@ const handleDelete = async (row?: UserVO) => { /** 用户状态修改 */ const handleStatusChange = async (row: UserVO) => { let text = row.status === "0" ? "启用" : "停用" - const [err] = await to(proxy?.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?') as any) - if(err) { - row.status = row.status === "0" ? "1" : "0"; - } else { + try { + await proxy?.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?'); await changeUserStatus(row.userId, row.status); proxy?.$modal.msgSuccess(text + "成功"); + } catch (err) { + row.status = row.status === "0" ? "1" : "0"; } - } /** 跳转角色分配 */ const handleAuthRole = (row: UserVO) => { @@ -516,7 +515,7 @@ const handleFileUploadProgress = () => { upload.isUploading = true; } /** 文件上传成功处理 */ -const handleFileSuccess = (response: any, file: UploadFile, fileList: UploadFiles) => { +const handleFileSuccess = (response: any, file: UploadFile) => { upload.open = false; upload.isUploading = false; uploadRef.value.handleRemove(file);