import request from "@/utils/request";
import { AxiosPromise } from "axios";

// 查询测试类型
export function searhTestType(data?: object): AxiosPromise {
  return request({
    url: "/api/v1/test/engrExecute/selectTestType",
    method: "post",
    data: {},
  });
}

// 测试仪器配置列表查询
export function searchTestMachineConfig(engineeringId: string): AxiosPromise {
  return request({
    url: "/api/v1/test/engrInstrumentConfig/list",
    method: "post",
    data: {
      engineeringIdList: [engineeringId, 0],
      instrumentProperty: 2,
      pageSize: 100,
    },
  });
}

// 查询执行工程项目关联的全局数据
export function searchExcutingGlobalData(
  engineeringId: string,
  itemIds: string[]
): AxiosPromise {
  return request({
    url: "/api/v1/test/engrProject/selectInvolveGlobalData",
    method: "post",
    data: {
      engineeringId: engineeringId,
      projectIdList: itemIds,
    },
  });
}

// 查询执行工程项目关联的仪器配置
export function searchExcutingInstrumentConfig(
  engineeringId: string,
  itemIds: string[]
): AxiosPromise {
  return request({
    url: "/api/v1/test/engrProject/selectInvolveInstrConfig",
    method: "post",
    data: {
      engineeringId: engineeringId,
      projectIdList: itemIds,
    },
  });
}
