import fetch from './fetch'
import {
  baseUrl,
  classDef,
  compEquipQuery,
  component,
  compSpace,
  dataCenter,
  dict,
  floor,
  graphicUrl,
  locationPoint,
  modelapi,
  object,
  rel,
  rwd,
  scan,
  shaft,
  shContainSp,
  stat,
  system,
  tenant,
  zone
} from './config.js'
import http from './httpUtil'
import storage from '@/framework/utils/storage'

var Comming = 'revit'

//获取扫楼用户表格
export function getUser(param, success) {
  let url = `${scan}/service/user/query`
  http.postJson(url, param, success)
}

//修改扫楼用户
export function loadUser(param, success) {
  let url = `${scan}/service/user/update`;
  http.postJson(url, param, success)
}

//删除扫楼用户
export function delUser(param, success) {
  let url = `${scan}/service/user/delete`;
  http.postJson(url, param, success)
}

//添加扫楼用户
export function addUser(param, success) {
  let url = `${scan}/service/user/create`;
  http.postJson(url, param, success)
}

//查询点位标签信息/location-point/query
export function locationPointQuery(param, success) {
  let url = `${baseUrl}${locationPoint}/query`;
  http.postJson(url, param, success)
}

//点位标签详情修改【数据中心接口】
export function updateLocationPoint(param, success) {
  let url = `${baseUrl}${locationPoint}/update`;
  http.postJson(url, param, success)
}

//根据点位标签推荐业务空间
export function zoneQueryByPoint(param, success) {
  let url = `${baseUrl}${compSpace}/in-bdfl-zonespacebase?X=${param.x}&Y=${param.y}`;
  http.postJson(url, param.data, success)
}

//更新业务空间图片
export function updateZonePic(param, success) {
  let url = `${baseUrl}${compSpace}/update-space-picinfo`;
  http.postJson(url, param, success)
}

//扫楼作业-位置标签-删除图片
export function deleteLocationImg(param, success) {
  let url = `${baseUrl}${locationPoint}/delete-image`;
  http.postJson(url, param, success)
}

//台账中待删除的对象
export function queryLederDelObject(param, success) {
  let url = `${baseUrl}${stat}/object-delete-count`
  http.postJson(url, param, success)
}

//获取设定参数和动态参数
export function BeatchQueryParam(param, success) {
  let url = `${rwd}/iot/data/current?projectId=${param.projectId}&groupCode=${param.groupCode}&appId=${param.appId}`
  let data = param.data
  http.postJson(url, data, success)
}

//根据条件查询统计数量
export function queryCenoteCount(param, success) {
  let url = `${baseUrl}${shaft}/count`
  http.postJson(url, param, success)
}

//竖井-按功能类型占比
export function queryShaftFunctionType(param, success) {
  let url = `${baseUrl}${stat}/shaft-functype-count`
  http.postJson(url, param, success)
}

//竖井-关联业务空间完成度
export function ShaftRelationBusinessSpace(param, success) {
  let url = `${baseUrl}${stat}/shaft2sp-count`
  http.postJson(url, param, success)
}

//获取竖井类型
export function getCenoteType(param, success) {
  let url = `${baseUrl}${object}/shaft/query-shaft-functype`
  http.postJson(url, param, success)
}

//获取竖井表格内容信息
export function getCenoteTableData(param, success) {
  let url = `${baseUrl}${shaft}/query-with-count`
  http.postJson(url, param, success)
}

//查询竖井信息
export function queryCenoteTableData(param, success) {
  let url = `${baseUrl}${object}/shaft/query`
  http.postJson(url, param, success)
}

//添加竖井信息
export function createCenoteTableData(param, success) {
  let url = `${baseUrl}${object}/shaft/create`
  http.postJson(url, param, success)
}

//修改竖井信息
export function updataCenoteTableData(param, success) {
  let url = `${baseUrl}${object}/shaft/update`
  http.postJson(url, param, success)
}

//删除竖井信息
export function deleteCenoteTableData(param, success) {
  let url = `${baseUrl}${object}/shaft/delete`
  http.postJson(url, param, success)
}

//竖井关联元空间
export function saveCenoteRelateSpace(param, success) {
  let url = `${baseUrl}${shaft}/relate-space`
  http.postJson(url, param, success)
}

//竖井关联的业务空间的楼层
export function shaftSpaceBuildingQuery(param, success) {
  let url = `${baseUrl}${shaft}/shaft-zoneSpaceBaseTable-building`
  http.getJson(url, param, success)
}

//竖井关联的业务空间
export function shaftSpaceQuery(param, success) {
  let url = `${baseUrl}${shaft}/shaft-zoneSpaceBaseTable?ShaftId=${param.ShaftId}`
  http.postJson(url, param.data, success)
}

//获取未和当前竖井关联的业务空间
export function shaftUnlinkSpaceQuery(param, success) {
  let url = `${baseUrl}${shaft}/un-shaft-zoneSpaceBaseTable?shaftId=${param.ShaftId}`
  http.postJson(url, param.data, success)
}

//竖井下的业务空间，竖井一对多，不覆盖
export function linkShaftSpace(param, success) {
  let url = `${baseUrl}${shContainSp}/link`
  http.postJson(url, param, success)
}

//删除竖井下的业务空间，只针对一个对象
export function spaceInShaftUnlink(param, success) {
  let url = `${baseUrl}${shContainSp}/unlink?type=${param.type}`
  http.postJson(url, param.data, success)
}

//查询竖井关联的空间垂直交通关系
export function shaftVerticalSpace(param, success) {
  let url = `${baseUrl}${component}/shaft/shaft-vertical-space`
  http.postJson(url, param, success)
}

//计算和当前竖井有关联的空间的垂直交通关系
export function verticalSpace(param, success) {
  let url = `${baseUrl}${component}/shaft/vertical-space`
  http.postJson(url, param, success)
}

//获取租户表格内容信息
export function getRentTableData(param, success) {
  let url = `${baseUrl}${tenant}/query-with-count`
  http.postJson(url, param, success)
}

//根据条件查询统计数量
export function queryRentCount(param, success) {
  let url = `${baseUrl}${object}/tenant/count`
  http.postJson(url, param, success)
}

export function queryTenantCompletion(param, success) {
  let url = `${baseUrl}${stat}/tenant2sp-count`
  http.postJson(url, param, success)
}

//创建租户信息
export function queryRentTableData(param, success) {
  // let url = `${baseUrl}${tenant}/query`
  let url = `${baseUrl}${object}/tenant/query`
  http.postJson(url, param, success)
}

//查询租户信息
export function queryTenant(param, success) {
  let url = `${baseUrl}${object}/tenant/query`
  http.postJson(url, param, success)
}

//创建租户信息
export function createRentTableData(param, success) {
  let url = `${baseUrl}${tenant}/create`
  http.postJson(url, param, success)
}

//修改租户信息
export function updataRentTableData(param, success) {
  let url = `${baseUrl}${tenant}/update`
  http.postJson(url, param, success)
}

