import fetch from './fetch'
import {api, baseUrl, business, physics, venders, zone} from './config.js'
import http from './httpUtil'

let arithmetic = '/arithmetic'

var Comming = 'revit'
//获取打印标签模板test
export function getTest() {
  return fetch({ method: 'GET', url: `${api}/service/template/note_template` })
}

//查看扫楼日志接口

export function getBuildLog(
  param
) {
  let data = {
    "BeginTime": param.startTime,
    "Comming": Comming,
    "EndTime": param.endTime,
    "Filter": param.filter,
    "PageNum": param.pageNum,
    "PageSize": param.pageSize,
    "ProjId": param.ProjId,
    "UserId": param.UserId
  }
  return fetch({ method: 'POST', url: `${api}/service/user_log/query`, data })
}

//下载扫楼日志接口

export function dowmloadLog(
  param
) {
  let data = {
    "BeginTime": param.startTime,
    "Comming": Comming,
    "EndTime": param.endTime,
    "Filter": param.filter,
    "ProjId": param.ProjId,
    "UserId": param.UserId
  }
  return fetch({ method: 'POST', url: `${api}/service/user_log/export`, data })
}

//获取扫楼用户表格
export function getUser(
  param
) {
  let data = {
    "Comming": Comming,
    "Filter": param.filter,
    "PageNum": param.pageNum,
    "PageSize": param.pageSize,
    "ProjId": param.ProjId,
    "UserId": param.UserId
  }
  return fetch({ method: 'POST', url: `${api}/service/user/query`, data })
}

//修改扫楼用户
export function loadUser(
  param
) {
  let data = {
    "Comming": Comming,
    "ProjId": param.ProjId,
    "UserId": param.UserId,
    "UserList": param.UserList
  }
  return fetch({ method: 'POST', url: `${api}/service/user/update`, data })
}

//删除扫楼用户
export function delUser(
  param
) {
  let data = {
    "Comming": Comming,
    "ProjId": param.ProjId,
    "UserId": param.UserId,
    "UserList": param.UserList
  }
  return fetch({ method: 'POST', url: `${api}/service/user/delete`, data })
}

//添加扫楼用户
export function addUser(
  param
) {
  let data = {
    "Comming": Comming,
    "ProjId": param.ProjId,
    "UserId": param.UserId,
    "User": param.User
  }
  return fetch({ method: 'POST', url: `${api}/service/user/create`, data })
}

//根据项目ID获得建筑列表
export function getBuildSelect(param) {
  let data = {
    "Comming": Comming,
    "ProjId": param.ProjId,
    "UserId": param.UserId,
  }
  return fetch({ method: 'POST', url: `${api}/service/building/query`, data })
}

//根据建筑ID获取楼层系信息
export function getFloor(param) {
  let data = {
    "Comming": Comming,
    "ProjId": param.ProjId,
    "UserId": param.UserId,
    "BuildId": param.BuildId
  }
  return fetch({ method: 'POST', url: `${api}/service/building/floor`, data })
}

//获取异常资产接口
export function getErrAssets(param) {
  let data = {
    "Comming": Comming,
    "ProjId": param.ProjId,
    "UserId": param.UserId,
    "BuildId": param.BuildId,
    "PageNum": param.PageNum,
    "PageSize": param.PageSize,
    "Type": param.Type,
    "CodeType": param.CodeType
  }
  if (param.BuildId == 'all') {
    delete data.BuildId
  }

  if (!param.CodeType) {
    delete data.CodeType
  }
  return fetch({ method: 'POST', url: `${api}/service/fm/exception`, data })
}

//删除资产接口
export function delErrAssets(param, paramList) {
  let data = {
    "Comming": Comming,
    "ProjId": param.ProjId,
    "UserId": param.UserId,
    "FmList": paramList
  }
  return fetch({ method: 'POST', url: `${api}/service/fm/delete`, data })
}

//根据选择的建筑楼层时间查询点位标签
export function getPT(param) {
  let data = {
    "Comming": Comming,
    "ProjId": param.ProjId,
    "UserId": param.UserId,
    "EndTime": param.EndTime,
    "BuildId": param.BuildId,
    "FloorId": param.FloorId
  }
  if (data.FloorId == 'all') {
    delete data.FloorId
  } else if (data.FloorId == "noKnow") {
    data.FloorId = ""
  }
  return fetch({ method: 'POST', url: `${api}/service/fm/point_group`, data })
}

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

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

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

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

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


//点位标签查看详情
export function getPoint(param) {
  let data = {
    "Comming": Comming,
    "ProjId": param.ProjId,
    "UserId": param.UserId,
    "PointId": param.PointId,
  }
  return fetch({ method: 'POST', url: `${api}/service/point/query`, data })
}

