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

/**
 * 列
 */
const columns = [
    {
    title: '分组',
    dataIndex: 'robotGroupName',
width: 120,
  },
  {
    title: $t('robot.runRecord.robotAccount'),
    dataIndex: 'robotAccount',
width: 120,
  },
  {
    title: $t('robot.runRecord.robotNickName'),
    dataIndex: 'robotNickName',
width: 100,
  },
  {
    title: '动作',
    dataIndex: 'configType',
width: 100,
    customRender: ({ text }) => configTypeMap[text] || text,
  },
   {
    title: $t('robot.runningInfo.liveRoomId'),
    dataIndex: 'liveRoomId',
width: 100,
  },
  {
    title: '直播间名称',
    dataIndex: 'liveRoomName',
width: 120,
  },
  {
    title: $t('robot.runningInfo.anchorId'),
    dataIndex: 'anchorId',
width: 100,
  },
  {
    title: '主播名称',
    dataIndex: 'anchorName',
width: 100,
  },
  {
    title: $t('robot.runRecord.executeStatus'),
    dataIndex: 'executeStatus',
width: 100,
    customRender: ({ text }) => executeStatusMap[text] || text,
  },
  {
    title: '执行时间',
    dataIndex: 'executeStartTime',
sorter: true,
    width: 160,
  },
  {
    title: $t('robot.runRecord.executeDesc'),
    dataIndex: 'executeDesc',
width: 150,
  },
  {
    title: '执行日志',
    dataIndex: 'executeLog',
width: 200,
  },
];

/**
 * 执行状态映射
 */
const executeStatusMap = {
  0: $t('robot.runRecord.executeStatusOptions.v0'),
  1: $t('robot.runRecord.executeStatusOptions.v1'),
  2: $t('robot.runRecord.executeStatusOptions.v2'),
  3: $t('robot.runRecord.executeStatusOptions.v3'),
  4: $t('robot.runRecord.executeStatusOptions.v4'),
}

/**
 * 配置类型映射
 */
const configTypeMap = {
  'v1': $t('robot.runRecord.configTypeOptions.v1'),
  'v2': $t('robot.runRecord.configTypeOptions.v2'),
  'v3': $t('robot.runRecord.configTypeOptions.v3'),
}
const actionOptions = [
  '点赞',
  '送礼'/* 送礼 */,
  '关注'/* 关注 */,
  '分享'/* 打赏 */,
  '聊天'/* 送礼物 */,
  '进入直播间'/* 送礼物并关注 */,
  '退出直播间'
]
/**
 * 查询参数
 */
const query = {
  uuid: '',
  robotUuid: '',
  robotAccount: '',
  configType: undefined,
  configName: '',
  configUuid: '',
  executeStatus: undefined,
  executeStartTime: '',
  executeEndTime: '',
  executeDesc: '',
  executeLog: '',
  notes: '',
  creator: '',
  creatorUuid: '',
  createTime: '',
  updateTime: '',
  groupName: undefined
};

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,
  executeStatusMap,
  configTypeMap,
  actionOptions,
}