import { listDictModel } from '/@/api/common';
import { DescItem } from '/@/components/Description';
import { BasicColumn, FormSchema } from '/@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: '手机号',
    dataIndex: 'mobile',
  },
  {
    title: '发送状态',
    dataIndex: 'sendStatus',
  },
  {
    title: '发送时间',
    dataIndex: 'sendTime',
  },
  {
    title: '接收状态',
    dataIndex: 'receiveStatus',
  },
  {
    title: '接收时间',
    dataIndex: 'receiveTime',
  },
  {
    title: '渠道',
    dataIndex: 'channelName',
  },
  {
    title: '模板',
    dataIndex: 'templateName',
  },
  {
    title: '模板编码',
    dataIndex: 'templateCode',
  },
  {
    title: '模板类型',
    dataIndex: 'templateType',
  },
];

// 表单列定义
export const searchFormSchema: FormSchema[] = [
  {
    label: '模板编码',
    field: 'templateCode',
    component: 'Input',
    componentProps: {
      placeholder: '请输入模板编码',
    },
  },
  {
    label: '手机号',
    field: 'mobile',
    component: 'Input',
    componentProps: {
      placeholder: '请输入手机号',
    },
  },
  {
    label: '发送状态',
    field: 'sendStatus',
    component: 'ApiSelect',
    componentProps: {
      api: listDictModel,
      params: {
        dictCode: 'sys_sms_send',
      },
    },
  },
  {
    label: '发送日期',
    field: 'sendTime',
    component: 'RangePicker',
    componentProps: {
      format: 'YYYY-MM-DD',
      showTime: { format: 'YYYY-MM-DD' },
    },
  },
  {
    label: '接收状态',
    field: 'receiveStatus',
    component: 'ApiSelect',
    componentProps: {
      api: listDictModel,
      params: {
        dictCode: 'sys_sms_reveice',
      },
    },
  },
];
// 表单详情查看
export const viewSchema: DescItem[] = [
  {
    label: '手机号',
    field: 'mobile',
  },
  {
    label: '发送状态',
    field: 'sendStatus',
  },
  {
    label: '发送时间',
    field: 'sendTime',
  },
  {
    label: '接收状态',
    field: 'receiveStatus',
  },
  {
    label: '接收时间',
    field: 'receiveTime',
  },
  {
    label: '渠道名称',
    field: 'channelName',
  },
  {
    label: '模板名称',
    field: 'templateName',
  },
  {
    label: '模板编码',
    field: 'templateCode',
  },
  {
    label: '模板类型',
    field: 'templateType',
  },
  {
    label: '模板内容',
    field: 'templateContent',
  },
  {
    label: '短信API模板编号',
    field: 'apiTemplateId',
  },
  {
    label: '发送结果编码',
    field: 'sendCode',
  },
  {
    label: '发送消息',
    field: 'sendMsg',
  },
  {
    label: 'API结果编号',
    field: 'apiSendCode',
  },
  {
    label: 'API错误信息',
    field: 'apiSendMsg',
  },
  {
    label: 'API请求编号',
    field: 'apiRequestId',
  },
  {
    label: 'API返回序号',
    field: 'apiSerialNo',
  },

  {
    label: 'API接收结果编码',
    field: 'apiReceiveCode',
  },
  {
    label: 'API接收结果提示',
    field: 'apiReceiveMsg',
  },
];
