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 1/3] =?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(() => { - - - - - + From c0258577499d002e0ce4d1d31d7eb2ddec329650 Mon Sep 17 00:00:00 2001 From: hxr <1490493387@qq.com> Date: Fri, 28 Jul 2023 23:55:50 +0800 Subject: [PATCH 2/3] =?UTF-8?q?style:=20:lipstick:=20=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=B0=83=E6=95=B4=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 999ce63dd020f5ffc100476edb11ebdcc4cb9c83 --- src/views/system/role/index.vue | 42 ++++++++------------------------- 1 file changed, 10 insertions(+), 32 deletions(-) diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index 59785f6b..d05d0ccf 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -60,9 +60,7 @@ interface CheckedRole { } let checkedRole: CheckedRole = reactive({}); -/** - * 查询 - */ +/** 查询 */ function handleQuery() { loading.value = true; getRolePage(queryParams) @@ -74,27 +72,19 @@ function handleQuery() { loading.value = false; }); } -/** - * 重置查询 - */ +/** 重置查询 */ function resetQuery() { queryFormRef.value.resetFields(); queryParams.pageNum = 1; handleQuery(); } -/** - * 行checkbox change事件 - */ +/** 行checkbox 选中事件 */ function handleSelectionChange(selection: any) { ids.value = selection.map((item: any) => item.id); } -/** - * 打开角色表单弹窗 - * - * @param roleId - */ +/** 打开角色表单弹窗 */ function openDialog(roleId?: number) { dialog.visible = true; if (roleId) { @@ -107,9 +97,7 @@ function openDialog(roleId?: number) { } } -/** - * 角色表单提交 - */ +/** 角色保存提交 */ function handleSubmit() { roleFormRef.value.validate((valid: any) => { if (valid) { @@ -136,17 +124,13 @@ function handleSubmit() { }); } -/** - * 关闭弹窗 - */ +/** 关闭表单弹窗 */ function closeDialog() { dialog.visible = false; resetForm(); } -/** - * 重置表单 - */ +/** 重置表单 */ function resetForm() { roleFormRef.value.resetFields(); roleFormRef.value.clearValidate(); @@ -156,9 +140,7 @@ function resetForm() { formData.status = 1; } -/** - * 删除 - */ +/** 删除角色 */ function handleDelete(roleId?: number) { const roleIds = [roleId || ids.value].join(","); if (!roleIds) { @@ -181,9 +163,7 @@ function handleDelete(roleId?: number) { }); } -/** - * 打开分配菜单弹窗 - */ +/** 打开分配菜单弹窗 */ function openMenuDialog(row: RolePageVO) { const roleId = row.id; if (roleId) { @@ -213,9 +193,7 @@ function openMenuDialog(row: RolePageVO) { } } -/** - * 角色分配菜单提交 - */ +/** 角色分配菜单保存提交 */ function handleRoleMenuSubmit() { const roleId = checkedRole.id; if (roleId) { From a240ff04d296be9ff640a85f688a432b65d4fc98 Mon Sep 17 00:00:00 2001 From: hxr <1490493387@qq.com> Date: Mon, 31 Jul 2023 08:37:23 +0800 Subject: [PATCH 3/3] =?UTF-8?q?style:=20=E8=8F=9C=E5=8D=95=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E6=A0=BC=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: f24f00f113a13a28bf488bfe5c64265897c2bf67 --- src/views/system/menu/index.vue | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue index c5e56d97..0627dfb2 100644 --- a/src/views/system/menu/index.vue +++ b/src/views/system/menu/index.vue @@ -73,17 +73,13 @@ function handleQuery() { }); } -/** - * 查询重置 - */ +/** 重置查询 */ function resetQuery() { queryFormRef.value.resetFields(); handleQuery(); } -/** - * 行点击事件 - */ +/**行点击事件 */ function onRowClick(row: MenuVO) { selectedRowMenuId.value = row.id; } @@ -115,9 +111,7 @@ function openDialog(parentId?: number, menuId?: number) { }); } -/** - * 菜单类型 change - */ +/** 菜单类型切换事件处理 */ function onMenuTypeChange() { // 如果菜单类型改变,清空路由路径;未改变在切换后还原路由路径 if (formData.type !== menuCacheData.type) { @@ -127,9 +121,7 @@ function onMenuTypeChange() { } } -/** - * 菜单保存提交 - */ +/** 菜单保存提交 */ function submitForm() { menuFormRef.value.validate((isValid: boolean) => { if (isValid) { @@ -151,10 +143,7 @@ function submitForm() { }); } -/** - * 删除菜单 - * @param menuId 菜单ID - */ +/** 删除菜单 */ function handleDelete(menuId: number) { if (!menuId) { ElMessage.warning("请勾选删除项"); @@ -175,17 +164,13 @@ function handleDelete(menuId: number) { .catch(() => ElMessage.info("已取消删除")); } -/** - * 关闭弹窗 - */ +/** 关闭弹窗 */ function closeDialog() { dialog.visible = false; resetForm(); } -/** - * 重置表单 - */ +/** 重置表单 */ function resetForm() { menuFormRef.value.resetFields(); menuFormRef.value.clearValidate();