import Mock from 'mockjs'

function getList () {
  const json = { code: 200, success: true, msg: '操作成功' };
  const list = [];
  list.push(
    {
      id: '1',
      title: '保洁人员',
      state: '1',
      no: 'M2020351400011212',
      applicantCount: 2,
      employCount: 12,
      remainDay: 2,
      wageCount: 55,
      wageDate: "2020-06-09",
      siginDate: '2020-05-02',
      startDate: '2020-05-09',
      endDate: '2020-05-20',
      content: '',
      industryCategory: '1',
      workCategory: '2',
      hireNumber: 5,
      wage: '2000',
      skill: [{
        name: '技能1',
        id: '1'
      }, {
        name: '技能2',
        id: '2'
      }, {
        name: '技能3',
        id: '3'
      }],
      description: '描述',
      personCategory: '2',
      sex: '2',
      age: '1',
      education: '2',
      experience: '1',
      contactsName: "高",
      contactsPhone: "15227117870",
      contactsTel: "80887875",
      province: "1",
      city: '2',
      county: '1',
      appraise: true,
      rate: 5,
      group: "1123598813738675201",
      inviteState: '2',
      address: '石家庄传媒大厦',
      addrPoint: { // 详细地址经纬度
        lng: 114.626155,
        lat: 38.143449
      }
    }, {
    id: '2',
    state: '2',
    title: '栾城齐鲁村镇银行',
    no: 'M2020351400011212',
    applicantCount: 10,
    employCount: 0,
    remainDay: 5,
    wageCount: 0,
    wageDate: "2020-06-09",
    siginDate: '2020-04-11',
    startDate: '2020-04-12',
    endDate: '2020-04-20',
    content: '备注',
    industryCategory: '1',
    workCategory: '2',
    hireNumber: 5,
    wage: '2000',
    skill: [{
      name: '技能1',
      id: '1'
    }, {
      name: '技能2',
      id: '2'
    }],
    description: '描述',
    personCategory: '2',
    sex: '2',
    age: '2',
    education: '2',
    experience: '1',
    contactsName: "高",
    contactsPhone: "15227117870",
    contactsTel: "80887875",
    province: "2",
    city: '2',
    county: '1',
    appraise: false,
    rate: 0,
    group: "1260853936219303938",
    inviteState: '1',
    address: '河北进出口大厦',
    addrPoint: { // 详细地址经纬度
      lng: 114.463488,
      lat: 38.06616
    }
  }, {
    id: '3',
    title: '电焊工',
    state: '4',
    no: 'M2020351400011212',
    applicantCount: 0,
    employCount: 0,
    wageCount: 5,
    remainDay: 20,
    wageDate: "2020-07-10",
    siginDate: '2020-04-09',
    startDate: '2020-04-10',
    endDate: '2020-05-09',
    content: '备注',
    industryCategory: '1',
    workCategory: '2',
    hireNumber: 5,
    wage: '1,525,000.00',
    skill: [],
    description: '描述',
    personCategory: '3',
    sex: '1',
    age: '1',
    education: '2',
    experience: '1',
    contactsName: "高",
    contactsPhone: "15227117870",
    contactsTel: "80887875",
    province: "1",
    city: '2',
    county: '1',
    appraise: false,
    rate: 0,
    group: "1123598813738675201",
    inviteState: '1',
    address: '',
    addrPoint: { // 详细地址经纬度
      lng: 0,
      lat: 0
    }
  }, {
    id: '4',
    title: '企业安保人员',
    state: '3',
    no: 'M2020351400011212',
    applicantCount: 0,
    employCount: 0,
    wageCount: 5,
    remainDay: 20,
    wageDate: "2020-07-10",
    siginDate: '2020-03-30',
    startDate: '2020-04-02',
    endDate: '2020-05-02',
    content: '备注',
    industryCategory: '1',
    workCategory: '2',
    hireNumber: 5,
    wage: '2000',
    skill: [{
      name: '技能1',
      id: '1'
    }],
    description: '描述',
    personCategory: '1',
    sex: '2',
    age: '2',
    education: '2',
    experience: '1',
    contactsName: "高",
    contactsPhone: "15227117870",
    contactsTel: "80887875",
    province: "2",
    city: '2',
    county: '2',
    appraise: true,
    rate: 4,
    group: "1260853936219303938",
    inviteState: '2',
    address: '',
    addrPoint: { // 详细地址经纬度
      lng: 0,
      lat: 0
    }
  }
  );
  json.data = {
    total: 50,
    size: 20,
    current: 1,
    searchCount: true,
    pages: 1,
    records: list,
  };
  return json;
}

function remove () {
  const json = { code: 200, success: true, msg: '操作成功' };
  return json;
}

function add () {
  const json = { code: 200, success: true, msg: '操作成功' };
  return json;
}

function employ () {
  const json = { code: 200, success: true, msg: '操作成功' };
  return json;
}


export default ({ mock }) => {
  if (!mock) return;
  Mock.mock(/\/api\/jobslink-talents\/person\/list/, 'get', getList);
  Mock.mock(/\/api\/jobslink-talents\/person\/remove/, 'post', remove);
  Mock.mock(/\/api\/jobslink-talents\/person\/submit/, 'post', add);
  Mock.mock(/\/api\/jobslink-talents\/person\/employ/, 'post', employ);
}
