@pisell/pisellos 2.2.283 → 2.2.285

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.
Files changed (283) hide show
  1. package/dist/core/index.js +6 -10
  2. package/dist/model/strategy/adapter/walletPass/example.js +3 -26
  3. package/dist/model/strategy/strategy-example.js +5 -19
  4. package/dist/modules/Cart/index.js +0 -3
  5. package/dist/modules/Cart/utils/cartProduct.js +0 -1
  6. package/dist/modules/Date/index.js +1 -5
  7. package/dist/modules/Discount/index.js +2 -4
  8. package/dist/modules/OpenData/index.js +0 -2
  9. package/dist/modules/Order/index.d.ts +1 -1
  10. package/dist/modules/Order/index.js +64 -86
  11. package/dist/modules/Order/types.d.ts +3 -1
  12. package/dist/modules/Order/types.js +1 -0
  13. package/dist/modules/Payment/index.js +97 -162
  14. package/dist/modules/ProductList/index.js +91 -65
  15. package/dist/modules/Rules/index.js +1 -4
  16. package/dist/modules/Schedule/index.js +0 -1
  17. package/dist/modules/Schedule/utils.js +0 -1
  18. package/dist/modules/Step/index.js +0 -1
  19. package/dist/plugins/request.js +1 -4
  20. package/dist/plugins/window.js +2 -6
  21. package/dist/server/index.js +97 -129
  22. package/dist/server/modules/menu/index.js +32 -41
  23. package/dist/server/modules/order/index.js +2 -4
  24. package/dist/server/modules/products/index.js +24 -42
  25. package/dist/server/modules/quotation/index.js +29 -38
  26. package/dist/server/modules/resource/index.js +3 -4
  27. package/dist/server/modules/schedule/index.js +27 -35
  28. package/dist/server/utils/product.js +0 -1
  29. package/dist/solution/BaseSales/index.js +115 -76
  30. package/dist/solution/BookingByStep/index.d.ts +1 -1
  31. package/dist/solution/BookingByStep/index.js +7 -59
  32. package/dist/solution/BookingByStep/utils/capacity.js +1 -11
  33. package/dist/solution/BookingByStep/utils/resources.js +1 -3
  34. package/dist/solution/BookingByStep/utils/timeslots.js +2 -43
  35. package/dist/solution/BookingTicket/index.d.ts +6 -16
  36. package/dist/solution/BookingTicket/index.js +13 -6
  37. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +6 -7
  38. package/dist/solution/BookingTicket/utils/scan/handleScan.js +25 -31
  39. package/dist/solution/BookingTicket/utils/scan/index.js +6 -10
  40. package/dist/solution/BuyTickets/index.js +9 -12
  41. package/dist/solution/Checkout/index.js +177 -252
  42. package/dist/solution/Checkout/utils/index.js +4 -16
  43. package/dist/solution/RegisterAndLogin/index.js +30 -76
  44. package/dist/solution/ScanOrder/index.js +50 -60
  45. package/dist/solution/ShopDiscount/index.js +2 -7
  46. package/dist/solution/VenueBooking/index.js +45 -55
  47. package/dist/utils/task.js +15 -18
  48. package/dist/utils/watch.js +0 -1
  49. package/lib/apis/picoding.js +2 -0
  50. package/lib/core/index.js +131 -132
  51. package/lib/effects/index.js +46 -57
  52. package/lib/index.js +82 -49
  53. package/lib/model/index.js +14 -21
  54. package/lib/model/strategy/adapter/dataVariant/adapter.js +38 -50
  55. package/lib/model/strategy/adapter/dataVariant/evaluator.js +162 -236
  56. package/lib/model/strategy/adapter/dataVariant/examples.js +229 -237
  57. package/lib/model/strategy/adapter/dataVariant/index.js +39 -34
  58. package/lib/model/strategy/adapter/dataVariant/type.js +57 -28
  59. package/lib/model/strategy/adapter/index.js +100 -64
  60. package/lib/model/strategy/adapter/itemRule/adapter.js +156 -144
  61. package/lib/model/strategy/adapter/itemRule/evaluator.js +36 -48
  62. package/lib/model/strategy/adapter/itemRule/examples.js +295 -225
  63. package/lib/model/strategy/adapter/itemRule/index.js +83 -57
  64. package/lib/model/strategy/adapter/itemRule/type.js +97 -36
  65. package/lib/model/strategy/adapter/promotion/adapter.js +91 -69
  66. package/lib/model/strategy/adapter/promotion/evaluator.js +444 -310
  67. package/lib/model/strategy/adapter/promotion/examples.js +222 -234
  68. package/lib/model/strategy/adapter/promotion/index.js +46 -0
  69. package/lib/model/strategy/adapter/promotion/type.js +243 -36
  70. package/lib/model/strategy/adapter/type.js +4 -16
  71. package/lib/model/strategy/adapter/walletPass/evaluator.js +180 -150
  72. package/lib/model/strategy/adapter/walletPass/example.js +217 -190
  73. package/lib/model/strategy/adapter/walletPass/index.js +75 -51
  74. package/lib/model/strategy/adapter/walletPass/locales.js +36 -58
  75. package/lib/model/strategy/adapter/walletPass/type.js +4 -16
  76. package/lib/model/strategy/adapter/walletPass/utils.js +588 -378
  77. package/lib/model/strategy/engine.js +270 -168
  78. package/lib/model/strategy/index.js +49 -34
  79. package/lib/model/strategy/strategy-example.js +243 -239
  80. package/lib/model/strategy/type.js +100 -40
  81. package/lib/modules/Account/index.js +39 -53
  82. package/lib/modules/Account/types.js +20 -33
  83. package/lib/modules/AccountList/index.js +116 -154
  84. package/lib/modules/AccountList/types.js +30 -31
  85. package/lib/modules/AccountList/utils.js +18 -30
  86. package/lib/modules/BaseModule.js +23 -42
  87. package/lib/modules/BookingContext/index.js +158 -136
  88. package/lib/modules/BookingContext/types.js +46 -32
  89. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +138 -146
  90. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +78 -83
  91. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +170 -150
  92. package/lib/modules/BookingContext/utils/flexible.js +38 -55
  93. package/lib/modules/BookingContext/utils/formatResourceList.js +19 -34
  94. package/lib/modules/BookingContext/utils/index.js +124 -41
  95. package/lib/modules/BookingContext/utils/noResource.js +58 -70
  96. package/lib/modules/BookingContext/utils/orderLineDisplay.js +14 -41
  97. package/lib/modules/BookingContext/utils/productExtend.js +202 -155
  98. package/lib/modules/BookingContext/utils/resourceErrors.js +53 -53
  99. package/lib/modules/BookingContext/utils/resourceSelection.js +19 -41
  100. package/lib/modules/BookingContext/utils/resources.js +209 -167
  101. package/lib/modules/BookingContext/utils/serviceTimes.js +115 -116
  102. package/lib/modules/BookingContext/utils/timeSlices.js +76 -86
  103. package/lib/modules/Cart/index.js +170 -124
  104. package/lib/modules/Cart/types.js +46 -51
  105. package/lib/modules/Cart/utils/cartAccount.js +40 -39
  106. package/lib/modules/Cart/utils/cartDate.js +56 -61
  107. package/lib/modules/Cart/utils/cartDiscount.js +28 -33
  108. package/lib/modules/Cart/utils/cartNote.js +27 -32
  109. package/lib/modules/Cart/utils/cartProduct.js +321 -251
  110. package/lib/modules/Cart/utils/cartRelationForms.js +29 -35
  111. package/lib/modules/Cart/utils/cartResource.js +70 -78
  112. package/lib/modules/Cart/utils/changePrice.js +22 -50
  113. package/lib/modules/Cart/utils/index.js +106 -48
  114. package/lib/modules/Customer/constants.js +13 -34
  115. package/lib/modules/Customer/index.js +235 -172
  116. package/lib/modules/Customer/types.js +38 -35
  117. package/lib/modules/Date/index.js +116 -115
  118. package/lib/modules/Date/types.js +16 -28
  119. package/lib/modules/Date/utils.js +174 -123
  120. package/lib/modules/Discount/index.js +122 -127
  121. package/lib/modules/Discount/types.js +9 -31
  122. package/lib/modules/Guests/index.js +30 -56
  123. package/lib/modules/Guests/types.js +23 -33
  124. package/lib/modules/Holder/index.js +209 -189
  125. package/lib/modules/Holder/types.js +4 -16
  126. package/lib/modules/Holder/utils.js +20 -49
  127. package/lib/modules/OpenData/index.js +70 -76
  128. package/lib/modules/OpenData/types.js +4 -16
  129. package/lib/modules/OpenData/utils.js +44 -78
  130. package/lib/modules/Order/index.d.ts +1 -1
  131. package/lib/modules/Order/index.js +1728 -2123
  132. package/lib/modules/Order/payment-utils.js +77 -120
  133. package/lib/modules/Order/types.d.ts +3 -1
  134. package/lib/modules/Order/types.js +88 -35
  135. package/lib/modules/Order/utils/bundleDiscountHydration.js +41 -74
  136. package/lib/modules/Order/utils/discountProductLineIdentity.js +142 -100
  137. package/lib/modules/Order/utils/manualProductDiscount.js +124 -123
  138. package/lib/modules/Order/utils/orderCollectionIdentity.js +184 -244
  139. package/lib/modules/Order/utils.js +814 -647
  140. package/lib/modules/Payment/cash.js +20 -33
  141. package/lib/modules/Payment/cashRecommendationAlgorithm.js +145 -76
  142. package/lib/modules/Payment/eftpos.js +16 -30
  143. package/lib/modules/Payment/index.js +532 -399
  144. package/lib/modules/Payment/mx51.js +1 -0
  145. package/lib/modules/Payment/types.js +230 -108
  146. package/lib/modules/Payment/utils.js +52 -51
  147. package/lib/modules/Payment/walletpass.js +485 -660
  148. package/lib/modules/Product/index.js +51 -46
  149. package/lib/modules/Product/types.js +4 -16
  150. package/lib/modules/Product/utils.js +32 -33
  151. package/lib/modules/ProductList/index.js +119 -123
  152. package/lib/modules/ProductList/types.js +9 -31
  153. package/lib/modules/Quotation/index.js +66 -100
  154. package/lib/modules/Quotation/types.js +4 -16
  155. package/lib/modules/Resource/index.js +27 -59
  156. package/lib/modules/Resource/types.js +22 -32
  157. package/lib/modules/Resource/utils.js +30 -38
  158. package/lib/modules/ResourcePlanner/index.js +60 -61
  159. package/lib/modules/ResourcePlanner/planner.js +346 -384
  160. package/lib/modules/ResourcePlanner/types.js +4 -16
  161. package/lib/modules/Rules/index.js +1218 -959
  162. package/lib/modules/Rules/types.js +17 -40
  163. package/lib/modules/SalesSummary/index.js +85 -90
  164. package/lib/modules/SalesSummary/types.js +4 -16
  165. package/lib/modules/SalesSummary/utils.js +355 -430
  166. package/lib/modules/ScanOrderLogger/index.js +59 -79
  167. package/lib/modules/ScanOrderLogger/providers/feishu.js +54 -78
  168. package/lib/modules/ScanOrderLogger/providers/grafana.js +13 -36
  169. package/lib/modules/ScanOrderLogger/types.js +4 -16
  170. package/lib/modules/Schedule/getDateIsInSchedule.js +334 -163
  171. package/lib/modules/Schedule/index.js +100 -114
  172. package/lib/modules/Schedule/type.js +4 -16
  173. package/lib/modules/Schedule/types.js +4 -16
  174. package/lib/modules/Schedule/utils.js +433 -291
  175. package/lib/modules/Step/index.js +40 -52
  176. package/lib/modules/Step/tyeps.js +4 -16
  177. package/lib/modules/Summary/index.js +66 -71
  178. package/lib/modules/Summary/types.js +4 -16
  179. package/lib/modules/Summary/utils.js +773 -418
  180. package/lib/modules/SurchargeList/index.js +46 -60
  181. package/lib/modules/SurchargeList/types.js +4 -16
  182. package/lib/modules/index.js +245 -63
  183. package/lib/plugins/app.js +4 -16
  184. package/lib/plugins/index.js +36 -25
  185. package/lib/plugins/request.js +137 -126
  186. package/lib/plugins/shopStore.js +4 -16
  187. package/lib/plugins/user.js +4 -16
  188. package/lib/plugins/window.js +171 -179
  189. package/lib/server/index.js +3027 -2655
  190. package/lib/server/modules/floor-plan/index.js +102 -123
  191. package/lib/server/modules/floor-plan/types.js +15 -30
  192. package/lib/server/modules/index.js +106 -68
  193. package/lib/server/modules/menu/index.js +146 -122
  194. package/lib/server/modules/menu/types.js +18 -31
  195. package/lib/server/modules/order/index.js +758 -956
  196. package/lib/server/modules/order/types.js +122 -33
  197. package/lib/server/modules/order/utils/filterBookings.js +219 -194
  198. package/lib/server/modules/order/utils/filterOrders.js +118 -92
  199. package/lib/server/modules/payment/index.js +59 -83
  200. package/lib/server/modules/payment/types.js +4 -16
  201. package/lib/server/modules/products/index.js +575 -459
  202. package/lib/server/modules/products/types.js +44 -34
  203. package/lib/server/modules/quotation/index.js +137 -172
  204. package/lib/server/modules/quotation/types.js +21 -31
  205. package/lib/server/modules/resource/index.js +213 -184
  206. package/lib/server/modules/resource/types.js +42 -33
  207. package/lib/server/modules/schedule/index.js +135 -123
  208. package/lib/server/modules/schedule/types.js +14 -21
  209. package/lib/server/modules/schedule/utils.js +334 -163
  210. package/lib/server/types.js +4 -16
  211. package/lib/server/utils/index.js +25 -23
  212. package/lib/server/utils/product.js +196 -139
  213. package/lib/server/utils/schedule.js +34 -41
  214. package/lib/server/utils/small-ticket.js +479 -456
  215. package/lib/server/utils/time.js +40 -49
  216. package/lib/solution/BaseSales/index.js +1220 -1412
  217. package/lib/solution/BaseSales/types.js +42 -38
  218. package/lib/solution/BaseSales/utils/cartPromotion.js +650 -502
  219. package/lib/solution/BaseSales/utils/parseSalesResponse.js +85 -105
  220. package/lib/solution/BaseSales/utils/quotationPrice.js +56 -114
  221. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +108 -145
  222. package/lib/solution/BaseSales/utils.js +158 -143
  223. package/lib/solution/BookingByStep/index.d.ts +1 -1
  224. package/lib/solution/BookingByStep/index.js +1527 -1340
  225. package/lib/solution/BookingByStep/types.js +40 -99
  226. package/lib/solution/BookingByStep/utils/capacity.js +192 -160
  227. package/lib/solution/BookingByStep/utils/products.js +42 -52
  228. package/lib/solution/BookingByStep/utils/resources.js +527 -330
  229. package/lib/solution/BookingByStep/utils/stock.js +65 -44
  230. package/lib/solution/BookingByStep/utils/timeslots.js +129 -131
  231. package/lib/solution/BookingTicket/index.d.ts +6 -16
  232. package/lib/solution/BookingTicket/index.js +608 -517
  233. package/lib/solution/BookingTicket/types.js +99 -77
  234. package/lib/solution/BookingTicket/utils/addProductDecision.js +225 -187
  235. package/lib/solution/BookingTicket/utils/addTimeAvailability.js +58 -89
  236. package/lib/solution/BookingTicket/utils/bookingStatus.js +107 -78
  237. package/lib/solution/BookingTicket/utils/cartView.js +114 -99
  238. package/lib/solution/BookingTicket/utils/exampleData.js +185 -0
  239. package/lib/solution/BookingTicket/utils/orderCustomer.js +18 -41
  240. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +219 -86
  241. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +168 -116
  242. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +79 -91
  243. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +54 -41
  244. package/lib/solution/BookingTicket/utils/scan/handleScan.js +84 -81
  245. package/lib/solution/BookingTicket/utils/scan/index.js +98 -104
  246. package/lib/solution/BookingTicket/utils/scan/scanCache.js +90 -43
  247. package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +52 -64
  248. package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +56 -58
  249. package/lib/solution/BookingTicket/utils/weighingProductSku.js +34 -48
  250. package/lib/solution/BuyTickets/index.js +67 -70
  251. package/lib/solution/BuyTickets/types.js +22 -38
  252. package/lib/solution/Checkout/index.js +1451 -1158
  253. package/lib/solution/Checkout/types.js +91 -61
  254. package/lib/solution/Checkout/utils/index.js +228 -156
  255. package/lib/solution/PlaceOrder/index.js +55 -0
  256. package/lib/solution/RegisterAndLogin/config.js +493 -460
  257. package/lib/solution/RegisterAndLogin/index.js +633 -630
  258. package/lib/solution/RegisterAndLogin/types.js +189 -76
  259. package/lib/solution/RegisterAndLogin/utils.js +183 -125
  260. package/lib/solution/Sales/index.js +328 -324
  261. package/lib/solution/Sales/types.js +27 -33
  262. package/lib/solution/ScanOrder/index.js +832 -864
  263. package/lib/solution/ScanOrder/types.js +33 -34
  264. package/lib/solution/ScanOrder/utils.js +409 -374
  265. package/lib/solution/ShopDiscount/index.js +226 -232
  266. package/lib/solution/ShopDiscount/types.js +15 -37
  267. package/lib/solution/ShopDiscount/utils.js +300 -172
  268. package/lib/solution/UnifiedBookingSales/index.js +437 -487
  269. package/lib/solution/UnifiedBookingSales/types.js +12 -31
  270. package/lib/solution/VenueBooking/index.js +811 -879
  271. package/lib/solution/VenueBooking/types.js +19 -39
  272. package/lib/solution/VenueBooking/utils/dateSummary.js +27 -56
  273. package/lib/solution/VenueBooking/utils/resource.js +31 -54
  274. package/lib/solution/VenueBooking/utils/slotMerge.js +94 -107
  275. package/lib/solution/VenueBooking/utils/timeSlot.js +132 -132
  276. package/lib/solution/VenueBooking/utils.js +130 -67
  277. package/lib/solution/index.js +124 -41
  278. package/lib/store/createStore.js +32 -29
  279. package/lib/types/index.js +4 -16
  280. package/lib/utils/payment-number.js +26 -46
  281. package/lib/utils/task.js +36 -36
  282. package/lib/utils/watch.js +81 -47
  283. package/package.json +2 -1
