@pisell/pisellos 0.0.220 → 0.0.222
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +180 -180
- package/dist/core/index.js +4 -4
- package/dist/index.js +3 -3
- package/dist/modules/Account/types.js +6 -6
- package/dist/modules/AccountList/index.js +14 -14
- package/dist/modules/AccountList/types.js +14 -14
- package/dist/modules/AccountList/utils.js +5 -5
- package/dist/modules/Cart/index.js +35 -35
- package/dist/modules/Cart/types.js +14 -14
- package/dist/modules/Cart/utils/cartAccount.js +8 -8
- package/dist/modules/Cart/utils/cartDate.js +12 -12
- package/dist/modules/Cart/utils/cartDiscount.js +8 -8
- package/dist/modules/Cart/utils/cartNote.js +8 -8
- package/dist/modules/Cart/utils/cartProduct.js +39 -39
- package/dist/modules/Cart/utils/cartRelationForms.js +8 -8
- package/dist/modules/Cart/utils/cartResource.js +8 -8
- package/dist/modules/Cart/utils/index.js +4 -4
- package/dist/modules/Customer/index.js +67 -67
- package/dist/modules/Customer/types.js +18 -18
- package/dist/modules/Date/types.js +6 -6
- package/dist/modules/Date/utils.js +25 -25
- package/dist/modules/Guests/types.js +8 -8
- package/dist/modules/Order/types.js +4 -4
- package/dist/modules/Order/utils.js +8 -8
- package/dist/modules/Payment/cash.js +2 -2
- package/dist/modules/Payment/eftpos.js +2 -2
- package/dist/modules/Payment/index.js +135 -135
- package/dist/modules/Payment/types.js +50 -50
- package/dist/modules/Payment/wallet.js +2 -2
- package/dist/modules/Product/index.js +22 -22
- package/dist/modules/Product/utils.js +12 -12
- package/dist/modules/ProductList/index.js +4 -4
- package/dist/modules/Resource/types.js +8 -8
- package/dist/modules/Resource/utils.js +14 -14
- package/dist/modules/Schedule/index.js +4 -4
- package/dist/modules/Schedule/utils.js +73 -73
- package/dist/modules/Step/index.js +18 -18
- package/dist/modules/Summary/index.js +4 -4
- package/dist/modules/Summary/utils.js +15 -15
- package/dist/plugins/app-types/app/app.d.ts +83 -83
- package/dist/plugins/app-types/app/const.d.ts +4 -4
- package/dist/plugins/app-types/app/index.d.ts +14 -14
- package/dist/plugins/app-types/applicationManager/application.d.ts +50 -50
- package/dist/plugins/app-types/applicationManager/index.d.ts +13 -13
- package/dist/plugins/app-types/config.d.ts +3 -3
- package/dist/plugins/app-types/cookie/index.d.ts +13 -13
- package/dist/plugins/app-types/data/index.d.ts +8 -8
- package/dist/plugins/app-types/history/config.d.ts +24 -24
- package/dist/plugins/app-types/history/index.d.ts +20 -20
- package/dist/plugins/app-types/history/type.d.ts +2 -2
- package/dist/plugins/app-types/hooks/index.d.ts +12 -12
- package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -2
- package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +2 -2
- package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +13 -13
- package/dist/plugins/app-types/hooks/useStore/index.d.ts +6 -6
- package/dist/plugins/app-types/index.d.ts +6 -6
- package/dist/plugins/app-types/indexDB/index.d.ts +178 -178
- package/dist/plugins/app-types/locales/en.d.ts +3 -3
- package/dist/plugins/app-types/locales/index.d.ts +37 -37
- package/dist/plugins/app-types/locales/original.d.ts +3 -3
- package/dist/plugins/app-types/locales/type.d.ts +19 -19
- package/dist/plugins/app-types/locales/zh-CN.d.ts +3 -3
- package/dist/plugins/app-types/locales/zh-HK.d.ts +3 -3
- package/dist/plugins/app-types/logger/feishu.d.ts +11 -11
- package/dist/plugins/app-types/logger/index.d.ts +122 -122
- package/dist/plugins/app-types/menuManager/hooks.d.ts +17 -17
- package/dist/plugins/app-types/menuManager/index.d.ts +28 -28
- package/dist/plugins/app-types/models/global.d.ts +32 -32
- package/dist/plugins/app-types/models/index.d.ts +45 -45
- package/dist/plugins/app-types/models/type.d.ts +2 -2
- package/dist/plugins/app-types/package.json +14 -14
- package/dist/plugins/app-types/pubsub/example.d.ts +5 -5
- package/dist/plugins/app-types/pubsub/index.d.ts +63 -63
- package/dist/plugins/app-types/request/cache.d.ts +46 -46
- package/dist/plugins/app-types/request/cancelToken.d.ts +38 -38
- package/dist/plugins/app-types/request/config.d.ts +3 -3
- package/dist/plugins/app-types/request/constants.d.ts +2 -2
- package/dist/plugins/app-types/request/index.d.ts +24 -24
- package/dist/plugins/app-types/request/pisell2Request.d.ts +6 -6
- package/dist/plugins/app-types/request/type.d.ts +41 -41
- package/dist/plugins/app-types/request/utils.d.ts +46 -46
- package/dist/plugins/app-types/routes/config.d.ts +7 -7
- package/dist/plugins/app-types/routes/index.d.ts +28 -28
- package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -6
- package/dist/plugins/app-types/socket/components/index.d.ts +2 -2
- package/dist/plugins/app-types/socket/constants.d.ts +33 -33
- package/dist/plugins/app-types/socket/events.d.ts +31 -31
- package/dist/plugins/app-types/socket/heartbeat.d.ts +66 -66
- package/dist/plugins/app-types/socket/index.d.ts +61 -61
- package/dist/plugins/app-types/socket/monitor.d.ts +169 -169
- package/dist/plugins/app-types/socket/reconnect.d.ts +61 -61
- package/dist/plugins/app-types/socket/socket.d.ts +129 -129
- package/dist/plugins/app-types/socket/types.d.ts +85 -85
- package/dist/plugins/app-types/storage/index.d.ts +17 -17
- package/dist/plugins/app-types/tasks/index.d.ts +77 -77
- package/dist/plugins/app-types/tasks/type.d.ts +62 -62
- package/dist/plugins/app-types/tasks/useTasks.d.ts +5 -5
- package/dist/plugins/app-types/type.d.ts +2 -2
- package/dist/plugins/app-types/variables/VariablesProvider.d.ts +7 -7
- package/dist/plugins/app-types/variables/config.d.ts +3 -3
- package/dist/plugins/app-types/variables/index.d.ts +6 -6
- package/dist/plugins/app-types/variables/type.d.ts +2 -2
- package/dist/plugins/app-types/website/index.d.ts +6 -6
- package/dist/plugins/request.js +33 -33
- package/dist/plugins/window.js +16 -16
- package/dist/solution/BookingByStep/index.js +126 -126
- package/dist/solution/BookingByStep/utils/capacity.js +30 -30
- package/dist/solution/BookingByStep/utils/products.js +4 -4
- package/dist/solution/BookingByStep/utils/resources.js +146 -146
- package/dist/solution/BookingByStep/utils/timeslots.js +20 -20
- package/dist/solution/BookingTicket/index.d.ts +13 -1
- package/dist/solution/BookingTicket/index.js +109 -86
- package/dist/solution/BookingTicket/types.js +8 -8
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +6 -6
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -4
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +20 -28
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +13 -0
- package/dist/solution/BookingTicket/utils/scan/index.js +64 -21
- package/dist/solution/BookingTicket/utils/scan/scanCache.js +52 -52
- package/dist/solution/BuyTickets/types.js +4 -4
- package/dist/utils/task.d.ts +5 -1
- package/dist/utils/task.js +22 -38
- package/dist/utils/watch.d.ts +1 -1
- package/dist/utils/watch.js +60 -60
- package/lib/plugins/app-types/app/app.d.ts +83 -83
- package/lib/plugins/app-types/app/const.d.ts +4 -4
- package/lib/plugins/app-types/app/index.d.ts +14 -14
- package/lib/plugins/app-types/applicationManager/application.d.ts +50 -50
- package/lib/plugins/app-types/applicationManager/index.d.ts +13 -13
- package/lib/plugins/app-types/config.d.ts +3 -3
- package/lib/plugins/app-types/cookie/index.d.ts +13 -13
- package/lib/plugins/app-types/data/index.d.ts +8 -8
- package/lib/plugins/app-types/history/config.d.ts +24 -24
- package/lib/plugins/app-types/history/index.d.ts +20 -20
- package/lib/plugins/app-types/history/type.d.ts +2 -2
- package/lib/plugins/app-types/hooks/index.d.ts +12 -12
- package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -2
- package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +2 -2
- package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +13 -13
- package/lib/plugins/app-types/hooks/useStore/index.d.ts +6 -6
- package/lib/plugins/app-types/index.d.ts +6 -6
- package/lib/plugins/app-types/indexDB/index.d.ts +178 -178
- package/lib/plugins/app-types/locales/en.d.ts +3 -3
- package/lib/plugins/app-types/locales/index.d.ts +37 -37
- package/lib/plugins/app-types/locales/original.d.ts +3 -3
- package/lib/plugins/app-types/locales/type.d.ts +19 -19
- package/lib/plugins/app-types/locales/zh-CN.d.ts +3 -3
- package/lib/plugins/app-types/locales/zh-HK.d.ts +3 -3
- package/lib/plugins/app-types/logger/feishu.d.ts +11 -11
- package/lib/plugins/app-types/logger/index.d.ts +122 -122
- package/lib/plugins/app-types/menuManager/hooks.d.ts +17 -17
- package/lib/plugins/app-types/menuManager/index.d.ts +28 -28
- package/lib/plugins/app-types/models/global.d.ts +32 -32
- package/lib/plugins/app-types/models/index.d.ts +45 -45
- package/lib/plugins/app-types/models/type.d.ts +2 -2
- package/lib/plugins/app-types/package.json +14 -14
- package/lib/plugins/app-types/pubsub/example.d.ts +5 -5
- package/lib/plugins/app-types/pubsub/index.d.ts +63 -63
- package/lib/plugins/app-types/request/cache.d.ts +46 -46
- package/lib/plugins/app-types/request/cancelToken.d.ts +38 -38
- package/lib/plugins/app-types/request/config.d.ts +3 -3
- package/lib/plugins/app-types/request/constants.d.ts +2 -2
- package/lib/plugins/app-types/request/index.d.ts +24 -24
- package/lib/plugins/app-types/request/pisell2Request.d.ts +6 -6
- package/lib/plugins/app-types/request/type.d.ts +41 -41
- package/lib/plugins/app-types/request/utils.d.ts +46 -46
- package/lib/plugins/app-types/routes/config.d.ts +7 -7
- package/lib/plugins/app-types/routes/index.d.ts +28 -28
- package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -6
- package/lib/plugins/app-types/socket/components/index.d.ts +2 -2
- package/lib/plugins/app-types/socket/constants.d.ts +33 -33
- package/lib/plugins/app-types/socket/events.d.ts +31 -31
- package/lib/plugins/app-types/socket/heartbeat.d.ts +66 -66
- package/lib/plugins/app-types/socket/index.d.ts +61 -61
- package/lib/plugins/app-types/socket/monitor.d.ts +169 -169
- package/lib/plugins/app-types/socket/reconnect.d.ts +61 -61
- package/lib/plugins/app-types/socket/socket.d.ts +129 -129
- package/lib/plugins/app-types/socket/types.d.ts +85 -85
- package/lib/plugins/app-types/storage/index.d.ts +17 -17
- package/lib/plugins/app-types/tasks/index.d.ts +77 -77
- package/lib/plugins/app-types/tasks/type.d.ts +62 -62
- package/lib/plugins/app-types/tasks/useTasks.d.ts +5 -5
- package/lib/plugins/app-types/type.d.ts +2 -2
- package/lib/plugins/app-types/variables/VariablesProvider.d.ts +7 -7
- package/lib/plugins/app-types/variables/config.d.ts +3 -3
- package/lib/plugins/app-types/variables/index.d.ts +6 -6
- package/lib/plugins/app-types/variables/type.d.ts +2 -2
- package/lib/plugins/app-types/website/index.d.ts +6 -6
- package/lib/solution/BookingTicket/index.d.ts +13 -1
- package/lib/solution/BookingTicket/index.js +19 -2
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -4
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -14
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +13 -0
- package/lib/solution/BookingTicket/utils/scan/index.js +32 -0
- package/lib/utils/task.d.ts +5 -1
- package/lib/utils/task.js +8 -1
- package/lib/utils/watch.d.ts +1 -1
- package/lib/utils/watch.js +1 -1
- package/package.json +1 -1
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
import { Task, TasksModule, RunTaskParams, AddTaskParams, DeleteTaskParams } from "./type";
|
|
2
|
-
import App from "../app";
|
|
3
|
-
export declare class TasksManager {
|
|
4
|
-
private static instance;
|
|
5
|
-
private taskFunctions;
|
|
6
|
-
private tasks;
|
|
7
|
-
private app;
|
|
8
|
-
private db;
|
|
9
|
-
useTasks: () => {
|
|
10
|
-
tasks: TasksModule;
|
|
11
|
-
};
|
|
12
|
-
watchTaskCallback: (taskModule: TasksModule) => void;
|
|
13
|
-
constructor(app: App);
|
|
14
|
-
static getInstance(app?: App): TasksManager;
|
|
15
|
-
addTaskFunction<T>(name: string, fun: T): void;
|
|
16
|
-
addTaskFunctions<T>(tasks: {
|
|
17
|
-
name: string;
|
|
18
|
-
fun: T;
|
|
19
|
-
}[]): void;
|
|
20
|
-
getTasks(): TasksModule;
|
|
21
|
-
getTaskFunction(name: string): any;
|
|
22
|
-
init(): Promise<void>;
|
|
23
|
-
private saveTaskQueueToLocal;
|
|
24
|
-
private loadTaskQueueFromLocal;
|
|
25
|
-
/**
|
|
26
|
-
* @title: 执行任务
|
|
27
|
-
* @description:
|
|
28
|
-
* @param {Task} task
|
|
29
|
-
* @return {*}
|
|
30
|
-
* @Author: zhiwei.Wang
|
|
31
|
-
* @Date: 2024-09-26 13:53
|
|
32
|
-
*/
|
|
33
|
-
private runTask;
|
|
34
|
-
/**
|
|
35
|
-
* @title: 启动轮询
|
|
36
|
-
* @description: 根据轮询间隔定期执行任务
|
|
37
|
-
* @param {Task} task
|
|
38
|
-
* @return {*}
|
|
39
|
-
*/
|
|
40
|
-
private startPolling;
|
|
41
|
-
/**
|
|
42
|
-
* @title: 创建任务数据
|
|
43
|
-
* @description:
|
|
44
|
-
* @param {Partial} payload
|
|
45
|
-
* @return {*}
|
|
46
|
-
* @Author: zhiwei.Wang
|
|
47
|
-
* @Date: 2024-09-26 13:54
|
|
48
|
-
*/
|
|
49
|
-
private createTaskData;
|
|
50
|
-
private getTaskQueue;
|
|
51
|
-
private timeout;
|
|
52
|
-
/**
|
|
53
|
-
* @title: 执行任务队列
|
|
54
|
-
* @description:
|
|
55
|
-
* @return {*}
|
|
56
|
-
* @Author: zhiwei.Wang
|
|
57
|
-
* @Date: 2024-09-26 13:52
|
|
58
|
-
*/
|
|
59
|
-
run(payload: RunTaskParams): Promise<void>;
|
|
60
|
-
deleteTask(payload: DeleteTaskParams): void;
|
|
61
|
-
/**
|
|
62
|
-
* @title: 重试任务
|
|
63
|
-
* @description:
|
|
64
|
-
* @return {*}
|
|
65
|
-
* @Author: zhiwei.Wang
|
|
66
|
-
* @Date: 2024-09-26 13:53
|
|
67
|
-
*/
|
|
68
|
-
retryTask(payload: RunTaskParams): void;
|
|
69
|
-
addTask(payload: AddTaskParams): void;
|
|
70
|
-
private updateTask;
|
|
71
|
-
private updateQueueStatus;
|
|
72
|
-
private setTasks;
|
|
73
|
-
clearAllTaskTimer(tasks: Task[]): void;
|
|
74
|
-
clearTasks(payload: RunTaskParams): void;
|
|
75
|
-
clearAllTasks(): void;
|
|
76
|
-
watchTask(callback: (taskModule: TasksModule) => void): void;
|
|
77
|
-
}
|
|
1
|
+
import { Task, TasksModule, RunTaskParams, AddTaskParams, DeleteTaskParams } from "./type";
|
|
2
|
+
import App from "../app";
|
|
3
|
+
export declare class TasksManager {
|
|
4
|
+
private static instance;
|
|
5
|
+
private taskFunctions;
|
|
6
|
+
private tasks;
|
|
7
|
+
private app;
|
|
8
|
+
private db;
|
|
9
|
+
useTasks: () => {
|
|
10
|
+
tasks: TasksModule;
|
|
11
|
+
};
|
|
12
|
+
watchTaskCallback: (taskModule: TasksModule) => void;
|
|
13
|
+
constructor(app: App);
|
|
14
|
+
static getInstance(app?: App): TasksManager;
|
|
15
|
+
addTaskFunction<T>(name: string, fun: T): void;
|
|
16
|
+
addTaskFunctions<T>(tasks: {
|
|
17
|
+
name: string;
|
|
18
|
+
fun: T;
|
|
19
|
+
}[]): void;
|
|
20
|
+
getTasks(): TasksModule;
|
|
21
|
+
getTaskFunction(name: string): any;
|
|
22
|
+
init(): Promise<void>;
|
|
23
|
+
private saveTaskQueueToLocal;
|
|
24
|
+
private loadTaskQueueFromLocal;
|
|
25
|
+
/**
|
|
26
|
+
* @title: 执行任务
|
|
27
|
+
* @description:
|
|
28
|
+
* @param {Task} task
|
|
29
|
+
* @return {*}
|
|
30
|
+
* @Author: zhiwei.Wang
|
|
31
|
+
* @Date: 2024-09-26 13:53
|
|
32
|
+
*/
|
|
33
|
+
private runTask;
|
|
34
|
+
/**
|
|
35
|
+
* @title: 启动轮询
|
|
36
|
+
* @description: 根据轮询间隔定期执行任务
|
|
37
|
+
* @param {Task} task
|
|
38
|
+
* @return {*}
|
|
39
|
+
*/
|
|
40
|
+
private startPolling;
|
|
41
|
+
/**
|
|
42
|
+
* @title: 创建任务数据
|
|
43
|
+
* @description:
|
|
44
|
+
* @param {Partial} payload
|
|
45
|
+
* @return {*}
|
|
46
|
+
* @Author: zhiwei.Wang
|
|
47
|
+
* @Date: 2024-09-26 13:54
|
|
48
|
+
*/
|
|
49
|
+
private createTaskData;
|
|
50
|
+
private getTaskQueue;
|
|
51
|
+
private timeout;
|
|
52
|
+
/**
|
|
53
|
+
* @title: 执行任务队列
|
|
54
|
+
* @description:
|
|
55
|
+
* @return {*}
|
|
56
|
+
* @Author: zhiwei.Wang
|
|
57
|
+
* @Date: 2024-09-26 13:52
|
|
58
|
+
*/
|
|
59
|
+
run(payload: RunTaskParams): Promise<void>;
|
|
60
|
+
deleteTask(payload: DeleteTaskParams): void;
|
|
61
|
+
/**
|
|
62
|
+
* @title: 重试任务
|
|
63
|
+
* @description:
|
|
64
|
+
* @return {*}
|
|
65
|
+
* @Author: zhiwei.Wang
|
|
66
|
+
* @Date: 2024-09-26 13:53
|
|
67
|
+
*/
|
|
68
|
+
retryTask(payload: RunTaskParams): void;
|
|
69
|
+
addTask(payload: AddTaskParams): void;
|
|
70
|
+
private updateTask;
|
|
71
|
+
private updateQueueStatus;
|
|
72
|
+
private setTasks;
|
|
73
|
+
clearAllTaskTimer(tasks: Task[]): void;
|
|
74
|
+
clearTasks(payload: RunTaskParams): void;
|
|
75
|
+
clearAllTasks(): void;
|
|
76
|
+
watchTask(callback: (taskModule: TasksModule) => void): void;
|
|
77
|
+
}
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
export type TaskRunStatus = "pending" | "in-progress" | "success" | "failure";
|
|
2
|
-
export interface Task {
|
|
3
|
-
id?: string;
|
|
4
|
-
type?: "local" | "cloud";
|
|
5
|
-
retries?: number;
|
|
6
|
-
maxRetries?: number;
|
|
7
|
-
status?: TaskRunStatus;
|
|
8
|
-
action: string;
|
|
9
|
-
payload: any;
|
|
10
|
-
beforeAction?: string;
|
|
11
|
-
beforePayload?: any;
|
|
12
|
-
afterAction?: string;
|
|
13
|
-
afterPayload?: any;
|
|
14
|
-
polling?: {
|
|
15
|
-
interval?: number;
|
|
16
|
-
};
|
|
17
|
-
pollingResult?: {
|
|
18
|
-
count: number;
|
|
19
|
-
timerId?: any;
|
|
20
|
-
};
|
|
21
|
-
manual?: boolean;
|
|
22
|
-
destroy?: boolean;
|
|
23
|
-
[key: string]: any;
|
|
24
|
-
}
|
|
25
|
-
export interface TaskConfig {
|
|
26
|
-
tasks: Task[];
|
|
27
|
-
}
|
|
28
|
-
type TaskModuleName = string;
|
|
29
|
-
type TaskQueueName = string;
|
|
30
|
-
type TaskStatus = "uncompleted" | "completed";
|
|
31
|
-
export interface TaskQueue {
|
|
32
|
-
status: TaskStatus;
|
|
33
|
-
tasks: Task[];
|
|
34
|
-
}
|
|
35
|
-
export interface RunTaskParams {
|
|
36
|
-
module: TaskModuleName;
|
|
37
|
-
queueId: TaskQueueName;
|
|
38
|
-
callback?: () => void;
|
|
39
|
-
}
|
|
40
|
-
export interface DeleteTaskParams {
|
|
41
|
-
module: TaskModuleName;
|
|
42
|
-
queueId: TaskQueueName;
|
|
43
|
-
taskId: string;
|
|
44
|
-
}
|
|
45
|
-
export interface AddTaskParams {
|
|
46
|
-
module: TaskModuleName;
|
|
47
|
-
queueId: TaskQueueName;
|
|
48
|
-
tasks: Task[];
|
|
49
|
-
}
|
|
50
|
-
export interface TaskRunResult {
|
|
51
|
-
status: TaskRunStatus;
|
|
52
|
-
[key: string]: any;
|
|
53
|
-
}
|
|
54
|
-
export interface TasksModule {
|
|
55
|
-
[key: TaskModuleName]: {
|
|
56
|
-
[key: TaskQueueName]: {
|
|
57
|
-
status: TaskStatus;
|
|
58
|
-
tasks: Task[];
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
export {};
|
|
1
|
+
export type TaskRunStatus = "pending" | "in-progress" | "success" | "failure";
|
|
2
|
+
export interface Task {
|
|
3
|
+
id?: string;
|
|
4
|
+
type?: "local" | "cloud";
|
|
5
|
+
retries?: number;
|
|
6
|
+
maxRetries?: number;
|
|
7
|
+
status?: TaskRunStatus;
|
|
8
|
+
action: string;
|
|
9
|
+
payload: any;
|
|
10
|
+
beforeAction?: string;
|
|
11
|
+
beforePayload?: any;
|
|
12
|
+
afterAction?: string;
|
|
13
|
+
afterPayload?: any;
|
|
14
|
+
polling?: {
|
|
15
|
+
interval?: number;
|
|
16
|
+
};
|
|
17
|
+
pollingResult?: {
|
|
18
|
+
count: number;
|
|
19
|
+
timerId?: any;
|
|
20
|
+
};
|
|
21
|
+
manual?: boolean;
|
|
22
|
+
destroy?: boolean;
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
}
|
|
25
|
+
export interface TaskConfig {
|
|
26
|
+
tasks: Task[];
|
|
27
|
+
}
|
|
28
|
+
type TaskModuleName = string;
|
|
29
|
+
type TaskQueueName = string;
|
|
30
|
+
type TaskStatus = "uncompleted" | "completed";
|
|
31
|
+
export interface TaskQueue {
|
|
32
|
+
status: TaskStatus;
|
|
33
|
+
tasks: Task[];
|
|
34
|
+
}
|
|
35
|
+
export interface RunTaskParams {
|
|
36
|
+
module: TaskModuleName;
|
|
37
|
+
queueId: TaskQueueName;
|
|
38
|
+
callback?: () => void;
|
|
39
|
+
}
|
|
40
|
+
export interface DeleteTaskParams {
|
|
41
|
+
module: TaskModuleName;
|
|
42
|
+
queueId: TaskQueueName;
|
|
43
|
+
taskId: string;
|
|
44
|
+
}
|
|
45
|
+
export interface AddTaskParams {
|
|
46
|
+
module: TaskModuleName;
|
|
47
|
+
queueId: TaskQueueName;
|
|
48
|
+
tasks: Task[];
|
|
49
|
+
}
|
|
50
|
+
export interface TaskRunResult {
|
|
51
|
+
status: TaskRunStatus;
|
|
52
|
+
[key: string]: any;
|
|
53
|
+
}
|
|
54
|
+
export interface TasksModule {
|
|
55
|
+
[key: TaskModuleName]: {
|
|
56
|
+
[key: TaskQueueName]: {
|
|
57
|
+
status: TaskStatus;
|
|
58
|
+
tasks: Task[];
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TasksModule } from './type';
|
|
2
|
-
declare const useTasks: () => {
|
|
3
|
-
tasks: TasksModule;
|
|
4
|
-
};
|
|
5
|
-
export default useTasks;
|
|
1
|
+
import { TasksModule } from './type';
|
|
2
|
+
declare const useTasks: () => {
|
|
3
|
+
tasks: TasksModule;
|
|
4
|
+
};
|
|
5
|
+
export default useTasks;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export interface CoreConfig {
|
|
2
|
-
}
|
|
1
|
+
export interface CoreConfig {
|
|
2
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export declare const useVariablesContext: () => any;
|
|
3
|
-
interface VariablesProviderProps {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
}
|
|
6
|
-
export declare const VariablesProvider: React.FC<VariablesProviderProps>;
|
|
7
|
-
export {};
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const useVariablesContext: () => any;
|
|
3
|
+
interface VariablesProviderProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const VariablesProvider: React.FC<VariablesProviderProps>;
|
|
7
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { VariablesConfig } from './type';
|
|
2
|
-
export declare const setConfig: (newConfig: Partial<VariablesConfig>) => void;
|
|
3
|
-
export declare const getConfig: () => VariablesConfig;
|
|
1
|
+
import { VariablesConfig } from './type';
|
|
2
|
+
export declare const setConfig: (newConfig: Partial<VariablesConfig>) => void;
|
|
3
|
+
export declare const getConfig: () => VariablesConfig;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type VariableMap = Record<string, string>;
|
|
2
|
-
declare const _default: {
|
|
3
|
-
setConfig: (newConfig: Partial<import("./type").VariablesConfig>) => void;
|
|
4
|
-
getConfig: () => import("./type").VariablesConfig;
|
|
5
|
-
};
|
|
6
|
-
export default _default;
|
|
1
|
+
export type VariableMap = Record<string, string>;
|
|
2
|
+
declare const _default: {
|
|
3
|
+
setConfig: (newConfig: Partial<import("./type").VariablesConfig>) => void;
|
|
4
|
+
getConfig: () => import("./type").VariablesConfig;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export interface VariablesConfig {
|
|
2
|
-
}
|
|
1
|
+
export interface VariablesConfig {
|
|
2
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
setTitle: (title: string) => void;
|
|
3
|
-
setIcon: (paramsIcon: string) => void;
|
|
4
|
-
setAppleWebAppTitle: (title: string) => void;
|
|
5
|
-
};
|
|
6
|
-
export default _default;
|
|
1
|
+
declare const _default: {
|
|
2
|
+
setTitle: (title: string) => void;
|
|
3
|
+
setIcon: (paramsIcon: string) => void;
|
|
4
|
+
setAppleWebAppTitle: (title: string) => void;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
@@ -111,7 +111,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
|
|
|
111
111
|
* 获取当前的客户搜索条件
|
|
112
112
|
* @returns 当前搜索条件
|
|
113
113
|
*/
|
|
114
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
114
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
|
|
115
115
|
/**
|
|
116
116
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
117
117
|
* @returns 客户状态
|
|
@@ -138,6 +138,18 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
|
|
|
138
138
|
activateCamera(data?: {
|
|
139
139
|
[key: string]: any;
|
|
140
140
|
}): void;
|
|
141
|
+
/**
|
|
142
|
+
* 禁用所有扫描监听
|
|
143
|
+
*/
|
|
144
|
+
disableAllScanListeners(): void;
|
|
145
|
+
/**
|
|
146
|
+
* 启用所有扫描监听
|
|
147
|
+
*/
|
|
148
|
+
enableAllScanListeners(): void;
|
|
149
|
+
/**
|
|
150
|
+
* 清空所有扫描监听对应的任务执行队列
|
|
151
|
+
*/
|
|
152
|
+
clearAllScanListenersTaskQueue(): void;
|
|
141
153
|
/**
|
|
142
154
|
* 设置其他参数
|
|
143
155
|
* @param params 参数
|
|
@@ -314,8 +314,7 @@ var BookingTicketImpl = class extends import_BaseModule.BaseModule {
|
|
|
314
314
|
* @param callback 回调
|
|
315
315
|
*/
|
|
316
316
|
scanCustomerListener(callback) {
|
|
317
|
-
const
|
|
318
|
-
const scanCallback = (0, import_handleScan.handleCustomerScan)(this.request, localSearch);
|
|
317
|
+
const scanCallback = (0, import_handleScan.handleCustomerScan)();
|
|
319
318
|
const safeCallback = (d) => {
|
|
320
319
|
try {
|
|
321
320
|
callback(d);
|
|
@@ -339,6 +338,24 @@ var BookingTicketImpl = class extends import_BaseModule.BaseModule {
|
|
|
339
338
|
data
|
|
340
339
|
});
|
|
341
340
|
}
|
|
341
|
+
/**
|
|
342
|
+
* 禁用所有扫描监听
|
|
343
|
+
*/
|
|
344
|
+
disableAllScanListeners() {
|
|
345
|
+
this.scan.disableAllListeners();
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* 启用所有扫描监听
|
|
349
|
+
*/
|
|
350
|
+
enableAllScanListeners() {
|
|
351
|
+
this.scan.enableAllListeners();
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* 清空所有扫描监听对应的任务执行队列
|
|
355
|
+
*/
|
|
356
|
+
clearAllScanListenersTaskQueue() {
|
|
357
|
+
this.scan.clearTaskQueue();
|
|
358
|
+
}
|
|
342
359
|
/**
|
|
343
360
|
* 设置其他参数
|
|
344
361
|
* @param params 参数
|
|
@@ -13,7 +13,4 @@ export declare const handleGlobalScan: (request: RequestPlugin, localSearch: (v:
|
|
|
13
13
|
* @param request 请求插件
|
|
14
14
|
* @returns 处理结果
|
|
15
15
|
*/
|
|
16
|
-
export declare const handleCustomerScan: (
|
|
17
|
-
type: string;
|
|
18
|
-
value: string;
|
|
19
|
-
}) => Promise<any>;
|
|
16
|
+
export declare const handleCustomerScan: () => () => Promise<{}>;
|
|
@@ -115,20 +115,8 @@ var handleGlobalScan = (request, localSearch) => {
|
|
|
115
115
|
};
|
|
116
116
|
return handleScanFn(getRequestList, localSearch);
|
|
117
117
|
};
|
|
118
|
-
var handleCustomerScan = (
|
|
119
|
-
|
|
120
|
-
let requestList = [];
|
|
121
|
-
if (value.startsWith("WL")) {
|
|
122
|
-
requestList = [(0, import_cloudSearch.searchWallet)(request, value)];
|
|
123
|
-
} else {
|
|
124
|
-
requestList = [
|
|
125
|
-
(0, import_cloudSearch.searchWalletPass)(request, value),
|
|
126
|
-
(0, import_cloudSearch.searchWallet)(request, value)
|
|
127
|
-
];
|
|
128
|
-
}
|
|
129
|
-
return requestList;
|
|
130
|
-
};
|
|
131
|
-
return handleScanFn(getRequestList, localSearch);
|
|
118
|
+
var handleCustomerScan = () => {
|
|
119
|
+
return () => Promise.resolve({});
|
|
132
120
|
};
|
|
133
121
|
// Annotate the CommonJS export names for ESM import in node:
|
|
134
122
|
0 && (module.exports = {
|
|
@@ -32,6 +32,19 @@ export default class Scan {
|
|
|
32
32
|
* @param event 事件
|
|
33
33
|
*/
|
|
34
34
|
removeListener(event: WatchEventItem): void;
|
|
35
|
+
/**
|
|
36
|
+
* 启用所有监听
|
|
37
|
+
*/
|
|
38
|
+
enableAllListeners(): void;
|
|
39
|
+
/**
|
|
40
|
+
* 禁用所有监听,并清空任务执行队列
|
|
41
|
+
*/
|
|
42
|
+
disableAllListeners(): void;
|
|
43
|
+
/**
|
|
44
|
+
* 清空监听对应的任务执行队列,不传入eventKey则清空所有监听对应的任务执行队列
|
|
45
|
+
* @param eventKey 事件key
|
|
46
|
+
*/
|
|
47
|
+
clearTaskQueue(eventKey?: string): void;
|
|
35
48
|
/**
|
|
36
49
|
* 处理扫码事件
|
|
37
50
|
* @param eventKey 事件key
|
|
@@ -85,6 +85,38 @@ var Scan = class {
|
|
|
85
85
|
(_a = this.listenerConfig.get(event.key)) == null ? void 0 : _a.task.clear();
|
|
86
86
|
this.listenerConfig.delete(event.key);
|
|
87
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* 启用所有监听
|
|
90
|
+
*/
|
|
91
|
+
enableAllListeners() {
|
|
92
|
+
import_watch.default.enableAllEventByWatchKey(this.watchKey);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* 禁用所有监听,并清空任务执行队列
|
|
96
|
+
*/
|
|
97
|
+
disableAllListeners() {
|
|
98
|
+
var _a, _b;
|
|
99
|
+
import_watch.default.disabledAllEventByWatchKey(this.watchKey);
|
|
100
|
+
(_b = (_a = this.listenerConfig) == null ? void 0 : _a.forEach) == null ? void 0 : _b.call(_a, (item) => {
|
|
101
|
+
var _a2;
|
|
102
|
+
(_a2 = item == null ? void 0 : item.task) == null ? void 0 : _a2.clearTaskQueue();
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* 清空监听对应的任务执行队列,不传入eventKey则清空所有监听对应的任务执行队列
|
|
107
|
+
* @param eventKey 事件key
|
|
108
|
+
*/
|
|
109
|
+
clearTaskQueue(eventKey) {
|
|
110
|
+
var _a, _b, _c;
|
|
111
|
+
if (eventKey) {
|
|
112
|
+
(_a = this.listenerConfig.get(eventKey)) == null ? void 0 : _a.task.clearTaskQueue();
|
|
113
|
+
} else {
|
|
114
|
+
(_c = (_b = this.listenerConfig) == null ? void 0 : _b.forEach) == null ? void 0 : _c.call(_b, (item) => {
|
|
115
|
+
var _a2;
|
|
116
|
+
(_a2 = item == null ? void 0 : item.task) == null ? void 0 : _a2.clearTaskQueue();
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
88
120
|
/**
|
|
89
121
|
* 处理扫码事件
|
|
90
122
|
* @param eventKey 事件key
|
package/lib/utils/task.d.ts
CHANGED
package/lib/utils/task.js
CHANGED
|
@@ -32,13 +32,20 @@ var Tasks = class {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* 清空所有任务
|
|
36
36
|
*/
|
|
37
37
|
clear() {
|
|
38
38
|
this.actions.clear();
|
|
39
39
|
this.taskQueue = [];
|
|
40
40
|
this.isRunning = false;
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* 清空任务执行队列
|
|
44
|
+
*/
|
|
45
|
+
clearTaskQueue() {
|
|
46
|
+
this.taskQueue = [];
|
|
47
|
+
this.isRunning = false;
|
|
48
|
+
}
|
|
42
49
|
/**
|
|
43
50
|
* 添加action
|
|
44
51
|
* @param name action名称
|
package/lib/utils/watch.d.ts
CHANGED
package/lib/utils/watch.js
CHANGED