| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- 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',
- },
- ];
|