@@ -131,8 +131,9 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
131
131
  }, {
132
132
  key: "loadProducts",
133
133
  value: function () {
134
- var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
135
- var _this$otherParams;
134
+ var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
135
+ var _this$otherParams,
136
+ _this2 = this;
136
137
  var _ref,
137
138
  _ref$category_ids,
138
139
  category_ids,
@@ -161,14 +162,16 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
161
162
  rawApplicationCode,
162
163
  mappedApplicationCode,
163
164
  queryPayload,
165
+ originalCallback,
166
+ subscriptionCallback,
164
167
  productsData,
165
168
  sortedList,
166
- _args4 = arguments;
167
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
168
- while (1) switch (_context4.prev = _context4.next) {
169
+ _args5 = arguments;
170
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
171
+ while (1) switch (_context5.prev = _context5.next) {
169
172
  case 0:
170
- _ref = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {}, _ref$category_ids = _ref.category_ids, category_ids = _ref$category_ids === void 0 ? [] : _ref$category_ids, _ref$product_ids = _ref.product_ids, product_ids = _ref$product_ids === void 0 ? [] : _ref$product_ids, _ref$collection = _ref.collection, collection = _ref$collection === void 0 ? [] : _ref$collection, _ref$menu_list_ids = _ref.menu_list_ids, menu_list_ids = _ref$menu_list_ids === void 0 ? [] : _ref$menu_list_ids, paramsCustomerId = _ref.customer_id, _ref$with_count = _ref.with_count, with_count = _ref$with_count === void 0 ? [] : _ref$with_count, schedule_datetime = _ref.schedule_datetime, schedule_date = _ref.schedule_date, cacheId = _ref.cacheId, with_schedule = _ref.with_schedule, extension_type = _ref.extension_type, _ref$status = _ref.status, status = _ref$status === void 0 ? 'published' : _ref$status, strategy_context = _ref.strategy_context;
171
- options = _args4.length > 1 ? _args4[1] : undefined;
173
+ _ref = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {}, _ref$category_ids = _ref.category_ids, category_ids = _ref$category_ids === void 0 ? [] : _ref$category_ids, _ref$product_ids = _ref.product_ids, product_ids = _ref$product_ids === void 0 ? [] : _ref$product_ids, _ref$collection = _ref.collection, collection = _ref$collection === void 0 ? [] : _ref$collection, _ref$menu_list_ids = _ref.menu_list_ids, menu_list_ids = _ref$menu_list_ids === void 0 ? [] : _ref$menu_list_ids, paramsCustomerId = _ref.customer_id, _ref$with_count = _ref.with_count, with_count = _ref$with_count === void 0 ? [] : _ref$with_count, schedule_datetime = _ref.schedule_datetime, schedule_date = _ref.schedule_date, cacheId = _ref.cacheId, with_schedule = _ref.with_schedule, extension_type = _ref.extension_type, _ref$status = _ref.status, status = _ref$status === void 0 ? 'published' : _ref$status, strategy_context = _ref.strategy_context;
174
+ options = _args5.length > 1 ? _args5[1] : undefined;
172
175
  // // 如果 schedule_ids 为空,则需要尝试从 schedule 模块里获取
173
176
  // if (!schedule_ids?.length) {
174
177
  // const schedule_ids_data = this.store.schedule
@@ -228,15 +231,38 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
228
231
  extension_type: extension_type,
229
232
  strategy_context: strategy_context
230
233
  });
231
- _context4.next = 11;
234
+ originalCallback = options === null || options === void 0 ? void 0 : options.callback;
235
+ subscriptionCallback = originalCallback ? ( /*#__PURE__*/function () {
236
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(result) {
237
+ var _result$data;
238
+ var products;
239
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
240
+ while (1) switch (_context4.prev = _context4.next) {
241
+ case 0:
242
+ products = Array.isArray(result === null || result === void 0 || (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.list) ? result.data.list : [];
243
+ _context4.next = 3;
244
+ return _this2.addProduct(products);
245
+ case 3:
246
+ originalCallback(result);
247
+ case 4:
248
+ case "end":
249
+ return _context4.stop();
250
+ }
251
+ }, _callee4);
252
+ }));
253
+ return function (_x5) {
254
+ return _ref2.apply(this, arguments);
255
+ };
256
+ }()) : undefined;
257
+ _context5.next = 13;
232
258
  return this.request.post("/product/query", queryPayload, {
233
259
  osServer: true,
234
- callback: options === null || options === void 0 ? void 0 : options.callback,
260
+ callback: subscriptionCallback,
235
261
  subscriberId: options === null || options === void 0 ? void 0 : options.subscriberId,
236
262
  customToast: function customToast() {}
237
263
  });
