30 lines
1.2 KiB
Vue
30 lines
1.2 KiB
Vue
|
|
import { defHttp } from '/@/utils/http/axios';
|
|||
|
|
|
|||
|
|
enum Api {
|
|||
|
|
list = '/print/bizTemplateBind/list',
|
|||
|
|
add = '/print/bizTemplateBind/add',
|
|||
|
|
edit = '/print/bizTemplateBind/edit',
|
|||
|
|
deleteOne = '/print/bizTemplateBind/delete',
|
|||
|
|
bizTypes = '/print/bizTemplateBind/bizTypes',
|
|||
|
|
parseTemplateFields = '/print/bizTemplateBind/parseTemplateFields',
|
|||
|
|
previewMappedData = '/print/bizTemplateBind/previewMappedData',
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
export const list = (params) => defHttp.get({ url: Api.list, params });
|
|||
|
|
// 与系统其它模块一致:body 走 params 键
|
|||
|
|
export const add = (params) => defHttp.post({ url: Api.add, params });
|
|||
|
|
export const edit = (params) => defHttp.put({ url: Api.edit, params });
|
|||
|
|
export const deleteOne = (params, handleSuccess?) =>
|
|||
|
|
defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => handleSuccess?.());
|
|||
|
|
|
|||
|
|
export const bizTypes = () => defHttp.get({ url: Api.bizTypes });
|
|||
|
|
export const parseTemplateFields = (templateId: string) =>
|
|||
|
|
defHttp.get({
|
|||
|
|
url: Api.parseTemplateFields,
|
|||
|
|
params: { templateId, _t: Date.now() },
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
/** 预览映射后的打印数据 */
|
|||
|
|
export const previewMappedData = (data: { bizCode: string; bizDataJson: Record<string, unknown> }) =>
|
|||
|
|
defHttp.post({ url: Api.previewMappedData, data });
|