import request from "@/utils/request";
import axios from "axios";

export function collectData(data) {
  return request({
    url: "/api/v1/spc/collectData",
    method: "post",
    data,
  });
}
export function cpkCompute(params) {
  return request({
    url: "/api/v1/spc/cpkCompute",
    method: "post",
    params: params,
  });
}
export function deleteQualityFile(data) {
  return request({
    url: "/api/v1/quality/file/del",
    method: "post",
    data,
  });
}
export function getQualityFileList(data) {
  return request({
    url: "/api/v1/quality/file/list",
    method: "post",
    data,
  });
}
export function EWMACompute(data) {
  return request({
    url: "/api/v1/spc/EWMACompute",
    method: "post",
    data,
  });
}
export function EWMACompute2(params) {
  return request({
    url: "/api/v1/spc/EWMACompute2",
    method: "get",
    params: params,
  });
}
export function IMRCompute(data) {
  return request({
    url: "/api/v1/spc/IMRCompute",
    method: "post",
    data,
  });
}
export function IMRCompute2(params) {
  return request({
    url: "/api/v1/spc/IMRCompute2",
    method: "get",
    params: params,
  });
}
export function UCompute(data) {
  return request({
    url: "/api/v1/spc/UCompute",
    method: "post",
    data,
  });
}
export function UCompute2(params) {
  return request({
    url: "/api/v1/spc/UCompute2",
    method: "get",
    params: params,
  });
}
export function CCompute(data) {
  return request({
    url: "/api/v1/spc/CCompute",
    method: "post",
    data,
  });
}
export function CCompute2(params) {
  return request({
    url: "/api/v1/spc/CCompute2",
    method: "get",
    params: params,
  });
}
export function NPCompute(data) {
  return request({
    url: "/api/v1/spc/NPCompute",
    method: "post",
    data,
  });
}
export function NPCompute2(params) {
  return request({
    url: "/api/v1/spc/NPCompute2",
    method: "get",
    params: params,
  });
}

export function PCompute(data) {
  return request({
    url: "/api/v1/spc/PCompute",
    method: "post",
    data,
  });
}
export function PCompute2(params) {
  return request({
    url: "/api/v1/spc/PCompute2",
    method: "get",
    params: params,
  });
}

export function XBarSCompute(data) {
  return request({
    url: "/api/v1/spc/XBarSCompute",
    method: "post",
    data,
  });
}
export function XBarRCompute(data) {
  return request({
    url: "/api/v1/spc/XBarRCompute",
    method: "post",
    data,
  });
}
export function getData(data) {
  return request({
    url: "/api/v1/spc/page",
    method: "post",
    data,
  });
}

export function saveExceptionData(data) {
  return request({
    url: "/api/v1/spc/saveExceptionData",
    method: "post",
    data: data,
    responseType: "arraybuffer",
  });
}

export function exportData(data) {
  return request({
    url: "/api/v1/spc/exportData",
    method: "post",
    data: data,
    responseType: "arraybuffer",
  });
}

export function getData2(data) {
  return request({
    url: "/api/v1/spc/page2",
    method: "post",
    data,
  });
}
export function addDatas(data) {
  return request({
    url: "/api/v1/spc/add",
    method: "post",
    data,
  });
}
export function deleteData(data) {
  return request({
    url: "/api/v1/spc/del",
    method: "post",
    data,
  });
}
export function updateData(data) {
  return request({
    url: "/api/v1/spc/update",
    method: "post",
    data,
  });
}
export function getTaskCode(data) {
  return request({
    url: "/api/v1/quality/task/list",
    method: "post",
    data,
  });
}
