import request from '@/utils/request.js'

export const getTunnelList = (params) => {
  return request({
    url: '/tunnel/tunnel/screen/list',
    method: 'get',
    params
  })
}
export const getTunnelDetail = (tunnelId) => {
  return request({
    url: `/tunnel/tunnel/${tunnelId}`,
    method: 'get'
  })
}
export const addTunnel = (data) => {
  return request({
    url: '/tunnel/tunnel',
    method: 'post',
    data
  })
}
export const deleteTunnel = (tunnelIdList) => {
  return request({
    url: `/tunnel/tunnel/${tunnelIdList}`,
    method: 'delete'
  })
}
//设备信息列表
export const getEquipmentList = (tunnelId) => {
  return request({
    url: '/tunnel/equipment/equipments',
    method: 'get',
    params:{
      tunnelId:tunnelId
    }
  })
}
export const getEquipmentDetail = (equipmentId) => {
  return request({
    url: `/tunnel/equipment/?equipmentId=${equipmentId}`,
    method: 'get'
  })
}
export const editTunnel = (data) => {
  return request({
    url: '/tunnel/model/details',
    method: 'put',
    data
  })
}
export const editEquipment = (data) => {
  return request({
    url: '/tunnel/equipment/equipments',
    method: 'put',
    data
  })
}
export const getWindPressureSerialNumberOptions = (tunnelId) => {
  return request({
    url: '/tunnel/equipment/serialnumber/wind/pressure/options',
    method: 'get',
    params:{
      tunnelId:tunnelId
    }
  })
}
export const getOtherSensorSerialNumberOptions = (tunnelId) => {
  return request({
    url: '/tunnel/equipment/serialnumber/options',
    method: 'get',
    params:{
      tunnelId:tunnelId
    }
  })
}
//获取隧道中正在使用的序列号
export const getSerialNumberOnUse = (tunnelId) => {
  return request({
    url: '/tunnel/equipment/serialnumber/on/use',
    method: 'get',
    params:{
      tunnelId:tunnelId
    }
  })
}


//模拟隧道
export const getSimulateTunnelList = (params) => {
  return request({
    url: '/tunnel/simulate',
    method: 'get',
    params
  })
}
export const getSimulateTunnelDetail = (projectId) => {
  return request({
    url: `/tunnel/simulate/${projectId}`,
    method: 'get'
  })
}
export const addSimulateTunnel = (data) => {
  return request({
    url: '/tunnel/simulate',
    method: 'post',
    data
  })
}

export const editSimulateTunnel = (data) => {
  return request({
    url: '/tunnel/simulate/edit',
    method: 'post',
    data
  })
}

export const editSimulateEquipment = (data) => {
  return request({
    url: '/tunnel/simulate',
    method: 'put',
    data
  })
}
export const deleteSimulateTunnel = (projectIdList) => {
  return request({
    url: `/tunnel/simulate/${projectIdList}`,
    method: 'delete'
  })
}
export const getScreenSimulateTunnel = (projectId) => {
  return request({
    url: `/tunnel/simulate/equipment/${projectId}`,
    method: 'get'
  })
}