//点位标签详情修改
export function updatePoint(param) {
  let data = {
    "Comming": Comming,
    "ProjId": param.ProjId,
    "UserId": param.UserId,
    "PointList": [param.PointList],
  }
  return fetch({ method: 'POST', url: `${api}/service/point/update`, data })
}

//点击点位标签获取tab设备族列表
export function getTabFamily(param) {
  let data = {
    "Comming": Comming,
    "ProjId": param.ProjId,
    "UserId": param.UserId,
    "BeginTime": param.BeginTime,
    "EndTime": param.EndTime,
    "FloorId": param.FloorId,
    "Checked": param.Checked,
    "BuildId": param.BuildId,
    "PointId": param.PointId
  }
  if (data.PointId == 'all') {
    delete data.PointId
  }
  if (data.FloorId == 'all') {
    delete data.FloorId
  } else if (data.FloorId == "noKnow") {
    data.FloorId = ""
  }
  return fetch({ method: 'POST', url: `${api}/service/fm/family_list`, data })
}

//获取表格数据的title
export function getTableHeader(param) {
  let data = {
    "AppType": Comming,
    "Code": param.code,
    "ProjId": param.ProjId
  }
  return fetch({ method: 'POST', url: `${api}/service/dict/infocode_query`, data })
}

//获取表格主体内容
export function getTableMain(param) {
  let data = {
    "BeginTime": param.BeginTime,
    "BuildId": param.BuildId,
    "Checked": param.Checked,
    "Comming": Comming,
    "EndTime": param.EndTime,
    "Family": param.Family,
    "FloorId": param.FloorId,
    "PageNum": param.PageNum,
    "PageSize": param.PageSize,
    "PointId": param.PointId,
    "ProjId": param.ProjId,
    "UserId": param.UserId
  }
  if (data.PointId == 'all') {
    delete data.PointId
  }
  if (data.Checked === '') {
    delete data.Checked
  }
  return fetch({ method: 'POST', url: `${api}/service/fm/query`, data })
}

export function getPointList(param, success) {
  let url = `${api}/service/point/queryByIdList`
  let data = param
  data.Comming = Comming
  http.postJson(url, data, success)
}

export function getdelMain(param) {
  let data = {
    "BeginTime": param.BeginTime,
    "BuildId": param.BuildId,
    "Checked": param.Checked,
    "CodeType": param.CodeType,
    "Comming": Comming,
    "EndTime": param.EndTime,
    "Family": param.Family,
    "FloorId": param.FloorId,
    "PageNum": param.PageNum,
    "PageSize": param.PageSize,
    "PointId": param.PointId,
    "ProjId": param.ProjId,
    "UserId": param.UserId
  }
  if (data.PointId == 'all') {
    delete data.PointId
  }
  if (data.Checked === '') {
    delete data.Checked
  }
  if (data.FloorId == 'all') {
    delete data.FloorId
  }
  return fetch({ method: 'POST', url: `${api}/service/fm/queryRevit`, data })
}

export function getTestEquire() {
  let data = {
    "Comming": "revit",
    "FloorId": "Fl110108000327d8f006c39f49feb40e24a7ef223232",
    "ProjId": "Pj1101080003",
    "UserId": "string"
  }
  return fetch({ method: 'POST', url: `${api}/service/fm/query`, data })
}

//批量更新表格数据
export function upDateTableMain(param, paramList) {
  let data = {
    "Comming": Comming,
    "FmList": paramList,
    "ProjId": param.ProjId,
    "UserId": param.UserId
  }
  return fetch({ method: 'POST', url: `${api}/service/fm/update`, data })
}

//获取所有设备族/service/dict/equipment_family
export function getAllFamily() {
  return fetch({ method: 'GET', url: `${api}/service/dict/equipment_family` })
}

//获取当前默认楼层/service/fm/default_floor
export function defaultFloor(param) {
  let data = {
    "Comming": Comming,
    "ProjId": param.ProjId,
    "UserId": param.UserId
  }
  return fetch({ method: 'POST', url: `${api}/service/fm/default_floor`, data })
}

//物理世界新建岗位（设备系统）
export function createPost(param) {
  let data = {
    "building_id": param.BuildId,
    "floor_id": param.BIMID,
    "equipment_category": param.category,
    "infos": {
      "BIMID": [
        { "value": param.BIMID }
      ],
      "BIMLocation": [
        { "value": param.BIMLocation }
      ]
    }
  }
  return fetch({ method: 'POST', url: `${godhand}/equipment/create?projectId=${param.perjectId}&secret=${param.secret}`, data })
}


