import axios from "@/utils/request";

export function getInvSpaceList(params) {
  return axios({
    url: "/spms/inv/space/filter",
    method: "get",
    params: params
  });
}

export function getInvSpaceListOptimize(params) {
  return axios({
    url: "/spms/inv/space/filterOptimize",
    method: "get",
    params: params
  });
}

export function saveSpace(data, formName) {
  return axios({
    url: formName === "add" ? "/spms/inv/space/add" : "/spms/inv/space/update",
    method: "post",
    data: data
  });
}

export function deleteSpace(data) {
  return axios({
    url: "/spms/inv/space/delete",
    method: "post",
    data: data
  })
}

export function getSpaceCodeList(params) {
  return axios({
    url: "/spms/inv/space/getSpaceCodeList",
    method: "get",
    params: params
  })
}
