import { http } from "/@/utils/http";
import { loadEnv } from "@build/index";
const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
const userAPi = VITE_PROXY_DOMAIN_REAL;
const yewuApi = VITE_PROXY_USER_REAL + "/admin/";

export const httpList = (data: object): any => {
  return http.request("post", `${yewuApi}interlist`, {
    data
  });
};

export const httpUserList = (): any => {
  return http.request("post", `${yewuApi}userall`, { data: {} });
};

export const httpCreate = (data): any => {
  return http.request("post", `${yewuApi}interadd`, { data });
};

export const httpUpdate = (data): any => {
  return http.request("post", `${yewuApi}interedit`, { data });
};

export const httpDetail = (data): any => {
  return http.request("post", `${yewuApi}interinfo`, { data });
};

export const httpRatelist = (): any => {
  return http.request("post", `${yewuApi}getrate`, { data: {} });
};

export const httpCustomerlist = (data): any => {
  return http.request("post", `${yewuApi}infolist`, { data });
};

export const httpFlattenCatgorylist = (data): any => {
  return http.request("post", `${yewuApi}getListByCompany`, { data });
};

export const httpCompanylist = (data): any => {
  return http.request("post", `${yewuApi}businesslist`, {  data: { ...data, noRela: true }
  });
};

export const httpPlatforms = (data): any => {
  return http.request("post", `${yewuApi}getPlatformListByUid`, {  data: { ...data, noRela: true }
  });
};

export const httpUsers= (data): any => {
  return http.request("post", `${yewuApi}userCompanyBasicList`, {  data: { ...data, noRela: true }});
};


export const httpManagerUsers= (data): any => {
  return http.request("post", `${yewuApi}user_role_list`, {  data: { ...data, noRela: true }});
};

export const httpOrderUsed= (data): any => {
  return http.request("post", `${yewuApi}uselist`, {  data: { ...data, noRela: true }});
};

export const httpUnits= (data): any => {
  return http.request("post", `${yewuApi}unitlist`, {  data: { ...data, noRela: true }});
};

export const httpBusinessTypes= (data): any => {
  return http.request("post", `${yewuApi}businesstitle`, {  data: { ...data, noRela: true }
  });
};

export const httpCategories = (data): any => {
  return http.request("post", `${yewuApi}scpList`, {  data: { ...data, noRela: true }
  });
};

export const httpArea = (data): any => {
  return http.request("post", `${yewuApi}addrquery`, {  data: { ...data, noRela: true }
  });
};


export const httpSupplierlist = (data): any => {
  return http.request("post", `${yewuApi}supplerlist`, { data });
};

export const httpCategorylist = (data): any => {
  return http.request("post", `${yewuApi}intercat`, { data });
};

export const httpUserlist = (data): any => {
  return http.request("post", `${yewuApi}userlist`, { data });
};

export const httpPlatformlist = (data): any => {
  return http.request("post", `${yewuApi}interplatform`, { data });
};

export const httpBrandlist = (data): any => {
  return http.request("post", `${yewuApi}brandlist`, { data });
};
