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

// 表格列配置
export const columns = [
  {
    title: $t('robot.chatConfig.configName'),
    dataIndex: 'name',
    key: 'name',
    width: 120,
    fixed: 'left',
  },
  {
    title: $t('robot.chatConfig.robotGroupUuid'),
    dataIndex: 'robotGroupName',
    key: 'robotGroupName',
    width: 120,
  },
  {
    title: $t('robot.chatConfig.robotUuid'),
    dataIndex: 'robotName',
    key: 'robotName',
    width: 120,
  },
  {
    title: $t('robot.chatConfig.minIntervalTime'),
    dataIndex: 'minIntervalTime',
    key: 'minIntervalTime',
    width: 100,
  },
  {
    title: $t('robot.chatConfig.maxIntervalTime'),
    dataIndex: 'maxIntervalTime',
    key: 'maxIntervalTime',
    width: 100,
  },
  {
    title: $t('robot.chatConfig.count'),
    dataIndex: 'count',
    key: 'count',
    width: 80,
  },
  {
    title: $t('robot.chatConfig.status'),
    dataIndex: 'status',
    key: 'status',
    width: 80,
    customRender: ({ text }) => {
      const statusMap = {
        0: $t('robot.chatConfig.statusOptions.v0'),
        1: $t('robot.chatConfig.statusOptions.v1'),
      };
      return statusMap[text] || text;
    },
  },
  {
    title: $t('robot.chatConfig.aiSwitch'),
    dataIndex: 'aiSwitch',
    key: 'aiSwitch',
    width: 80,
    customRender: ({ text }) => {
      const aiSwitchMap = {
        0: $t('robot.chatConfig.aiSwitchOptions.v0'),
        1: $t('robot.chatConfig.aiSwitchOptions.v1'),
      };
      return aiSwitchMap[text] || text;
    },
  },
  // {
  //   title: $t('robot.chatConfig.openingRemarks'),
  //   dataIndex: 'openingRemarks',
  //   key: 'openingRemarks',
  //   width: 150,
  //   ellipsis: true,
  // },
  {
    title: $t('robot.chatConfig.notes'),
    dataIndex: 'notes',
    key: 'notes',
    width: 150,
    ellipsis: true,
  },
  {
    title: $t('robot.chatConfig.creator'),
    dataIndex: 'creator',
    key: 'creator',
    width: 100,
  },
  {
    title: $t('robot.chatConfig.createTime'),
    dataIndex: 'createTime',
    key: 'createTime',
    width: 150,
  },
  {
    title: $t('common.action'),
    dataIndex: 'action',
    key: 'action',
    width: 120,
    fixed: 'right',
  },
];

// 查询参数
export const query = {
  name: null,
  robotGroupUuid: null,
  robotUuid: null,
  minIntervalTime: null,
  maxIntervalTime: null,
  count: null,
  status: null,
  aiSwitch: null,
  openingRemarks: null,
  notes: null,
  creator: 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,
};