import request from "@/api/request";
import type { MaskCombinationData, MaskCombinationQuery } from "./model";
import type { ID } from "@/api/common";

// 查询治具组合列表
export function listMaskCombination(params: MaskCombinationQuery) {
  return request({
    url: "/tpm/mask/combination/list",
    method: "get",
    params,
  });
}

// 查询治具组合包含的治具列表
export function listCombinationAssignMask(id: ID, params: MaskCombinationQuery) {
  return request({
    url: "/tpm/mask/combination/" + id + "/masks",
    method: "get",
    params,
  });
}

// 高级查询治具组合列表
export function advListMaskCombination(params: MaskCombinationQuery) {
  return request({
    url: "/tpm/mask/combination/advList",
    method: "get",
    params,
  });
}

// 查询治具组合详细
export function getMaskCombination(id: ID) {
  return request({
    url: "/tpm/mask/combination/" + id,
    method: "get",
  });
}

// 新增治具组合
export function addMaskCombination(data: MaskCombinationData) {
  return request({
    url: "/tpm/mask/combination",
    method: "post",
    data,
  });
}

// 修改治具组合
export function updateMaskCombination(data: MaskCombinationData) {
  return request({
    url: "/tpm/mask/combination",
    method: "put",
    data,
  });
}

// 删除治具组合
export function delMaskCombination(id: ID) {
  return request({
    url: "/tpm/mask/combination/" + id,
    method: "delete",
  });
}

// 新增治具组合与治具关联关系
export function addMaskCombinationAssignment(data: MaskCombinationData) {
  return request({
    url: "/tpm/mask/combination/assignment",
    method: "post",
    data,
  });
}

// 删除治具组合与治具关联关系
export function delMaskCombinationAssignment(id: ID) {
  return request({
    url: "/tpm/mask/combination/assignment/" + id,
    method: "delete",
  });
}
