From 9084a05f09aaff046b22119f1e6e8b8e3e9473dd Mon Sep 17 00:00:00 2001 From: cs Date: Wed, 11 Sep 2024 02:33:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/message/my/index.tsx | 4 ++-- src/pages/message/template/index.tsx | 3 ++- src/types/message/template.ts | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/pages/message/my/index.tsx b/src/pages/message/my/index.tsx index 63971f4..f1f4080 100644 --- a/src/pages/message/my/index.tsx +++ b/src/pages/message/my/index.tsx @@ -10,7 +10,7 @@ import {getValueCount, unSetColumnRules} from '@/utils' import {Table as ProTable} from '@/components/table' import {msgListAtom, msgSearchAtom, saveMsgAtom} from "@/store/message/my.ts"; import {templateAllListAtom} from "@/store/message/template.ts"; -import {IMsgTemplate} from "@/types/message/template.ts"; +import {coverType, IMsgTemplate} from "@/types/message/template.ts"; const i18nPrefix = 'msgMy.list' @@ -243,7 +243,7 @@ const MdwMessage = () => { title: t(`${i18nPrefix}.columns.type`, '类型'), dataIndex: 'type', render: (_, record) => { - return
{record.type}
+ return
{coverType(record.type)}
} }, { diff --git a/src/pages/message/template/index.tsx b/src/pages/message/template/index.tsx index dcc1ccc..c481efc 100644 --- a/src/pages/message/template/index.tsx +++ b/src/pages/message/template/index.tsx @@ -16,6 +16,7 @@ import { templateListAtom, templateSearchAtom } from "@/store/message/template.ts"; +import {coverType} from "@/types/message/template.ts"; const i18nPrefix = 'mdwMessage.list' @@ -214,7 +215,7 @@ const MdwMessage = () => { title: t(`${i18nPrefix}.columns.type`, '模板类型'), dataIndex: 'type', render: (_, record) => { - return
{record.type}
+ return
{coverType(record.type)}
} }, { diff --git a/src/types/message/template.ts b/src/types/message/template.ts index 25cf08c..7ff2eec 100644 --- a/src/types/message/template.ts +++ b/src/types/message/template.ts @@ -7,3 +7,19 @@ export interface IMsgTemplate { type: string fields: string } + +export const coverType = (type: string) => { + let typeText = '' + switch (type) { + case 'SMS': + typeText = '短信' + break + case 'EMAIL': + typeText = '邮件' + break + case 'TG': + typeText = 'Telegram' + break + } + return typeText +}