import request from "@/utils/request";

// 获取事件列表数据接口
export function getEventTable(params) {
  return request({
    url: "/xj/event/list",
    method: "get",
    params,
  });
}

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

// 事件类型下拉
export function getEventType() {
  return request({
    url: "/metadata/eventDefectType",
    method: "get",
  });
}

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

// 新增事件接口
export function addEvent(data) {
  return request({
    url: "/xj/event",
    method: "post",
    data,
  });
}

// 修改事件接口
export function uploadEvent(data) {
  return request({
    url: "/xj/event",
    method: "put",
    data,
  });
}

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

// 批量修改事件接口
export function changeEvent(data) {
  return request({
    url: "/xj/event/batch",
    method: "put",
    data,
  });
}

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

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