import request from '@/utils/request'

//机车信息管理列表查询
export function getLocomotiveList(data) {
    return request({
        url: '/baseVehicle/vehicleList',
        method: 'post',
        data
    })
}

//机车信息导出
export function exportBaseVehicle(data) {
    return request({
        method: 'post',
        url: '/baseVehicle/exportBaseVehicle',
        responseType: 'blob',
        data
    })
}

//机车信息模板下载
export function downloaExcel(url) {
    return request({
        method: 'get',
        url: url,
        responseType: 'blob',
        data: {}
    })
}

//删除
export function vehicleDelete(ids) {
    return request({
        method: 'get',
        url: `/baseVehicle/vehicleDelete/${ids}`
    })
}

//导入机车信息
export function importVehicle(params) {
  return request({
    method: 'post',
    url: '/baseVehicle/importBaseVehicle',
    data: params
  })
}

//新增机车信息
export function addVehicle(params){
    return request({
        method:'post',
        url:'/baseVehicle/vehicleAdd',
        data:params
    })
}

//修改机车信息
export function vehicleUpdate(params){
    return request({
        method:'post',
        url:'/baseVehicle/vehicleUpdate',
        data:params
    })
}

//车载终端挂载列表
export function vehicleTerminal(params){
    return request({
        method:'post',
        url:'/baseVehicle/vehicleTerminal',
        data:params
    })
}

//当前机车是否挂载终端
export function isMount(params){
    return request({
        method:'post',
        url:'/baseVehicle/isMount',
        data:params
    })
}
//车载终端挂载 保存
export function vehicleTerminalAdd(params){
    return request({
        method:'post',
        url:'/baseVehicle/vehicleTerminalAdd',
        data:params
    })
}
//车载终端取消挂载
export function vehicleTerminalUnmount(params){
    return request({
        method:'post',
        url:'/baseVehicle/vehicleTerminalUnmount',
        data:params
    })
}