//删除租户信息
export function deleteRentTableData(param, success) {
  let url = `${baseUrl}${tenant}/delete`
  http.postJson(url, param, success)
}

//租户关联租户业务空间,租户一对多,覆盖
export function tnRelateTenantZone(param, success) {
  let url = `${baseUrl}${dataCenter}/tn-in-sp-zone-Tenant/link-sp`
  http.postJson(url, param, success)
}

//租户关联默认业务空间,租户一对多,覆盖
export function tnRelateGeneralZone(param, success) {
  let url = `${baseUrl}${dataCenter}/tn-in-sp-zone-general/link-sp`
  http.postJson(url, param, success)
}

//租户关联默认业务空间,租户一对多,覆盖
export function tnRelateZone(param, success) {
  let url = `${baseUrl}${dataCenter}/tn-in-sp-base/link-sp?type=${param.type}`
  http.postJson(url, param.data, success)
}

//租户关联业务空间,累加
export function tnRelateOneZone(param, success) {
  let url = `${baseUrl}${dataCenter}/tn-in-sp-base/link?type=${param.type}`
  http.postJson(url, param.data, success)
}

//删除租户业务空间关系
export function delTnRelateZone(param, success) {
  let url = `${baseUrl}${dataCenter}/tn-in-sp-base/unlink?type=${param.type}`
  http.postJson(url, param.data, success)
}

//查询租户关联的业务空间所在的建筑楼层
export function queryTnRelateFloor(param, success) {
  // let url = `${baseUrl}${component}/tenant/tenant-building-floor?objectType=${param.objectType}&tenantId=${param.tenantId}`
  let url = `${baseUrl}${component}/tenant/tenant-building-floor`
  http.postJson(url, param, success)
}

//关联分区空间
export function saveRentRelateSpace(param, success) {
  let url = `${baseUrl}${tenant}/relate-space`
  http.postJson(url, param, success)
}

//根据条件查询分区数量
export function queryZoneCount(param, success) {
  // let url = `${baseUrl}${dataCenter}/zonespacebase/count`
  let url = `${baseUrl}${object}/zone/count`
  http.postJson(url, param, success)
}

//业务空间-各分区占比
export function queryPartitionRatio(param, success) {
  let url = `${baseUrl}${stat}/sp-objecttype-count`
  http.postJson(url, param, success)
}

//业务空间-默认分区功能类型占比
export function queryDefaultFunTypes(param, success) {
  let url = `${baseUrl}${stat}/general-sp-functype-count`
  http.postJson(url, param, success)
}

//设备清单-查询设备内容
export function getEquipTableCon(param, success) {
  let url = `${baseUrl}${compEquipQuery}/equip-components`;
  http.postJson(url, param, success)
}

//根据模型id查询待删除的设备数量
// export function getToBeDelEquip(param, success) {
//   let url = `${baseUrl}${compEquipQuery}/equip-del-com`;
//   let data = param.data;
//   http.postJson(url, data, success)
// }
export function getToBeDelEquip(param, success) {
  let url = `${baseUrl}${compEquipQuery}/equip-del-com`;
  let data = param.data;
  http.postJson(url, data, success)
}

//根据模型id查询待补充的设备数量
// export function getSupplement(param, success) {
//   let url = `${baseUrl}${compEquipQuery}/equip-supply`;
//   let data = param.data;
//   http.postJson(url, data, success)
// }
export function getSupplement(param, success) {
  let url = `${baseUrl}${compEquipQuery}/equip-supply`;
  let data = param.data;
  http.postJson(url, data, success)
}

// 模型质量报告 待删除的设备
// export function toBeDelEquipPage(params, success) {
//   let url = `${baseUrl}${compEquipQuery}/equip-comm-del`;
//   http.postJson(url, params, success)
// }
export function toBeDelEquipPage(params, success) {
  let url = `${baseUrl}${compEquipQuery}/equip-comm-del`;
  http.postJson(url, params, success)
}

// 模型质量报告 待补充的设备
// export function toBeSupplementEquip(params, success) {
//   let url = `${baseUrl}${compEquipQuery}/property-equip-supp`;
//   http.postJson(url, params, success)
// }
export function toBeSupplementEquip(params, success) {
  let url = `${baseUrl}${compEquipQuery}/property-equip-supp`;
  http.postJson(url, params, success)
}

//设备清单-查询当前设备下的部件分类
// export function getEquipPartsType(param, success) {
//   let url = `${baseUrl}${compEquipQuery}/components-count`;
//   http.postJson(url, param, success)
// }
export function getEquipPartsType(param, success) {
  let url = `${baseUrl}${compEquipQuery}/components-count`;
  http.postJson(url, param, success)
}

//设备清单-查询当前设备类下的部件分类
export function getPartsAllType(param, success) {
  let url = `${baseUrl}${compEquipQuery}/equip-compon`;
  http.getJson(url, param, success)
}

//all - 查询数据字典 --列表表头 api/dict
export function getDataDictionary(param, success) {
  let url = `${baseUrl}${dataCenter}/data-dictionary/project/query?type=${param.type}`;
  let data = param.data
  http.postJson(url, data, success)
}

//all - 查询数据字典 --列表表头  字典-查询所有字典信息M和L类型,包括自定义信息点
export function cacheDictionary(param, success) {
  // let url = `${baseUrl}${classDef}/query-dict`;
  let url = `${baseUrl}${component}/dict/morl/query`;
  http.postJson(url, param, success)
}

//批量处理字典信息操作 api/dict
export function setInfoPoint(param, success) {
  let url = `${baseUrl}${dataCenter}/data-dictionary/project/dict-batch`;
  http.postJson(url, param, success)
}

//设置项目数据字典显隐 --列表表头 api/dict
export function setDataDictionary(param, success) {
  // let url = `${baseUrl}${dataCenter}/data-dictionary/project/setting-dic-project`;
  let url = `${baseUrl}${dict}/setting-dic-project`;
  http.postJson(url, param, success)
}

//设备清单 - 根据分类查询部件列表内容
// export function getEquipPartsCon(param, success) {
//   let url = `${baseUrl}${compEquipQuery}/components-property`;
//   http.postJson(url, param, success)
// }
export function getEquipPartsCon(param, success) {
  let url = `${baseUrl}${compEquipQuery}/components-property`;
  http.postJson(url, param, success)
}

//设备清单 - 新增部件
export function createPart(param, success) {
  let url = `${baseUrl}${object}/component/create`;
  http.postJson(url, param, success)
}

// 查询部件总数
export function queryPart(param, success) {
  let url = `${baseUrl}${object}/component/count`;
  http.postJson(url, param, success)
}

//设备清单 - 删除部件
export function deleteParts(param, success) {
  let url = `${baseUrl}${object}/component/delete?projectId=${param.projectId}`;
  let data = param.data;
  http.postJson(url, data, success)
}

//设备清单 - 更新部件
export function updateParts(param, success) {
  let url = `${baseUrl}${object}/component/update?projectId=${param.projectId}`;
  let data = param.data;
  http.postJson(url, data, success)
}