238
- case 11:
239
- productsData = _context4.sent;
264
+ case 13:
265
+ productsData = _context5.sent;
240
266
  sortedList = (productsData.data.list || []).slice().sort(function (a, b) {
241
267
  return Number(b.sort) - Number(a.sort);
242
268
  }); // if (sortedList.length) {
@@ -247,12 +273,12 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
247
273
  // })
248
274
  // }
249
275
  this.addProduct(sortedList);
250
- return _context4.abrupt("return", sortedList);
251
- case 15:
276
+ return _context5.abrupt("return", sortedList);
277
+ case 17:
252
278
  case "end":
253
- return _context4.stop();
279
+ return _context5.stop();
254
280
  }
255
- }, _callee4, this);
281
+ }, _callee5, this);
256
282
  }));
257
283
  function loadProducts() {
258
284
  return _loadProducts.apply(this, arguments);
@@ -262,13 +288,13 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
262
288
  }, {
263
289
  key: "loadProductsPrice",
264
290
  value: function () {
265
- var _loadProductsPrice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_ref2) {
266
- var _ref2$ids, ids, customer_id, schedule_date, channel, productsData;
267
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
268
- while (1) switch (_context5.prev = _context5.next) {
291
+ var _loadProductsPrice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(_ref3) {
292
+ var _ref3$ids, ids, customer_id, schedule_date, channel, productsData;
293
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
294
+ while (1) switch (_context6.prev = _context6.next) {
269
295
  case 0:
270
- _ref2$ids = _ref2.ids, ids = _ref2$ids === void 0 ? [] : _ref2$ids, customer_id = _ref2.customer_id, schedule_date = _ref2.schedule_date, channel = _ref2.channel;
271
- _context5.next = 3;
296
+ _ref3$ids = _ref3.ids, ids = _ref3$ids === void 0 ? [] : _ref3$ids, customer_id = _ref3.customer_id, schedule_date = _ref3.schedule_date, channel = _ref3.channel;
297
+ _context6.next = 3;
272
298
  return this.request.post("/product/query/price", {
273
299
  ids: ids,
274
300
  customer_id: customer_id,
@@ -278,15 +304,15 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
278
304
  useCache: true
279
305
  });
280
306
  case 3:
281
- productsData = _context5.sent;
282
- return _context5.abrupt("return", productsData.data);
307
+ productsData = _context6.sent;
308
+ return _context6.abrupt("return", productsData.data);
283
309
  case 5:
284
310
  case "end":
285
- return _context5.stop();
311
+ return _context6.stop();
286
312
  }
287
- }, _callee5, this);
313
+ }, _callee6, this);
288
314
  }));
