reactor:【system 系统管理】loginlog、maillog、smslog 的描述统一
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import type { VbenFormSchema } from '#/adapter/form';
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { SystemSmsLogApi } from '#/api/system/sms/log';
|
||||
import type { DescriptionItemSchema } from '#/components/description';
|
||||
|
||||
import { h } from 'vue';
|
||||
|
||||
import { DICT_TYPE } from '@vben/constants';
|
||||
import { getDictOptions } from '@vben/hooks';
|
||||
import { formatDateTime } from '@vben/utils';
|
||||
|
||||
import { getSimpleSmsChannelList } from '#/api/system/sms/channel';
|
||||
import { DictTag } from '#/components/dict-tag';
|
||||
import { DICT_TYPE } from '@vben/constants';
|
||||
import { getDictOptions } from '@vben/hooks';
|
||||
|
||||
import { getRangePickerDefaultProps } from '#/utils';
|
||||
|
||||
/** 列表的搜索表单 */
|
||||
@@ -93,10 +93,18 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||
{
|
||||
field: 'id',
|
||||
title: '编号',
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
minWidth: 180,
|
||||
formatter: 'formatDateTime',
|
||||
},
|
||||
{
|
||||
field: 'mobile',
|
||||
title: '手机号',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'templateContent',
|
||||
@@ -106,6 +114,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||
{
|
||||
field: 'sendStatus',
|
||||
title: '发送状态',
|
||||
minWidth: 120,
|
||||
cellRender: {
|
||||
name: 'CellDict',
|
||||
props: { type: DICT_TYPE.SYSTEM_SMS_SEND_STATUS },
|
||||
@@ -114,11 +123,13 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||
{
|
||||
field: 'sendTime',
|
||||
title: '发送时间',
|
||||
minWidth: 180,
|
||||
formatter: 'formatDateTime',
|
||||
},
|
||||
{
|
||||
field: 'receiveStatus',
|
||||
title: '接收状态',
|
||||
minWidth: 120,
|
||||
cellRender: {
|
||||
name: 'CellDict',
|
||||
props: { type: DICT_TYPE.SYSTEM_SMS_RECEIVE_STATUS },
|
||||
@@ -127,11 +138,13 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||
{
|
||||
field: 'receiveTime',
|
||||
title: '接收时间',
|
||||
minWidth: 180,
|
||||
formatter: 'formatDateTime',
|
||||
},
|
||||
{
|
||||
field: 'channelCode',
|
||||
title: '短信渠道',
|
||||
minWidth: 120,
|
||||
cellRender: {
|
||||
name: 'CellDict',
|
||||
props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE },
|
||||
@@ -140,10 +153,12 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||
{
|
||||
field: 'templateId',
|
||||
title: '模板编号',
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
field: 'templateType',
|
||||
title: '短信类型',
|
||||
minWidth: 100,
|
||||
cellRender: {
|
||||
name: 'CellDict',
|
||||
props: { type: DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE },
|
||||
@@ -152,6 +167,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
minWidth: 180,
|
||||
formatter: 'formatDateTime',
|
||||
},
|
||||
{
|
||||
@@ -169,7 +185,9 @@ export function useDetailSchema(): DescriptionItemSchema[] {
|
||||
{
|
||||
field: 'createTime',
|
||||
label: '创建时间',
|
||||
content: (data) => formatDateTime(data?.createTime || '') as string,
|
||||
content: (data: SystemSmsLogApi.SmsLog) => {
|
||||
return formatDateTime(data?.createTime || '') as string;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'mobile',
|
||||
@@ -186,7 +204,7 @@ export function useDetailSchema(): DescriptionItemSchema[] {
|
||||
{
|
||||
field: 'templateType',
|
||||
label: '模板类型',
|
||||
content: (data) => {
|
||||
content: (data: SystemSmsLogApi.SmsLog) => {
|
||||
return h(DictTag, {
|
||||
type: DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE,
|
||||
value: data?.templateType,
|
||||
@@ -200,7 +218,7 @@ export function useDetailSchema(): DescriptionItemSchema[] {
|
||||
{
|
||||
field: 'sendStatus',
|
||||
label: '发送状态',
|
||||
content: (data) => {
|
||||
content: (data: SystemSmsLogApi.SmsLog) => {
|
||||
return h(DictTag, {
|
||||
type: DICT_TYPE.SYSTEM_SMS_SEND_STATUS,
|
||||
value: data?.sendStatus,
|
||||
@@ -210,7 +228,9 @@ export function useDetailSchema(): DescriptionItemSchema[] {
|
||||
{
|
||||
field: 'sendTime',
|
||||
label: '发送时间',
|
||||
content: (data) => formatDateTime(data?.sendTime || '') as string,
|
||||
content: (data: SystemSmsLogApi.SmsLog) => {
|
||||
return formatDateTime(data?.sendTime || '') as string;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'apiSendCode',
|
||||
@@ -223,7 +243,7 @@ export function useDetailSchema(): DescriptionItemSchema[] {
|
||||
{
|
||||
field: 'receiveStatus',
|
||||
label: '接收状态',
|
||||
content: (data) => {
|
||||
content: (data: SystemSmsLogApi.SmsLog) => {
|
||||
return h(DictTag, {
|
||||
type: DICT_TYPE.SYSTEM_SMS_RECEIVE_STATUS,
|
||||
value: data?.receiveStatus,
|
||||
@@ -233,7 +253,9 @@ export function useDetailSchema(): DescriptionItemSchema[] {
|
||||
{
|
||||
field: 'receiveTime',
|
||||
label: '接收时间',
|
||||
content: (data) => formatDateTime(data?.receiveTime || '') as string,
|
||||
content: (data: SystemSmsLogApi.SmsLog) => {
|
||||
return formatDateTime(data?.receiveTime || '') as string;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'apiReceiveCode',
|
||||
@@ -242,6 +264,7 @@ export function useDetailSchema(): DescriptionItemSchema[] {
|
||||
{
|
||||
field: 'apiReceiveMsg',
|
||||
label: 'API 接收消息',
|
||||
span: 2,
|
||||
},
|
||||
{
|
||||
field: 'apiRequestId',
|
||||
|
||||
@@ -18,7 +18,7 @@ const [DetailModal, detailModalApi] = useVbenModal({
|
||||
});
|
||||
|
||||
/** 刷新表格 */
|
||||
function onRefresh() {
|
||||
function handleRefresh() {
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
isHover: true,
|
||||
},
|
||||
toolbarConfig: {
|
||||
refresh: true,
|
||||
@@ -69,7 +70,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
<DocAlert title="短信配置" url="https://doc.iocoder.cn/sms/" />
|
||||
</template>
|
||||
|
||||
<DetailModal @success="onRefresh" />
|
||||
<DetailModal @success="handleRefresh" />
|
||||
<Grid table-title="短信日志列表">
|
||||
<template #toolbar-tools>
|
||||
<TableAction
|
||||
|
||||
@@ -11,7 +11,7 @@ import { useDetailSchema } from '../data';
|
||||
|
||||
const formData = ref<SystemSmsLogApi.SmsLog>();
|
||||
|
||||
const [Descriptions] = useDescription({
|
||||
const [Description] = useDescription({
|
||||
componentProps: {
|
||||
bordered: true,
|
||||
column: 2,
|
||||
@@ -44,10 +44,10 @@ const [Modal, modalApi] = useVbenModal({
|
||||
<template>
|
||||
<Modal
|
||||
title="短信日志详情"
|
||||
class="w-1/2"
|
||||
class="w-[1280px]"
|
||||
:show-cancel-button="false"
|
||||
:show-confirm-button="false"
|
||||
>
|
||||
<Descriptions :data="formData" />
|
||||
<Description :data="formData" />
|
||||
</Modal>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user