@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
|
@@ -5,10 +5,10 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
5
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
-
/**
|
|
9
|
-
* 简单的数据压缩函数
|
|
10
|
-
* @param data 要压缩的数据
|
|
11
|
-
* @returns 压缩后的字符串
|
|
8
|
+
/**
|
|
9
|
+
* 简单的数据压缩函数
|
|
10
|
+
* @param data 要压缩的数据
|
|
11
|
+
* @returns 压缩后的字符串
|
|
12
12
|
*/
|
|
13
13
|
var compressData = function compressData(data) {
|
|
14
14
|
try {
|
|
@@ -23,10 +23,10 @@ var compressData = function compressData(data) {
|
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
/**
|
|
27
|
-
* 数据解压缩函数
|
|
28
|
-
* @param compressedData 压缩后的数据
|
|
29
|
-
* @returns 解压缩后的数据
|
|
26
|
+
/**
|
|
27
|
+
* 数据解压缩函数
|
|
28
|
+
* @param compressedData 压缩后的数据
|
|
29
|
+
* @returns 解压缩后的数据
|
|
30
30
|
*/
|
|
31
31
|
var decompressData = function decompressData(compressedData) {
|
|
32
32
|
try {
|
|
@@ -41,14 +41,14 @@ var decompressData = function decompressData(compressedData) {
|
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
/**
|
|
45
|
-
* 双向链表节点
|
|
44
|
+
/**
|
|
45
|
+
* 双向链表节点
|
|
46
46
|
*/
|
|
47
|
-
/**
|
|
48
|
-
* LRU缓存类,用于缓存接口数据
|
|
49
|
-
* 限制最多存储100条数据,超过时移除最久未使用的数据
|
|
50
|
-
* 支持数据压缩以减小缓存压力
|
|
51
|
-
* 尾部优先策略:新节点插入尾部,最近使用的节点移动到尾部,删除头部节点
|
|
47
|
+
/**
|
|
48
|
+
* LRU缓存类,用于缓存接口数据
|
|
49
|
+
* 限制最多存储100条数据,超过时移除最久未使用的数据
|
|
50
|
+
* 支持数据压缩以减小缓存压力
|
|
51
|
+
* 尾部优先策略:新节点插入尾部,最近使用的节点移动到尾部,删除头部节点
|
|
52
52
|
*/
|
|
53
53
|
var LRUCache = /*#__PURE__*/function () {
|
|
54
54
|
function LRUCache() {
|
|
@@ -64,9 +64,9 @@ var LRUCache = /*#__PURE__*/function () {
|
|
|
64
64
|
this.maxSize = maxSize;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
/**
|
|
68
|
-
* 将节点移动到链表尾部(最近使用)
|
|
69
|
-
* @param node 要移动的节点
|
|
67
|
+
/**
|
|
68
|
+
* 将节点移动到链表尾部(最近使用)
|
|
69
|
+
* @param node 要移动的节点
|
|
70
70
|
*/
|
|
71
71
|
_createClass(LRUCache, [{
|
|
72
72
|
key: "moveToTail",
|
|
@@ -100,11 +100,11 @@ var LRUCache = /*#__PURE__*/function () {
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
/**
|
|
104
|
-
* 添加新节点到链表尾部
|
|
105
|
-
* @param key 缓存键
|
|
106
|
-
* @param compressedData 压缩后的数据
|
|
107
|
-
* @param timestamp 时间戳
|
|
103
|
+
/**
|
|
104
|
+
* 添加新节点到链表尾部
|
|
105
|
+
* @param key 缓存键
|
|
106
|
+
* @param compressedData 压缩后的数据
|
|
107
|
+
* @param timestamp 时间戳
|
|
108
108
|
*/
|
|
109
109
|
}, {
|
|
110
110
|
key: "addToTail",
|
|
@@ -136,9 +136,9 @@ var LRUCache = /*#__PURE__*/function () {
|
|
|
136
136
|
return node;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
/**
|
|
140
|
-
* 从链表中移除节点
|
|
141
|
-
* @param node 要移除的节点
|
|
139
|
+
/**
|
|
140
|
+
* 从链表中移除节点
|
|
141
|
+
* @param node 要移除的节点
|
|
142
142
|
*/
|
|
143
143
|
}, {
|
|
144
144
|
key: "removeNode",
|
|
@@ -160,8 +160,8 @@ var LRUCache = /*#__PURE__*/function () {
|
|
|
160
160
|
this.keyMap.delete(node.key);
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
/**
|
|
164
|
-
* 移除最久未使用的节点(链表头部)
|
|
163
|
+
/**
|
|
164
|
+
* 移除最久未使用的节点(链表头部)
|
|
165
165
|
*/
|
|
166
166
|
}, {
|
|
167
167
|
key: "removeOldest",
|
|
@@ -171,10 +171,10 @@ var LRUCache = /*#__PURE__*/function () {
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
/**
|
|
175
|
-
* 设置缓存
|
|
176
|
-
* @param key 缓存键
|
|
177
|
-
* @param data 缓存数据
|
|
174
|
+
/**
|
|
175
|
+
* 设置缓存
|
|
176
|
+
* @param key 缓存键
|
|
177
|
+
* @param data 缓存数据
|
|
178
178
|
*/
|
|
179
179
|
}, {
|
|
180
180
|
key: "set",
|
|
@@ -201,10 +201,10 @@ var LRUCache = /*#__PURE__*/function () {
|
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
/**
|
|
205
|
-
* 获取缓存
|
|
206
|
-
* @param key 缓存键
|
|
207
|
-
* @returns 缓存数据或undefined
|
|
204
|
+
/**
|
|
205
|
+
* 获取缓存
|
|
206
|
+
* @param key 缓存键
|
|
207
|
+
* @returns 缓存数据或undefined
|
|
208
208
|
*/
|
|
209
209
|
}, {
|
|
210
210
|
key: "get",
|
|
@@ -227,10 +227,10 @@ var LRUCache = /*#__PURE__*/function () {
|
|
|
227
227
|
return undefined;
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
/**
|
|
231
|
-
* 检查是否存在缓存
|
|
232
|
-
* @param key 缓存键
|
|
233
|
-
* @returns 是否存在
|
|
230
|
+
/**
|
|
231
|
+
* 检查是否存在缓存
|
|
232
|
+
* @param key 缓存键
|
|
233
|
+
* @returns 是否存在
|
|
234
234
|
*/
|
|
235
235
|
}, {
|
|
236
236
|
key: "has",
|
|
@@ -238,8 +238,8 @@ var LRUCache = /*#__PURE__*/function () {
|
|
|
238
238
|
return this.keyMap.has(key);
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
-
/**
|
|
242
|
-
* 清除所有缓存
|
|
241
|
+
/**
|
|
242
|
+
* 清除所有缓存
|
|
243
243
|
*/
|
|
244
244
|
}, {
|
|
245
245
|
key: "clear",
|
|
@@ -259,9 +259,9 @@ var LRUCache = /*#__PURE__*/function () {
|
|
|
259
259
|
this.tail = null;
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
-
/**
|
|
263
|
-
* 获取缓存大小
|
|
264
|
-
* @returns 当前缓存数量
|
|
262
|
+
/**
|
|
263
|
+
* 获取缓存大小
|
|
264
|
+
* @returns 当前缓存数量
|
|
265
265
|
*/
|
|
266
266
|
}, {
|
|
267
267
|
key: "size",
|
|
@@ -269,9 +269,9 @@ var LRUCache = /*#__PURE__*/function () {
|
|
|
269
269
|
return this.keyMap.size;
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
-
/**
|
|
273
|
-
* 获取缓存统计信息
|
|
274
|
-
* @returns 缓存统计信息
|
|
272
|
+
/**
|
|
273
|
+
* 获取缓存统计信息
|
|
274
|
+
* @returns 缓存统计信息
|
|
275
275
|
*/
|
|
276
276
|
}, {
|
|
277
277
|
key: "getStats",
|
|
@@ -283,10 +283,10 @@ var LRUCache = /*#__PURE__*/function () {
|
|
|
283
283
|
};
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
-
/**
|
|
287
|
-
* 删除指定的缓存项
|
|
288
|
-
* @param key 要删除的缓存键
|
|
289
|
-
* @returns 是否删除成功
|
|
286
|
+
/**
|
|
287
|
+
* 删除指定的缓存项
|
|
288
|
+
* @param key 要删除的缓存键
|
|
289
|
+
* @returns 是否删除成功
|
|
290
290
|
*/
|
|
291
291
|
}, {
|
|
292
292
|
key: "delete",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 购票流程hook
|
|
1
|
+
/**
|
|
2
|
+
* 购票流程hook
|
|
3
3
|
*/
|
|
4
4
|
export var BuyTicketsHooks = /*#__PURE__*/function (BuyTicketsHooks) {
|
|
5
5
|
BuyTicketsHooks["onInited"] = "buyTickets:onInited";
|
|
@@ -14,6 +14,6 @@ export var BuyTicketsHooks = /*#__PURE__*/function (BuyTicketsHooks) {
|
|
|
14
14
|
return BuyTicketsHooks;
|
|
15
15
|
}({});
|
|
16
16
|
|
|
17
|
-
/**
|
|
18
|
-
* 票务状态接口
|
|
17
|
+
/**
|
|
18
|
+
* 票务状态接口
|
|
19
19
|
*/
|
package/dist/utils/task.d.ts
CHANGED
package/dist/utils/task.js
CHANGED
|
@@ -19,8 +19,8 @@ var Tasks = /*#__PURE__*/function () {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
22
|
+
/**
|
|
23
|
+
* 清空所有任务
|
|
24
24
|
*/
|
|
25
25
|
_createClass(Tasks, [{
|
|
26
26
|
key: "clear",
|
|
@@ -30,10 +30,20 @@ var Tasks = /*#__PURE__*/function () {
|
|
|
30
30
|
this.isRunning = false;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
/**
|
|
34
|
-
*
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
/**
|
|
34
|
+
* 清空任务执行队列
|
|
35
|
+
*/
|
|
36
|
+
}, {
|
|
37
|
+
key: "clearTaskQueue",
|
|
38
|
+
value: function clearTaskQueue() {
|
|
39
|
+
this.taskQueue = [];
|
|
40
|
+
this.isRunning = false;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* 添加action
|
|
45
|
+
* @param name action名称
|
|
46
|
+
* @param action action函数
|
|
37
47
|
*/
|
|
38
48
|
}, {
|
|
39
49
|
key: "addAction",
|
|
@@ -41,9 +51,9 @@ var Tasks = /*#__PURE__*/function () {
|
|
|
41
51
|
this.actions.set(name, action);
|
|
42
52
|
}
|
|
43
53
|
|
|
44
|
-
/**
|
|
45
|
-
* 添加任务
|
|
46
|
-
* @param task 任务
|
|
54
|
+
/**
|
|
55
|
+
* 添加任务
|
|
56
|
+
* @param task 任务
|
|
47
57
|
*/
|
|
48
58
|
}, {
|
|
49
59
|
key: "addTask",
|
|
@@ -53,8 +63,8 @@ var Tasks = /*#__PURE__*/function () {
|
|
|
53
63
|
this.run();
|
|
54
64
|
}
|
|
55
65
|
|
|
56
|
-
/**
|
|
57
|
-
* 执行任务
|
|
66
|
+
/**
|
|
67
|
+
* 执行任务
|
|
58
68
|
*/
|
|
59
69
|
}, {
|
|
60
70
|
key: "run",
|
|
@@ -121,30 +131,4 @@ var Tasks = /*#__PURE__*/function () {
|
|
|
121
131
|
}]);
|
|
122
132
|
return Tasks;
|
|
123
133
|
}();
|
|
124
|
-
export default Tasks;
|
|
125
|
-
|
|
126
|
-
// const tasks = new Tasks(new Map([
|
|
127
|
-
// ['查询客户', async () => {
|
|
128
|
-
// console.log('action1');
|
|
129
|
-
// // 1. 获取东西
|
|
130
|
-
// }],
|
|
131
|
-
// ['action2', async () => {
|
|
132
|
-
// console.log('action2');
|
|
133
|
-
// }],
|
|
134
|
-
// ]));
|
|
135
|
-
|
|
136
|
-
// const fn = (str: string) => {
|
|
137
|
-
|
|
138
|
-
// if (str === '查询客户') {
|
|
139
|
-
// tasks.addTask({ type: '查询客户' });
|
|
140
|
-
// }
|
|
141
|
-
// if (str === '查询客户') {
|
|
142
|
-
// tasks.addTask({ type: '查询客户' });
|
|
143
|
-
// }
|
|
144
|
-
// if (str === '查询客户') {
|
|
145
|
-
// tasks.addTask({ type: '查询客户' });
|
|
146
|
-
// }
|
|
147
|
-
// if (str === '查询客户') {
|
|
148
|
-
// tasks.addTask({ type: '查询客户' });
|
|
149
|
-
// }
|
|
150
|
-
// }
|
|
134
|
+
export default Tasks;
|
package/dist/utils/watch.d.ts
CHANGED
package/dist/utils/watch.js
CHANGED
|
@@ -5,9 +5,9 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
5
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
-
/**
|
|
9
|
-
* 监听模块
|
|
10
|
-
*
|
|
8
|
+
/**
|
|
9
|
+
* 监听模块
|
|
10
|
+
*
|
|
11
11
|
*/
|
|
12
12
|
var Watch = /*#__PURE__*/function () {
|
|
13
13
|
function Watch() {
|
|
@@ -20,11 +20,11 @@ var Watch = /*#__PURE__*/function () {
|
|
|
20
20
|
_createClass(Watch, [{
|
|
21
21
|
key: "subscribe",
|
|
22
22
|
value:
|
|
23
|
-
/**
|
|
24
|
-
* 订阅事件
|
|
25
|
-
* @param event 事件名称
|
|
26
|
-
* @param callback 回调函数
|
|
27
|
-
* @returns 订阅对象,可用于取消订阅
|
|
23
|
+
/**
|
|
24
|
+
* 订阅事件
|
|
25
|
+
* @param event 事件名称
|
|
26
|
+
* @param callback 回调函数
|
|
27
|
+
* @returns 订阅对象,可用于取消订阅
|
|
28
28
|
*/
|
|
29
29
|
function subscribe(watchKey, event) {
|
|
30
30
|
var _this = this;
|
|
@@ -49,10 +49,10 @@ var Watch = /*#__PURE__*/function () {
|
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
/**
|
|
53
|
-
* 启用事件
|
|
54
|
-
* @param watchKey 监听的key
|
|
55
|
-
* @param event 事件名称
|
|
52
|
+
/**
|
|
53
|
+
* 启用事件
|
|
54
|
+
* @param watchKey 监听的key
|
|
55
|
+
* @param event 事件名称
|
|
56
56
|
*/
|
|
57
57
|
}, {
|
|
58
58
|
key: "enableEvent",
|
|
@@ -71,10 +71,10 @@ var Watch = /*#__PURE__*/function () {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
/**
|
|
75
|
-
* 禁用某个事件
|
|
76
|
-
* @param watchKey 监听的key
|
|
77
|
-
* @param eventKey 事件名称
|
|
74
|
+
/**
|
|
75
|
+
* 禁用某个事件
|
|
76
|
+
* @param watchKey 监听的key
|
|
77
|
+
* @param eventKey 事件名称
|
|
78
78
|
*/
|
|
79
79
|
}, {
|
|
80
80
|
key: "disableEvent",
|
|
@@ -91,9 +91,9 @@ var Watch = /*#__PURE__*/function () {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
/**
|
|
95
|
-
* 冻结某个监听下的所有事件
|
|
96
|
-
* @param watchKey 监听的key
|
|
94
|
+
/**
|
|
95
|
+
* 冻结某个监听下的所有事件
|
|
96
|
+
* @param watchKey 监听的key
|
|
97
97
|
*/
|
|
98
98
|
}, {
|
|
99
99
|
key: "disabledAllEventByWatchKey",
|
|
@@ -102,9 +102,9 @@ var Watch = /*#__PURE__*/function () {
|
|
|
102
102
|
this.enableListMap.set(watchKey, []);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
/**
|
|
106
|
-
* 启用某个监听下的所有事件
|
|
107
|
-
* @param watchKey 监听的key
|
|
105
|
+
/**
|
|
106
|
+
* 启用某个监听下的所有事件
|
|
107
|
+
* @param watchKey 监听的key
|
|
108
108
|
*/
|
|
109
109
|
}, {
|
|
110
110
|
key: "enableAllEventByWatchKey",
|
|
@@ -114,11 +114,11 @@ var Watch = /*#__PURE__*/function () {
|
|
|
114
114
|
this.enableListMap.set(watchKey, Array.from(((_this$events$get = this.events.get(watchKey)) === null || _this$events$get === void 0 ? void 0 : _this$events$get.keys()) || []));
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
/**
|
|
118
|
-
* 取消订阅事件
|
|
119
|
-
* @param event 事件名称
|
|
120
|
-
* @param callback 回调函数
|
|
121
|
-
* @returns 是否成功取消订阅
|
|
117
|
+
/**
|
|
118
|
+
* 取消订阅事件
|
|
119
|
+
* @param event 事件名称
|
|
120
|
+
* @param callback 回调函数
|
|
121
|
+
* @returns 是否成功取消订阅
|
|
122
122
|
*/
|
|
123
123
|
}, {
|
|
124
124
|
key: "unsubscribe",
|
|
@@ -136,10 +136,10 @@ var Watch = /*#__PURE__*/function () {
|
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
/**
|
|
140
|
-
* 发布事件
|
|
141
|
-
* @param event 事件名称
|
|
142
|
-
* @param args 事件参数
|
|
139
|
+
/**
|
|
140
|
+
* 发布事件
|
|
141
|
+
* @param event 事件名称
|
|
142
|
+
* @param args 事件参数
|
|
143
143
|
*/
|
|
144
144
|
}, {
|
|
145
145
|
key: "publish",
|
|
@@ -174,11 +174,11 @@ var Watch = /*#__PURE__*/function () {
|
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
/**
|
|
178
|
-
* 根据事件名称发布事件
|
|
179
|
-
* @param watchKey 监听的key
|
|
180
|
-
* @param eventKey 事件名称
|
|
181
|
-
* @param args 事件参数
|
|
177
|
+
/**
|
|
178
|
+
* 根据事件名称发布事件
|
|
179
|
+
* @param watchKey 监听的key
|
|
180
|
+
* @param eventKey 事件名称
|
|
181
|
+
* @param args 事件参数
|
|
182
182
|
*/
|
|
183
183
|
}, {
|
|
184
184
|
key: "publishByEventKey",
|
|
@@ -194,10 +194,10 @@ var Watch = /*#__PURE__*/function () {
|
|
|
194
194
|
(_callbacks$get2 = callbacks.get(eventKey)) === null || _callbacks$get2 === void 0 || _callbacks$get2.apply(void 0, args);
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
/**
|
|
198
|
-
* 获取最后一个启用的事件
|
|
199
|
-
* @param watchKey 监听的key
|
|
200
|
-
* @returns 最后一个启用的事件
|
|
197
|
+
/**
|
|
198
|
+
* 获取最后一个启用的事件
|
|
199
|
+
* @param watchKey 监听的key
|
|
200
|
+
* @returns 最后一个启用的事件
|
|
201
201
|
*/
|
|
202
202
|
}, {
|
|
203
203
|
key: "getLastEnableEventKey",
|
|
@@ -210,10 +210,10 @@ var Watch = /*#__PURE__*/function () {
|
|
|
210
210
|
return enableList.at(-1) || undefined;
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
-
/**
|
|
214
|
-
* 移除某个事件的所有订阅
|
|
215
|
-
* @param event 事件名称
|
|
216
|
-
* @returns 是否成功移除
|
|
213
|
+
/**
|
|
214
|
+
* 移除某个事件的所有订阅
|
|
215
|
+
* @param event 事件名称
|
|
216
|
+
* @returns 是否成功移除
|
|
217
217
|
*/
|
|
218
218
|
}, {
|
|
219
219
|
key: "clearEvent",
|
|
@@ -221,11 +221,11 @@ var Watch = /*#__PURE__*/function () {
|
|
|
221
221
|
// 禁用所有事件
|
|
222
222
|
this.disabledAllEventByWatchKey(watchKey);
|
|
223
223
|
// 删除监听列表
|
|
224
|
-
|
|
224
|
+
this.events.delete(watchKey);
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
/**
|
|
228
|
-
* 移除所有事件订阅
|
|
227
|
+
/**
|
|
228
|
+
* 移除所有事件订阅
|
|
229
229
|
*/
|
|
230
230
|
}, {
|
|
231
231
|
key: "clearAllEvents",
|
|
@@ -236,10 +236,10 @@ var Watch = /*#__PURE__*/function () {
|
|
|
236
236
|
this.enableListMap.clear();
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
-
/**
|
|
240
|
-
* 获取事件的订阅数量
|
|
241
|
-
* @param event 事件名称
|
|
242
|
-
* @returns 订阅数量
|
|
239
|
+
/**
|
|
240
|
+
* 获取事件的订阅数量
|
|
241
|
+
* @param event 事件名称
|
|
242
|
+
* @returns 订阅数量
|
|
243
243
|
*/
|
|
244
244
|
}, {
|
|
245
245
|
key: "getSubscriberCount",
|
|
@@ -250,10 +250,10 @@ var Watch = /*#__PURE__*/function () {
|
|
|
250
250
|
return callbacks ? callbacks.size : 0;
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
-
/**
|
|
254
|
-
* 检查事件是否有订阅者
|
|
255
|
-
* @param event 事件名称
|
|
256
|
-
* @returns 是否有订阅者
|
|
253
|
+
/**
|
|
254
|
+
* 检查事件是否有订阅者
|
|
255
|
+
* @param event 事件名称
|
|
256
|
+
* @returns 是否有订阅者
|
|
257
257
|
*/
|
|
258
258
|
}, {
|
|
259
259
|
key: "hasSubscribers",
|
|
@@ -262,11 +262,11 @@ var Watch = /*#__PURE__*/function () {
|
|
|
262
262
|
return this.getSubscriberCount(event) > 0;
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
-
/**
|
|
266
|
-
* 一次性订阅事件,事件触发后自动取消订阅
|
|
267
|
-
* @param event 事件名称
|
|
268
|
-
* @param callback 回调函数
|
|
269
|
-
* @returns 订阅对象,可用于取消订阅
|
|
265
|
+
/**
|
|
266
|
+
* 一次性订阅事件,事件触发后自动取消订阅
|
|
267
|
+
* @param event 事件名称
|
|
268
|
+
* @param callback 回调函数
|
|
269
|
+
* @returns 订阅对象,可用于取消订阅
|
|
270
270
|
*/
|
|
271
271
|
}, {
|
|
272
272
|
key: "once",
|