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 getEquipmentSerialNumberOptions = (tunnelId) => {
  return request({
    url: '/tunnel/tunnel/serialnumber/options',
    method: 'get',
    params:{
      tunnelId:tunnelId
    }
  })
}
