import { $t } from '#/locales';

/**
 * 列
 */
const columns = [
  {
    title: $t('robot.messageTemplate.content'),
    dataIndex: 'content',
   
  },
  {
    title: $t('robot.messageTemplate.status'),
    dataIndex: 'status',
   
  },
  {
    title: $t('common.action'),
    dataIndex: 'action',
    fixed: 'right',
    width: 160
  }
]

/**
 * 状态映射
 */
const statusMap = {
  0: $t('robot.messageTemplate.statusOptions.v0'),
  1: $t('robot.messageTemplate.statusOptions.v1'),
}

/**
 * 类型映射
 */
const typeMap = {
  'notification': $t('robot.messageTemplate.typeOptions.notification'),
  'verification': $t('robot.messageTemplate.typeOptions.verification'),
  'announcement': $t('robot.messageTemplate.typeOptions.announcement'),
  'other': $t('robot.messageTemplate.typeOptions.other'),
}

/**
 * 查询参数
 */
const query = {
  type: 'robotMessage',
  code: '',
  content: '',
  status: undefined,
  creator: ''
};

export const d = {
  isShowQuery: true,
  loading: false,
  pagination: {
    total: 0,
    current: 1,
    pageSize: 10,
    showTotal: (total, range) => `共 ${total} 条`,
    showSizeChanger: true,
    pageSizeOptions: ['10', '20', '50', '100', '500', '1000'],
    showQuickJumper: true,
  },
  datas: [],
  query,
  columns,
  statusMap,
  typeMap,
}