refactor: sms

This commit is contained in:
xingyu
2022-11-15 20:43:02 +08:00
parent 12ac097b47
commit 09e61f7ef3
12 changed files with 361 additions and 487 deletions

View File

@@ -1,105 +1,68 @@
import { reactive } from 'vue'
import { useI18n } from '@/hooks/web/useI18n'
import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
import { DICT_TYPE } from '@/utils/dict'
import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
const { t } = useI18n() // 国际化
// CrudSchema
const crudSchemas = reactive<CrudSchema[]>([
{
label: t('common.index'),
field: 'id',
type: 'index',
form: {
show: false
const crudSchemas = reactive<VxeCrudSchema>({
primaryKey: 'id',
primaryType: 'seq',
action: true,
columns: [
{
title: '手机号',
field: 'mobile',
isSearch: true
},
detail: {
show: false
}
},
{
label: '手机号',
field: 'mobile',
search: {
show: true
}
},
{
label: '短信内容',
field: 'templateContent'
},
{
label: '短信渠道',
field: 'channelId',
dictType: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE,
search: {
show: true
}
},
{
label: '发送状态',
field: 'sendStatus',
dictType: DICT_TYPE.SYSTEM_SMS_SEND_STATUS,
search: {
show: true
}
},
{
label: '接收状态',
field: 'receiveTime',
dictType: DICT_TYPE.SYSTEM_SMS_RECEIVE_STATUS,
search: {
show: true
}
},
{
label: '模板编号',
field: 'templateId',
search: {
show: true
}
},
{
label: '短信类型',
field: 'channelId',
dictType: DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE,
search: {
show: true
}
},
{
label: '接收时间',
field: 'receiveTime',
form: {
show: false
}
},
{
label: t('common.createTime'),
field: 'createTime',
form: {
show: false
{
title: '短信内容',
field: 'templateContent'
},
search: {
show: true,
component: 'DatePicker',
componentProps: {
type: 'daterange',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)]
{
title: '短信渠道',
field: 'channelId',
dictType: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE,
isSearch: true
},
{
title: '发送状态',
field: 'sendStatus',
dictType: DICT_TYPE.SYSTEM_SMS_SEND_STATUS,
isSearch: true
},
{
title: '接收状态',
field: 'receiveStatus',
dictType: DICT_TYPE.SYSTEM_SMS_RECEIVE_STATUS,
isSearch: true
},
{
title: '模板编号',
field: 'templateId',
isSearch: true
},
{
title: '短信类型',
field: 'templateType',
dictType: DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE,
isSearch: true
},
{
title: '接收时间',
field: 'receiveTime'
},
{
title: t('common.createTime'),
field: 'createTime',
formatter: 'formatDate',
search: {
show: true,
itemRender: {
name: 'XDataTimePicker'
}
}
}
},
{
label: t('table.action'),
field: 'action',
width: '80px',
form: {
show: false
},
detail: {
show: false
}
}
])
export const { allSchemas } = useCrudSchemas(crudSchemas)
]
})
export const { allSchemas } = useVxeCrudSchemas(crudSchemas)