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

/**
 * 列
 */
const columns = [
  {
    title: $t('system.user.nickname'),
    dataIndex: 'nickname',
   
  },
  {
    title: $t('system.user.username'),
    dataIndex: 'username',
   
  },
  {
    title: $t('system.user.phone'),
    dataIndex: 'phone',
sorter: true,
  },
  {
    title: $t('system.user.mail'),
    dataIndex: 'mail',
   
  },
  // {
  //   title: '角色',
  //   dataIndex: 'roles',
  //  
  // },
  {
    title: $t('system.user.status'),
    dataIndex: 'status',
sorter: true,
  },
  {
    title: $t('system.user.registerIp'),
    dataIndex: 'registerIp',
   
  },
  {
    title: $t('system.user.registerTime'),
    dataIndex: 'registerTime',
sorter: true,
  },
  {
    title: $t('system.user.lastLoginIp'),
    dataIndex: 'lastLoginIp',
   
  },
  {
    title: $t('system.user.lastLoginTime'),
    dataIndex: 'lastLoginTime',
sorter: true,
  },
  {
    title: $t('system.user.creatorName'),
    dataIndex: 'creatorName',
   
  },
  {
    title: $t('system.user.action'),
    dataIndex: 'action',
    fixed: 'right',
    width: 220
  }
]
/**
 * 状态映射
 * 1 正常；2 冻结；3 已锁定；4 已注销；5 待审核；6 异常；
 */
const statusMap = {
  1: $t('system.user.statusOptions.v1'),
  2: $t('system.user.statusOptions.v2'),
  3: $t('system.user.statusOptions.v3'),
  4: $t('system.user.statusOptions.v4'),
  5: $t('system.user.statusOptions.v5'),
  6: $t('system.user.statusOptions.v6'),
}
/**
 * 查询参数
 */
const query = {
  username: '',
  mail: '',
  phone: '',
  nickname: '',
  type: 'yunying'
};

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,
}