//物理世界新建岗位（部件）
export function createComponent(param) {
  let data = {
    "building_id": param.BuildId,
    "component_category": param.category,
    "floor_id": param.BIMID,
    "infos": {
      "BIMID": [
        { "value": param.BIMID }
      ],
      "BIMLocation": [
        { "value": param.BIMLocation }
      ]
    }
  }
  return fetch({ method: 'POST', url: `${physics}/component/create?projectId=${param.perjectId}&secret=${param.secret}`, data })
}

//通过岗位id查询元空间id
export function getSpaceId(param) {
  let data = {
    "criterias": param.list
  }
  return fetch({ method: 'POST', url: `${physics}/relation/query?projectId=${param.perjectId}&secret=${param.secret}`, data })
}

//通过元空间id查询元空间名称
export function getSpaceName(param) {
  let data = {
    "criterias": param.list
  }
  return fetch({ method: 'POST', url: `${physics}/object/batch_query?projectId=${param.perjectId}&secret=${param.secret}`, data })
}


//设备族修改显示接口
export function setHeader(param) {
  let data = {
    "Comming": Comming,
    "InfoType": param.FamilyId,
    "InfopointCode": param.code,
    "ProjId": param.perjectId,
    "UserId": param.UserId,
    "Visible": param.Visible
  }
  return fetch({ method: 'POST', url: `${api}/service/dict/infopoint_visible`, data })
}

//获取头部接口
export function getHeader(param) {
  let data = {
    "AppType": Comming,
    "Code": param.code,
    "ProjId": param.perjectId
  }
  // return fetch({ method: 'POST', url: `${api}/service/dict/equipment_family_info_header`, data })
  return fetch({ method: 'POST', url: `${api}/service/dict/infocode_query_header`, data })
}


/** 业务空间相关 */

// 业务空间
export function getSpaceHeader(param) {
  return fetch({ method: 'GET', url: `${physics}/infocode/query_property?projectId=${param.ProjId}&type=${param.code ? param.code : 'space'}&enrich=true` })
}


//获取某个业务空间下的
export function getAllbusiness(param) {
  let data = null
  if (!!param.id) {
    data = {
      "criteria": {
        "id": param.id,
        "type": param.type
      }
    }
  } else {
    data = param.data
  }
  return fetch({ method: "POST", url: `${physics}/object/subset_query?projectId=${param.ProjId}&secret=${param.secret}`, data })
}

//通过BIMID获取物理世界id
export function formBIMToPri(param) {
  let data = {
    "criteria": {
      "type": param.type,
      "BIMID": param.ids
    }
  }
  return fetch({ method: "POST", url: `${physics}/fast/object/in_query?projectId=${param.ProjId}&secret=${param.secret}`, data })
}

//获取业务空间楼层的关系
export function getSpaceFloor(param) {
  return fetch({ method: "POST", url: `${business}/floor/tree?projectId=${param.ProjId}&secret=${param.secret}` })
}

//创建业务空间
export function createBusiness(param) {
  let data = param.data
  return fetch({ method: "POST", url: `${physics}/space/create?projectId=${param.ProjId}&secret=${param.secret}`, data })
  // return fetch({ method: "POST", url: `/test/space/create?projectId=${param.ProjId}&secret=${param.secret}`, data })
}

//批量创建业务空间
export function createBusinessList(param) {
  let data = param.data
  return fetch({ method: "POST", url: `${physics}/space/batch/create?projectId=${param.ProjId}&secret=${param.secret}`, data })
}

//更新业务空间
export function updateBusiness(param) {
  let data = param.data
  return fetch({ method: "POST", url: `${physics}/object/batch_update?projectId=${param.ProjId}&secret=${param.secret}`, data })
}

//模糊搜索设备类型
export function searchCode(param) {
  let data = param
  return fetch({ method: "POST", url: `${physics}/dict/query/equipment_all`, data })
}

//获取所有设备类型
export function getEqCode() {
  return fetch({ method: "GET", url: `${physics}/dict/query/equipment_all` })
}

//批量删除业务空间
export function delManySpace(param) {
  let data = param.data
  return fetch({ method: "POST", url: `${physics}/space/batch/delete?projectId=${param.ProjId}&secret=${param.secret}`, data })
}

//添加关系
export function createRelation(param) {
  let data = param.data
  return fetch({ method: "POST", url: `${physics}/relation/create?projectId=${param.ProjId}&secret=${param.secret}`, data })
}