//设备清单 - 创建设备
export function createEquip(param, success) {
  let url = `${baseUrl}${dataCenter}/equip/create`;
  http.postJson(url, param, success)
}

//设备清单 - 创建设备-关联资产-关联系统
export function createEquipAndProperty(param, success) {
  // let url = `${baseUrl}${compEquipQuery}/creat-equip-pro`;
  let url = `${baseUrl}${object}/equip/creat-equip-pro`;
  http.postJson(url, param, success)
}

//设备清单 - 更新设备
export function updateEquip(param, success) {
  // let url = `${baseUrl}${dataCenter}/equip/update`;
  let url = `${baseUrl}${object}/equip/update`;
  http.postJson(url, param, success)
}

//设备清单 - 删除设备
export function deleteEquip(param, success) {
  let url = `${baseUrl}${object}/equip/delete`;
  http.postJson(url, param, success)
}

//设备清单 - 查询系统关联专业 - 查询系统信息 - 查询系统所属专业类型
export function queryLinkSys(param, success) {
  // let url = `${baseUrl}${system}/query`;
  let url = `${baseUrl}${object}/general-system/query`;
  http.postJson(url, param, success)
}

//查询系统信息 - 建筑楼层 - 系统一对多
export function querySysLinkBuild(param, success) {
  // let url = `${baseUrl}${system}/query-new`;
  let url = `${baseUrl}${object}/general-system/query-new`;
  if (param.buildingId) {
    url += `?buildingId=${param.buildingId}`
  }
  if (param.floorId) {
    url += `&floorId=${param.floorId}`
  }
  http.postJson(url, param.data, success)
}


//设备清单 - 设备关联系统 设备1-n
export function equipLinkSys(param, success) {
  let url = `${baseUrl}${dataCenter}/rel/sy-in-eq/link-sy`;
  http.postJson(url, param, success)
}

//设备清单 - 设备关联系统 系统1-n
export function sysLinkEquip(param, success) {
  // let url = `${baseUrl}${dataCenter}/sy-in-eq/link-sy-eq`;
  let url = `${baseUrl}${dataCenter}/rel/sy-in-eq/link-sy-eq`;
  http.postJson(url, param, success)
}

//设备清单 - 根据对象删除系统和设备的关系
export function sysUnlinkEquip(param, success) {
  let url = `${baseUrl}${dataCenter}/sy-in-eq/unlinks-sy-eq`;
  http.postJson(url, param, success)
}

//设备清单 - 统计项目下所有设备数量
export function countEquip(param, success) {
  let url = `${baseUrl}${object}/equip/count`;
  http.postJson(url, param, success)
}

//设备清单 - 查询设备信息
export function queryEquip(param, success) {
  let url = `${baseUrl}${object}/equip/query`;
  http.postJson(url, param, success)
}

// //资产清单 - 查询资产信息
// export function queryProperty(param, success) {
//   let url = `${baseUrl}${dataCenter}/property/query`;
//   http.postJson(url, param, success)
// }
//资产清单 - 更新资产
// export function updateProperty(param, success) {
//   let url = `${baseUrl}${dataCenter}/property/update`;
//   http.postJson(url, param, success)
// }
//查询项目下的设备或部件-根据项目、建筑、楼层、设备或部件分类、业务空间实例筛选设备 然后通过计算匹配资产
export function equipCategoryProperty(param, success) {
  // let url = `${baseUrl}${compEquipQuery}/equip-category-property?category=${param.category}${param.spaceIdList ? param.spaceIdList : ''}`;
  let url = `${baseUrl}${compEquipQuery}/equip-category-property?category=${param.category}${param.spaceIdList ? param.spaceIdList : ''}`;
  // let data = param.data;
  http.postJson(url, param, success)
}

//批量添加设备和资产的关系
export function equipRproperty(param, success) {
  let url = `${baseUrl}${compEquipQuery}/equip-r-property`;
  http.postJson(url, param, success)
}

//创建资产所需(Family族id3位编码)-根据设备类型(4位编码)或部件类型(6位编码)查询,!!设备与设备族的关系
export function getEquipBelongs(param, success) {
  // let url = `${baseUrl}${dataCenter}/data-dictionary/family-query`;
  let url = `${baseUrl}${dict}/family/query`;
  let data = param.data;
  http.postJson(url, data, success)
}

//创建资产
export function createPropertyData(param, success) {
  // let url = `${baseUrl}${dataCenter}/property/create`;
  let url = `${baseUrl}${object}/property/create`;
  http.postJson(url, param, success)
}

//查询资产
export function queryProperty(param, success) {
  // let url = `${baseUrl}${dataCenter}/property/query`;
  let url = `${baseUrl}${object}/property/query`;
  http.postJson(url, param, success)
}

// 修改设备的附件功能
export function queryUpdate(param, success) {
  // /equip-componnet2/equip-query/update
  let url = `${baseUrl}${compEquipQuery}/update`;
  http.postJson(url, param, success)
}

// 修改资产的附件功能
export function propertyUpdate(param, success) {
  let url = `${baseUrl}${component}/property/update`;
  http.postJson(url, param, success)
}

//查询资产 同时关联设备信息
export function propertyLinkEq(param, success) {
  // let url = `${baseUrl}${component}/property/property-query`;
  let url = `${baseUrl}${component}/property/property-query`;
  http.postJson(url, param, success)
}

//查询设备或部件
export function queryPartsDie(param, success) {
  // let url = `${baseUrl}${compEquipQuery}/pagequery`;
  let url = `${baseUrl}${compEquipQuery}/pagequery`;
  http.postJson(url, param, success)
}

//查询项目下设备或部件的类别、以及名称
export function TypePartsDie(success) {
  // let url = `${baseUrl}${compEquipQuery}/equip-compon-category`;
  let url = `${baseUrl}${compEquipQuery}/equip-compon-category`;
  http.getJson(url, {}, success)
}

//根据条件查询项目下设备部件数量
export function countPartsDie(param, success) {
  // let url = `${baseUrl}${compEquipQuery}/count`;
  let url = `${baseUrl}${compEquipQuery}/count`;
  http.postJson(url, param, success)
}

//根据设备或部件批量创建资产
export function createPropertys(param, success) {
  let url = `${baseUrl}${compEquipQuery}/creat-propertys`;
  http.postJson(url, param, success)
}

//根据条件查询统计数量
export function countProperty(param, success) {
  let url = `${baseUrl}${object}/property/count`;
  http.postJson(url, param, success)
}

//根据id删除资产信息
export function deleteProperty(param, success) {
  let url = `${baseUrl}${object}/property/delete`;
  http.postJson(url, param, success)
}

//更新资产信息
export function updateProperty(param, success) {
  // let url = `${baseUrl}${dataCenter}/property/update`;
  let url = `${baseUrl}${object}/property/update`;
  http.postJson(url, param, success)
}

//更新系统信息
export function updateGeneralSys(param, success) {
  let url = `${baseUrl}${system}/update`;
  http.postJson(url, param, success)
}

