From 7e554a7751d0f668e0558e69ee9b67fdfa6cb2b9 Mon Sep 17 00:00:00 2001 From: ray <1490493387@qq.com> Date: Thu, 31 Oct 2024 01:20:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20:recycle:=20=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96=EF=BC=8C?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=AD=97=E5=85=B8=E7=BF=BB=E8=AF=91=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/user.ts | 2 +- src/views/system/user/index.vue | 115 ++++++++++++++++---------------- 2 files changed, 59 insertions(+), 58 deletions(-) diff --git a/src/api/system/user.ts b/src/api/system/user.ts index 865e306d..6a1d23af 100644 --- a/src/api/system/user.ts +++ b/src/api/system/user.ts @@ -257,7 +257,7 @@ export interface UserPageVO { /** 用户邮箱 */ email?: string; /** 性别 */ - genderLabel?: string; + gender?: number; /** 用户ID */ id?: number; /** 手机号 */ diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 1e70ea60..0e263b2d 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -59,41 +59,47 @@ - - +
+ + 导入 + + + + 导出 + +
+ - + + + @@ -337,7 +342,7 @@ const dialog = reactive({ title: "", }); -/** 导入弹窗显示状态 */ +// 导入弹窗显示状态 const importDialogVisible = ref(false); // 用户表单数据 @@ -345,7 +350,7 @@ const formData = reactive({ status: 1, }); -/** 用户表单校验规则 */ +// 用户表单校验规则 const rules = reactive({ username: [{ required: true, message: "用户名不能为空", trigger: "blur" }], nickname: [{ required: true, message: "用户昵称不能为空", trigger: "blur" }], @@ -367,7 +372,7 @@ const rules = reactive({ ], }); -/** 查询 */ +//查询 function handleQuery() { loading.value = true; UserAPI.getPage(queryParams) @@ -380,7 +385,7 @@ function handleQuery() { }); } -/** 重置查询 */ +// 重置查询 function handleResetQuery() { queryFormRef.value.resetFields(); queryParams.pageNum = 1; @@ -389,16 +394,12 @@ function handleResetQuery() { handleQuery(); } -/** 行复选框选中记录选中ID集合 */ +// 行复选框选中记录选中ID集合 function handleSelectionChange(selection: any) { removeIds.value = selection.map((item: any) => item.id); } -/** - * 重置密码 - * - * - */ +// 重置密码 function hancleResetPassword(row: { [key: string]: any }) { ElMessageBox.prompt( "请输入用户「" + row.username + "」的新密码", @@ -446,7 +447,7 @@ async function handleOpenDialog(id?: number) { } } -/** 关闭弹窗 */ +// 关闭弹窗 function handleCloseDialog() { dialog.visible = false; userFormRef.value.resetFields(); @@ -456,7 +457,7 @@ function handleCloseDialog() { formData.status = 1; } -/** 表单提交 */ +// 表单提交 const handleSubmit = useThrottleFn(() => { userFormRef.value.validate((valid: any) => { if (valid) { @@ -483,7 +484,7 @@ const handleSubmit = useThrottleFn(() => { }); }, 3000); -/** 删除用户 */ +// 删除用户 function handleDelete(id?: number) { const userIds = [id || removeIds.value].join(","); if (!userIds) { @@ -510,17 +511,17 @@ function handleDelete(id?: number) { } ); } -/** 打开导入弹窗 */ +// 打开导入弹窗 * function handleOpenImportDialog() { importDialogVisible.value = true; } -/** 导入用户成功 */ +// 导入用户成功 function handleUserImportSuccess() { handleQuery(); } -/** 导出用户 */ +// 导出用户 function handleExport() { UserAPI.export(queryParams).then((response: any) => { const fileData = response.data;