diff --git a/apps/web-antd/src/views/system/sms/log/data.ts b/apps/web-antd/src/views/system/sms/log/data.ts index 3babce416..9eed1257a 100644 --- a/apps/web-antd/src/views/system/sms/log/data.ts +++ b/apps/web-antd/src/views/system/sms/log/data.ts @@ -1,5 +1,6 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { SystemSmsChannelApi } from '#/api/system/sms/channel'; import type { DescriptionItemSchema } from '#/components/description'; import { h } from 'vue'; @@ -12,6 +13,10 @@ import { getSimpleSmsChannelList } from '#/api/system/sms/channel'; import { DictTag } from '#/components/dict-tag'; import { getRangePickerDefaultProps } from '#/utils'; +/** 关联数据 */ +let channelList: SystemSmsChannelApi.SmsChannel[] = []; +getSimpleSmsChannelList().then((data) => (channelList = data)); + /** 列表的搜索表单 */ export function useGridFormSchema(): VbenFormSchema[] { return [ @@ -135,13 +140,14 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { formatter: 'formatDateTime', }, { - field: 'channelCode', + field: 'channelId', title: '短信渠道', minWidth: 120, - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE }, - }, + formatter: ({ cellValue, row }) => + channelList.find((channel) => channel.id === cellValue)?.signature ?? + channelList.find((channel) => channel.code === row.channelCode) + ?.signature ?? + '-', }, { field: 'templateId', diff --git a/apps/web-antd/src/views/system/sms/template/data.ts b/apps/web-antd/src/views/system/sms/template/data.ts index 13786c56a..79ae3c811 100644 --- a/apps/web-antd/src/views/system/sms/template/data.ts +++ b/apps/web-antd/src/views/system/sms/template/data.ts @@ -1,5 +1,6 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { SystemSmsChannelApi } from '#/api/system/sms/channel'; import { CommonStatusEnum, DICT_TYPE } from '@vben/constants'; import { getDictOptions } from '@vben/hooks'; @@ -8,6 +9,10 @@ import { z } from '#/adapter/form'; import { getSimpleSmsChannelList } from '#/api/system/sms/channel'; import { getRangePickerDefaultProps } from '#/utils'; +/** 关联数据 */ +let channelList: SystemSmsChannelApi.SmsChannel[] = []; +getSimpleSmsChannelList().then((data) => (channelList = data)); + /** 新增/修改的表单 */ export function useFormSchema(): VbenFormSchema[] { return [ @@ -245,13 +250,14 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { minWidth: 180, }, { - field: 'channelCode', + field: 'channelId', title: '短信渠道', minWidth: 100, - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE }, - }, + formatter: ({ cellValue, row }) => + channelList.find((channel) => channel.id === cellValue)?.signature ?? + channelList.find((channel) => channel.code === row.channelCode) + ?.signature ?? + '-', }, { field: 'createTime', diff --git a/apps/web-antdv-next/src/views/system/sms/log/data.ts b/apps/web-antdv-next/src/views/system/sms/log/data.ts index 3babce416..9eed1257a 100644 --- a/apps/web-antdv-next/src/views/system/sms/log/data.ts +++ b/apps/web-antdv-next/src/views/system/sms/log/data.ts @@ -1,5 +1,6 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { SystemSmsChannelApi } from '#/api/system/sms/channel'; import type { DescriptionItemSchema } from '#/components/description'; import { h } from 'vue'; @@ -12,6 +13,10 @@ import { getSimpleSmsChannelList } from '#/api/system/sms/channel'; import { DictTag } from '#/components/dict-tag'; import { getRangePickerDefaultProps } from '#/utils'; +/** 关联数据 */ +let channelList: SystemSmsChannelApi.SmsChannel[] = []; +getSimpleSmsChannelList().then((data) => (channelList = data)); + /** 列表的搜索表单 */ export function useGridFormSchema(): VbenFormSchema[] { return [ @@ -135,13 +140,14 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { formatter: 'formatDateTime', }, { - field: 'channelCode', + field: 'channelId', title: '短信渠道', minWidth: 120, - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE }, - }, + formatter: ({ cellValue, row }) => + channelList.find((channel) => channel.id === cellValue)?.signature ?? + channelList.find((channel) => channel.code === row.channelCode) + ?.signature ?? + '-', }, { field: 'templateId', diff --git a/apps/web-antdv-next/src/views/system/sms/template/data.ts b/apps/web-antdv-next/src/views/system/sms/template/data.ts index fdd0fcce8..53f6160c5 100644 --- a/apps/web-antdv-next/src/views/system/sms/template/data.ts +++ b/apps/web-antdv-next/src/views/system/sms/template/data.ts @@ -1,5 +1,6 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { SystemSmsChannelApi } from '#/api/system/sms/channel'; import { CommonStatusEnum, DICT_TYPE } from '@vben/constants'; import { getDictOptions } from '@vben/hooks'; @@ -8,6 +9,10 @@ import { z } from '#/adapter/form'; import { getSimpleSmsChannelList } from '#/api/system/sms/channel'; import { getRangePickerDefaultProps } from '#/utils'; +/** 关联数据 */ +let channelList: SystemSmsChannelApi.SmsChannel[] = []; +getSimpleSmsChannelList().then((data) => (channelList = data)); + /** 新增/修改的表单 */ export function useFormSchema(): VbenFormSchema[] { return [ @@ -245,13 +250,14 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { minWidth: 180, }, { - field: 'channelCode', + field: 'channelId', title: '短信渠道', minWidth: 100, - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE }, - }, + formatter: ({ cellValue, row }) => + channelList.find((channel) => channel.id === cellValue)?.signature ?? + channelList.find((channel) => channel.code === row.channelCode) + ?.signature ?? + '-', }, { field: 'createTime', diff --git a/apps/web-ele/src/views/system/sms/log/data.ts b/apps/web-ele/src/views/system/sms/log/data.ts index 3657516b6..f6881d7ef 100644 --- a/apps/web-ele/src/views/system/sms/log/data.ts +++ b/apps/web-ele/src/views/system/sms/log/data.ts @@ -1,5 +1,6 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { SystemSmsChannelApi } from '#/api/system/sms/channel'; import type { DescriptionItemSchema } from '#/components/description'; import { h } from 'vue'; @@ -12,6 +13,10 @@ import { getSimpleSmsChannelList } from '#/api/system/sms/channel'; import { DictTag } from '#/components/dict-tag'; import { getRangePickerDefaultProps } from '#/utils'; +/** 关联数据 */ +let channelList: SystemSmsChannelApi.SmsChannel[] = []; +getSimpleSmsChannelList().then((data) => (channelList = data)); + /** 列表的搜索表单 */ export function useGridFormSchema(): VbenFormSchema[] { return [ @@ -135,13 +140,14 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { formatter: 'formatDateTime', }, { - field: 'channelCode', + field: 'channelId', title: '短信渠道', minWidth: 120, - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE }, - }, + formatter: ({ cellValue, row }) => + channelList.find((channel) => channel.id === cellValue)?.signature ?? + channelList.find((channel) => channel.code === row.channelCode) + ?.signature ?? + '-', }, { field: 'templateId', diff --git a/apps/web-ele/src/views/system/sms/template/data.ts b/apps/web-ele/src/views/system/sms/template/data.ts index 0a3d3e814..031ba137f 100644 --- a/apps/web-ele/src/views/system/sms/template/data.ts +++ b/apps/web-ele/src/views/system/sms/template/data.ts @@ -1,5 +1,6 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { SystemSmsChannelApi } from '#/api/system/sms/channel'; import { CommonStatusEnum, DICT_TYPE } from '@vben/constants'; import { getDictOptions } from '@vben/hooks'; @@ -8,6 +9,10 @@ import { z } from '#/adapter/form'; import { getSimpleSmsChannelList } from '#/api/system/sms/channel'; import { getRangePickerDefaultProps } from '#/utils'; +/** 关联数据 */ +let channelList: SystemSmsChannelApi.SmsChannel[] = []; +getSimpleSmsChannelList().then((data) => (channelList = data)); + /** 新增/修改的表单 */ export function useFormSchema(): VbenFormSchema[] { return [ @@ -243,13 +248,14 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { minWidth: 180, }, { - field: 'channelCode', + field: 'channelId', title: '短信渠道', minWidth: 100, - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE }, - }, + formatter: ({ cellValue, row }) => + channelList.find((channel) => channel.id === cellValue)?.signature ?? + channelList.find((channel) => channel.code === row.channelCode) + ?.signature ?? + '-', }, { field: 'createTime', diff --git a/apps/web-naive/src/views/system/sms/log/data.ts b/apps/web-naive/src/views/system/sms/log/data.ts index 6fea4bb36..b54a661cb 100644 --- a/apps/web-naive/src/views/system/sms/log/data.ts +++ b/apps/web-naive/src/views/system/sms/log/data.ts @@ -1,5 +1,6 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { SystemSmsChannelApi } from '#/api/system/sms/channel'; import type { DescriptionItemSchema } from '#/components/description'; import { h } from 'vue'; @@ -12,6 +13,10 @@ import { getSimpleSmsChannelList } from '#/api/system/sms/channel'; import { DictTag } from '#/components/dict-tag'; import { getRangePickerDefaultProps } from '#/utils'; +/** 关联数据 */ +let channelList: SystemSmsChannelApi.SmsChannel[] = []; +getSimpleSmsChannelList().then((data) => (channelList = data)); + /** 列表的搜索表单 */ export function useGridFormSchema(): VbenFormSchema[] { return [ @@ -135,13 +140,14 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { formatter: 'formatDateTime', }, { - field: 'channelCode', + field: 'channelId', title: '短信渠道', minWidth: 120, - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE }, - }, + formatter: ({ cellValue, row }) => + channelList.find((channel) => channel.id === cellValue)?.signature ?? + channelList.find((channel) => channel.code === row.channelCode) + ?.signature ?? + '-', }, { field: 'templateId', diff --git a/apps/web-naive/src/views/system/sms/template/data.ts b/apps/web-naive/src/views/system/sms/template/data.ts index d8b381040..675901177 100644 --- a/apps/web-naive/src/views/system/sms/template/data.ts +++ b/apps/web-naive/src/views/system/sms/template/data.ts @@ -1,5 +1,6 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { SystemSmsChannelApi } from '#/api/system/sms/channel'; import { CommonStatusEnum, DICT_TYPE } from '@vben/constants'; import { getDictOptions } from '@vben/hooks'; @@ -8,6 +9,10 @@ import { z } from '#/adapter/form'; import { getSimpleSmsChannelList } from '#/api/system/sms/channel'; import { getRangePickerDefaultProps } from '#/utils'; +/** 关联数据 */ +let channelList: SystemSmsChannelApi.SmsChannel[] = []; +getSimpleSmsChannelList().then((data) => (channelList = data)); + /** 新增/修改的表单 */ export function useFormSchema(): VbenFormSchema[] { return [ @@ -246,13 +251,14 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { minWidth: 180, }, { - field: 'channelCode', + field: 'channelId', title: '短信渠道', minWidth: 100, - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE }, - }, + formatter: ({ cellValue, row }) => + channelList.find((channel) => channel.id === cellValue)?.signature ?? + channelList.find((channel) => channel.code === row.channelCode) + ?.signature ?? + '-', }, { field: 'createTime', diff --git a/apps/web-tdesign/src/views/system/sms/log/data.ts b/apps/web-tdesign/src/views/system/sms/log/data.ts index 3babce416..9eed1257a 100644 --- a/apps/web-tdesign/src/views/system/sms/log/data.ts +++ b/apps/web-tdesign/src/views/system/sms/log/data.ts @@ -1,5 +1,6 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { SystemSmsChannelApi } from '#/api/system/sms/channel'; import type { DescriptionItemSchema } from '#/components/description'; import { h } from 'vue'; @@ -12,6 +13,10 @@ import { getSimpleSmsChannelList } from '#/api/system/sms/channel'; import { DictTag } from '#/components/dict-tag'; import { getRangePickerDefaultProps } from '#/utils'; +/** 关联数据 */ +let channelList: SystemSmsChannelApi.SmsChannel[] = []; +getSimpleSmsChannelList().then((data) => (channelList = data)); + /** 列表的搜索表单 */ export function useGridFormSchema(): VbenFormSchema[] { return [ @@ -135,13 +140,14 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { formatter: 'formatDateTime', }, { - field: 'channelCode', + field: 'channelId', title: '短信渠道', minWidth: 120, - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE }, - }, + formatter: ({ cellValue, row }) => + channelList.find((channel) => channel.id === cellValue)?.signature ?? + channelList.find((channel) => channel.code === row.channelCode) + ?.signature ?? + '-', }, { field: 'templateId', diff --git a/apps/web-tdesign/src/views/system/sms/template/data.ts b/apps/web-tdesign/src/views/system/sms/template/data.ts index 13786c56a..79ae3c811 100644 --- a/apps/web-tdesign/src/views/system/sms/template/data.ts +++ b/apps/web-tdesign/src/views/system/sms/template/data.ts @@ -1,5 +1,6 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { SystemSmsChannelApi } from '#/api/system/sms/channel'; import { CommonStatusEnum, DICT_TYPE } from '@vben/constants'; import { getDictOptions } from '@vben/hooks'; @@ -8,6 +9,10 @@ import { z } from '#/adapter/form'; import { getSimpleSmsChannelList } from '#/api/system/sms/channel'; import { getRangePickerDefaultProps } from '#/utils'; +/** 关联数据 */ +let channelList: SystemSmsChannelApi.SmsChannel[] = []; +getSimpleSmsChannelList().then((data) => (channelList = data)); + /** 新增/修改的表单 */ export function useFormSchema(): VbenFormSchema[] { return [ @@ -245,13 +250,14 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { minWidth: 180, }, { - field: 'channelCode', + field: 'channelId', title: '短信渠道', minWidth: 100, - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE }, - }, + formatter: ({ cellValue, row }) => + channelList.find((channel) => channel.id === cellValue)?.signature ?? + channelList.find((channel) => channel.code === row.channelCode) + ?.signature ?? + '-', }, { field: 'createTime',