//删除系统信息
export function deleteGeneralSys(param, success) {
  let url = `${baseUrl}${system}/delete`;
  http.postJson(url, param, success)
}

//创建系统信息
export function createGeneralSys(param, success) {
  let url = `${baseUrl}${system}/create`;
  http.postJson(url, param, success)
}

//创建系统---处理建筑楼层(一对多)
export function createSystemBuildFloor(param, success) {
  // let url = `${baseUrl}${system}/create-bd-fl`
  let url = `${baseUrl}${object}/general-system/create-bd-fl`
  http.postJson(url, param, success)
}

//查询不在当前系统下的设备
export function getEquipNotInSys(param, success) {
  let url = `${baseUrl}${compEquipQuery}/equip-sys?sysId=${param.sysId}`;
  http.postJson(url, param.data, success)
}

//创建系统所在建筑关系,系统一对多,覆盖
export function sysRelateBuild(param, success) {
  let url = `${baseUrl}${rel}/sy-in-bd/link-bd`;
  http.postJson(url, param, success)
}

//创建系统所在楼层关系,系统一对多,覆盖
export function sysRelateFloor(param, success) {
  let url = `${baseUrl}${rel}/sy-in-fl/link-fl`;
  http.postJson(url, param, success)
}

//查询当前系统下的设备
export function getEquipInSys(param, success) {
  let url = `${baseUrl}${compEquipQuery}/sys-equip`;
  http.postJson(url, param, success)
}

// 统计设备信息点与需采集数据占比
export function gatherInfoPoint(param, success) {
  let url = `${baseUrl}${compEquipQuery}/gather-info-point`;
  http.postJson(url, param, success)
}

// 统计设备信息点与总数据占比
export function infoPoint(param, success) {
  let url = `${baseUrl}${compEquipQuery}/info-point`;
  http.postJson(url, param, success)
}

// 统计系统信息点与需采集数据占比
export function systemInfoPoint(param, success) {
  let url = `${baseUrl}${compEquipQuery}/system-info-point`;
  http.postJson(url, param, success)
}

//根据条件查询统计数量
export function countGeneralSys(param, success) {
  // let url = `${baseUrl}${system}/count`;
  let url = `${baseUrl}${object}/general-system/count`;
  http.postJson(url, param, success)
}

//查询所有设备族信息
export function queryFamilyAll(success) {
  let url = `${baseUrl}${dataCenter}/data-dictionary/family-query-All`;
  http.getJson(url, {}, success)
}

//字典头部信息查询接口
export function queryDictionaryHead(param, success) {
  let url = `${baseUrl}${classDef}/query`;
  http.postJson(url, param, success)
}

//动态数据关联-冲突选择确认
export function dynamicClashConfirm(param, success) {
  let url = `${baseUrl}/pointconfig/dynamic/clashconfirm`;
  http.postJson(url, param, success)
}

//子系统点位接入-第三部步骤3保存
export function groupCreatePointRelation(param, success) {
  let url = `${baseUrl}/pointconfig/relation/group-create`;
  http.postJson(url, param, success)
}

//动态数据关联-查询数据源列表(P1&2)
export function dynamicDataSource(param, success) {
  let url = `${baseUrl}/pointconfig/dynamic/datasource-list`;
  http.postJson(url, param, success);
}

//动态数据关联-查询设备类型列表(P1&2)
export function dynamicDynEquipList(param, success) {
  let url = `${baseUrl}/pointconfig/dynamic/equipmenttype-list`;
  http.postJson(url, param, success);
}

//动态数据关联-执行对应结果
export function dynamicExecute(param, success) {
  let url = `${baseUrl}/pointconfig/dynamic/execute`;
  http.postJson(url, param, success);
}

//动态数据关联-执行对应结果反馈
export function dynamicExecuteFeedback(param, success) {
  let url = `${baseUrl}/pointconfig/dynamic/executeFeedback`;
  http.postJson(url, param, success);
}

//动态数据关联-位置下拉列表(P2)
export function dynamicLocationList(param, success) {
  let url = `${baseUrl}/pointconfig/dynamic/location-list`;
  http.postJson(url, param, success);
}

//动态数据关联-查询位置标签列表
export function dynamicLocFlagList(param, success) {
  let url = `${baseUrl}/pointconfig/dynamic/locationflag-list`;
  http.postJson(url, param, success)
}

//动态数据关联-提示信息
export function dynamicPromptmessage(param, success) {
  let url = `${baseUrl}/pointconfig/dynamic/promptmessage`;
  http.postJson(url, param, success);
}

//动态数据关联-提示冲突
export function dynamicPromptobjs(param, success) {
  let url = `${baseUrl}/pointconfig/dynamic/promptobjs`;
  http.postJson(url, param, success);
}

//动态数据关联-查询对应关系(P1)
export function dynamicQuery(param, success) {
  let url = `${baseUrl}/pointconfig/dynamic/query`;
  http.postJson(url, param, success);
}

//动态数据关联-待关联实例(P2)
export function dynamicPendingobjs(param, success) {
  let url = `${baseUrl}/pointconfig/dynamic/query-pending-objs`;
  http.postJson(url, param, success);
}

//动态数据关联-待关联点位(P2)
export function dynamicPendingPoint(param, success) {
  let url = `${baseUrl}/pointconfig/dynamic/query-pending-point`;
  http.postJson(url, param, success);
}

//动态数据关联-查点位
export function dynamicQueryPoint(param, success) {
  let url = `${baseUrl}/pointconfig/dynamic/query-point`;
  http.postJson(url, param, success);
}

//动态数据关联-创建关联
export function dynamicCreateRelation(param, success) {
  let url = `${baseUrl}/pointconfig/dynamic/relation-create`;
  http.postJson(url, param, success);
}

//动态数据关联-清除关联
export function dynamicDeleteRelation(param, success) {
  let url = `${baseUrl}/pointconfig/dynamic/relation-delete`;
  http.postJson(url, param, success);
}

//动态数据关联-查询对象类列表(P1&2)
export function dynamicPointTypeList(param, success) {
  let url = `${baseUrl}/pointconfig/dynamic/type-list`;
  http.postJson(url, param, success)
}

//动态数据关联-自动关联
export function dynamicAutoRelate(param, success) {
  let url = `${baseUrl}/pointconfig/dynamic/auto-relate`;
  http.postJson(url, param, success)
}

//动态数据关联-(2020改版新增接口)已关联实例查询
export function dynamicRelatedObj(param, success) {
  let url = `${baseUrl}/pointconfig/dynamic/query-related-objs`;
  http.postJson(url, param, success)
}

//动态数据关联-带关联实例(设备)
export function dynamicEquipQuery(param, success) {
  let url = `${baseUrl}${compEquipQuery}/zone-query`;
  http.postJson(url, param, success)
}

//动态数据关联-带关联实例(部件)
export function dynamicPartQuery(param, success) {
  let url = `${baseUrl}${compEquipQuery}/zone-component-query`;
  http.postJson(url, param, success)
}

