@pisell/pisellos 0.0.220 → 0.0.221
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 +1 -1
- package/dist/solution/BookingTicket/index.js +82 -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.js +19 -19
- package/dist/solution/BookingTicket/utils/scan/scanCache.js +52 -52
- package/dist/solution/BuyTickets/types.js +4 -4
- package/dist/utils/task.js +11 -11
- package/dist/utils/watch.js +59 -59
- 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 +1 -1
- package/lib/solution/BookingTicket/index.js +1 -2
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -4
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -14
- package/package.json +1 -1
|
@@ -1,122 +1,122 @@
|
|
|
1
|
-
import App from "../app";
|
|
2
|
-
export type LogConsoleType = "info" | "warning" | "error" | "debug";
|
|
3
|
-
/**
|
|
4
|
-
* 日志项接口
|
|
5
|
-
*/
|
|
6
|
-
interface LogItem {
|
|
7
|
-
type: LogConsoleType;
|
|
8
|
-
title: string;
|
|
9
|
-
date?: string;
|
|
10
|
-
metadata?: any;
|
|
11
|
-
}
|
|
12
|
-
interface LogFile {
|
|
13
|
-
fileName: string;
|
|
14
|
-
date: string;
|
|
15
|
-
fileContent: LogFileContent;
|
|
16
|
-
}
|
|
17
|
-
interface LogFileContent {
|
|
18
|
-
metadata: any;
|
|
19
|
-
logs: LogItem[];
|
|
20
|
-
}
|
|
21
|
-
export interface LoggerOptions {
|
|
22
|
-
prefix?: string;
|
|
23
|
-
checkInterval?: number;
|
|
24
|
-
feishuConfig?: any;
|
|
25
|
-
retentionDays?: number;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* 日志管理器类
|
|
29
|
-
*/
|
|
30
|
-
declare class LoggerManager {
|
|
31
|
-
private logBuffer;
|
|
32
|
-
private timer;
|
|
33
|
-
private checkInterval;
|
|
34
|
-
private prefix;
|
|
35
|
-
private metadata;
|
|
36
|
-
private db;
|
|
37
|
-
private app;
|
|
38
|
-
private feishuConfig;
|
|
39
|
-
private retentionDays;
|
|
40
|
-
private metadataFunction;
|
|
41
|
-
/**
|
|
42
|
-
* 构造函数
|
|
43
|
-
* @param prefix 日志前缀
|
|
44
|
-
* @param checkInterval 检查间隔时间,默认5分钟
|
|
45
|
-
*/
|
|
46
|
-
constructor(app: App, options?: LoggerOptions);
|
|
47
|
-
init(): void;
|
|
48
|
-
/**
|
|
49
|
-
* 初始化 IndexDB
|
|
50
|
-
*/
|
|
51
|
-
private initDB;
|
|
52
|
-
/**
|
|
53
|
-
* 设置元数据
|
|
54
|
-
* @param metadata 元数据
|
|
55
|
-
*/
|
|
56
|
-
setMetadata(metadata: any): void;
|
|
57
|
-
setMetadataFunction(metadataFunction: () => any): void;
|
|
58
|
-
/**
|
|
59
|
-
* 初始化定时器
|
|
60
|
-
*/
|
|
61
|
-
initTimer(): void;
|
|
62
|
-
/**
|
|
63
|
-
* 添加日志
|
|
64
|
-
* @param log 日志项
|
|
65
|
-
*/
|
|
66
|
-
addLog(log: LogItem): void;
|
|
67
|
-
/**
|
|
68
|
-
* 发送飞书通知
|
|
69
|
-
* @param log 日志项
|
|
70
|
-
*/
|
|
71
|
-
private sendFeishuNotification;
|
|
72
|
-
/**
|
|
73
|
-
* 创建日志文件名
|
|
74
|
-
* @returns 日志文件名
|
|
75
|
-
*/
|
|
76
|
-
private createFileName;
|
|
77
|
-
/**
|
|
78
|
-
* 创建日志文件
|
|
79
|
-
* @param _fileName 文件名
|
|
80
|
-
* @returns 日志文件对象
|
|
81
|
-
*/
|
|
82
|
-
private createFile;
|
|
83
|
-
/**
|
|
84
|
-
* 存储日志到持久化存储
|
|
85
|
-
*/
|
|
86
|
-
private storeLog;
|
|
87
|
-
/**
|
|
88
|
-
* 清理旧日志,只保留最近指定天数的日志
|
|
89
|
-
*/
|
|
90
|
-
private cleanupOldLogs;
|
|
91
|
-
/**
|
|
92
|
-
* 获取日志文件列表
|
|
93
|
-
* @returns 日志文件列表
|
|
94
|
-
*/
|
|
95
|
-
getLogFiles(): Promise<LogFile[]>;
|
|
96
|
-
/**
|
|
97
|
-
* 获取指定日志文件的内容
|
|
98
|
-
* @param fileName 日志文件名
|
|
99
|
-
* @returns 日志文件内容
|
|
100
|
-
*/
|
|
101
|
-
getLogFile(fileName: string): Promise<LogFile | null>;
|
|
102
|
-
/**
|
|
103
|
-
* 清空指定日志文件
|
|
104
|
-
* @param fileName 日志文件名,不指定则清空所有日志
|
|
105
|
-
* @returns 是否成功
|
|
106
|
-
*/
|
|
107
|
-
clearLogs(fileName?: string): Promise<boolean>;
|
|
108
|
-
/**
|
|
109
|
-
* 设置日志保留天数
|
|
110
|
-
* @param days 保留天数
|
|
111
|
-
*/
|
|
112
|
-
setRetentionDays(days: number): void;
|
|
113
|
-
/**
|
|
114
|
-
* 手动触发清理旧日志
|
|
115
|
-
*/
|
|
116
|
-
manualCleanup(): Promise<void>;
|
|
117
|
-
/**
|
|
118
|
-
* 销毁实例
|
|
119
|
-
*/
|
|
120
|
-
destroy(): void;
|
|
121
|
-
}
|
|
122
|
-
export default LoggerManager;
|
|
1
|
+
import App from "../app";
|
|
2
|
+
export type LogConsoleType = "info" | "warning" | "error" | "debug";
|
|
3
|
+
/**
|
|
4
|
+
* 日志项接口
|
|
5
|
+
*/
|
|
6
|
+
interface LogItem {
|
|
7
|
+
type: LogConsoleType;
|
|
8
|
+
title: string;
|
|
9
|
+
date?: string;
|
|
10
|
+
metadata?: any;
|
|
11
|
+
}
|
|
12
|
+
interface LogFile {
|
|
13
|
+
fileName: string;
|
|
14
|
+
date: string;
|
|
15
|
+
fileContent: LogFileContent;
|
|
16
|
+
}
|
|
17
|
+
interface LogFileContent {
|
|
18
|
+
metadata: any;
|
|
19
|
+
logs: LogItem[];
|
|
20
|
+
}
|
|
21
|
+
export interface LoggerOptions {
|
|
22
|
+
prefix?: string;
|
|
23
|
+
checkInterval?: number;
|
|
24
|
+
feishuConfig?: any;
|
|
25
|
+
retentionDays?: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* 日志管理器类
|
|
29
|
+
*/
|
|
30
|
+
declare class LoggerManager {
|
|
31
|
+
private logBuffer;
|
|
32
|
+
private timer;
|
|
33
|
+
private checkInterval;
|
|
34
|
+
private prefix;
|
|
35
|
+
private metadata;
|
|
36
|
+
private db;
|
|
37
|
+
private app;
|
|
38
|
+
private feishuConfig;
|
|
39
|
+
private retentionDays;
|
|
40
|
+
private metadataFunction;
|
|
41
|
+
/**
|
|
42
|
+
* 构造函数
|
|
43
|
+
* @param prefix 日志前缀
|
|
44
|
+
* @param checkInterval 检查间隔时间,默认5分钟
|
|
45
|
+
*/
|
|
46
|
+
constructor(app: App, options?: LoggerOptions);
|
|
47
|
+
init(): void;
|
|
48
|
+
/**
|
|
49
|
+
* 初始化 IndexDB
|
|
50
|
+
*/
|
|
51
|
+
private initDB;
|
|
52
|
+
/**
|
|
53
|
+
* 设置元数据
|
|
54
|
+
* @param metadata 元数据
|
|
55
|
+
*/
|
|
56
|
+
setMetadata(metadata: any): void;
|
|
57
|
+
setMetadataFunction(metadataFunction: () => any): void;
|
|
58
|
+
/**
|
|
59
|
+
* 初始化定时器
|
|
60
|
+
*/
|
|
61
|
+
initTimer(): void;
|
|
62
|
+
/**
|
|
63
|
+
* 添加日志
|
|
64
|
+
* @param log 日志项
|
|
65
|
+
*/
|
|
66
|
+
addLog(log: LogItem): void;
|
|
67
|
+
/**
|
|
68
|
+
* 发送飞书通知
|
|
69
|
+
* @param log 日志项
|
|
70
|
+
*/
|
|
71
|
+
private sendFeishuNotification;
|
|
72
|
+
/**
|
|
73
|
+
* 创建日志文件名
|
|
74
|
+
* @returns 日志文件名
|
|
75
|
+
*/
|
|
76
|
+
private createFileName;
|
|
77
|
+
/**
|
|
78
|
+
* 创建日志文件
|
|
79
|
+
* @param _fileName 文件名
|
|
80
|
+
* @returns 日志文件对象
|
|
81
|
+
*/
|
|
82
|
+
private createFile;
|
|
83
|
+
/**
|
|
84
|
+
* 存储日志到持久化存储
|
|
85
|
+
*/
|
|
86
|
+
private storeLog;
|
|
87
|
+
/**
|
|
88
|
+
* 清理旧日志,只保留最近指定天数的日志
|
|
89
|
+
*/
|
|
90
|
+
private cleanupOldLogs;
|
|
91
|
+
/**
|
|
92
|
+
* 获取日志文件列表
|
|
93
|
+
* @returns 日志文件列表
|
|
94
|
+
*/
|
|
95
|
+
getLogFiles(): Promise<LogFile[]>;
|
|
96
|
+
/**
|
|
97
|
+
* 获取指定日志文件的内容
|
|
98
|
+
* @param fileName 日志文件名
|
|
99
|
+
* @returns 日志文件内容
|
|
100
|
+
*/
|
|
101
|
+
getLogFile(fileName: string): Promise<LogFile | null>;
|
|
102
|
+
/**
|
|
103
|
+
* 清空指定日志文件
|
|
104
|
+
* @param fileName 日志文件名,不指定则清空所有日志
|
|
105
|
+
* @returns 是否成功
|
|
106
|
+
*/
|
|
107
|
+
clearLogs(fileName?: string): Promise<boolean>;
|
|
108
|
+
/**
|
|
109
|
+
* 设置日志保留天数
|
|
110
|
+
* @param days 保留天数
|
|
111
|
+
*/
|
|
112
|
+
setRetentionDays(days: number): void;
|
|
113
|
+
/**
|
|
114
|
+
* 手动触发清理旧日志
|
|
115
|
+
*/
|
|
116
|
+
manualCleanup(): Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* 销毁实例
|
|
119
|
+
*/
|
|
120
|
+
destroy(): void;
|
|
121
|
+
}
|
|
122
|
+
export default LoggerManager;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { MenuItem } from "./index";
|
|
3
|
-
export declare const isHttp: (url: string) => boolean;
|
|
4
|
-
export interface MenuContextType {
|
|
5
|
-
selectedKeys: string[];
|
|
6
|
-
openKeys: string[];
|
|
7
|
-
setOpenKeys: (keys: string[]) => void;
|
|
8
|
-
handleClick: (key: string) => void;
|
|
9
|
-
menuItems: MenuItem[];
|
|
10
|
-
getShowChildren: (children: MenuItem[]) => MenuItem[];
|
|
11
|
-
setMenuItems: (items: MenuItem[]) => void;
|
|
12
|
-
}
|
|
13
|
-
export declare const MenuProvider: React.FC<{
|
|
14
|
-
children: React.ReactNode;
|
|
15
|
-
menus: MenuItem[];
|
|
16
|
-
}>;
|
|
17
|
-
export declare const useMenu: () => MenuContextType;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MenuItem } from "./index";
|
|
3
|
+
export declare const isHttp: (url: string) => boolean;
|
|
4
|
+
export interface MenuContextType {
|
|
5
|
+
selectedKeys: string[];
|
|
6
|
+
openKeys: string[];
|
|
7
|
+
setOpenKeys: (keys: string[]) => void;
|
|
8
|
+
handleClick: (key: string) => void;
|
|
9
|
+
menuItems: MenuItem[];
|
|
10
|
+
getShowChildren: (children: MenuItem[]) => MenuItem[];
|
|
11
|
+
setMenuItems: (items: MenuItem[]) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const MenuProvider: React.FC<{
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
menus: MenuItem[];
|
|
16
|
+
}>;
|
|
17
|
+
export declare const useMenu: () => MenuContextType;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import App from '../app';
|
|
3
|
-
export interface MenuItem {
|
|
4
|
-
key: string;
|
|
5
|
-
label: string;
|
|
6
|
-
path: string;
|
|
7
|
-
children?: MenuItem[];
|
|
8
|
-
icon?: string | React.ReactNode;
|
|
9
|
-
hide?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare class MenuManager {
|
|
12
|
-
private menuItems;
|
|
13
|
-
private menuMaps;
|
|
14
|
-
private app;
|
|
15
|
-
useMenu: () => import("./hooks").MenuContextType;
|
|
16
|
-
MenuProvider: React.FC<{
|
|
17
|
-
children: React.ReactNode;
|
|
18
|
-
menus: MenuItem[];
|
|
19
|
-
}>;
|
|
20
|
-
constructor(items: MenuItem[], app: App);
|
|
21
|
-
set(items: MenuItem[]): void;
|
|
22
|
-
getMenus(): MenuItem[];
|
|
23
|
-
getMenuMaps(): void;
|
|
24
|
-
findMenuItemByPath(items: MenuItem[], path: string): MenuItem | null;
|
|
25
|
-
findParent(items: MenuItem[], key: string, parent?: MenuItem | null): MenuItem | null;
|
|
26
|
-
getShowChildren(items: MenuItem[]): MenuItem[];
|
|
27
|
-
findMenuItemByKey(items: MenuItem[], key: string): MenuItem | null;
|
|
28
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import App from '../app';
|
|
3
|
+
export interface MenuItem {
|
|
4
|
+
key: string;
|
|
5
|
+
label: string;
|
|
6
|
+
path: string;
|
|
7
|
+
children?: MenuItem[];
|
|
8
|
+
icon?: string | React.ReactNode;
|
|
9
|
+
hide?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare class MenuManager {
|
|
12
|
+
private menuItems;
|
|
13
|
+
private menuMaps;
|
|
14
|
+
private app;
|
|
15
|
+
useMenu: () => import("./hooks").MenuContextType;
|
|
16
|
+
MenuProvider: React.FC<{
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
menus: MenuItem[];
|
|
19
|
+
}>;
|
|
20
|
+
constructor(items: MenuItem[], app: App);
|
|
21
|
+
set(items: MenuItem[]): void;
|
|
22
|
+
getMenus(): MenuItem[];
|
|
23
|
+
getMenuMaps(): void;
|
|
24
|
+
findMenuItemByPath(items: MenuItem[], path: string): MenuItem | null;
|
|
25
|
+
findParent(items: MenuItem[], key: string, parent?: MenuItem | null): MenuItem | null;
|
|
26
|
+
getShowChildren(items: MenuItem[]): MenuItem[];
|
|
27
|
+
findMenuItemByKey(items: MenuItem[], key: string): MenuItem | null;
|
|
28
|
+
}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { Effect, Subscription } from 'dva';
|
|
2
|
-
import { Reducer } from 'redux';
|
|
3
|
-
export interface GlobalModal {
|
|
4
|
-
namespace: 'global';
|
|
5
|
-
state: {
|
|
6
|
-
isLogin: boolean;
|
|
7
|
-
account: any;
|
|
8
|
-
core: any;
|
|
9
|
-
isInstallAPP: boolean;
|
|
10
|
-
app: {
|
|
11
|
-
status: {
|
|
12
|
-
login: boolean;
|
|
13
|
-
storage: boolean;
|
|
14
|
-
network: boolean;
|
|
15
|
-
materials: boolean;
|
|
16
|
-
pisell2: boolean;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
effects: {
|
|
21
|
-
init: Effect;
|
|
22
|
-
};
|
|
23
|
-
reducers: {
|
|
24
|
-
saveGlobalState: Reducer<any>;
|
|
25
|
-
setInit: Reducer<any>;
|
|
26
|
-
};
|
|
27
|
-
subscriptions: {
|
|
28
|
-
_init: Subscription;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
declare const modal: GlobalModal;
|
|
32
|
-
export default modal;
|
|
1
|
+
import { Effect, Subscription } from 'dva';
|
|
2
|
+
import { Reducer } from 'redux';
|
|
3
|
+
export interface GlobalModal {
|
|
4
|
+
namespace: 'global';
|
|
5
|
+
state: {
|
|
6
|
+
isLogin: boolean;
|
|
7
|
+
account: any;
|
|
8
|
+
core: any;
|
|
9
|
+
isInstallAPP: boolean;
|
|
10
|
+
app: {
|
|
11
|
+
status: {
|
|
12
|
+
login: boolean;
|
|
13
|
+
storage: boolean;
|
|
14
|
+
network: boolean;
|
|
15
|
+
materials: boolean;
|
|
16
|
+
pisell2: boolean;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
effects: {
|
|
21
|
+
init: Effect;
|
|
22
|
+
};
|
|
23
|
+
reducers: {
|
|
24
|
+
saveGlobalState: Reducer<any>;
|
|
25
|
+
setInit: Reducer<any>;
|
|
26
|
+
};
|
|
27
|
+
subscriptions: {
|
|
28
|
+
_init: Subscription;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
declare const modal: GlobalModal;
|
|
32
|
+
export default modal;
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import hooks from '../hooks';
|
|
2
|
-
import { Provider as StoreProvider } from "react-redux";
|
|
3
|
-
declare const models: import("./global").GlobalModal[];
|
|
4
|
-
type ModalsType = (typeof models[number]);
|
|
5
|
-
export interface Store {
|
|
6
|
-
getDataByModel: typeof getDataByModel;
|
|
7
|
-
useStore: typeof hooks.useStore;
|
|
8
|
-
useDispatch: typeof hooks.useDispatch;
|
|
9
|
-
setDataByModel: typeof setDataByModel;
|
|
10
|
-
dispatch: any;
|
|
11
|
-
getState: any;
|
|
12
|
-
}
|
|
13
|
-
export type ModelsNames = ModalsType['namespace'];
|
|
14
|
-
export type ModelsState = {
|
|
15
|
-
[K in (ModalsType['namespace'])]: Extract<ModalsType, {
|
|
16
|
-
namespace: K;
|
|
17
|
-
}>['state'];
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* @title: 从store内获取数据
|
|
21
|
-
* @description:
|
|
22
|
-
* @param {string} model
|
|
23
|
-
* @param {string} key
|
|
24
|
-
* @return {*}
|
|
25
|
-
* @Author: zhiwei.Wang
|
|
26
|
-
* @Date: 2024-09-03 11:07
|
|
27
|
-
*/
|
|
28
|
-
declare const getDataByModel: <T extends keyof ModelsState, D extends keyof ModelsState[T]>(model: string, key?: D) => D extends undefined ? ModelsState[T] : ModelsState[T][D];
|
|
29
|
-
/**
|
|
30
|
-
* @title: 设置数据到store
|
|
31
|
-
* @description:
|
|
32
|
-
* @param {string} model
|
|
33
|
-
* @param {string} key
|
|
34
|
-
* @param {string} value
|
|
35
|
-
* @return {*}
|
|
36
|
-
* @Author: zhiwei.Wang
|
|
37
|
-
* @Date: 2024-09-08 15:17
|
|
38
|
-
*/
|
|
39
|
-
declare const setDataByModel: <T extends keyof ModelsState, D extends keyof ModelsState[T]>(model: string, key: any, value: any) => void;
|
|
40
|
-
declare const _default: {
|
|
41
|
-
getStore: () => Store;
|
|
42
|
-
StoreProvider: typeof StoreProvider;
|
|
43
|
-
setConfig: (models: any[]) => void;
|
|
44
|
-
};
|
|
45
|
-
export default _default;
|
|
1
|
+
import hooks from '../hooks';
|
|
2
|
+
import { Provider as StoreProvider } from "react-redux";
|
|
3
|
+
declare const models: import("./global").GlobalModal[];
|
|
4
|
+
type ModalsType = (typeof models[number]);
|
|
5
|
+
export interface Store {
|
|
6
|
+
getDataByModel: typeof getDataByModel;
|
|
7
|
+
useStore: typeof hooks.useStore;
|
|
8
|
+
useDispatch: typeof hooks.useDispatch;
|
|
9
|
+
setDataByModel: typeof setDataByModel;
|
|
10
|
+
dispatch: any;
|
|
11
|
+
getState: any;
|
|
12
|
+
}
|
|
13
|
+
export type ModelsNames = ModalsType['namespace'];
|
|
14
|
+
export type ModelsState = {
|
|
15
|
+
[K in (ModalsType['namespace'])]: Extract<ModalsType, {
|
|
16
|
+
namespace: K;
|
|
17
|
+
}>['state'];
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* @title: 从store内获取数据
|
|
21
|
+
* @description:
|
|
22
|
+
* @param {string} model
|
|
23
|
+
* @param {string} key
|
|
24
|
+
* @return {*}
|
|
25
|
+
* @Author: zhiwei.Wang
|
|
26
|
+
* @Date: 2024-09-03 11:07
|
|
27
|
+
*/
|
|
28
|
+
declare const getDataByModel: <T extends keyof ModelsState, D extends keyof ModelsState[T]>(model: string, key?: D) => D extends undefined ? ModelsState[T] : ModelsState[T][D];
|
|
29
|
+
/**
|
|
30
|
+
* @title: 设置数据到store
|
|
31
|
+
* @description:
|
|
32
|
+
* @param {string} model
|
|
33
|
+
* @param {string} key
|
|
34
|
+
* @param {string} value
|
|
35
|
+
* @return {*}
|
|
36
|
+
* @Author: zhiwei.Wang
|
|
37
|
+
* @Date: 2024-09-08 15:17
|
|
38
|
+
*/
|
|
39
|
+
declare const setDataByModel: <T extends keyof ModelsState, D extends keyof ModelsState[T]>(model: string, key: any, value: any) => void;
|
|
40
|
+
declare const _default: {
|
|
41
|
+
getStore: () => Store;
|
|
42
|
+
StoreProvider: typeof StoreProvider;
|
|
43
|
+
setConfig: (models: any[]) => void;
|
|
44
|
+
};
|
|
45
|
+
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export interface ModelsConfig {
|
|
2
|
-
}
|
|
1
|
+
export interface ModelsConfig {
|
|
2
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@pisell/core-types",
|
|
3
|
-
"version": "1.0.1",
|
|
4
|
-
"description": "TypeScript type definitions for @pisell/core",
|
|
5
|
-
"main": "index.d.ts",
|
|
6
|
-
"types": "index.d.ts",
|
|
7
|
-
"typings": "index.d.ts",
|
|
8
|
-
"peerDependencies": {
|
|
9
|
-
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
10
|
-
},
|
|
11
|
-
"files": ["**/*.d.ts"],
|
|
12
|
-
"publishConfig": {
|
|
13
|
-
"access": "public"
|
|
14
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@pisell/core-types",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "TypeScript type definitions for @pisell/core",
|
|
5
|
+
"main": "index.d.ts",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"typings": "index.d.ts",
|
|
8
|
+
"peerDependencies": {
|
|
9
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
10
|
+
},
|
|
11
|
+
"files": ["**/*.d.ts"],
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
}
|
|
15
15
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 发布订阅模块使用示例
|
|
3
|
-
* 此文件仅用于演示,不会被实际引入项目
|
|
4
|
-
*/
|
|
5
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* 发布订阅模块使用示例
|
|
3
|
+
* 此文件仅用于演示,不会被实际引入项目
|
|
4
|
+
*/
|
|
5
|
+
export {};
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 发布订阅模块
|
|
3
|
-
* 用于组件/服务间的事件通信
|
|
4
|
-
*/
|
|
5
|
-
type EventCallback = (...args: any[]) => void;
|
|
6
|
-
interface EventSubscription {
|
|
7
|
-
unsubscribe: () => void;
|
|
8
|
-
}
|
|
9
|
-
declare class PubSub {
|
|
10
|
-
private events;
|
|
11
|
-
/**
|
|
12
|
-
* 订阅事件
|
|
13
|
-
* @param event 事件名称
|
|
14
|
-
* @param callback 回调函数
|
|
15
|
-
* @returns 订阅对象,可用于取消订阅
|
|
16
|
-
*/
|
|
17
|
-
subscribe(event: string, callback: EventCallback): EventSubscription;
|
|
18
|
-
/**
|
|
19
|
-
* 取消订阅事件
|
|
20
|
-
* @param event 事件名称
|
|
21
|
-
* @param callback 回调函数
|
|
22
|
-
* @returns 是否成功取消订阅
|
|
23
|
-
*/
|
|
24
|
-
unsubscribe(event: string, callback: EventCallback): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* 发布事件
|
|
27
|
-
* @param event 事件名称
|
|
28
|
-
* @param args 事件参数
|
|
29
|
-
*/
|
|
30
|
-
publish(event: string, ...args: any[]): void;
|
|
31
|
-
/**
|
|
32
|
-
* 移除某个事件的所有订阅
|
|
33
|
-
* @param event 事件名称
|
|
34
|
-
* @returns 是否成功移除
|
|
35
|
-
*/
|
|
36
|
-
clearEvent(event: string): boolean;
|
|
37
|
-
/**
|
|
38
|
-
* 移除所有事件订阅
|
|
39
|
-
*/
|
|
40
|
-
clearAllEvents(): void;
|
|
41
|
-
/**
|
|
42
|
-
* 获取事件的订阅数量
|
|
43
|
-
* @param event 事件名称
|
|
44
|
-
* @returns 订阅数量
|
|
45
|
-
*/
|
|
46
|
-
getSubscriberCount(event: string): number;
|
|
47
|
-
/**
|
|
48
|
-
* 检查事件是否有订阅者
|
|
49
|
-
* @param event 事件名称
|
|
50
|
-
* @returns 是否有订阅者
|
|
51
|
-
*/
|
|
52
|
-
hasSubscribers(event: string): boolean;
|
|
53
|
-
/**
|
|
54
|
-
* 一次性订阅事件,事件触发后自动取消订阅
|
|
55
|
-
* @param event 事件名称
|
|
56
|
-
* @param callback 回调函数
|
|
57
|
-
* @returns 订阅对象,可用于取消订阅
|
|
58
|
-
*/
|
|
59
|
-
once(event: string, callback: EventCallback): EventSubscription;
|
|
60
|
-
}
|
|
61
|
-
declare const pubsub: PubSub;
|
|
62
|
-
export default pubsub;
|
|
63
|
-
export { PubSub, type EventCallback, type EventSubscription };
|
|
1
|
+
/**
|
|
2
|
+
* 发布订阅模块
|
|
3
|
+
* 用于组件/服务间的事件通信
|
|
4
|
+
*/
|
|
5
|
+
type EventCallback = (...args: any[]) => void;
|
|
6
|
+
interface EventSubscription {
|
|
7
|
+
unsubscribe: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare class PubSub {
|
|
10
|
+
private events;
|
|
11
|
+
/**
|
|
12
|
+
* 订阅事件
|
|
13
|
+
* @param event 事件名称
|
|
14
|
+
* @param callback 回调函数
|
|
15
|
+
* @returns 订阅对象,可用于取消订阅
|
|
16
|
+
*/
|
|
17
|
+
subscribe(event: string, callback: EventCallback): EventSubscription;
|
|
18
|
+
/**
|
|
19
|
+
* 取消订阅事件
|
|
20
|
+
* @param event 事件名称
|
|
21
|
+
* @param callback 回调函数
|
|
22
|
+
* @returns 是否成功取消订阅
|
|
23
|
+
*/
|
|
24
|
+
unsubscribe(event: string, callback: EventCallback): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* 发布事件
|
|
27
|
+
* @param event 事件名称
|
|
28
|
+
* @param args 事件参数
|
|
29
|
+
*/
|
|
30
|
+
publish(event: string, ...args: any[]): void;
|
|
31
|
+
/**
|
|
32
|
+
* 移除某个事件的所有订阅
|
|
33
|
+
* @param event 事件名称
|
|
34
|
+
* @returns 是否成功移除
|
|
35
|
+
*/
|
|
36
|
+
clearEvent(event: string): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* 移除所有事件订阅
|
|
39
|
+
*/
|
|
40
|
+
clearAllEvents(): void;
|
|
41
|
+
/**
|
|
42
|
+
* 获取事件的订阅数量
|
|
43
|
+
* @param event 事件名称
|
|
44
|
+
* @returns 订阅数量
|
|
45
|
+
*/
|
|
46
|
+
getSubscriberCount(event: string): number;
|
|
47
|
+
/**
|
|
48
|
+
* 检查事件是否有订阅者
|
|
49
|
+
* @param event 事件名称
|
|
50
|
+
* @returns 是否有订阅者
|
|
51
|
+
*/
|
|
52
|
+
hasSubscribers(event: string): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* 一次性订阅事件,事件触发后自动取消订阅
|
|
55
|
+
* @param event 事件名称
|
|
56
|
+
* @param callback 回调函数
|
|
57
|
+
* @returns 订阅对象,可用于取消订阅
|
|
58
|
+
*/
|
|
59
|
+
once(event: string, callback: EventCallback): EventSubscription;
|
|
60
|
+
}
|
|
61
|
+
declare const pubsub: PubSub;
|
|
62
|
+
export default pubsub;
|
|
63
|
+
export { PubSub, type EventCallback, type EventSubscription };
|