update chart

This commit is contained in:
Timi
2026-08-12 00:24:12 +08:00
parent 9c30891f2c
commit 171aee1602
17 changed files with 1554 additions and 697 deletions
+19
View File
@@ -0,0 +1,19 @@
import { axios } from "timi-web";
import type { CustomerChartReq } from "@/types/Customer";
import type { StoreEventRecordCalendarView, StoreEventRecordDailyStatView } from "@/types/Store";
import { withCurrentStoreId } from "@/utils/store";
const BASE_URI = "/gao/customer/chart";
async function eventRecordDailyStat(req: CustomerChartReq): Promise<StoreEventRecordDailyStatView[]> {
return await axios.post(`${BASE_URI}/event/record/daily`, withCurrentStoreId(req));
}
async function eventRecordCalendar(req: CustomerChartReq): Promise<StoreEventRecordCalendarView[]> {
return await axios.post(`${BASE_URI}/event/record/calendar`, withCurrentStoreId(req));
}
export default {
eventRecordDailyStat,
eventRecordCalendar
};
+31
View File
@@ -0,0 +1,31 @@
import { axios } from "timi-web";
import type { CustomerDailyStatView, CustomerGenderStatView } from "@/types/Customer";
import type { StoreChartReq, StoreEventRecordCalendarView, StoreEventRecordDailyStatView } from "@/types/Store";
import { getCurrentStoreId, withCurrentStoreId } from "@/utils/store";
const BASE_URI = "/gao/store/chart";
async function customerDailyStat(req: StoreChartReq): Promise<CustomerDailyStatView[]> {
return await axios.post(`${BASE_URI}/customer/daily`, withCurrentStoreId(req));
}
async function customerGenderStat(): Promise<CustomerGenderStatView[]> {
return await axios.post(`${BASE_URI}/customer/gender`, undefined, {
params: { storeId: getCurrentStoreId() }
});
}
async function eventRecordDailyStat(req: StoreChartReq): Promise<StoreEventRecordDailyStatView[]> {
return await axios.post(`${BASE_URI}/event/record/daily`, withCurrentStoreId(req));
}
async function eventRecordCalendar(req: StoreChartReq): Promise<StoreEventRecordCalendarView[]> {
return await axios.post(`${BASE_URI}/event/record/calendar`, withCurrentStoreId(req));
}
export default {
customerDailyStat,
customerGenderStat,
eventRecordDailyStat,
eventRecordCalendar
};