From eea46a1920e51164f6d881edab95a7b9fc60a457 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 19 Apr 2025 09:44:49 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E9=82=AE=E7=AE=B1=E6=A8=A1?= =?UTF-8?q?=E7=89=88=E7=9A=84=E8=AF=BB=E5=8F=96=EF=BC=8C=E6=94=BE=E5=88=B0?= =?UTF-8?q?=20data.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/system/mail/template/data.ts | 7 ++-- .../src/views/system/mail/template/index.vue | 32 ++++--------------- 2 files changed, 10 insertions(+), 29 deletions(-) diff --git a/apps/web-antd/src/views/system/mail/template/data.ts b/apps/web-antd/src/views/system/mail/template/data.ts index 777828bb1..547a58c31 100644 --- a/apps/web-antd/src/views/system/mail/template/data.ts +++ b/apps/web-antd/src/views/system/mail/template/data.ts @@ -1,7 +1,6 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table'; import type { SystemMailTemplateApi } from '#/api/system/mail/template'; -import type { ComputedRef } from 'vue'; import { z } from '#/adapter/form'; import { getSimpleMailAccountList } from '#/api/system/mail/account'; @@ -192,9 +191,9 @@ export function useGridFormSchema(): VbenFormSchema[] { } /** 列表的字段 */ +const accountList = await getSimpleMailAccountList(); export function useGridColumns( - onActionClick: OnActionClickFn, - getAccountName: ComputedRef<(cellValue: number) => string>, + onActionClick: OnActionClickFn ): VxeTableGridOptions['columns'] { return [ { @@ -221,7 +220,7 @@ export function useGridColumns( field: 'accountId', title: '邮箱账号', minWidth: 120, - formatter: ({ cellValue }) => getAccountName.value(cellValue), + formatter: ({ cellValue }) => accountList.find((account) => account.id === cellValue)?.mail || '-', }, { field: 'nickname', diff --git a/apps/web-antd/src/views/system/mail/template/index.vue b/apps/web-antd/src/views/system/mail/template/index.vue index ee6b7ea47..b223b5b25 100644 --- a/apps/web-antd/src/views/system/mail/template/index.vue +++ b/apps/web-antd/src/views/system/mail/template/index.vue @@ -1,20 +1,17 @@