import http from "@/api";
const BASE = `product/compat`;
// 列表
export const getCompatListApi = (params: any) => {
    return http.get<any>(`${BASE}/index`, params);
};
// 详情
export const getCompatDetailsApi = (params: any) => {
    return http.get<any>(`${BASE}/read/${params}`);
};
// 删除
export const getCompatDelApi = (params: any) => {
    return http.delete<any>(`${BASE}/delete/${params}`);
};
//新增

export const getCompatSaveApi = (params: any) => {
    return http.post<any>(`${BASE}/save`, params, {
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        }
    });
};
//更新
export const getCompatUpApi = (params: any) => {
    return http.put<any>(`${BASE}/update/${params.id}`, params);
};

// 导出
export const getCompatUpExportApi = (params: any) => {
    return http.get<any>(`${BASE}/export`, params, {
        responseType: "arraybuffer"
    });
};
//导入
export const getCompatImportApi = (params: any) => {
    return http.post<any>(`${BASE}/import`, params);
};
//配件類型
export const getPartsListApi = (params: any) => {
    return http.get<any>(`${BASE}/parts/list`, params);
};
//產品類型
export const getTypesListApi = (params: any) => {
    return http.get<any>(`${BASE}/types/list`, params);
};
