import request from "@/utils/request";

// 创建编号规则表头
export function createNumRule(data) {
  return request({
    url: "/infra/numRule/add",
    method: "post",
    data: data,
  });
}

// 更新编号规则表头
export function updateNumRule(data) {
  return request({
    url: "/infra/numRule/edit",
    method: "put",
    data: data,
  });
}

// 删除编号规则表头
export function deleteNumRule(id) {
  return request({
    url: "/infra/numRule/delete?id=" + id,
    method: "delete",
  });
}

// 获得编号规则表头
export function getNumRule(id) {
  return request({
    url: "/infra/numRule/query?id=" + id,
    method: "get",
  });
}

// 获得编号规则表头分页
export function getNumRulePage(query) {
  return request({
    url: "/infra/numRule/list",
    method: "get",
    params: query,
  });
}

// 导出编号规则表头 Excel
export function exportNumRuleExcel(query) {
  return request({
    url: "/infra/numRule/export-excel",
    method: "get",
    params: query,
    responseType: "blob",
  });
}

// 启用/禁用
export function updateNumRuleStatus(data) {
  return request({
    url: "/infra/numRule/update",
    method: "put",
    data,
  });
}