//获取图实例关系
export function getGraphyId(param) {
  let data = {
    "graph_type": param.type
  }
  return fetch({ method: "POST", url: `${physics}/relation/graph_instance/get?projectId=${param.ProjId}&secret=${param.secret}`, data })
}

//查询业务空间
export function getBussines(param) {
  let data = param.data
  return fetch({ method: "POST", url: `${physics}/object/outside_query?projectId=${param.ProjId}&secret=${param.secret}`, data })
  // return fetch({ method: "POST", url: `/test/object/outside_query?projectId=${param.ProjId}&secret=${param.secret}`, data })
}

//替代前一个接口
export function getBussines2(param) {
  let data = param.data
  return fetch({ method: "POST", url: `${physics}/fast/object/in_query?projectId=${param.ProjId}&secret=${param.secret}`, data })
}

//查询业务空间下的元空间
export function getRelation(param) {
  let data = param.criterias
  return fetch({ method: 'POST', url: `${physics}/relation/query?projectId=${param.ProjId}&secret=${param.secret}`, data })
}

//查询业务空间下的设备
export function getSpaceEquip(param) {
  let data = param.data
  return fetch({ method: 'POST', url: `${business}/space/equip/query?projectId=${param.ProjId}&secret=${param.secret}`, data })
}

//删除关系实例
export function deleteRelation(param) {
  let data = param.data
  return fetch({ method: 'POST', url: `${physics}/relation/delete?projectId=${param.ProjId}&secret=${param.secret}`, data })
}

//查询是否关联元空间的业务空间
export function isSpaceBuss(param) {
  let data = param.data
  return fetch({ method: 'POST', url: `${business}/floor/space/query?projectId=${param.ProjId}&secret=${param.secret}`, data })
}

//查询所有提示
export function getAllMess(param) {
  let data = {}
  return fetch({ method: 'POST', url: `${physics}/space/affected/query?projectId=${param.ProjId}&secret=${param.secret}`, data })
}

//删除提示
export function deleteNotice(param) {
  let data = param.data
  return fetch({ method: 'POST', url: `${physics}/space/affected/delete_notice?projectId=${param.ProjId}&secret=${param.secret}`, data })
}

//模糊查询楼层下的设备
export function getEquipSearch(param) {
  let data = param.data
  return fetch({ method: 'POST', url: `${business}/floor/equip/query?projectId=${param.ProjId}&secret=${param.secret}`, data })
}

export function getBussTypes(success) {
  http.getJson(`${physics}/infocode/business_space_type/query`, {}, success)
}

export function getBussTypes2() {
  return fetch({ method: 'GET', url: `${physics}/infocode/business_space_type/query` })
}




//验证元空间是否相邻
export function isAbut(param) {
  let data = param.data
  return fetch({ method: 'POST', url: `${business}/space/abut?projectId=${param.ProjId}&secret=${param.secret}`, data })
}

/**算法接口 */
export function strDiff(param) {
  let data = param
  return fetch({ method: 'POST', url: `${arithmetic}/str_diff`, data })
}


/********* 台账部分  厂商库接口 */
//获取供应商列表
export function getManuLib(param, success) {
  let data = param
  http.postJson(`${venders}/supplier/query`, data, success)
}

//查询所有供应商信息
export function getLib(param) {
  let data = param
  return fetch({ method: 'POST', url: `${venders}/auxiliary/query/all`, data })
}

//查询资产的list
export function getPropertyList(param, success) {
  let data = param.data
  let url = `${physics}/property/relation_query?projectId=${param.ProjId}&secret=${param.secret}`
  http.postJson(url, data, success)
}

//获取资产种族编码query/equipment_family
export function getEquipmentFamily(success) {
  let url = `${physics}/dict/query/equipment_family`
  http.getJson(url, {}, success)
}

//删除资产
export function delProperty(param, success) {
  let url = `${physics}/property/delete?projectId=${param.ProjId}&secret=${param.secret}`
  let data = param.data
  http.postJson(url, data, success)
}

//获取制定供应商下的供应合同编号
export function getListForSupplier(param, success) {
  let url = `/venders-dp/supplier/property/query?projectId=${param.ProjId}&secret=${param.secret}`
  let data = param.data
  http.postJson(url, data, success)
}

//获取保单列表
export function getListForGuarantee(param, success) {
  let url = `/venders-dp/insurance/contract/query`
  let data = param.data
  http.postJson(url, data, success)
}

//新建保单
export function createGuarantee(param, success) {
  let url = `${venders}/insurance/contract/create `
  let data = param.data
  http.postJson(url, data, success)
}

