refactor timi-web

This commit is contained in:
Timi
2026-08-26 21:18:02 +08:00
parent fe5d190308
commit f54a129edb
85 changed files with 1745 additions and 180 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
import { axios, type Page, type PageResult } from "timi-web";
import { axios } from "timi-web-api";
import type { Page, PageResult } from "timi-web-api";
import type { Customer, CustomerDailyStatView, CustomerGenderStatView, CustomerTrendStatReq } from "@/types/Customer";
import { getCurrentStoreId, withCurrentStoreId, withCurrentStorePage } from "@/utils/store";
+1 -1
View File
@@ -1,4 +1,4 @@
import { axios } from "timi-web";
import { axios } from "timi-web-api";
import type { CustomerChartReq } from "@/types/Customer";
import type { StoreEventRecordCalendarView, StoreEventRecordDailyStatView } from "@/types/Store";
import { withCurrentStoreId } from "@/utils/store";
+2 -1
View File
@@ -1,4 +1,5 @@
import { axios, type Page, type PageResult } from "timi-web";
import { axios } from "timi-web-api";
import type { Page, PageResult } from "timi-web-api";
import type { EventItem } from "@/types/EventItem";
import { getCurrentStoreId, withCurrentStoreId, withCurrentStorePage } from "@/utils/store";
+2 -1
View File
@@ -1,4 +1,5 @@
import { axios, type PageResult } from "timi-web";
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 { Customer } from "@/types/Customer.ts";
import { withCurrentStoreId } from "@/utils/store";
+36
View File
@@ -0,0 +1,36 @@
import { axios } from "timi-web-api";
import type { Notify, Page, PageResult } from "timi-web-api";
import type { ManagedUser } from "@/types/ManagedUser";
const BASE_URI = "/gao/notify";
type RecipientListOptions = {
storeId?: string;
};
async function listRecipients(
page: Page<ManagedUser>,
options?: RecipientListOptions
): Promise<PageResult<ManagedUser>> {
const equalsExample = {
...(page.equalsExample || {})
};
if (options?.storeId) {
equalsExample.storeId = options.storeId;
} else {
delete equalsExample.storeId;
}
return await axios.post(`${BASE_URI}/recipient/list`, {
...page,
equalsExample
});
}
async function create(notify: Notify): Promise<Notify> {
return await axios.post(`${BASE_URI}/create`, notify);
}
export default {
listRecipients,
create
};
+2 -1
View File
@@ -1,4 +1,5 @@
import { axios, type LoginResponse, type Page, type PageResult, type Role } from "timi-web";
import { axios } from "timi-web-api";
import type { LoginResponse, Page, PageResult, Role } from "timi-web-api";
import type { ManagedUser } from "@/types/ManagedUser";
import { withCurrentStoreId, withCurrentStorePage } from "@/utils/store";
+2 -1
View File
@@ -1,4 +1,5 @@
import { axios, type Page, type PageResult } from "timi-web";
import { axios } from "timi-web-api";
import type { Page, PageResult } from "timi-web-api";
import type {
PointAccount,
PointAccountPage,
+2 -1
View File
@@ -1,4 +1,5 @@
import { axios, type Page, type PageResult } from "timi-web";
import { axios } from "timi-web-api";
import type { Page, PageResult } from "timi-web-api";
import type { Store, StoreBusinessDay } from "@/types/Store";
const STORE_BASE_URI = "/gao/store";
+1 -1
View File
@@ -1,4 +1,4 @@
import { axios } from "timi-web";
import { axios } from "timi-web-api";
import EventAPI from "@/api/EventAPI";
import StoreAPI from "@/api/StoreAPI";
import type { CustomerDailyStatView, CustomerGenderStatView } from "@/types/Customer";
+2 -1
View File
@@ -1,4 +1,5 @@
import { axios, type Page, type PageResult } from "timi-web";
import { axios } from "timi-web-api";
import type { Page, PageResult } from "timi-web-api";
import type { Tag, TagApply, TagBizType } from "@/types/Tag";
const BASE_URI = "/gao/tag";