//动态数据关联-带关联实例(租户)
export function dynamicTenantQuery(param, success) {
  let url = `${baseUrl}${component}/tenant/zone-query`;
  http.postJson(url, param, success)
}

//查询部件
export function partsQuery(param, success) {
  let url = `${baseUrl}${object}/component/query`;
  http.postJson(url, param, success)
}

//查询项目信息
export function projectQuery(param, success) {
  let url = `${baseUrl}${dataCenter}/project/query`;
  http.postJson(url, param, success)
}

//查询项目信息
export function projectQuerys(param, success) {
  let url = `${baseUrl}${dataCenter}/object/project/query`;
  return http.postJson(url, param, success, '', '', 1)
}

//查询楼层信息
export function floorQuery(param, success) {
  let url = `${baseUrl}${floor}/query`;
  http.postJson(url, param, success)
}

//查询楼层信息+sign
export function floorQueryAndSign(param, success) {
  let url = `${baseUrl}${component}/floor/query`;
  http.postJson(url, param, success)
}

//查询建筑信息
export function buildingQuery(param, success) {
  let url = `${baseUrl}${object}/building/query`;
  http.postJson(url, param, success)
}

// //查询建筑信息+count
// export function buildingQueryAndCount(param, success) {
//   let url = `${baseUrl}${component}/building/query`;
//   http.postJson(url, param, success)
// }
//查询建筑信息+count
export function buildingQueryAndCount(param, success) {
  let url = `${baseUrl}${component}/building/query`;
  http.postJson(url, param, success)
}

// 查询建筑楼层-统计业务空间state
export function queryBFloorWithState(param, success) {
  let url = `${baseUrl}${object}/zone/building-floor`;
  http.postJson(url, param, success)
}

// 查询业务空间分区类型包含其他
export function queryAllZoneType(param, success) {
  let url = `${baseUrl}${object}/zone/type`;
  http.postJson(url, param, success)
}

// 创建分区信息
export function createZone(param, success) {
  let data = param.data
  let url = `${baseUrl}${object}/${zone[param.zone]}/create-bd-fl`;
  http.postJson(url, data, success)
}

//删除分区信息
export function deleteZone(param, success) {
  let data = param.data
  let url = `${baseUrl}${object}/${zone[param.zone]}/delete`;
  http.postJson(url, data, success)
}

//查询分区信息
export function queryZone(param, success) {
  let data = param.data
  let url = `${baseUrl}${object}/${zone[param.zone]}/query`;
  http.postJson(url, data, success)
}

//更新分区信息
export function updateZone(param, success) {
  let data = param.data
  let url = `${baseUrl}${object}/${zone[param.zone]}/update`;
  http.postJson(url, data, success)
}

//根据条件查询统计数量
export function countZone(param, success) {
  let data = param.data
  let url = `${baseUrl}${object}/${zone[param.zone]}/count`;
  http.postJson(url, data, success)
}

//查询空间信息父类
export function queryParentZone(param, success) {
  let url = `${baseUrl}${dataCenter}/zonespacebase/query`;
  http.postJson(url, param, success)
}

//创建邻接关系
export function createSpaceNeighborhood(param, success) {
  let url = `${baseUrl}${dataCenter}/relation/sp-rel/space-neighborhood-Create`;
  http.postJson(url, param, success)
}

//查询邻接关系
export function querySpaceNeighborhood(param, success) {
  let url = `${baseUrl}${dataCenter}/relation/sp-rel/space-neighborhood-query`;
  http.postJson(url, param, success)
}

//查询邻接关系
export function delSpaceNeighborhood(param, success) {
  let url = `${baseUrl}${dataCenter}/relation/sp-rel/delete`;
  http.postJson(url, param, success)
}

//查询邻接关系
export function delFloorNeighborhood(param, success) {
  let url = `${baseUrl}${dataCenter}/relation/sp-rel/delete-floor`;
  http.postJson(url, param, success)
}

//项目关系类型查询
export function getrelationTypeProject(param, success) {
  let url = `${baseUrl}${graphicUrl}/relation_type_project`;
  http.postJson(url, param, success)
}

//动态数据关联-查询对应关系(删除提示页)
export function dynamicQueryPrompt(param, success) {
  let url = `${baseUrl}/pointconfig/dynamic/query-prompt`;
  http.postJson(url, param, success)
}

//动态数据关联-AI辅助
export function dynamicQueryAI(param, success) {
  let url = `${baseUrl}/pointconfig/dynamic/ai`;
  http.postJson(url, param, success)
}

//动态数据关联-执行对应结果详情
export function dynamicExecuteDetail(param, success) {
  let url = `${baseUrl}/pointconfig/dynamic/executeDetail`;
  http.postJson(url, param, success)
}

//建筑楼层管理-创建楼层
export function manageCreateFloor(param, success) {
  let url = `${baseUrl}${floor}/create`;
  http.postJson(url, param, success)
}

//建筑楼层管理-删除楼层
export function manageDeleteFloor(param, success) {
  let url = `${baseUrl}${floor}/delete`;
  http.postJson(url, param, success)
}

//建筑楼层管理-删除楼层(该接口有删除失败的原因)
export function deleteFloorInfo(param, success) {
	let url = `${baseUrl}${floor}/single/delete`;
	http.postJson(url, param, success)
}

//建筑楼层管理-修改楼层
export function manageUpdateFloor(param, success) {
  let url = `${baseUrl}${floor}/update`;
  http.postJson(url, param, success)
}

//建筑楼层管理-创建楼层关联关系
// export function createRelationInFloor(param, success) {
//   let url = `${baseUrl}${dataCenter}/fl-through-fl/link-or`;
//   http.postJson(url, param, success)
// }
export function createRelationInFloor(param, success) {
  let url = `${baseUrl}${dataCenter}/rel/fl-through-fl/link-or`;
  http.postJson(url, param, success)
}

//查询底图
export function queryBaseGraphy(param, success) {
  let url = `${modelapi}/base-graph/query`;
  http.postJson(url, param, success)
}

//楼层接口-----更新楼层信息
export function floorUpdate(param, success) {
  let url = `${baseUrl}${floor}/update`;
  http.postJson(url, param, success)
}

//楼层接口-----更新楼层轮廓
export function floorUpdateOutline(param, success) {
  // 上边一个为新接口
  // let url = `${baseUrl}${floor}/outline/update`;
  // 这个旧接口,需要改回旧接口12-14
  let url = `${baseUrl}${floor}/update-outline`;
  http.postJson(url, param, success)
}

//楼层接口-----查询楼层轮廓
export function floorQueryOutline(param, success) {
  // 上边一个为新接口
  // let url = `${baseUrl}${floor}/outline/query`;
  // 这个旧接口,需要改回旧接口12-14
  let url = `${baseUrl}${floor}/query-outline`;
  http.postJson(url, param, success)
}

/****关系-竖井****/
//字典查询接口 竖井所有类型
export function queryShaftType(success) {
  let url = `${baseUrl}${dataCenter}/data-dictionary/query-shaft-type`;
  http.getJson(url, {}, success)
}

