From cdc350cef94dc335aaad8a95e426c30566c1a450 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 9 Sep 2025 09:06:46 +0800 Subject: [PATCH] =?UTF-8?q?reactor=EF=BC=9A=E3=80=90infra=20=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E8=AE=BE=E6=96=BD=E3=80=91fileConfig=20=E8=BF=9B?= =?UTF-8?q?=E4=B8=80=E6=AD=A5=E7=BB=9F=E4=B8=80=E4=BB=A3=E7=A0=81=E9=A3=8E?= =?UTF-8?q?=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/infra/fileConfig/index.vue | 64 +++++++++---------- 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/apps/web-antd/src/views/infra/fileConfig/index.vue b/apps/web-antd/src/views/infra/fileConfig/index.vue index 152fd0222..4ffe5475e 100644 --- a/apps/web-antd/src/views/infra/fileConfig/index.vue +++ b/apps/web-antd/src/views/infra/fileConfig/index.vue @@ -28,7 +28,7 @@ const [FormModal, formModalApi] = useVbenModal({ }); /** 刷新表格 */ -function onRefresh() { +function handleRefresh() { gridApi.query(); } @@ -47,12 +47,11 @@ async function handleMaster(row: InfraFileConfigApi.FileConfig) { const hideLoading = message.loading({ content: $t('ui.actionMessage.updating', [row.name]), duration: 0, - key: 'action_process_msg', }); try { - await updateFileConfigMaster(row.id as number); + await updateFileConfigMaster(row.id!); message.success($t('ui.actionMessage.updateSuccess', [row.name])); - onRefresh(); + handleRefresh(); } finally { hideLoading(); } @@ -63,11 +62,9 @@ async function handleTest(row: InfraFileConfigApi.FileConfig) { const hideLoading = message.loading({ content: '测试上传中...', duration: 0, - key: 'action_process_msg', }); try { - const response = await testFileConfig(row.id as number); - hideLoading(); + const response = await testFileConfig(row.id!); // 确认是否访问该文件 confirm({ title: '测试上传成功', @@ -86,15 +83,28 @@ async function handleTest(row: InfraFileConfigApi.FileConfig) { async function handleDelete(row: InfraFileConfigApi.FileConfig) { const hideLoading = message.loading({ content: $t('ui.actionMessage.deleting', [row.name]), - key: 'action_key_msg', }); try { await deleteFileConfig(row.id as number); - message.success({ - content: $t('ui.actionMessage.deleteSuccess', [row.name]), - key: 'action_key_msg', - }); - onRefresh(); + message.success($t('ui.actionMessage.deleteSuccess', [row.name])); + handleRefresh(); + } finally { + hideLoading(); + } +} + +/** 批量删除文件配置 */ +async function handleDeleteBatch() { + await confirm($t('ui.actionMessage.deleteBatchConfirm')); + const hideLoading = message.loading({ + content: $t('ui.actionMessage.deletingBatch'), + duration: 0, + }); + try { + await deleteFileConfigList(checkedIds.value); + checkedIds.value = []; + message.success($t('ui.actionMessage.deleteSuccess')); + handleRefresh(); } finally { hideLoading(); } @@ -109,23 +119,6 @@ function handleRowCheckboxChange({ checkedIds.value = records.map((item) => item.id!); } -/** 批量删除文件配置 */ -async function handleDeleteBatch() { - const hideLoading = message.loading({ - content: $t('ui.actionMessage.deleting'), - duration: 0, - key: 'action_process_msg', - }); - try { - await deleteFileConfigList(checkedIds.value); - checkedIds.value = []; - message.success($t('ui.actionMessage.deleteSuccess')); - onRefresh(); - } finally { - hideLoading(); - } -} - const [Grid, gridApi] = useVbenVxeGrid({ formOptions: { schema: useGridFormSchema(), @@ -163,7 +156,7 @@ const [Grid, gridApi] = useVbenVxeGrid({