add data export
This commit is contained in:
@@ -71,12 +71,6 @@ async function findByName(name: string): Promise<Customer | undefined> {
|
||||
});
|
||||
}
|
||||
|
||||
async function exportXSSF(page: Page<Customer>): Promise<Blob> {
|
||||
return await axios.post(`${BASE_URI}/export`, withCurrentStorePage(page), {
|
||||
responseType: "blob"
|
||||
});
|
||||
}
|
||||
|
||||
async function listInvited(introducerCustomerId: string): Promise<Customer[]> {
|
||||
return await axios.post(`${BASE_URI}/invited/list`, undefined, {
|
||||
params: { introducerCustomerId }
|
||||
@@ -117,7 +111,6 @@ export default {
|
||||
findById,
|
||||
findByCode,
|
||||
findByName,
|
||||
exportXSSF,
|
||||
listInvited,
|
||||
saveInvite,
|
||||
deleteInvite,
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import { axios, getBaseURI } from "timi-web-api/api/BaseAPI";
|
||||
import type { DataExportRequest, DataExportStat, DataExportTask } from "@/types/DataExport";
|
||||
|
||||
const BASE_URI = "/gao/data-export";
|
||||
|
||||
async function stat(request: DataExportRequest): Promise<DataExportStat> {
|
||||
return await axios.post(`${BASE_URI}/stat`, request);
|
||||
}
|
||||
|
||||
async function createTask(request: DataExportRequest): Promise<DataExportTask> {
|
||||
return await axios.post(`${BASE_URI}/task`, request);
|
||||
}
|
||||
|
||||
async function detail(taskId: string): Promise<DataExportTask> {
|
||||
return await axios.get(`${BASE_URI}/task/${encodeURIComponent(taskId)}`);
|
||||
}
|
||||
|
||||
/** 获取由浏览器直接处理的导出文件下载地址。 */
|
||||
function getDownloadURL(attachmentId: string): string {
|
||||
return `${getBaseURI()}/attach/download/${encodeURIComponent(attachmentId)}`;
|
||||
}
|
||||
|
||||
export default {
|
||||
stat,
|
||||
createTask,
|
||||
detail,
|
||||
getDownloadURL
|
||||
};
|
||||
@@ -52,16 +52,9 @@ async function optionStat(page: EventRecordPage): Promise<EventOptionStat[]> {
|
||||
return await axios.post(`${BASE_URI}/option/stat`, withCurrentStoreId(page));
|
||||
}
|
||||
|
||||
async function exportXSSF(page: EventRecordPage): Promise<Blob> {
|
||||
return await axios.post(`${BASE_URI}/export`, withCurrentStoreId(page), {
|
||||
responseType: "blob"
|
||||
});
|
||||
}
|
||||
|
||||
export default {
|
||||
list,
|
||||
detail,
|
||||
exportXSSF,
|
||||
create,
|
||||
createBatch,
|
||||
createWithCustomer,
|
||||
|
||||
@@ -37,12 +37,6 @@ async function remove(id: string): Promise<void> {
|
||||
});
|
||||
}
|
||||
|
||||
async function exportXSSF(page: Page<Store>): Promise<Blob> {
|
||||
return await axios.post(`${STORE_BASE_URI}/export`, page, {
|
||||
responseType: "blob"
|
||||
});
|
||||
}
|
||||
|
||||
async function businessDayList(page: Page<StoreBusinessDay>): Promise<PageResult<StoreBusinessDay>> {
|
||||
return await axios.post(`${BUSINESS_DAY_BASE_URI}/list`, page);
|
||||
}
|
||||
@@ -85,7 +79,6 @@ export default {
|
||||
update,
|
||||
sort,
|
||||
remove,
|
||||
exportXSSF,
|
||||
businessDayList,
|
||||
businessDayCalendar,
|
||||
businessDayDetail,
|
||||
|
||||
Reference in New Issue
Block a user