//根据对象删除设备所在竖井关系，只针对一个对象
export function eqinshUnlink(param, success) {
  let url = `${baseUrl}${rel}/eq-in-sh/unlink`;
  http.postJson(url, param, success)
}

//根据对象删除系统所在竖井关系，只针对一个对象
export function syinshUnlink(param, success) {
  let url = `${baseUrl}${rel}/sy-in-sh/unlink`;
  http.postJson(url, param, success)
}

//根据对象删除竖井的贯通关系，只针对一个对象
export function shthroughshUnlink(param, success) {
  let url = `${baseUrl}${rel}/sh-through-sh/unlink`;
  http.postJson(url, param, success)
}

//查询没有和当前系统关联的设备
export function unSysEq(param, success) {
  let data = param.data
  // let url = `${baseUrl}${system}/un-sys-equip?sysId=${param.sysId}`;
  let url = `${baseUrl}${object}/general-system/un-sys-equip?sysId=${param.id}`;
  http.postJson(url, data, success)
}

//查询没有和当前系统关联的竖井
export function unSysShaft(param, success) {
  let data = param.data
  // let url = `${baseUrl}${system}/un-sys-shaft?sysId=${param.sysId}`;
  let url = `${baseUrl}${system}/un-sys-shaft?sysId=${param.sysId}`;
  http.postJson(url, data, success)
}

//查询没有和当前系统关联的业务空间
export function unSysZoneSpace(param, success) {
  let data = param.data
  let url = `${baseUrl}${object}/general-system/un-sys-zoneSpaceBaseTable?sysId=${param.sysId}`;
  http.postJson(url, data, success)
}

//查询没有和当前竖井绑定的设备
export function unshaftInEq(param, success) {
  let data = param.data
  let url = `${baseUrl}${component}/shaft/unshaft-in-eq?shaftId=${param.shaftId}`;
  http.postJson(url, data, success)
}

//查询没有和当前竖井贯通的其它竖井
export function unshaftThroughShaft(param, success) {
  let data = param.data
  let url = `${baseUrl}${component}/shaft/unshaft-through-shaft?shaftId=${param.shaftId}`;
  http.postJson(url, data, success)
}

//查询没有和当前竖井绑定的系统
export function unshaftInSys(param, success) {
  let data = param.data
  let url = `${baseUrl}${component}/shaft/unshaft-in-sys?shaftId=${param.shaftId}`;
  http.postJson(url, data, success)
}

//设备所在的竖井，竖井一对多，此方不会覆盖以前的记录，累计添加
export function linkEqSh(param, success) {
  let url = `${baseUrl}${dataCenter}/rel/eq-in-sh/link-eq-sh`;
  http.postJson(url, param, success)
}

//创建系统下的设备关系
export function linkSysEq(param, success) {
  let url = `${baseUrl}${system}/link-equip`;
  http.postJson(url, param, success)
}

//竖井的贯通，竖井一对多，此方法不会覆盖以前的记录
export function linkShaft(param, success) {
  let url = `${baseUrl}${rel}/sh-through-sh/link-shaft`;
  http.postJson(url, param, success)
}

//系统所在的竖井，竖井一对多，累计添加，此方法不会覆盖以前记录
export function linkSySh(param, success) {
  let url = `${baseUrl}${rel}/sy-in-sh/link-sy-sh`;
  http.postJson(url, param, success)
}

//创建系统所在业务空间关系
export function linkSysSp(param, success) {
  let url = `${baseUrl}${rel}/sy-in-sp-base/link-list`;
  http.postJson(url, param, success)
}

//系统所在竖井，系统一对多，此方法会覆盖以前的记录
export function linkSh(param, success) {
  let url = `${baseUrl}${dataCenter}/sy-in-sh/link-sh`;
  http.postJson(url, param, success)
}

//系统所在竖井，系统一对多，此方法不会覆盖以前的记录
export function linkSysSh(param, success) {
  let url = `${baseUrl}${rel}/sy-in-sh/link-sy-shs`;
  http.postJson(url, param, success)
}

//根据对象删除系统和设备的关系，只针对一个对象
export function eqInSysUnlink(param, success) {
  // let url = `${baseUrl}${dataCenter}/sy-in-eq/unlink`;
  let url = `${baseUrl}${rel}/sy-in-eq/unlink`;
  http.postJson(url, param, success)
}

//根据对象删除系统所在业务空间关系
export function spaceInSysUnlink(param, success) {
  let url = `${baseUrl}${rel}/sy-in-sp-base/unlink-list?type=${param.type}`;
  http.postJson(url, param.data, success)
}

//关系-----设备所在业务空间--删除关系
export function eqInSpaceDelete(param, success) {
  let url = `${baseUrl}${rel}/eq-in-sp-base/unlink-list?type=${param.type}`;
  http.postJson(url, param.data, success)
}

//关系-----设备所在业务空间--创建关系
export function eqInSpaceCreate(param, success) {
  let url = `${baseUrl}${rel}/eq-in-sp-base/link-eq-sp?type=${param.type}`;
  http.postJson(url, param.data, success)
}

//关系-----设备服务业务空间--删除关系
export function eqForSpaceDelete(param, success) {
  let url = `${baseUrl}${rel}/eq-for-sp-base/unlink-list?type=${param.type}`;
  http.postJson(url, param.data, success)
}

//关系-----设备服务业务空间--创建关系
export function eqForSpaceCreate(param, success) {
  let url = `${baseUrl}${rel}/eq-for-sp-base/link-eq-sp?type=${param.type}`;
  http.postJson(url, param.data, success)
}

//关系-----系统所在业务空间--删除关系
export function syInSpaceDelete(param, success) {
  let url = `${baseUrl}${rel}/sy-in-sp-base/unlink-list?type=${param.type}`;
  http.postJson(url, param.data, success)
}

//关系-----系统所在业务空间--创建关系
export function syInSpaceCreate(param, success) {
  let url = `${baseUrl}${rel}/sy-in-sp-base/link-sp-sys?type=${param.type}`;
  http.postJson(url, param.data, success)
}

//关系-----没有和当前空间绑定的设备
export function notEqInSpaceQuery(param, success) {
  let url = `${baseUrl}${compSpace}/unspace-in-eq?type=${param.type}&spaceId=${param.spaceId}`;
  http.postJson(url, param.data, success)
}

//关系-----未服务当前空间的设备
export function notEqForSpaceQuery(param, success) {
  let url = `${baseUrl}${compSpace}/unspace-for-eq?type=${param.type}&spaceId=${param.spaceId}`;
  http.postJson(url, param.data, success)
}

//关系-----没有和当前空间绑定的系统
export function notSyInSpaceQuery(param, success) {
  let url = `${baseUrl}${compSpace}/unspace-in-sys?type=${param.type}&spaceId=${param.spaceId}`;
  http.postJson(url, param.data, success)
}

//关系-----空间内没有和空间关联的设备 根据坐标计算(专用接口)
export function getEqNotInSpace(param, success) {
  let url = `${baseUrl}${compSpace}/unspace-fIn-eq-point?spaceId=${param.spaceId}&type=${param.type}`;
  http.postJson(url, param.data, success)
}