289
- function loadProductsPrice(_x5) {
315
+ function loadProductsPrice(_x6) {
290
316
  return _loadProductsPrice.apply(this, arguments);
291
317
  }
292
318
  return loadProductsPrice;
@@ -294,19 +320,19 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
294
320
  }, {
295
321
  key: "getProducts",
296
322
  value: function () {
297
- var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
298
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
299
- while (1) switch (_context6.prev = _context6.next) {
323
+ var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
324
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
325
+ while (1) switch (_context7.prev = _context7.next) {
300
326
  case 0:
301
- _context6.next = 2;
327
+ _context7.next = 2;
302
328
  return this.core.effects.emit("".concat(this.name, ":onGetProducts"), this.store.list);
303
329
  case 2:
304
- return _context6.abrupt("return", cloneDeep(this.store.list));
330
+ return _context7.abrupt("return", cloneDeep(this.store.list));
305
331
  case 3:
306
332
  case "end":
307
- return _context6.stop();
333
+ return _context7.stop();
308
334
  }
309
- }, _callee6, this);
335
+ }, _callee7, this);
310
336
  }));
311
337
  function getProducts() {
312
338
  return _getProducts.apply(this, arguments);
@@ -316,25 +342,25 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
316
342
  }, {
317
343
  key: "getProduct",
318
344
  value: function () {
319
- var _getProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(id) {
345
+ var _getProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(id) {
320
346
  var product;
321
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
322
- while (1) switch (_context7.prev = _context7.next) {
347
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
348
+ while (1) switch (_context8.prev = _context8.next) {
323
349
  case 0:
324
- _context7.next = 2;
350
+ _context8.next = 2;
325
351
  return this.core.effects.emit("".concat(this.name, ":onGetProduct"), this.store.list);
326
352
  case 2:
327
353
  product = this.store.list.find(function (product) {
328
354
  return product.id === id;
329
355
  });
330
- return _context7.abrupt("return", product ? cloneDeep(product) : undefined);
356
+ return _context8.abrupt("return", product ? cloneDeep(product) : undefined);
331
357
  case 4:
332
358
  case "end":
333
- return _context7.stop();
359
+ return _context8.stop();
334
360
  }
335
- }, _callee7, this);
361
+ }, _callee8, this);
336
362
  }));
