fix(sms): 修复短信渠道列表展示不一致

pull/346/head
YunaiV 2026-05-23 16:41:36 +08:00
parent 5710761dbe
commit d910450426
10 changed files with 110 additions and 50 deletions

View File

@ -1,5 +1,6 @@
import type { VbenFormSchema } from '#/adapter/form'; import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { SystemSmsChannelApi } from '#/api/system/sms/channel';
import type { DescriptionItemSchema } from '#/components/description'; import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue'; import { h } from 'vue';
@ -12,6 +13,10 @@ import { getSimpleSmsChannelList } from '#/api/system/sms/channel';
import { DictTag } from '#/components/dict-tag'; import { DictTag } from '#/components/dict-tag';
import { getRangePickerDefaultProps } from '#/utils'; import { getRangePickerDefaultProps } from '#/utils';
/** 关联数据 */
let channelList: SystemSmsChannelApi.SmsChannel[] = [];
getSimpleSmsChannelList().then((data) => (channelList = data));
/** 列表的搜索表单 */ /** 列表的搜索表单 */
export function useGridFormSchema(): VbenFormSchema[] { export function useGridFormSchema(): VbenFormSchema[] {
return [ return [
@ -135,13 +140,14 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
formatter: 'formatDateTime', formatter: 'formatDateTime',
}, },
{ {
field: 'channelCode', field: 'channelId',
title: '短信渠道', title: '短信渠道',
minWidth: 120, minWidth: 120,
cellRender: { formatter: ({ cellValue, row }) =>
name: 'CellDict', channelList.find((channel) => channel.id === cellValue)?.signature ??
props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE }, channelList.find((channel) => channel.code === row.channelCode)
}, ?.signature ??
'-',
}, },
{ {
field: 'templateId', field: 'templateId',

View File

@ -1,5 +1,6 @@
import type { VbenFormSchema } from '#/adapter/form'; import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { SystemSmsChannelApi } from '#/api/system/sms/channel';
import { CommonStatusEnum, DICT_TYPE } from '@vben/constants'; import { CommonStatusEnum, DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks'; import { getDictOptions } from '@vben/hooks';
@ -8,6 +9,10 @@ import { z } from '#/adapter/form';
import { getSimpleSmsChannelList } from '#/api/system/sms/channel'; import { getSimpleSmsChannelList } from '#/api/system/sms/channel';
import { getRangePickerDefaultProps } from '#/utils'; import { getRangePickerDefaultProps } from '#/utils';
/** 关联数据 */
let channelList: SystemSmsChannelApi.SmsChannel[] = [];
getSimpleSmsChannelList().then((data) => (channelList = data));
/** 新增/修改的表单 */ /** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] { export function useFormSchema(): VbenFormSchema[] {
return [ return [
@ -245,13 +250,14 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
minWidth: 180, minWidth: 180,
}, },
{ {
field: 'channelCode', field: 'channelId',
title: '短信渠道', title: '短信渠道',
minWidth: 100, minWidth: 100,
cellRender: { formatter: ({ cellValue, row }) =>
name: 'CellDict', channelList.find((channel) => channel.id === cellValue)?.signature ??
props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE }, channelList.find((channel) => channel.code === row.channelCode)
}, ?.signature ??
'-',
}, },
{ {
field: 'createTime', field: 'createTime',

View File

@ -1,5 +1,6 @@
import type { VbenFormSchema } from '#/adapter/form'; import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { SystemSmsChannelApi } from '#/api/system/sms/channel';
import type { DescriptionItemSchema } from '#/components/description'; import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue'; import { h } from 'vue';
@ -12,6 +13,10 @@ import { getSimpleSmsChannelList } from '#/api/system/sms/channel';
import { DictTag } from '#/components/dict-tag'; import { DictTag } from '#/components/dict-tag';
import { getRangePickerDefaultProps } from '#/utils'; import { getRangePickerDefaultProps } from '#/utils';
/** 关联数据 */
let channelList: SystemSmsChannelApi.SmsChannel[] = [];
getSimpleSmsChannelList().then((data) => (channelList = data));
/** 列表的搜索表单 */ /** 列表的搜索表单 */
export function useGridFormSchema(): VbenFormSchema[] { export function useGridFormSchema(): VbenFormSchema[] {
return [ return [
@ -135,13 +140,14 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
formatter: 'formatDateTime', formatter: 'formatDateTime',
}, },
{ {
field: 'channelCode', field: 'channelId',
title: '短信渠道', title: '短信渠道',
minWidth: 120, minWidth: 120,
cellRender: { formatter: ({ cellValue, row }) =>
name: 'CellDict', channelList.find((channel) => channel.id === cellValue)?.signature ??
props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE }, channelList.find((channel) => channel.code === row.channelCode)
}, ?.signature ??
'-',
}, },
{ {
field: 'templateId', field: 'templateId',

View File

@ -1,5 +1,6 @@
import type { VbenFormSchema } from '#/adapter/form'; import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { SystemSmsChannelApi } from '#/api/system/sms/channel';
import { CommonStatusEnum, DICT_TYPE } from '@vben/constants'; import { CommonStatusEnum, DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks'; import { getDictOptions } from '@vben/hooks';
@ -8,6 +9,10 @@ import { z } from '#/adapter/form';
import { getSimpleSmsChannelList } from '#/api/system/sms/channel'; import { getSimpleSmsChannelList } from '#/api/system/sms/channel';
import { getRangePickerDefaultProps } from '#/utils'; import { getRangePickerDefaultProps } from '#/utils';
/** 关联数据 */
let channelList: SystemSmsChannelApi.SmsChannel[] = [];
getSimpleSmsChannelList().then((data) => (channelList = data));
/** 新增/修改的表单 */ /** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] { export function useFormSchema(): VbenFormSchema[] {
return [ return [
@ -245,13 +250,14 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
minWidth: 180, minWidth: 180,
}, },
{ {
field: 'channelCode', field: 'channelId',
title: '短信渠道', title: '短信渠道',
minWidth: 100, minWidth: 100,
cellRender: { formatter: ({ cellValue, row }) =>
name: 'CellDict', channelList.find((channel) => channel.id === cellValue)?.signature ??
props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE }, channelList.find((channel) => channel.code === row.channelCode)
}, ?.signature ??
'-',
}, },
{ {
field: 'createTime', field: 'createTime',

View File

@ -1,5 +1,6 @@
import type { VbenFormSchema } from '#/adapter/form'; import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { SystemSmsChannelApi } from '#/api/system/sms/channel';
import type { DescriptionItemSchema } from '#/components/description'; import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue'; import { h } from 'vue';
@ -12,6 +13,10 @@ import { getSimpleSmsChannelList } from '#/api/system/sms/channel';
import { DictTag } from '#/components/dict-tag'; import { DictTag } from '#/components/dict-tag';
import { getRangePickerDefaultProps } from '#/utils'; import { getRangePickerDefaultProps } from '#/utils';
/** 关联数据 */
let channelList: SystemSmsChannelApi.SmsChannel[] = [];
getSimpleSmsChannelList().then((data) => (channelList = data));
/** 列表的搜索表单 */ /** 列表的搜索表单 */
export function useGridFormSchema(): VbenFormSchema[] { export function useGridFormSchema(): VbenFormSchema[] {
return [ return [
@ -135,13 +140,14 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
formatter: 'formatDateTime', formatter: 'formatDateTime',
}, },
{ {
field: 'channelCode', field: 'channelId',
title: '短信渠道', title: '短信渠道',
minWidth: 120, minWidth: 120,
cellRender: { formatter: ({ cellValue, row }) =>
name: 'CellDict', channelList.find((channel) => channel.id === cellValue)?.signature ??
props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE }, channelList.find((channel) => channel.code === row.channelCode)
}, ?.signature ??
'-',
}, },
{ {
field: 'templateId', field: 'templateId',

View File

@ -1,5 +1,6 @@
import type { VbenFormSchema } from '#/adapter/form'; import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { SystemSmsChannelApi } from '#/api/system/sms/channel';
import { CommonStatusEnum, DICT_TYPE } from '@vben/constants'; import { CommonStatusEnum, DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks'; import { getDictOptions } from '@vben/hooks';
@ -8,6 +9,10 @@ import { z } from '#/adapter/form';
import { getSimpleSmsChannelList } from '#/api/system/sms/channel'; import { getSimpleSmsChannelList } from '#/api/system/sms/channel';
import { getRangePickerDefaultProps } from '#/utils'; import { getRangePickerDefaultProps } from '#/utils';
/** 关联数据 */
let channelList: SystemSmsChannelApi.SmsChannel[] = [];
getSimpleSmsChannelList().then((data) => (channelList = data));
/** 新增/修改的表单 */ /** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] { export function useFormSchema(): VbenFormSchema[] {
return [ return [
@ -243,13 +248,14 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
minWidth: 180, minWidth: 180,
}, },
{ {
field: 'channelCode', field: 'channelId',
title: '短信渠道', title: '短信渠道',
minWidth: 100, minWidth: 100,
cellRender: { formatter: ({ cellValue, row }) =>
name: 'CellDict', channelList.find((channel) => channel.id === cellValue)?.signature ??
props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE }, channelList.find((channel) => channel.code === row.channelCode)
}, ?.signature ??
'-',
}, },
{ {
field: 'createTime', field: 'createTime',

View File

@ -1,5 +1,6 @@
import type { VbenFormSchema } from '#/adapter/form'; import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { SystemSmsChannelApi } from '#/api/system/sms/channel';
import type { DescriptionItemSchema } from '#/components/description'; import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue'; import { h } from 'vue';
@ -12,6 +13,10 @@ import { getSimpleSmsChannelList } from '#/api/system/sms/channel';
import { DictTag } from '#/components/dict-tag'; import { DictTag } from '#/components/dict-tag';
import { getRangePickerDefaultProps } from '#/utils'; import { getRangePickerDefaultProps } from '#/utils';
/** 关联数据 */
let channelList: SystemSmsChannelApi.SmsChannel[] = [];
getSimpleSmsChannelList().then((data) => (channelList = data));
/** 列表的搜索表单 */ /** 列表的搜索表单 */
export function useGridFormSchema(): VbenFormSchema[] { export function useGridFormSchema(): VbenFormSchema[] {
return [ return [
@ -135,13 +140,14 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
formatter: 'formatDateTime', formatter: 'formatDateTime',
}, },
{ {
field: 'channelCode', field: 'channelId',
title: '短信渠道', title: '短信渠道',
minWidth: 120, minWidth: 120,
cellRender: { formatter: ({ cellValue, row }) =>
name: 'CellDict', channelList.find((channel) => channel.id === cellValue)?.signature ??
props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE }, channelList.find((channel) => channel.code === row.channelCode)
}, ?.signature ??
'-',
}, },
{ {
field: 'templateId', field: 'templateId',

View File

@ -1,5 +1,6 @@
import type { VbenFormSchema } from '#/adapter/form'; import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { SystemSmsChannelApi } from '#/api/system/sms/channel';
import { CommonStatusEnum, DICT_TYPE } from '@vben/constants'; import { CommonStatusEnum, DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks'; import { getDictOptions } from '@vben/hooks';
@ -8,6 +9,10 @@ import { z } from '#/adapter/form';
import { getSimpleSmsChannelList } from '#/api/system/sms/channel'; import { getSimpleSmsChannelList } from '#/api/system/sms/channel';
import { getRangePickerDefaultProps } from '#/utils'; import { getRangePickerDefaultProps } from '#/utils';
/** 关联数据 */
let channelList: SystemSmsChannelApi.SmsChannel[] = [];
getSimpleSmsChannelList().then((data) => (channelList = data));
/** 新增/修改的表单 */ /** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] { export function useFormSchema(): VbenFormSchema[] {
return [ return [
@ -246,13 +251,14 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
minWidth: 180, minWidth: 180,
}, },
{ {
field: 'channelCode', field: 'channelId',
title: '短信渠道', title: '短信渠道',
minWidth: 100, minWidth: 100,
cellRender: { formatter: ({ cellValue, row }) =>
name: 'CellDict', channelList.find((channel) => channel.id === cellValue)?.signature ??
props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE }, channelList.find((channel) => channel.code === row.channelCode)
}, ?.signature ??
'-',
}, },
{ {
field: 'createTime', field: 'createTime',

View File

@ -1,5 +1,6 @@
import type { VbenFormSchema } from '#/adapter/form'; import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { SystemSmsChannelApi } from '#/api/system/sms/channel';
import type { DescriptionItemSchema } from '#/components/description'; import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue'; import { h } from 'vue';
@ -12,6 +13,10 @@ import { getSimpleSmsChannelList } from '#/api/system/sms/channel';
import { DictTag } from '#/components/dict-tag'; import { DictTag } from '#/components/dict-tag';
import { getRangePickerDefaultProps } from '#/utils'; import { getRangePickerDefaultProps } from '#/utils';
/** 关联数据 */
let channelList: SystemSmsChannelApi.SmsChannel[] = [];
getSimpleSmsChannelList().then((data) => (channelList = data));
/** 列表的搜索表单 */ /** 列表的搜索表单 */
export function useGridFormSchema(): VbenFormSchema[] { export function useGridFormSchema(): VbenFormSchema[] {
return [ return [
@ -135,13 +140,14 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
formatter: 'formatDateTime', formatter: 'formatDateTime',
}, },
{ {
field: 'channelCode', field: 'channelId',
title: '短信渠道', title: '短信渠道',
minWidth: 120, minWidth: 120,
cellRender: { formatter: ({ cellValue, row }) =>
name: 'CellDict', channelList.find((channel) => channel.id === cellValue)?.signature ??
props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE }, channelList.find((channel) => channel.code === row.channelCode)
}, ?.signature ??
'-',
}, },
{ {
field: 'templateId', field: 'templateId',

View File

@ -1,5 +1,6 @@
import type { VbenFormSchema } from '#/adapter/form'; import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { SystemSmsChannelApi } from '#/api/system/sms/channel';
import { CommonStatusEnum, DICT_TYPE } from '@vben/constants'; import { CommonStatusEnum, DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks'; import { getDictOptions } from '@vben/hooks';
@ -8,6 +9,10 @@ import { z } from '#/adapter/form';
import { getSimpleSmsChannelList } from '#/api/system/sms/channel'; import { getSimpleSmsChannelList } from '#/api/system/sms/channel';
import { getRangePickerDefaultProps } from '#/utils'; import { getRangePickerDefaultProps } from '#/utils';
/** 关联数据 */
let channelList: SystemSmsChannelApi.SmsChannel[] = [];
getSimpleSmsChannelList().then((data) => (channelList = data));
/** 新增/修改的表单 */ /** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] { export function useFormSchema(): VbenFormSchema[] {
return [ return [
@ -245,13 +250,14 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
minWidth: 180, minWidth: 180,
}, },
{ {
field: 'channelCode', field: 'channelId',
title: '短信渠道', title: '短信渠道',
minWidth: 100, minWidth: 100,
cellRender: { formatter: ({ cellValue, row }) =>
name: 'CellDict', channelList.find((channel) => channel.id === cellValue)?.signature ??
props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE }, channelList.find((channel) => channel.code === row.channelCode)
}, ?.signature ??
'-',
}, },
{ {
field: 'createTime', field: 'createTime',