import request from "@/utils/request.js";

// 设备类型
export const getEquipmentType = () => {
  return request({
    url: "/tunnel/model/equipment/type/option",
    method: "get",
  });
};
// 获取设备
export const getEquipment = (tunnelId, typeKey, equipmentIds = "1") => {
  return request({
    url: "/tunnel/model/equipment/option",
    method: "post",
    params: {
      tunnelId,
      typeKey,
      equipmentIds,
    },
  });
};
// 初始化数据
export const initSceneData = (tunnelId) => {
  return request({
    url: `/tunnel/model/${tunnelId}`,
    method: "get",
  });
};
// 添加设备
export const saveEquipment = (
  constructionLength,
  tunnelId,
  tunnelThreeConfig
) => {
  return request({
    url: "/tunnel/model",
    method: "put",
    data: {
      constructionLength,
      tunnelId,
      tunnelThreeConfig,
    },
  });
};

// 保存模型(新增)
export const apiSaveEquipment = (data) => {
  return request({
    url: "/tunnel/model/details",
    method: "put",
    data,
  });
};