//关系-----空间内没有服务空间的设备 根据坐标计算(专用接口)
export function getEqNotForSpace(param, success) {
  let url = `${baseUrl}${compSpace}/unspace-for-eq-point?spaceId=${param.spaceId}&type=${param.type}`;
  http.postJson(url, param.data, success)
}

//关系-----未关联业务空间的元空间
export function getIspNotInSpace(param, success) {
  let url = `${baseUrl}${compSpace}/unspace-ispace?objectType=${param.objectType}`;
  http.postJson(url, param.data, success)
}

//关系-----统计 属于多建筑楼层的空间数据
export function getSpaceBdFlCount(param, success) {
  let url = `${baseUrl}${compSpace}/space-bd-fl`;
  http.postJson(url, param, success)
}

//关系-----统计 属于多建筑楼层的空间数据
export function getSpaceBdFlData(param, success) {
  let url = `${baseUrl}${compSpace}/space-bd-fl-data`;
  http.postJson(url, param, success)
}

//关系-----业务空间内的元空间，业务空间一对多,累计添加会覆盖以前记录
export function createRelateInZoneAndISp(param, success) {
  let url = `${baseUrl}${rel}/si-in-sp-base/link-sp?type=${param.type}`;
  http.postJson(url, param.data, success)
}

//关系-----业务空间内的元空间，创建业务空间内的元空间关系, 累计添加不会覆盖-批量关联
export function groupCreRelaZoneAndISp(param, success) {
  let url = `${baseUrl}${rel}/si-in-sp-base/link-list?type=${param.type}`;
  http.postJson(url, param.data, success)
}

//扫楼作业-扫楼日志查看
export function queryUserLog(param, success) {
  let url = `${baseUrl}${scan}/user-log/query`;
  http.postJson(url, param, success)
}

//扫楼作业-信息点整理-查询点位标签
export function queryLocationPoint(param, success) {
  let url = `${baseUrl}${locationPoint}/query`;
  http.postJson(url, param, success)
}

//扫楼作业-信息点整理-更新点位标签
// export function updateLocationPoint(param, success) {
//     let url = `${baseUrl}${locationPoint}/update`;
//     http.postJson(url, param, success)
// }

//扫楼作业-位置标签-删除图片
// export function deleteLocationImg(param, success) {
//     let url = `${baseUrl}${locationPoint}/delete-image`;
//     http.postJson(url, param, success)
// }

//扫楼作业-信息点整理-资产族及个数
export function queryPropertyTypeCount(param, success) {
  let url = `${baseUrl}${component}/property/property-family`;
  http.getJson(url, param, success)
}

//扫楼作业-信息点整理-位置标签及对应资产数量
export function queryPropertyPoint(param, success) {
  let url = `${baseUrl}${component}/point/point-property`;
  http.getJson(url, param, success)
}

// =======
//关系-----业务空间所属建筑楼层修改
export function updateRelateInSpAndBuild(param, success) {
  let url = `${baseUrl}${dataCenter}/update-relationship/update-sp`;
  http.postJson(url, param, success)
}

//关系-----查询竖井关联的空间类型和名称
export function shaftSpaceTypeQuery(param, success) {
  let url = `${baseUrl}${shContainSp}/space-type-query?shaftId=${param.shaftId}`;
  http.postJson(url, param, success)
}

//关系-----竖井下的业务空间，竖井一对多，此方法不会覆盖以前的记录
export function shaftZoneLink(param, success) {
  let url = `${baseUrl}${shContainSp}/link-shsps?type=${param.type}`;
  http.postJson(url, param.data, success)
}

//关系-----竖井下的业务空间，竖井一对多，此方法会覆盖以前的记录
export function shaftZoneLinkReplace(param, success) {
  let url = `${baseUrl}${shContainSp}/link-shsps-replace?BuildingId=${param.buildingId}&FloorId=${param.floorId}&Type=${param.type}`;
  http.postJson(url, param.data, success)
}

/**系统集成成果管理 */
//系统集成统计条形图
export function getIntegrateStatisticsToBar(param, success) {
  let url = `/pointconfig/report/point-statis    `
  http.postJson(url, param, success)
}

//系统集成统计环形图
export function getIntegrateStatisticsToLoop(param, success) {
  let url = `/pointconfig/report/meterfunc-statis`
  http.postJson(url, param, success)
}

//表号功能号总览
export function getTabFunNumOverview(param, success) {
  let url = `/pointconfig/report/meterfunc-overview`
  http.postJson(url, param, success)
}

/*********************************************************************************/

// 通讯状态
export function communicationStatus(param, success) {
  let url = `/pointconfig/datasource/connection`
  http.postJson(url, param, success)
}

// 点位数量
export function numberOfPoints(param, success) {
  let url = `/pointconfig/datasource/pointstatis`
  http.postJson(url, param, success)
}

//数据源启动
export function originOpen(param, success) {
  let url = `/pointconfig/datasource/start`
  http.postJson(url, param, success)
}

//数据源停止
export function originBin(param, success) {
  let url = `/pointconfig/datasource/stop`
  http.postJson(url, param, success)
}

//数据源测试
export function originTest(param, success) {
  let url = `/pointconfig/datasource/check`
  http.postJson(url, param, success)
}

//监测详情
export function testDetail(param, success) {
  let url = `/pointconfig/datasource/pointdetail`
  http.postJson(url, param, success)
}

//当前设置值
export function settingValue(param, success) {
  let url = `/pointconfig/datasource/pointset-present`
  http.postJson(url, param, success)
}

//点位测试
// export function pointTest(param, success) {
//   let url = `/pointconfig/datasource/pointTest`
//   http.postJson(url, param, success)
// }

export function pointTest(data) {
  let userName = storage.get("user_name")
  let ProjectId = localStorage.getItem("projectId")
  return fetch({
    method: 'POST',
    url: `/pointconfig/datasource/pointTest2`,
    data,
    //头信息中的 ProjectId 改为 projectId    nh-2021.11.25
    headers: { 'projectId': ProjectId, 'Comming': 'adm', 'Account': userName }
  })
}

//获取原始点位历史数据
export function originalHistory(param, success) {
  let url = `/pointconfig/point/common/original-history`
  http.postJson(url, param, success)
}

/*********************************************************************************/

//表号功能号对应历史数据
export function getHistoryData(query, param, success) {
  let url = `/data-platform-3/hisdata/batch_query_period_data_by_metfun`
  url += `?projectId=${query.projectId}&secret=${query.secret}`
  fetch({
    url: url,
    method: 'post',
    data: param,
    //头信息中的 ProjectId 改为 projectId    nh-2021.11.25
    headers: { 'projectId': query.projectId, 'Comming': 'adm', 'Account': query.userInfo.username }
  }).then((response) => {
    success(response.data);
  }).catch(error => {
    console.error(error);
  });
}