337
- function getProduct(_x6) {
363
+ function getProduct(_x7) {
338
364
  return _getProduct.apply(this, arguments);
339
365
  }
340
366
  return getProduct;
@@ -342,25 +368,25 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
342
368
  }, {
343
369
  key: "getProductByIds",
344
370
  value: function () {
345
- var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(ids) {
371
+ var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(ids) {
346
372
  var products;
347
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
348
- while (1) switch (_context8.prev = _context8.next) {
373
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
374
+ while (1) switch (_context9.prev = _context9.next) {
349
375
  case 0:
350
- _context8.next = 2;
376
+ _context9.next = 2;
351
377
  return this.core.effects.emit("".concat(this.name, ":onGetProductByIds"), this.store.list);
352
378
  case 2:
353
379
  products = this.store.list.filter(function (product) {
354
380
  return ids.includes(product.id);
355
381
  });
356
- return _context8.abrupt("return", products);
382
+ return _context9.abrupt("return", products);
357
383
  case 4:
358
384
  case "end":
359
- return _context8.stop();
385
+ return _context9.stop();
360
386
  }
361
- }, _callee8, this);
387
+ }, _callee9, this);
362
388
  }));
363
- function getProductByIds(_x7) {
389
+ function getProductByIds(_x8) {
364
390
  return _getProductByIds.apply(this, arguments);
365
391
  }
366
392
  return getProductByIds;
@@ -368,23 +394,23 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
368
394
  }, {
369
395
  key: "addProduct",
370
396
  value: function () {
371
- var _addProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(products) {
372
- var _this2 = this;
373
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
374
- while (1) switch (_context9.prev = _context9.next) {
397
+ var _addProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(products) {
398
+ var _this3 = this;
399
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
400
+ while (1) switch (_context10.prev = _context10.next) {
375
401
  case 0:
376
402
  // list 需要根据 id 去重
377
403
  if (!this.store.list) {
378
404
  this.store.list = [];
379
405
  }
380
406
  products.forEach(function (n) {
381
- var index = _this2.store.list.findIndex(function (m) {
407
+ var index = _this3.store.list.findIndex(function (m) {
382
408
  return m.id === n.id;
383
409
  });
384
410
  if (index === -1) {
385
- _this2.store.list.push(n);
411
+ _this3.store.list.push(n);
386
412
  } else {
387
- _this2.store.list[index] = n;
413
+ _this3.store.list[index] = n;
388
414
  }
389
415
  });
390
416
  // 根据 sort 值做降序排序(数字越大越靠前)
@@ -394,11 +420,11 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
394
420
  this.core.effects.emit("".concat(this.name, ":changed"), this.store.list);
395
421
  case 4:
396
422
  case "end":
397
- return _context9.stop();
423
+ return _context10.stop();
398
424
  }
399
- }, _callee9, this);
425
+ }, _callee10, this);
400
426
  }));
