// const warnColor = '#F59A23';
// const okColor = '#4B7902';
// const errColor = '#D9001B';
import { Modal } from "antd";
import { getPerAuthRecord } from "../../../../../services/api";
export default function () {
  return [
    // {
    //   title: '序号',
    //   dataIndex: 'number',
    //   key: 'number',
    //   width: 80,
    //   fixed: 'left'
    // },
    {
      title: "姓名",
      dataIndex: "name",
      key: "name",
      width: 100,
      fixed: "left",
      render: (value) => value || "-",
    },
    {
      title: "身份证号",
      dataIndex: "idCardNo",
      key: "idCardNo",
      // width: 200,
      // fixed: 'left',
      render: (value) => value || "-",
    },
    {
      title: "手机号码",
      dataIndex: "mobilePhone",
      key: "mobilePhone",
      render: (value) => value || "-",
    },
    {
      title: "部门",
      dataIndex: "departName",
      key: "departName",
      render: (value) => value || "-",
    },
    {
      title: "人员类别",
      dataIndex: "perType",
      key: "perType",
      render: (value) => value || "-",
    },
    {
      title: "APP激活状态",
      dataIndex: "isAppActive",
      key: "isAppActive",
      render: (value) => value || "-",
    },
    // {
    //   title: '认证状态',
    //   dataIndex: 'authStatus',
    //   key: 'authStatus',
    //   render: value => value || '-'
    // },
    {
      title: "认证状态",
      dataIndex: "authStatus",
      key: "authStatus",
      render: (text, record) => {
        return (
          <span>
            {text === "认证失败" ? (
              <a
                style={{ color: "red" }}
                onClick={() => {
                  // getPerAuthRecord({
                  //   perId: record.perId,
                  // }).then((res) => {
                  //   if (res.retType === "0") {
                      Modal.error({
                        title: "认证失败原因:",
                        content: record.authResult,
                        okText: "确定",
                      });
                //     }
                //   });
                }}
              >
                认证失败！
              </a>
            ) : (
              text
            )}
          </span>
        );
      },
    },
    {
      title: "申诉状态",
      dataIndex: "sszt",
      key: "sszt",
      render: (text, record) => {
        return (
          <span>
            {text === "申诉不通过" ? (
              <a
                style={{ color: "red" }}
                onClick={() => {
                  Modal.error({
                    title: "认证失败原因:",
                    content: record.approveContent,
                    okText: "确定",
                  });
                }}
              >
                {text}
              </a>
            ) : (
              text
            )}
          </span>
        );
      },
    },
    {
      title: "入职日期",
      dataIndex: "entryDate",
      key: "entryDate",
      render: (value) => value || "-",
    },
    {
      title: "出生日期",
      dataIndex: "birthday",
      key: "birthday",
      render: (value) => value || "-",
    },
    {
      title: "年龄",
      dataIndex: "age",
      key: "age",
      render: (value) => value || "-",
    },
    {
      title: "性别",
      dataIndex: "sex",
      key: "sex",
      render: (value) => value || "-",
    },
    {
      title: "国籍",
      dataIndex: "nationality",
      key: "nationality",
      render: (value) => value || "-",
    },
    {
      title: "学历",
      dataIndex: "education",
      key: "education",
      render: (value) => value || "-",
    },
    {
      title: "民族",
      dataIndex: "nation",
      key: "nation",
      render: (value) => value || "-",
    },
    {
      title: "政治面貌",
      dataIndex: "politicalStatus",
      key: "politicalStatus",
      render: (value) => value || "-",
    },
    {
      title: "户籍地址",
      dataIndex: "residenceAddress",
      key: "residenceAddress",
      render: (value) => value || "-",
    },
    {
      title: "居住地址",
      dataIndex: "domicileAddress",
      key: "domicileAddress",
      render: (value) => value || "-",
    },
    {
      title: "是否退伍军人",
      dataIndex: "isVeteran",
      key: "isVeteran",
      render: (value) => value || "-",
    },
    {
      title: "投保单号",
      dataIndex: "policyNos",
      key: "policyNos",
      render: (value) => value || "-",
    },
    {
      title: "投保状态",
      dataIndex: "tbzt",
      key: "tbzt",
      render: (value) => value || "-",
    },
    {
      title: "保安资格证号",
      dataIndex: "bayzgzh",
      key: "bayzgzh",
      render: (value) => value || "-",
    },
    {
      title: "保安等级",
      dataIndex: "badj",
      key: "badj",
      render: (text, record) => {
        if (text && text != "-") {
          return (
            <span>
              {text}
              {record.badjzbh ? `(${record.badjzbh})` : ""}
            </span>
          );
        } else {
          return "-";
        }
      },
    },
    {
      title: "企业录入时间",
      dataIndex: "comCreateTime",
      key: "comCreateTime",
    },
    {
      title: "紧急联系人信息",
      dataIndex: "contactper",
      key: "contactper",
      render: (text, record) => {
        return (
          <span>
            {text
              ? record.contactPhone
                ? text + "(" + record.contactPhone + ")"
                : text
              : record.contactPhone
              ? "-(" + record.contactPhone + ")"
              : "-"}
          </span>
        );
      },
    },
    {
      title: "驾照等级",
      dataIndex: "drivingLicenseLevel",
      key: "drivingLicenseLevel",
      render: (text, record) => {
        return (
          <span>
            {text ? text : "-"}
          </span>
        );
      },
    },
  ];
}
