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({
-
+
(
- onActionClick: OnActionClickFn,
-): VxeTableGridOptions['columns'] {
+export function useGridColumns(): VxeTableGridOptions['columns'] {
return [
- {
- type: 'checkbox',
- width: 40,
- },
+ { type: 'checkbox', width: 40 },
{
field: 'id',
title: '编号',
@@ -184,29 +175,10 @@ export function useGridColumns(
formatter: 'formatDateTime',
},
{
- field: 'operation',
title: '操作',
- minWidth: 130,
- align: 'center',
+ width: 130,
fixed: 'right',
- cellRender: {
- attrs: {
- nameField: 'mail',
- nameTitle: '邮箱账号',
- onClick: onActionClick,
- },
- name: 'CellOperation',
- options: [
- {
- code: 'edit',
- show: hasAccessByCodes(['system:mail-account:update']),
- },
- {
- code: 'delete',
- show: hasAccessByCodes(['system:mail-account:delete']),
- },
- ],
- },
+ slots: { default: 'actions' },
},
];
}
diff --git a/apps/web-ele/src/views/system/mail/account/index.vue b/apps/web-ele/src/views/system/mail/account/index.vue
index f4c2ec4e..4a3b43a1 100644
--- a/apps/web-ele/src/views/system/mail/account/index.vue
+++ b/apps/web-ele/src/views/system/mail/account/index.vue
@@ -1,8 +1,5 @@
-
+