import { $t } from '@vben/locales';

// 表格列配置
export const columns = [
  {
    title: $t('robot.chatInfo.id'),
    dataIndex: 'id',
    key: 'id',
    width: 80,
  },
  {
    title: $t('robot.chatInfo.uuid'),
    dataIndex: 'uuid',
    key: 'uuid',
    width: 120,
  },
  {
    title: $t('robot.chatInfo.chatContent'),
    dataIndex: 'chatContent',
    key: 'chatContent',
    width: 200,
    ellipsis: true,
  },
  {
    title: $t('robot.chatInfo.chatTime'),
    dataIndex: 'chatTime',
    key: 'chatTime',
    width: 150,
  },
  {
    title: $t('robot.chatInfo.chatConfigUuid'),
    dataIndex: 'chatConfigUuid',
    key: 'chatConfigUuid',
    width: 120,
  },
  {
    title: $t('robot.chatInfo.chatType'),
    dataIndex: 'chatType',
    key: 'chatType',
    width: 100,
    customRender: ({ text }) => {
      const chatTypeMap = {
        1: $t('robot.chatInfo.chatTypeOptions.1'),
        2: $t('robot.chatInfo.chatTypeOptions.2'),
      };
      return chatTypeMap[text] || text;
    },
  },
  {
    title: $t('robot.chatInfo.robotGroupUuid'),
    dataIndex: 'robotGroupUuid',
    key: 'robotGroupUuid',
    width: 120,
  },
  {
    title: $t('robot.chatInfo.robotGroupName'),
    dataIndex: 'robotGroupName',
    key: 'robotGroupName',
    width: 120,
  },
  {
    title: $t('robot.chatInfo.robotUuid'),
    dataIndex: 'robotUuid',
    key: 'robotUuid',
    width: 120,
  },
  {
    title: $t('robot.chatInfo.robotAccount'),
    dataIndex: 'robotAccount',
    key: 'robotAccount',
    width: 120,
  },
  {
    title: $t('robot.chatInfo.robotNickName'),
    dataIndex: 'robotNickName',
    key: 'robotNickName',
    width: 120,
  },
  {
    title: $t('robot.chatInfo.anchorId'),
    dataIndex: 'anchorId',
    key: 'anchorId',
    width: 100,
  },
  {
    title: $t('robot.chatInfo.anchorName'),
    dataIndex: 'anchorName',
    key: 'anchorName',
    width: 120,
  },
  {
    title: $t('robot.chatInfo.roomId'),
    dataIndex: 'roomId',
    key: 'roomId',
    width: 100,
  },
  {
    title: $t('robot.chatInfo.roomName'),
    dataIndex: 'roomName',
    key: 'roomName',
    width: 150,
    ellipsis: true,
  },
];

// 查询参数
export const query = {
  id: null,
  uuid: null,
  chatContent: null,
  chatTime: null,
  chatConfigUuid: null,
  chatType: null,
  robotGroupUuid: null,
  robotGroupName: null,
  robotUuid: null,
  robotAccount: null,
  robotNickName: null,
  anchorId: null,
  anchorName: null,
  anchorAvatar: null,
  roomId: null,
  roomName: null,
};

// 页面状态数据
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: [],
  columns,
  query,
};