//创建资产
export function createProperty(param, success) {
  let url = `${physics}/property/create?projectId=${param.ProjId}&secret=${param.secret}`
  let data = param.data
  http.postJson(url, data, success)
}

//获取项目内[岗位]和[绑定岗位的资产]的数量
export function getNumber(param, success) {
  let url = `${business}/equip/count?projectId=${param.ProjId}&secret=${param.secret}`
  let data = param.data
  http.postJson(url, data, success)
}

//获取项目内有实例的所有种族
export function getFamilyList(param, success) {
  let url = `${business}/equip/type/list?projectId=${param.ProjId}&secret=${param.secret}`
  let data = param.data
  http.postJson(url, data, success)
}

//删除系统、设备
export function delSystem(param, success) {
  let url = `${physics}/equipment/delete?projectId=${param.ProjId}&secret=${param.secret}`
  let data = param.data
  http.postJson(url, data, success)
}


//创建系统设备
export function createSystem(param, success) {
  let url = `${physics}/equipment/create?projectId=${param.ProjId}&secret=${param.secret}`
  let data = param.data
  http.postJson(url, data, success)
}


//获取台账资产列表
export function getBillPropList(param, success) {
  let url = `${business}/property/list?projectId=${param.ProjId}&secret=${param.secret}`
  let data = param.data
  http.postJson(url, data, success)
}

//台账获取设备列表
export function getBillEquipList(param, success) {
  let url = `${business}/equip/list?projectId=${param.ProjId}&secret=${param.secret}`
  let data = param.data
  http.postJson(url, data, success)
}

//台账获取系统列表
export function getBillSystemList(param, success) {
  let url = `${business}/system/list?projectId=${param.ProjId}&secret=${param.secret}`
  let data = param.data
  http.postJson(url, data, success)
}

//台账获取系统关联的设备
export function getSysToEq(param, success) {
  let url = `${physics}/object/rel_query?projectId=${param.ProjId}&secret=${param.secret}`
  let data = param.data
  http.postJson(url, data, success)
}

//按生产商名, 品牌名, 型号名模糊查询型号
export function getSpecList(param, success) {
  let url = `${venders}/manufacturer/specification/query_spec`
  let data = param
  http.postJson(url, data, success)
}

//按品牌名称和生厂商名称模糊查询品牌
export function getBrandList(param, success) {
  let url = `${venders}/manufacturer/brand/queryByName`
  let data = param
  http.postJson(url, data, success)
}

//按名称模糊查询生产商
export function getManufacturerList(param, success) {
  let url = `${venders}/manufacturer/queryByName`
  let data = param
  http.postJson(url, data, success)
}

//台账根据设备id创建岗位
export function EqToAssets(param, success) {
  let url = `${physics}/property/create_by_equip?projectId=${param.ProjId}&secret=${param.secret}`
  let data = param.data
  http.postJson(url, data, success)
}

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

//获取设定参数和动态参数
export function BeatchQueryParam(param, success) {
  let url = `${physics}/parameter/batch_query_param?projectId=${param.ProjId}&secret=${param.secret}`
  let data = param.data
  http.postJson(url, data, success)
}

export function BatchCreateSome(param, success) {
  let url = `${physics}/equipment/batch/create?projectId=${param.ProjId}&secret=${param.secret}`
  let data = param.data
  http.postJson(url, data, success)
}

