/**
 * 路线信息管理接口
 */
import request from '@/utils/request'
import qs from 'qs'
// 路线信息查询
export function getRouteInfoList(params) {
  return request({
    url: '/car/busRouteInfo/listPage',
    method: 'get',
    params
  })
}
// 路线信息详情查询
export function getRouteInfo(id) {
  return request({
    url: '/car/busRouteInfo/detail/' + id,
    method: 'get',
    params: {
    }
  })
}
// 新增路线基础信息
export function addRouteInfo(params) {
  return request({
    url: '/car/busRouteInfo/add',
    method: 'post',
    params
  })
}
// 修改路线信息
export function updateRouteInfo(params) {
  return request({
    url: '/car/busRouteInfo/update',
    method: 'post',
    params
  })
}
// 删除路线信息
export function delRouteInfo(id) {
  return request({
    url: '/car/busRouteInfo/delete',
    method: 'get',
    params: {
      busRouteInfoId: id
    }
  })
}
// 查询未关联车辆列表
export function listUnbindCar(params) {
  return request({
    url: '/car/busRouteInfo/listUnbindCar',
    method: 'get',
    params
  })
}
// 绑定车辆
export function bindCar(params) {
  return request({
    url: '/car/busRouteInfo/bindCar',
    method: 'post',
    params,
    paramsSerializer: params => {
      return qs.stringify(params, { indices: false })
    }
  })
}
// 解绑车辆
export function unbindCar(params) {
  return request({
    url: '/car/busRouteInfo/unbindCar',
    method: 'post',
    params,
    paramsSerializer: params => {
      return qs.stringify(params, { indices: false })
    }
  })
}
// 保存路线
export function addPath(data) {
  return request({
    url: '/car/busRouteInfo/addPath',
    method: 'post',
    data,
    paramsSerializer: params => {
      return qs.stringify(params, { indices: false })
    }
  })
}

