
import { Avatar } from 'antd'
import Navigate from '@/components/Navigate';

export default () => [
  {
    title: '头像',
    dataIndex: 'picture',
    key: 'picture',
    align: 'center',
    width: '10%',
    render: (_, record) => (
      <Avatar
        shape="square"
        style={{ color: 'blue', cursor: 'pointer' }}
        onClick={() => toCustomerDateil(record)}
        src={record.picture}
        size={64}
        icon="user"
      />
    ),
  },
  {
    title: '姓名',
    dataIndex: 'name',
    key: 'name',
    align: 'center',
    width: '10%',
    // eslint-disable-next-line no-nested-ternary
    render: (_, record) => (
      <>
        <Navigate onClick={() => toCustomerDateil(record)}>{record.name}</Navigate>
      </>
    ),
  },
  {
    title: '电话',
    dataIndex: 'phone',
    key: 'phone',
    align: 'center',
    width: '10%',
  },
  {
    title: '性别',
    dataIndex: 'sex',
    key: 'sex',
    align: 'center',
    width: '10%',
    // eslint-disable-next-line no-nested-ternary
    render: (_, record) => (
      <>
        <span>{record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知'}</span>
      </>
    ),
  },
  {
    title: '置业顾问',
    dataIndex: 'consultantName',
    key: 'consultantName',
    align: 'center',
    width: '10%',
    // eslint-disable-next-line no-nested-ternary
    render: (_, record) => (
      <>
        <span>{record.consultantName}</span>
        <br />
        <span>{record.consultTel}</span>
      </>
    ),
  },
  {
    title: '归属项目',
    dataIndex: 'buildingName',
    key: 'buildingName',
    align: 'center',
    width: '10%',
  },
  {
    title: '推广人员',
    dataIndex: 'sharePersonName',
    key: 'sharePersonName',
    align: 'center',
    width: '10%',
  },
  {
    title: '客户状态',
    dataIndex: 'reportRecommendStatus',
    key: 'reportRecommendStatus',
    align: 'center',
    width: '10%',
    // eslint-disable-next-line no-nested-ternary
    render: (text, records) => {
      if (records.status === 1) {
        return '报备';
      }
      if (records.status === 2) {
        return '到访';
      }
      if (records.status === 3) {
        return '认购';
      }
      if (records.status === 4) {
        return '签约';
      }
    },
  },
  {
    title: '操作',
    dataIndex: 'customerId',
    key: 'customerId',
    align: 'center',
    width: '20%',
    //   render: withActions((text, record) => [
    //     <EditIcon color="#FF4A4A" text="查看详情" onClick={() => toCustomerDateil(record)} />,
    //     <AuthButton name="admin.customer.recommend.edit.id.put" noRight={null}>
    //       <Button className={Styles.text} type="link" onClick={() => showStatus(record)}>变更状态</Button>
    //     </AuthButton>,

    //     <AuthButton name="admin.customer.recommend.belong" noRight={null}>
    //       <Button className={Styles.text} type="link" onClick={() => showGM(record)}>调整归属</Button>
    //     </AuthButton>,

    //     <AuthButton name="admin.mine.taPointsRecords.point.record" noRight={null}>
    //       <Button className={ Styles.text } type="link" onClick={() => showRecord(record)}>积分记录</Button>
    //     </AuthButton>,

    //     <AuthButton name="admin.mine.taPointsRecords.id.get" noRight={null}>
    //       <Button className={ Styles.text} type="link" onClick={() => showRecommend(record.personId)}>推荐客户</Button>
    //     </AuthButton>
    //   ]),
  },
];