diff --git a/apps/web-antd/src/views/system/mail/account/data.ts b/apps/web-antd/src/views/system/mail/account/data.ts index 00e5e560..2a00f39e 100644 --- a/apps/web-antd/src/views/system/mail/account/data.ts +++ b/apps/web-antd/src/views/system/mail/account/data.ts @@ -128,26 +128,32 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'id', title: '编号', + minWidth: 100, }, { field: 'mail', title: '邮箱', + minWidth: 160, }, { field: 'username', title: '用户名', + minWidth: 160, }, { field: 'host', title: 'SMTP 服务器域名', + minWidth: 150, }, { field: 'port', title: 'SMTP 服务器端口', + minWidth: 130, }, { field: 'sslEnable', title: '是否开启 SSL', + minWidth: 120, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.INFRA_BOOLEAN_STRING }, @@ -156,6 +162,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'starttlsEnable', title: '是否开启 STARTTLS', + minWidth: 145, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.INFRA_BOOLEAN_STRING }, @@ -164,6 +171,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'createTime', title: '创建时间', + minWidth: 180, formatter: 'formatDateTime', }, { diff --git a/apps/web-antd/src/views/system/mail/account/index.vue b/apps/web-antd/src/views/system/mail/account/index.vue index e9fa4e0f..467ed2de 100644 --- a/apps/web-antd/src/views/system/mail/account/index.vue +++ b/apps/web-antd/src/views/system/mail/account/index.vue @@ -4,7 +4,7 @@ import type { SystemMailAccountApi } from '#/api/system/mail/account'; import { ref } from 'vue'; -import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; +import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; import { isEmpty } from '@vben/utils'; import { message } from 'ant-design-vue'; @@ -26,7 +26,7 @@ const [FormModal, formModalApi] = useVbenModal({ }); /** 刷新表格 */ -function onRefresh() { +function handleRefresh() { gridApi.query(); } @@ -44,15 +44,28 @@ function handleEdit(row: SystemMailAccountApi.MailAccount) { async function handleDelete(row: SystemMailAccountApi.MailAccount) { const hideLoading = message.loading({ content: $t('ui.actionMessage.deleting', [row.mail]), - key: 'action_key_msg', }); try { await deleteMailAccount(row.id as number); - message.success({ - content: $t('ui.actionMessage.deleteSuccess', [row.mail]), - key: 'action_key_msg', - }); - onRefresh(); + message.success($t('ui.actionMessage.deleteSuccess', [row.mail])); + 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 deleteMailAccountList(checkedIds.value); + checkedIds.value = []; + message.success($t('ui.actionMessage.deleteSuccess')); + handleRefresh(); } finally { hideLoading(); } @@ -67,23 +80,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 deleteMailAccountList(checkedIds.value); - checkedIds.value = []; - message.success($t('ui.actionMessage.deleteSuccess')); - onRefresh(); - } finally { - hideLoading(); - } -} - const [Grid, gridApi] = useVbenVxeGrid({ formOptions: { schema: useGridFormSchema(), @@ -124,7 +120,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ - +