import {
  getCommunityList,
  getHdCommunityNames,
  getCommunityIdAll,
  deleteCommunity,
  communityOnline,
  getVrCityList,
  insertSecondHouse,
  getCommunityByHouseId,
  getSecondHouseList,
  getPropertyList
} from './config'

const genList = (item, updateProps, total = 10) => {
  const ret = []
  for (let i = 0; i < total; i++) {
    const copyItem = {
      ...item
    }
    for (let prop of updateProps) {
      copyItem[prop] = copyItem[prop] ? copyItem[prop] + i : copyItem[prop]
    }
    ret.push(copyItem)
  }
  return ret
}


const devData = {
  [getSecondHouseList]: () => ({
    "status": 200,
    "code": 0,
    "msg":"成功",
    "data": {
      "curPage":1,
      "totalNum":448,
      "totalPageNum":38,
      "list": genList({
        "gardenId": "HUS000011430366527977459712",
        "building_Unit": "123",
        "roomNumber": "142",
        "constructionArea": "180㎡",
        countNum: 10,
        "insideArea": "160㎡",
        "updateTime": "2021-08-25 11:18:46",
        "reviewTime": "2021-08-25 11:18:46",
        "reviewer": "梁勇-测试",
        "maintenanceMan": "梁勇-测试",
        "status": 2,
      }, ['gardenName', 'building_Unit', 'roomNumber'], 15)
    }
  }),
  [getCommunityByHouseId]: () => ({
    "status":200,
    "code":0,
    "msg":"成功",
    data: {
      "gardenId": "HUS000011430366527977459712",
      "estateId": "EST000011430366527914545152",
      "fcbEstateId": "2994907509988755961",
      "estateName": "VR-验收楼盘-请勿动",
      "createTime": "2021-08-25 11:08:50",
      "updateTime": "2021-08-25 11:18:46",
      "buildYears": "2021-08-25 11:18:46",
      "auditStatus": 2,
      "cityId": 2,
      "companyName": "房车宝",
      "cityName": "珠海",
      "propertyTypeName": "恒大",
      "gardenName": "海湾城",
      "areaName": "华发",
      "number": "123123",
      "creatorName": "梁勇-测试",
      "auditorName": "梁勇-测试",
      "auditTime": "2021-08-25 11:18:46",
      "coverImagUrl": "https://vr-web02-uat.fcb.com.cn/cms_pano_fcb/image/20210825_110909542.jpg?d=1629860949632",
      "createByName": "vr权限-拍摄人员",
      "houseTitle": "VR-验收楼盘-请勿动",
      "submitAuditTime": "2021-08-25 11:15:13",
      "vrLink": null,
      "vrPath": null,
      "innerVrLink": null,
      "type": 1,
      "countNum": 1,
      "garden": 1,
      "house": 1,
      "building": 1,
      "sales": 0,
      "points": 2,
      "saleVideos": 0,
      "houseVideos": 1
    }
  }),
  [insertSecondHouse]: () => ({
    "status":200,
    "code":0,
    "msg":"成功"
  }),
  [getVrCityList]: () => ({
    "status":200,
    "code":0,
    "msg":"成功",
    data: {
      "resultData": genList({cityId: '0', cityName: '珠海'}, ['cityId', 'cityName'], 100)
    }
  }),
  [getPropertyList]: () => ({
    "status":200,
    "code":0,
    "msg":"成功",
    data: {
      "resultData": genList({propertyId: '0', propertyName: '物业'}, ['propertyId', 'propertyName'], 100)
    }
  }),
  [communityOnline]: () => ({"status":200,"code":0,"msg":"成功"}),
  [deleteCommunity]: () => ({"status":200,"code":0,"msg":"成功"}),
  [getCommunityIdAll]: () => ({"status":200,"code":0,"msg":"成功","data":[1,2]}),
  [getHdCommunityNames]: () => ({
    "code": "000000",
    "message": null,
    "data": {
      "records": genList({
        "gardenId": "4271257006895227235",
        "number": "123123123",
        "gardenName": "宁夏回族自治区石嘴山市大武口区",
        "areaName": "华发",
        "cityName": "宁夏"
      }, ['gardenId', 'gardenName'], 100),
      "total": 297,
      "size": 100,
      "current": 1,
      "orders": [],
      "hitCount": false,
      "type": 1,
      "searchCount": true,
      "pages": 3
    }
  }),
  [getCommunityList]:() => ({
    "status": 200,
    "code": 0,
    "msg":"成功",
    "data": {
      "curPage":1,
      "totalNum":448,
      "totalPageNum":38,
      "list": genList({
        "gardenId": "HUS000011430366527977459712",
        "estateId": "EST000011430366527914545152",
        "fcbEstateId": "2994907509988755961",
        "estateName": "VR-验收楼盘-请勿动",
        "createTime": "2021-08-25 11:08:50",
        "updateTime": "2021-08-25 11:18:46",
        "buildYears": "2021-08-25 11:18:46",
        "auditStatus": 1,
        "cityId": 2,
        "companyName": "房车宝",
        "cityName": "珠海",
        "propertyTypeName": "恒大",
        "gardenName": "海湾城",
        "areaName": "华发",
        "number": "123123",
        "creatorName": "梁勇-测试",
        "auditorName": "梁勇-测试",
        "auditTime": "2021-08-25 11:18:46",
        "coverImagUrl": "https://vr-web02-uat.fcb.com.cn/cms_pano_fcb/image/20210825_110909542.jpg?d=1629860949632",
        "createByName": "vr权限-拍摄人员",
        "houseTitle": "VR-验收楼盘-请勿动",
        "submitAuditTime": "2021-08-25 11:15:13",
        "vrLink": null,
        "vrPath": null,
        "innerVrLink": null,
        "type": 1,
        "countNum": 1,
        "garden": 1,
        "house": 1,
        "building": 1,
        "sales": 0,
        "points": 2,
        "saleVideos": 0,
        "houseVideos": 1
      }, ['gardenId', 'gardenName'])
    }
  })
}

export default new Proxy(devData, {
  get() {
    return void 0
    // return Reflect.get(...arguments)
  }
})