add event option
This commit is contained in:
+8
-1
@@ -1,6 +1,6 @@
|
||||
import { axios } from "timi-web-api";
|
||||
import type { Page, PageResult } from "timi-web-api";
|
||||
import type { EventItem } from "@/types/EventItem";
|
||||
import type { EventItem, EventOptionGroup } from "@/types/EventItem";
|
||||
import { getCurrentStoreId, withCurrentStoreId, withCurrentStorePage } from "@/utils/store";
|
||||
|
||||
const BASE_URI = "/gao/event";
|
||||
@@ -83,6 +83,12 @@ async function update(event: EventItem): Promise<void> {
|
||||
return await axios.post(`${BASE_URI}/update`, withCurrentStoreId(event));
|
||||
}
|
||||
|
||||
async function updateOptionGroupList(eventId: string, optionGroupList: EventOptionGroup[]): Promise<void> {
|
||||
await axios.post(`${BASE_URI}/options/update`, optionGroupList, {
|
||||
params: { id: eventId }
|
||||
});
|
||||
}
|
||||
|
||||
async function sort(idList: string[]): Promise<void> {
|
||||
return await axios.post(`${BASE_URI}/sort`, idList);
|
||||
}
|
||||
@@ -99,6 +105,7 @@ export default {
|
||||
detail,
|
||||
create,
|
||||
update,
|
||||
updateOptionGroupList,
|
||||
sort,
|
||||
remove
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { axios } from "timi-web-api";
|
||||
import type { PageResult } from "timi-web-api";
|
||||
import type { CustomerEventRankView, EventRecord, EventRecordPage, EventRecordPageResult, EventRecordRankPage } from "@/types/EventRecord";
|
||||
import type { CustomerEventRankView, EventOptionStat, EventRecord, EventRecordPage, EventRecordPageResult, EventRecordRankPage } from "@/types/EventRecord";
|
||||
import type { Customer } from "@/types/Customer.ts";
|
||||
import { withCurrentStoreId } from "@/utils/store";
|
||||
|
||||
@@ -48,6 +48,10 @@ async function eventRank(page: EventRecordRankPage): Promise<PageResult<Customer
|
||||
return await axios.post(`${BASE_URI}/rank`, withCurrentStoreId(page));
|
||||
}
|
||||
|
||||
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"
|
||||
@@ -64,5 +68,6 @@ export default {
|
||||
update,
|
||||
verify,
|
||||
remove,
|
||||
eventRank
|
||||
eventRank,
|
||||
optionStat
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user