import request from "@/utils/request"
const api = "/mosty-api/mosty-base"
const api2 = "/mosty-api"
const api3 = "/mosty-wljc"
// 根据场所/建筑物/楼层查询平面图信息
export const selectPmtFloorConf = params => {
  return request({
    url: api2 + api3 + "/sbglPmt/selectPmtFloorConf",
    method: "GET",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    },
    params
  })
}

// 保存场所/建筑物/楼层的平面图关联信息
export const savePmtFloor = data => {
  return request({
    url: api2 + api3 + "/sbglPmt/savePmtFloor",
    method: "POST",
    data
  })
}

// 保存子设备位置信息
export const saveBjsssbConf = data => {
  return request({
    url: api2 + api3 + "/sbglPmt/saveBjsssbConf",
    method: "post",
    headers: {
      "Content-Type": "application/json;"
    },
    data
  })
}

// 查询配置的子设备位置信息
export const listBjsssbConf = params => {
  return request({
    url: api2 + api3 + "/sbglPmt/listBjsssbConf",
    method: "get",
    params
  })
}

// 清空场所/建筑物/楼层查询平面图信息
export const deletePmtFloor = data => {
  return request({
    url: api2 + api3 + `/sbglPmt/deletePmtFloor?floorid=${data.floorid}&buildingid=${data.buildingid}&placeid=${data.placeid}`,
    method: "POST",
    headers: {
      "content-Type": "application/json;charset=UTF-8;"
    },
  })
}

// 清空子设备位置信息
export const deleteBjsssbConf = data => {
  return request({
    url: api2 + api3 +  `/sbglPmt/deleteBjsssbConf?sbid=${data.sbid}&zsbid=${data.zsbid}`,
    method: "POST",
  })
}

// 查询子设备信息
export const listAttaInfo = data => {
  return request({
    url: api2 + api3 + "/sbglPmt/listAttaInfo",
    method: "POST",
    headers: {
      "Content-Type": "application/json;"
    },
    data
  })
}

// 查询子设备基础信息详情
export const getAttaBasicInfo = data => {
  return request({
    url: api2 + api3 + "/sbglPmt/getAttaBasicInfo",
    method: "POST",
    headers: {
      "Content-Type": "application/json;"
    },
    data
  })
}
