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

/**
 * 列
 */
const columns = [
  // {
  //   title: $t('robot.runningInfo.robotUuid'),
  //   dataIndex: 'robotUuid',
  //  
  //   width: 120,
  // },
      {
    title: '分组',
    dataIndex: 'robotGroupName',
width: 120,
  },
  {
    title: $t('robot.runningInfo.robotAccount'),
    dataIndex: 'robotAccount',
width: 120,
  },
  {
    title: $t('robot.runningInfo.robotNickName'),
    dataIndex: 'robotNickName',
width: 100,
  },
  {
    title: $t('robot.runningInfo.runningStatus'),
    dataIndex: 'runningStatus',
width: 80,
    customRender: ({ text }) => runningStatusMap[text] || text,
  },
  {
    title: $t('robot.runningInfo.currentBehavior'),
    dataIndex: 'currentBehavior',
width: 80,
    customRender: ({ text }) => currentBehaviorMap[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.runningInfo.enterLiveRoomTime'),
    dataIndex: 'enterLiveRoomTime',
sorter: true,
    width: 160,
  },
  {
    title: $t('robot.runningInfo.exitLiveRoomTime'),
    dataIndex: 'exitLiveRoomTime',
sorter: true,
    width: 160,
  },
  {
    title: $t('robot.runningInfo.loginTime'),
    dataIndex: 'loginTime',
sorter: true,
    width: 160,
  },
  {
    title: $t('robot.runningInfo.logoutTime'),
    dataIndex: 'logoutTime',
sorter: true,
    width: 160,
  },
  {
    title: $t('robot.runningInfo.lastUpdateTime'),
    dataIndex: 'lastUpdateTime',
sorter: true,
    width: 160,
  },
  {
    title: $t('robot.runningInfo.action'),
    dataIndex: 'action',
    fixed: 'right',
    width: 120
  }
];

/**
 * 运行状态映射
 */
const runningStatusMap = {
  1: $t('robot.runningInfo.runningStatusOptions.v1'),
  2: $t('robot.runningInfo.runningStatusOptions.v2'),
  3: $t('robot.runningInfo.runningStatusOptions.v3'),
}

/**
 * 当前行为映射
 */
const currentBehaviorMap = {
  0: $t('robot.runningInfo.currentBehaviorOptions.v0'),
  1: $t('robot.runningInfo.currentBehaviorOptions.v1'),
  2: $t('robot.runningInfo.currentBehaviorOptions.v2'),
  3: $t('robot.runningInfo.currentBehaviorOptions.v3'),
  4: $t('robot.runningInfo.currentBehaviorOptions.v4'),
}

/**
 * 查询参数
 */
const query = {
  robotUuid: '',
  robotAccount: '',
  runningStatus: undefined,
  currentBehavior: undefined,
  liveRoomId: '',
  anchorId: '',
  anchorName: '',
  liveRoomName: '',
  platform: '',
  liveRoomStatus: '',
  loginTime: '',
  logoutTime: '',
  lastUpdateTime: '',
  enterLiveRoomTime: '',
  exitLiveRoomTime: '',
  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,
  runningStatusMap,
  currentBehaviorMap,
}