401
- function addProduct(_x8) {
427
+ function addProduct(_x9) {
402
428
  return _addProduct.apply(this, arguments);
403
429
  }
404
430
  return addProduct;
@@ -406,18 +432,18 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
406
432
  }, {
407
433
  key: "selectProducts",
408
434
  value: function () {
409
- var _selectProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(products) {
410
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
411
- while (1) switch (_context10.prev = _context10.next) {
435
+ var _selectProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(products) {
436
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
437
+ while (1) switch (_context11.prev = _context11.next) {
412
438
  case 0:
413
439
  this.store.selectProducts = products;
414
440
  case 1:
415
441
  case "end":
416
- return _context10.stop();
442
+ return _context11.stop();
417
443
  }
418
- }, _callee10, this);
444
+ }, _callee11, this);
419
445
  }));
420
- function selectProducts(_x9) {
446
+ function selectProducts(_x10) {
421
447
  return _selectProducts.apply(this, arguments);
422
448
  }
423
449
  return selectProducts;
@@ -2457,9 +2457,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
2457
2457
  _context3.next = 3;
2458
2458
  return this.core.effects.emit("".concat(this.name, ":onDestroy"), {});
2459
2459
  case 3:
2460
- console.log('[Rules] 已销毁');
2461
2460
  _get(_getPrototypeOf(RulesModule.prototype), "destroy", this).call(this);
2462
- case 5:
2461
+ case 4:
2463
2462
  case "end":
2464
2463
  return _context3.stop();
2465
2464
  }
