import { listDictModel } from '/@/api/common'; import { DescItem } from '/@/components/Description'; import { BasicColumn, FormSchema } from '/@/components/Table'; export const columns: BasicColumn[] = [ { title: '渠道名称', dataIndex: 'name', }, { title: '短信签名', dataIndex: 'signature', }, { title: '渠道类型', dataIndex: 'type', }, { title: '短信API账号', dataIndex: 'apiKey', }, { title: '发送回调URL', dataIndex: 'callbackUrl', }, { title: '启用', dataIndex: 'disable', }, ]; // 表单列定义 export const searchFormSchema: FormSchema[] = [ { label: '渠道名称', field: 'name', component: 'Input', componentProps: { placeholder: '请输入渠道名称', }, }, { label: '渠道类型', field: 'type', component: 'ApiSelect', componentProps: { api: listDictModel, params: { dictCode: 'sys_sms_channel', }, }, }, { label: '是否启用', field: 'disable', component: 'ApiSelect', componentProps: { api: listDictModel, params: { dictCode: 'sys_disable_type', }, }, }, ]; // 表单新增编辑 export const dataFormSchema: FormSchema[] = [ { label: '渠道名称', field: 'name', required: true, component: 'Input', componentProps: { placeholder: '请输入渠道名称', }, }, { label: '短信签名', field: 'signature', required: true, component: 'Input', componentProps: { placeholder: '请输入短信签名', }, }, { label: '渠道类型', field: 'type', component: 'ApiSelect', componentProps: { api: listDictModel, params: { dictCode: 'sys_sms_channel', }, }, defaultValue: 'ALIYUN', }, { label: '短信API账号', field: 'apiKey', required: true, component: 'Input', componentProps: { placeholder: '请输入短信API的账号', }, }, { label: '短信API秘钥', field: 'apiSecret', required: true, component: 'Input', componentProps: { placeholder: '请输入短信API的秘钥', }, }, { label: '发送回调URL', field: 'callbackUrl', required: true, component: 'Input', componentProps: { placeholder: '请输入短信发送回调URL', }, helpMessage: ({ values }) => { switch (values.type) { case 'ALIYUN': return '阿里云回调地址:https://host:ip+/sms/callback/aliyun'; case 'TENCENT': return '腾讯云回调地址: https://host:ip+/sms/callback/tencent'; } }, }, { label: '是否启用', field: 'disable', component: 'ApiRadioGroup', componentProps: { api: listDictModel, params: { dictCode: 'sys_disable_type', }, }, defaultValue: '0', }, { label: '备注', field: 'remark', component: 'InputTextArea', componentProps: { placeholder: '请输入备注', }, }, ]; // 表单详情查看 export const viewSchema: DescItem[] = [ { label: '主键', field: 'id', }, { label: '渠道名称', field: 'name', }, { label: '短信签名', field: 'signature', }, { label: '渠道类型', field: 'type', }, { label: '短信API账号', field: 'apiKey', }, { label: '短信API秘钥', field: 'apiSecret', }, { label: '发送回调URL', field: 'callbackUrl', }, { label: '启用', field: 'disable', }, { label: '备注', field: 'remark', }, ];