/*
 * @Author: zc
 * @description 附件管理
 */
import request from '@/utils/request';
/**
 * @description 附件列表
 * @param {object}  params
 */
export const fileList = (params: object) => {
    return request({
        url: `/api/v1/File/list`,
        method: 'get',
        params,
    });
};
/**
 * @description 新增附件
 * @param {object}  data
 */
export const fileAdd = (data: object) => {
    return request({
        url: `/api/v1/File`,
        method: 'post',
        data,
    });
};
/**
 * @description 删除附件
 * @param {object}  data
 */
export const fileDelete = (data: object) => {
    return request({
        url: `/api/v1/File`,
        method: 'delete',
        data,
    });
};
/**
 * @description 更新附件
 * @param {object}  data
 */
export const fileUpdate = (data: object) => {
    return request({
        url: `/api/v1/File`,
        method: 'put',
        data,
    });
};
/**
 * @description 附件详情
 * @param {string}  id
 */
export const fileDetail = (id: string) => {
    return request({
        url: `/${id}`,
        method: 'get',
    });
};
/**
 * @description 获取模板类型
 */
export const fileTemplateType = () => {
    return request({
        url: `/api/v1/Order/import-basedata`,
        method: 'get',
    });
}
/**
 * @description 下载导入模板
 */
export const fileTemplateDownload = () => {
    return request({
        url: `/api/v1/Order/download-order-template`,
        method: 'get',
        responseType: 'blob',
        headers: { 'content-type': 'audio/mpeg' },
    });
}
/**
 * @description 导入
 * @param {object}  data
 */
export const fileImport = (data: object) => {
    return request({
        url: `/api/v1/Order/import-order`,
        method: 'post',
        headers: {
            'Content-Type':'multipart/form-data'
        },
        data,
    });
}