/*
 * @Author: SunTao 328867980@qq.com
 * @Date: 2024-10-14 10:04:12
 * @LastEditors: SunTao 328867980@qq.com
 * @LastEditTime: 2025-01-02 15:10:39
 * @FilePath: \znxjxt-ui\src\api\xj\task.js
 * @Description: 巡检任务管理接口
 */
import request from "@/utils/request";

// 获取巡检任务列表数据接口
export function getTaskTable(params) {
  return request({
    url: "/xj/xjtask/list",
    method: "get",
    params,
  });
}

// 任务id模糊查询接口
export function getTaskIdList(params) {
  return request({
    url: "/xj/xjtask/taskDropDown",
    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",
  });
}


// 根据id查看新增病害详情
export function getTaskDefectDetail(params) {
  return request({
    url: "/xj/defect/getNewDefectByTaskId",
    method: "get",
    params,
  });
}

// 查询列表病害类型
export function getDefectList(params) {
  return request({
    // 病害类型下拉
    // url: "/metadata/defectType",
    url: "/bigscreen/v2/getDefectTypesDrowDown",
    method: "get",
    params,
  });
}


// 导出病害数据
export function exportDefectData(params) {
  return request({
    url: "/xj/defect/exportNewDefectByTaskId",
    method: "get",
    responseType: "blob",
    params,
  });
}

// 根据任务id查询病害点位
export function getDefectPoint(params) {
  return request({
    url: "/xj/xjtask/getMapInfoByTaskId",
    method: "get",
    params,
  });
}