@@ -2477,8 +2476,6 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
2477
2476
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
2478
2477
  while (1) switch (_context4.prev = _context4.next) {
2479
2478
  case 0:
2480
- console.log('[Rules] clear');
2481
- case 1:
2482
2479
  case "end":
2483
2480
  return _context4.stop();
2484
2481
  }
@@ -255,7 +255,6 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
255
255
  var idSet = new Set(ids.map(function (id) {
256
256
  return String(id);
257
257
  }));
258
- console.log('getScheduleListByIds', this.store.scheduleList);
259
258
  if (this.store.map instanceof Map && this.store.map.size > 0) {
260
259
  return ids.map(function (id) {
261
260
  return _this2.store.map.get(Number(id));
@@ -721,7 +721,6 @@ export function getAllSortedDateRanges(schedules) {
721
721
 
722
722
  // 如果没有找到任何 dateRange,返回空数组
723
723
  if (allDateRanges.length === 0) {
724
- console.log('No dateRanges found in schedules:', schedules);
725
724
  return [];
726
725
  }
727
726
 
@@ -166,7 +166,6 @@ export var StepModule = /*#__PURE__*/function (_BaseModule) {
166
166
  return n.key === step.key;
167
167
  });
168
168
  if (index !== -1) {
169
- console.log('[StepModule] 步骤已存在,添加失败');
170
169
  return;
171
170
  }
172
171
  if (key) {
@@ -107,15 +107,12 @@ var RequestPluginImpl = /*#__PURE__*/function () {
107
107
  // 初始化方法
108
108
  function initialize() {
109
109
  this.core = globalThis.pisellOS;
110
- console.log('[RequestPlugin] 初始化完成');
111
110
  }
112
111
 
113
112
  // 销毁方法
114
113
  }, {
115
114
  key: "destroy",
116
- value: function destroy() {
117
- console.log('[RequestPlugin] 已销毁');
118
- }
115
+ value: function destroy() {}
119
116
 
120
117
  /**
121
118
  * 添加请求拦截器
@@ -312,16 +312,12 @@ var WindowPluginImpl = /*#__PURE__*/function () {
312
312
  key: "initialize",
313
313
  value:
314
314
  // 初始化方法
315
- function initialize() {
316
- console.log('[WindowPlugin] 初始化完成');
317
- }
315
+ function initialize() {}
318
316
 
319
317
  // 销毁方法
320
318
  }, {
321
319
  key: "destroy",
322
- value: function destroy() {
323
- console.log('[WindowPlugin] 已销毁');
324
- }
320
+ value: function destroy() {}
325
321
  }]);
326
322
  return WindowPluginImpl;
327
323
  }();