// src/api/mes/lotoStation/lotoStation.ts
import request from '@/config/axios'

export interface LotoStationVO {
  lotoId?: number
  lotoName: string
  lotoCode: string
  lotoType?: string
  lotoStatus?: string
  lotoMap?: string
  remark?: string
  createTime?: Date
}

export interface PageParam {
  current: number
  size: number
  lotoName?: string
  lotoCode?: string
  lotoType?: string
}

// 查询锁定站列表
export const listLoto = async (params: PageParam) => {
  return await request.get({ url: '/iscs/loto-station/getLotoStationPage', params })
}

// 获取电柜详细信息
export const selectIsLotoStationById = async (id: number) => {
  return await request.get({ url: '/iscs/loto-station/selectLotoStationById', params: { id: id } })
}

// 获取电柜map解析数据
export const selectLotoMapById = async (id: number) => {
  return await request.get({ url: 'iscs/loto-station/selectLotoMapById', params: { lotoId: id } })
}

// 新增电柜
export const addLoto = async (data: LotoStationVO) => {
  return await request.post({ url: '/iscs/loto-station/insertLotoStation', data })
}

// 修改电柜
export const updateLoto = async (data: LotoStationVO) => {
  return await request.put({ url: '/iscs/loto-station/updateLotoStation', data })
}

// 删除电柜
export const delLoto = async (ids: number) => {
  return await request.delete({
    url: '/iscs/loto-station/deleteLotoStationList?ids='+ids,
  })
}

// 更新隔离点绑定关系
export const updatePointsBindingLoto = async (data: any) => {
  return await request.post({ url: '/iscs/loto-station/updatePointsBindingLoto', data })
}
