import request from "@/utils/request";

// 获取路产列表数据接口
export function getRoadTable(params) {
  return request({
    url: "/xj/equipment/list",
    method: "get",
    params,
  });
}

// 道路名称下拉数据
export function getSegment() {
  return request({
    url: "/api/v2/segment/selectList",
    method: "post",
  });
}

// 路产类型下拉
export function getRoadType() {
  return request({
    url: "/metadata/equipmentEquipmentType",
    method: "get",
  });
}

// 路产状态下拉类型
export function getDefectStatus() {
  return request({
    url: "/metadata/defectState",
    method: "get",
  });
}

// 新增路产接口
export function addRoad(data) {
  return request({
    url: "/xj/equipment",
    method: "post",
    data,
  });
}

// 修改路产接口
export function uploadRoad(data) {
  return request({
    url: "/xj/equipment",
    method: "put",
    data,
  });
}

// 删除路产接口
export function deleteRoad(data) {
  return request({
    url: "/xj/equipment",
    method: "delete",
    data,
  });
}

// 批量修改路产接口
export function changeRoad(data) {
    return request({
      url: "/xj/equipment/batch",
      method: "put",
      data,
    });
  }

//   路产详情接口
export function detailRoad(id) {
  return request({
    url: "/xj/equipment/" + id,
    method: "get",
  });
}

// 巡检任务下拉接口
export function getTaskList(params) {
  return request({
    url: "/xj/xjtask/taskDropDown",
    method: "get",
    params,
  });
}