//获取表号功能号的源数据
export function getTabFunNumSourceData(param, success) {
  let url = `/pointconfig/report/query-point`
  http.postJson(url, param, success)
}

//获取表号功能号对应的对象实例
export function getTabFunNumObjInstance(param, success) {
  let url = `/pointconfig/report/query-instance`
  http.postJson(url, param, success)
}

//添加表号功能号
export function addTabFunNum(param, success) {
  let url = `/pointconfig/report/custom-meter-func`
  http.postJson(url, param, success)
}

//表号功能号对应总览
export function tableFuncRelatedOverview(param, success) {
  let url = `/pointconfig/report/meter-related`
  http.postJson(url, param, success)
}

//实例中查询设备信息
export function getEquipByEqID(param, success) {
  let url = `${baseUrl}${dataCenter}/equip/query`
  http.postJson(url, param, success)
}

//获取楼层信息
export function getFloorMsgByFloorID(param, success) {
  let url = `${baseUrl}${floor}/query`
  http.postJson(url, param, success)
}

// 不能同步到物理世界的关系数据
export function notSyncRelationData(param, success) {
  let url = `${baseUrl}${stat}/unsyn-relation-count`
  http.postJson(url, param, success)
}

// 不能同步到物理世界的对象
export function notSyncObject(param, success) {
  // let url = `${baseUrl}${dictCustom}/data-count`
  let url = `${baseUrl}${component}/dict/data-count`
  http.postJson(url, param, success)
}

// 岗位和关联的资产信息点值不一致
export function postRelationInforAtpism(param, success) {
  let url = `${baseUrl}${stat}/eq2pe-count`
  http.postJson(url, param, success)
}

// 查询所有设备和部件的类型
export function getAllEqPaType(param, success) {
  let url = `${baseUrl}${classDef}/query-equip-comm-type`
  http.postJson(url, param, success)
}

/********************更换接口**************************/
// 查询空间信息
export function getZoneQuery(param, success) {
  let url = `${baseUrl}${classDef}/query-equip-comm-type`
  http.postJson(url, param, success)
}

//创建空间分类型
export function zoneCreateType(param, success) {
  let url = `${baseUrl}${object}/zone/create-type`
  http.postJson(url, param, success)
}

//创建空间分区对象
export function zoneCreate(param, success) {
  let url = `${baseUrl}${object}/zone/create`
  http.postJson(url, param, success)
}

//跟据id删除分区对象
export function zoneDelete(param, success) {
  let url = `${baseUrl}${object}/zone/delete`
  http.postJson(url, param, success)
}

//更新分区对象信息
export function zoneUpdate(param, success) {
  let url = `${baseUrl}${object}/zone/update`
  http.postJson(url, param, success)
}

//查询分区对象信息
export function zoneQuery(param, success) {
  let url = `${baseUrl}${object}/zone/query`
  http.postJson(url, param, success)
}

//查询分区对象轮廓线
export function zoneQueryOutline(param, success) {
  let url = `${baseUrl}${object}/zone/query-outline`
  // 12-14 接口改回之前
  // let url = `${baseUrl}${object}/zone/outline/query`
  http.postJson(url, param, success)
}

//更新分区对象轮廓线
export function zoneUpdateOutline(param, success) {
  // let url = `${baseUrl}${object}/zone/outline/update`
  // 12-14 接口改回之前
  let url = `${baseUrl}${object}/zone/update-outline`
  http.postJson(url, param, success)
}

//查询分区对象信息
export function zoneCount(param, success) {
  let url = `${baseUrl}${object}/zone/count`
  http.postJson(url, param, success)
}

//修改业务空间对象和建筑楼层的关系
export function handleZoneUpdateBd(param, success) {
  let url = `${baseUrl}${object}/zone/update-fl-bd`
  http.postJson(url, param, success)
}


//创建建筑信息
export function objectCreateBuild(param, success) {
  let url = `${baseUrl}${object}/building/create`
  http.postJson(url, param, success)
}

//更新建筑信息
export function objectUpdateBuild(param, success) {
  let url = `${baseUrl}${object}/building/update`
  http.postJson(url, param, success)
}

//查询建筑信息
export function objectQueryBuild(param, success) {
  let url = `${baseUrl}${object}/building/query`
  http.postJson(url, param, success)
}

//根据id删除建筑信息
export function objectDeleteBuild(param, success) {
  let url = `${baseUrl}${object}/building/delete`
  http.postJson(url, param, success)
}

//根据id删除建筑信息(该接口有删除失败的原因)
export function deleteBuildInfo(param, success) {
  let url = `${baseUrl}${object}/building/single/delete`
  http.postJson(url, param, success)
}

// 查询记录
export function problemQuery(param, success) {
  // let url = `${baseUrl}${dataCenter}/problems/query`
  let url = `${baseUrl}${scan}/task/problems/query`
  http.postJson(url, param, success)
}

// 关系-竖井所在建筑
export function shaftLinkBuild(param, success) {
    let url = `${baseUrl}${rel}/sh-in-bd/link-bd`
    http.postJson(url, param, success)
}

// 查询项目信息-全部或指定id
export function getAllProject(param, success) {
    let url = `${baseUrl}${object}/project/query/obj`
    http.postJson(url, param, success)
}

// 批量添加系统下的设备
export function sysBatchLinkEquip(param, success) {
    let url = `${baseUrl}${rel}/sy-in-eq/batch/equip`
    http.postJson(url, param, success)
}

// 下载报告-查询key值
export function queryDownloadsKey(param, success) {
    let url = `${baseUrl}${graphicUrl}/downloads/point/key`
    http.postJson(url, param, success)
}

// 设备所在空间占比统计
export function equipInSpacePer(param, success) {
    let url = `${baseUrl}${stat}/eq2sp`
    http.getJson(url, param, success)
}

// 下载报告-设备-未关联空间的设备
export function eqNotSp(param, success, name) {
    let url = `${baseUrl}${graphicUrl}/downloads/eq/not/sp`
    http.getDownload(url, param, success, name)
}

// 下载报告-统计项目下已有的设备,信息点，每个设备
export function dBindingPoint(param, success, name) {
    let url = `${baseUrl}${graphicUrl}/downloads/project/binding/point`
    http.getDownload(url, param, success, name)
}

// 下载报告-统计项目下已有的设备，以及静态和iot 信息点使用情况
export function dEquipCount(param, success, name) {
    let url = `${baseUrl}${graphicUrl}/downloads/project/equip/count`
    http.getDownload(url, param, success, name)
}

// 设备绑定的动态信息点或静态信息点
export function dEquipExport(param, success, name) {
    let url = `${baseUrl}${object}/equip/export`
    http.getDownload(url, param, success, name)
}

// 下载模板-设备静态信息维护模板
export function equipTemplate(param, success, name) {
    let url = `${baseUrl}${graphicUrl}/downloads/equip/template`
    http.getDownload(url, param, success, name)
}

// 系统绑定的动态信息点或静态信息点
export function dSystemExport(param, success, name) {
    let url = `${baseUrl}${object}/general-system/export`
    http.getDownload(url, param, success, name)
}
