From 02a6cc3bb2a0a0025e440b7b8f4513a062885692 Mon Sep 17 00:00:00 2001 From: hxr <1490493387@qq.com> Date: Thu, 27 Jul 2023 23:58:26 +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=E6=B3=A8=E9=87=8A=E4=BC=98=E5=8C=96=EF=BC=8C?= =?UTF-8?q?=E6=80=A7=E5=88=AB=E4=BD=BF=E7=94=A8=E5=AD=97=E5=85=B8=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 6cd06a50e9a635d885c85bfa0ffeb651633b64ec --- src/views/system/user/index.vue | 58 ++++++++------------------------- 1 file changed, 14 insertions(+), 44 deletions(-) diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 2742fee9..da1e2057 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -153,9 +153,7 @@ function handleQuery() { }); } -/** - * 重置查询 - */ +/** 重置查询 */ function resetQuery() { queryFormRef.value.resetFields(); queryParams.pageNum = 1; @@ -163,16 +161,12 @@ function resetQuery() { handleQuery(); } -/** - * 行checkbox change事件 - */ +/** 行选中事件 */ function handleSelectionChange(selection: any) { ids.value = selection.map((item: any) => item.id); } -/** - * 重置密码 - */ +/**重置密码 */ function resetPassword(row: { [key: string]: any }) { ElMessageBox.prompt( "请输入用户「" + row.username + "」的新密码", @@ -194,9 +188,7 @@ function resetPassword(row: { [key: string]: any }) { .catch(() => {}); } -/** - * 打开用户弹窗 - */ +/** 打开表单弹窗 */ async function openDialog(userId?: number) { await getDeptOptions(); await getRoleOptions(); @@ -211,17 +203,13 @@ async function openDialog(userId?: number) { } } -/** - * 关闭弹窗 - */ +/** 关闭表单弹窗 */ function closeDialog() { dialog.visible = false; resetForm(); } -/** - * 重置表单 - */ +/** 重置表单 */ function resetForm() { userFormRef.value.resetFields(); userFormRef.value.clearValidate(); @@ -230,9 +218,7 @@ function resetForm() { formData.status = 1; } -/** - * 表单提交 - */ +/** 表单提交 */ const handleSubmit = useThrottleFn(() => { userFormRef.value.validate((valid: any) => { if (valid) { @@ -259,9 +245,7 @@ const handleSubmit = useThrottleFn(() => { }); }, 3000); -/** - * 删除用户 - */ +/** 删除用户 */ function handleDelete(id?: number) { const userIds = [id || ids.value].join(","); if (!userIds) { @@ -290,9 +274,7 @@ async function getDeptOptions() { }); } -/** - * 下载导入模板 - */ +/** 下载导入模板 */ function downloadTemplate() { downloadTemplateApi().then((response: any) => { const blob = new Blob([response.data], { @@ -311,9 +293,7 @@ function downloadTemplate() { }); } -/** - * 打开导入弹窗 - */ +/** 打开导入弹窗 */ async function openImportDialog() { await getDeptOptions(); importDeptId.value = undefined; @@ -335,9 +315,7 @@ function handleExcelChange(file: UploadFile) { excelFile.value = file.raw; } -/** - * 导入用户提交 - */ +/** 导入用户提交 */ function handleUserImport() { if (importDeptId.value) { if (!excelFile.value) { @@ -352,18 +330,14 @@ function handleUserImport() { } } -/** - * 关闭导入弹窗 - */ +/** 关闭导入弹窗 */ function closeImportDialog() { importDialog.visible = false; excelFile.value = undefined; excelFilelist.value = []; } -/** - * 导出用户 - */ +/** 导出用户 */ function handleUserExport() { exportUser(queryParams).then((response: any) => { const blob = new Blob([response.data], { @@ -630,11 +604,7 @@ onMounted(() => { - - - - - +