export function delBatchList(param, success) {
  let url = `${physics}/equipment/batch/delete?projectId=${param.ProjId}&secret=${param.secret}`
  let data = param.data
  http.postJson(url, data, success)
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

//删除租户信息
export function deleteRentTableData(param, success) {
  let url = `${baseUrl}/datacenter/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}/equip-component/tenant/tenant-building-floor?objectType=${param.objectType}&tenantId=${param.tenantId}`
    http.postJson(url, {}, success)
}

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

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

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

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

//扫楼创建资产
export function createFmList(param, success) {
  let url = `${api}/service/fm/create`
  param.Comming = Comming
  http.postJson(url, param, success)
}

export function createAssetsList(param, success) {
  let url = `${api}/service/fm/create_list`
  param.Comming = Comming
  http.postJson(url, param, success)
}

export function getListForBuss(param, success) {
  let url = `${business}/space/ispace/equip/query?projectId=${param.ProjId}&secret=${param.secret}`
  let data = param.data
  http.postJson(url, data, success)
}

//获取产品list
export function getProductList(param, success) {
  let url = `${venders}/manufacturer/product/queryByType`
  http.postJson(url, param, success)
}

//完全匹配的厂商信息
export function getBasicMatch(param) {
  let data = param
  return fetch({ method: 'POST', url: `${venders}/basic/autoFillId`, data })
}

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

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

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

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

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

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

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

//all - 查询数据字典 --列表表头
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 - 查询数据字典 --列表表头
export function cacheDictionary(param, success) {
  let url = `${baseUrl}/datacenter/class-def/query-dict`;
  http.postJson(url, param, success)
}

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

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

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

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

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

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

//设备清单 - 更新部件
export function updateParts(param, success) {
  let url = `${baseUrl}/datacenter/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}/equip-component/equip-query/creat-equip-pro`;
  http.postJson(url, param, success)
}

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

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

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

//查询系统信息 - 建筑楼层 - 系统一对多
export function querySysLinkBuild(param, success) {
    let url = `${baseUrl}/datacenter/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/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`;
  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}/datacenter/equip/count`;
  http.postJson(url, param, success)
}

//设备清单 - 查询设备信息
export function queryEquip(param, success) {
  let url = `${baseUrl}/datacenter/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}/equip-component/equip-query/equip-category-property?category=${param.category}${param.spaceIdList?param.spaceIdList:''}`;
  let data = param.data;
  http.postJson(url, data, success)
}

//批量添加设备和资产的关系
export function equipRproperty(param, success) {
  let url = `${baseUrl}/equip-component/equip-query/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 data = param.data;
  http.postJson(url, data, success)
}

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

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

