feat: 优化 system

This commit is contained in:
xingyu4j
2025-06-24 17:35:43 +08:00
parent 9821f134fc
commit 34730ab1a0
22 changed files with 483 additions and 275 deletions

View File

@@ -1,7 +1,13 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue';
import { formatDateTime } from '@vben/utils';
import { getSimpleSmsChannelList } from '#/api/system/sms/channel';
import { DictTag } from '#/components/dict-tag';
import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
/** 列表的搜索表单 */
@@ -153,3 +159,94 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
},
];
}
/** 详情页的字段 */
export function useDetailSchema(): DescriptionItemSchema[] {
return [
{
field: 'createTime',
label: '创建时间',
content: (data) => formatDateTime(data?.createTime || '') as string,
},
{
field: 'mobile',
label: '手机号',
},
{
field: 'channelCode',
label: '短信渠道',
},
{
field: 'templateId',
label: '模板编号',
},
{
field: 'templateType',
label: '模板类型',
content: (data) => {
return h(DictTag, {
type: DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE,
value: data?.templateType,
});
},
},
{
field: 'templateContent',
label: '短信内容',
},
{
field: 'sendStatus',
label: '发送状态',
content: (data) => {
return h(DictTag, {
type: DICT_TYPE.SYSTEM_SMS_SEND_STATUS,
value: data?.sendStatus,
});
},
},
{
field: 'sendTime',
label: '发送时间',
content: (data) => formatDateTime(data?.sendTime || '') as string,
},
{
field: 'apiSendCode',
label: 'API 发送编码',
},
{
field: 'apiSendMsg',
label: 'API 发送消息',
},
{
field: 'receiveStatus',
label: '接收状态',
content: (data) => {
return h(DictTag, {
type: DICT_TYPE.SYSTEM_SMS_RECEIVE_STATUS,
value: data?.receiveStatus,
});
},
},
{
field: 'receiveTime',
label: '接收时间',
content: (data) => formatDateTime(data?.receiveTime || '') as string,
},
{
field: 'apiReceiveCode',
label: 'API 接收编码',
},
{
field: 'apiReceiveMsg',
label: 'API 接收消息',
},
{
field: 'apiRequestId',
label: 'API 请求 ID',
},
{
field: 'apiSerialNo',
label: 'API 序列号',
},
];
}