import { BasicColumn } from '/@/components/Table/src/types/table';
import { Time } from '/@/components/Time';
import { h } from 'vue';
import { Badge } from 'ant-design-vue';

export const refundTimeTableSchema: BasicColumn[] = [
  {
    title: '联系方式',
    width: 150,
    dataIndex: 'contact',
  },
  {
    title: '留言内容',
    width: 250,
    dataIndex: 'content',
  },
  {
    title: '提交时间',
    width: 150,
    dataIndex: 'createTime',
  },
  {
    title: '状态',
    width: 150,
    dataIndex: 'state',
    customRender: ({ record }) => {
      return <Badge status={record.state==1?'warning':'success'} text={record.state == 1?'待处理':'已处理'} />;
    },
  },
  {
    title: '备注',
    width: 150,
    dataIndex: 'noteContent',
  },
];

export const agentSchema: BasicColumn[] = [
  {
    title: '公司名称',
    width: 150,
    dataIndex: 'name',
  },
  {
    title: '公司地址',
    width: 150,
    dataIndex: 'address',
  },
  {
    title: '门店类型',
    width: 150,
    dataIndex: 'country',
    customRender: ({ record }) => {
      return <Badge status='success' text={record.type == 1?'线下':'线上'} />;
    },
  },
  {
    title: '门店地址',
    width: 150,
    dataIndex: 'storeAddress',
  },
  {
    title: '申请人姓名',
    width: 150,
    dataIndex: 'surName',
    ellipsis: true,
    customRender: ({ record }) => {
      return record.surName + record.userName
    },
  },
  {
    title: '申请人职位',
    width: 150,
    dataIndex: 'post',
    ellipsis: true,
  },
  {
    title: '申请人电话',
    width: 150,
    dataIndex: 'phone',
  },
  {
    title: '申请人邮箱',
    width: 150,
    dataIndex: 'email',
  },
  {
    title: '提交时间',
    width: 150,
    dataIndex: 'createTime',
    customRender: ({ record }) => {
      return (
        record.createTime &&
        h(Time, {
          value: record.createTime,
          mode: 'datetime',
        })
      );
    },
  },
  {
    title: '处理备注',
    width: 150,
    dataIndex: 'noteContent',
  },
];
let industryListObj = {
  1:'测绘或激光扫描',
  2:'建筑、工程和施工',
  3:'石油和天然气',
  4:'软件和IT服务',
  5:'学术界',
  6:'其他',
}
export const DMegaSchema: BasicColumn[] = [
  {
    title: '公司名称',
    width: 150,
    dataIndex: 'company',
  },
  {
    title: '行业',
    width: 150,
    dataIndex: 'job',
    customRender: ({ record }) => {
      return (
        record.job &&industryListObj[record.job]
      );
    },
  },
  {
    title: '国家与地区',
    width: 150,
    dataIndex: 'country',
  },
  {
    title: '申请人姓名',
    width: 150,
    dataIndex: 'name',
    ellipsis: true,
  },
  {
    title: '申请人电话',
    width: 150,
    dataIndex: 'phone',
  },
  {
    title: '申请人邮箱',
    width: 150,
    dataIndex: 'email',
  },
  {
    title: '备注',
    width: 150,
    dataIndex: 'remark',
  },
  {
    title: '提交时间',
    width: 150,
    dataIndex: 'createTime',
    customRender: ({ record }) => {
      return (
        record.createTime &&
        h(Time, {
          value: record.createTime,
          mode: 'datetime',
        })
      );
    },
  },
];

export const refundTimeTableData: any[] = [
  {
    t1: '2017-10-01 14:10',
    t2: '联系客户',
    t3: '进行中',
    t4: '取货员 ID1234',
    t5: '5mins',
  },
  {
    t1: '2017-10-01 14:10',
    t2: '取货员出发',
    t3: '成功',
    t4: '取货员 ID1234',
    t5: '5mins',
  },
  {
    t1: '2017-10-01 14:10',
    t2: '取货员接单',
    t3: '成功',
    t4: '系统',
    t5: '5mins',
  },
  {
    t1: '2017-10-01 14:10',
    t2: '申请审批通过',
    t3: '成功',
    t4: '用户',
    t5: '1h',
  },
];