// 修改设备的附件功能
export function queryUpdate(param, success) {
  let url = `${baseUrl}/equip-component/equip-query/update`;
  http.postJson(url, param, success)
}
// 修改资产的附件功能
export function propertyUpdate(param, success) {
  let url = `${baseUrl}/equip-component/property/update`;
  http.postJson(url, param, success)
}
//查询资产 同时关联设备信息
export function propertyLinkEq(param, success) {
  let url = `${baseUrl}/equip-component/property/property-query`;
  http.postJson(url, param, success)
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// 统计设备信息点与总数据占比
export function infoPoint(param, success) {
  let url = `${baseUrl}/equip-component/equip-query/info-point`;
  http.postJson(url, param, success)
}
// 统计系统信息点与需采集数据占比
export function systemInfoPoint(param, success) {
  let url = `${baseUrl}/equip-component/equip-query/system-info-point`;
  http.postJson(url, param, success)
}
//根据条件查询统计数量
export function countGeneralSys(param, success) {
    let url = `${baseUrl}/datacenter/general-system/count`;
    http.postJson(url, param, success)
}

//头部信息查询(查询所有设备类型-所有部件类型-所有系统类型-所有专业类型)
export function queryPhysicsAllType(param, success) {
  let url = `${baseUrl}/datacenter/class-def/category?type=${param}`;
  http.postJson(url, {}, 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}/datacenter/class-def/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}/equip-component/equip-query/zone-query`;
  http.postJson(url, param, success)
}

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

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

//查询部件
export function partsQuery(param, success) {
  let url = `${baseUrl}/datacenter/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 floorQuery(param, success) {
  let url = `${baseUrl}/datacenter/floor/query`;
  http.postJson(url, param, success)
}

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

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

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

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

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

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

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

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

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

//根据条件查询统计数量
export function countZone(param, success) {
  let data = param.data
  let url = `${baseUrl}/datacenter/${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}/datacenter/graphic/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}/datacenter/floor/create`;
  http.postJson(url, param, success)
}

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

//建筑楼层管理-修改楼层
export function manageUpdateFloor(param, success) {
  let url = `${baseUrl}/datacenter/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 queryBaseGraphy(param, success) {
  let url = `/modelapi/base-graph/query`;
  http.postJson(url, param, success)
}
//楼层接口-----更新楼层信息
export function floorUpdate(param, success) {
  let url = `${baseUrl}/datacenter/floor/update`;
  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}/datacenter/eq-in-sh/unlink`;
  http.postJson(url, param, success)
}
//根据对象删除系统所在竖井关系，只针对一个对象
export function syinshUnlink(param, success) {
  let url = `${baseUrl}/datacenter/sy-in-sh/unlink`;
  http.postJson(url, param, success)
}
//根据对象删除竖井的贯通关系，只针对一个对象
export function shthroughshUnlink(param, success) {
  let url = `${baseUrl}/datacenter/sh-through-sh/unlink`;
  http.postJson(url, param, success)
}
//查询没有和当前系统关联的设备
export function unSysEq(param, success) {
    let data = param.data
    let url = `${baseUrl}/datacenter/general-system/un-sys-equip?sysId=${param.sysId}`;
    http.postJson(url, data, success)
}
//查询没有和当前系统关联的竖井
export function unSysShaft(param, success) {
    let data = param.data
    let url = `${baseUrl}/datacenter/general-system/un-sys-shaft?sysId=${param.sysId}`;
    http.postJson(url, data, success)
}
//查询没有和当前系统关联的业务空间
export function unSysZoneSpace(param, success) {
    let data = param.data
    let url = `${baseUrl}/datacenter/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}/equip-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}/equip-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}/equip-component/shaft/unshaft-in-sys?shaftId=${param.shaftId}`;
  http.postJson(url, data, success)
}
//设备所在的竖井，竖井一对多，此方不会覆盖以前的记录，累计添加
export function linkEqSh(param, success) {
  let url = `${baseUrl}/datacenter/eq-in-sh/link-eq-sh`;
  http.postJson(url, param, success)
}
//创建系统下的设备关系
export function linkSysEq(param, success) {
    let url = `${baseUrl}/datacenter/general-system/link-equip`;
    http.postJson(url, param, success)
}
//竖井的贯通，竖井一对多，此方法不会覆盖以前的记录
export function linkShaft(param, success) {
  let url = `${baseUrl}/datacenter/sh-through-sh/link-shaft`;
  http.postJson(url, param, success)
}
//系统所在的竖井，竖井一对多，累计添加，此方法不会覆盖以前记录
export function linkSySh(param, success) {
  let url = `${baseUrl}/datacenter/sy-in-sh/link-sy-sh`;
  http.postJson(url, param, success)
}
//创建系统所在业务空间关系
export function linkSysSp(param, success) {
  let url = `${baseUrl}/datacenter/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}/datacenter/sy-in-sh/link-sy-shs`;
  http.postJson(url, param, success)
}
//根据对象删除系统和设备的关系，只针对一个对象
export function eqInSysUnlink(param, success) {
  let url = `${baseUrl}/datacenter/sy-in-eq/unlink`;
  http.postJson(url, param, success)
}
//根据对象删除系统所在业务空间关系
export function spaceInSysUnlink(param, success) {
  let url = `${baseUrl}/datacenter/sy-in-sp-base/unlink-list?type=${param.type}`;
  http.postJson(url, param.data, success)
}
//关系-----设备所在业务空间--删除关系
export function eqInSpaceDelete(param, success) {
  let url = `${baseUrl}/datacenter/eq-in-sp-base/unlink-list?type=${param.type}`;
  http.postJson(url, param.data, success)
}
//关系-----设备所在业务空间--创建关系
export function eqInSpaceCreate(param, success) {
  let url = `${baseUrl}/datacenter/eq-in-sp-base/link-eq-sp?type=${param.type}`;
  http.postJson(url, param.data, success)
}
//关系-----设备服务业务空间--删除关系
export function eqForSpaceDelete(param, success) {
  let url = `${baseUrl}/datacenter/eq-for-sp-base/unlink-list?type=${param.type}`;
  http.postJson(url, param.data, success)
}
//关系-----设备服务业务空间--创建关系
export function eqForSpaceCreate(param, success) {
  let url = `${baseUrl}/datacenter/eq-for-sp-base/link-eq-sp?type=${param.type}`;
  http.postJson(url, param.data, success)
}
//关系-----系统所在业务空间--删除关系
export function syInSpaceDelete(param, success) {
  let url = `${baseUrl}/datacenter/sy-in-sp-base/unlink-list?type=${param.type}`;
  http.postJson(url, param.data, success)
}
//关系-----系统所在业务空间--创建关系
export function syInSpaceCreate(param, success) {
  let url = `${baseUrl}/datacenter/sy-in-sp-base/link-sp-sys?type=${param.type}`;
  http.postJson(url, param.data, success)
}
//关系-----没有和当前空间绑定的设备
export function notEqInSpaceQuery(param, success) {
  let url = `${baseUrl}/equip-component/space/unspace-in-eq?type=${param.type}&spaceId=${param.spaceId}`;
  http.postJson(url, param.data, success)
}
//关系-----未服务当前空间的设备
export function notEqForSpaceQuery(param, success) {
  let url = `${baseUrl}/equip-component/space/unspace-for-eq?type=${param.type}&spaceId=${param.spaceId}`;
  http.postJson(url, param.data, success)
}
//关系-----没有和当前空间绑定的系统
export function notSyInSpaceQuery(param, success) {
  let url = `${baseUrl}/equip-component/space/unspace-in-sys?type=${param.type}&spaceId=${param.spaceId}`;
  http.postJson(url, param.data, success)
}
//关系-----空间内没有和空间关联的设备 根据坐标计算(专用接口)
export function getEqNotInSpace(param, success) {
  let url = `${baseUrl}/equip-component/space/unspace-fIn-eq-point?spaceId=${param.spaceId}&type=${param.type}`;
  http.postJson(url, param.data, success)
}
//关系-----空间内没有服务空间的设备 根据坐标计算(专用接口)
export function getEqNotForSpace(param, success) {
  let url = `${baseUrl}/equip-component/space/unspace-for-eq-point?spaceId=${param.spaceId}&type=${param.type}`;
  http.postJson(url, param.data, success)
}
//关系-----未关联业务空间的元空间
export function getIspNotInSpace(param, success) {
  let url = `${baseUrl}/equip-component/space/unspace-ispace?objectType=${param.objectType}`;
  http.postJson(url, param.data, success)
}
//关系-----统计 属于多建筑楼层的空间数据
export function getSpaceBdFlCount(param, success) {
	let url = `${baseUrl}/equip-component/space/space-bd-fl`;
	http.postJson(url, param, success)
}
//关系-----统计 属于多建筑楼层的空间数据
export function getSpaceBdFlData(param, success) {
	let url = `${baseUrl}/equip-component/space/space-bd-fl-data`;
	http.postJson(url, param, success)
}
//关系-----业务空间内的元空间，业务空间一对多,累计添加会覆盖以前记录
export function createRelateInZoneAndISp(param, success) {
  let url = `${baseUrl}/datacenter/si-in-sp-base/link-sp?type=${param.type}`;
  http.postJson(url, param.data, success)
}
//关系-----业务空间内的元空间，创建业务空间内的元空间关系, 累计添加不会覆盖-批量关联
export function groupCreRelaZoneAndISp(param, success) {
  let url = `${baseUrl}/datacenter/si-in-sp-base/link-list?type=${param.type}`;
  http.postJson(url, param.data, 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}/datacenter/sh-contain-sp-base/space-type-query?shaftId=${param.shaftId}`;
  http.postJson(url, param, success)
}
//关系-----竖井下的业务空间，竖井一对多，此方法不会覆盖以前的记录
export function shaftZoneLink(param, success) {
  let url = `${baseUrl}/datacenter/sh-contain-sp-base/link-shsps?type=${param.type}`;
  http.postJson(url, param.data, success)
}
//关系-----竖井下的业务空间，竖井一对多，此方法会覆盖以前的记录
export function shaftZoneLinkReplace(param, success) {
  let url = `${baseUrl}/datacenter/sh-contain-sp-base/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 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, 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}/datacenter/floor/query`
  http.postJson(url, param, success)
}

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

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

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

// 查询所有设备和部件的类型
export function getAllEqPaType(param, success) {
  let url = `${baseUrl}/datacenter/class-def/query-equip-comm-type`
  http.postJson(url, param, success)
}
/********************更换接口**************************/
// 查询空间信息
export function getZoneQuery(param,success) {
let url = `${baseUrl}/datacenter/class-def/query-equip-comm-type`
  http.postJson(url,param,success)
}
//创建空间分类型
export function zoneCreateType(param,success) {
  let url = `${baseUrl}/datacenter/object/zone/create-type`
  http.postJson(url,param,success)
}
//创建空间分区对象
export function zoneCreate(param,success) {
  let url = `${baseUrl}/datacenter/object/zone/create`
  http.postJson(url,param,success)
}

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

//更新分区对象信息
export function zoneUpdate(param,success) {
  let url = `${baseUrl}/datacenter/object/zone/update`
  http.postJson(url,param,success)
}
//查询分区对象信息
export function zoneQuery(param,success) {
  let url = `${baseUrl}/datacenter/object/zone/query`
  http.postJson(url,param,success)
}
//查询分区对象信息
export function zoneCount(param,success) {
  let url = `${baseUrl}/datacenter/object/zone/count`
  http.postJson(url,param,success)
}
//修改业务空间对象和建筑楼层的关系
export function handleZoneUpdateBd(param,success) {
  let url = `${baseUrl}/datacenter/object/zone/update-fl-bd`
  http.postJson(url,param,success)
}


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

//更新建筑信息
export function objectUpdateBuild(param, success) {
  let url = `${baseUrl}/datacenter/object/building/update`
  http.postJson(url, param, success)
}
//查询建筑信息
export function objectQueryBuild(param, success) {
  let url = `${baseUrl}/datacenter/object/building/query`
  http.postJson(url, param, success)
}
//根据id删除建筑信息
export function objectDeleteBuild(param, success) {
  let url = `${baseUrl}/datacenter/object/building/delete`
  http.postJson(url, param, success)
}

