@pisell/pisellos 2.3.74 → 2.3.75
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/dist/core/index.js +6 -10
- package/dist/model/strategy/adapter/promotion/index.js +9 -0
- package/dist/model/strategy/adapter/walletPass/example.js +3 -26
- package/dist/model/strategy/strategy-example.js +5 -19
- package/dist/modules/Cart/index.js +0 -3
- package/dist/modules/Cart/utils/cartProduct.js +0 -1
- package/dist/modules/Date/index.js +1 -5
- package/dist/modules/Discount/index.js +2 -4
- package/dist/modules/OpenData/index.js +0 -2
- package/dist/modules/Order/index.js +36 -64
- package/dist/modules/Payment/index.js +97 -162
- package/dist/modules/Rules/index.js +1 -4
- package/dist/modules/Schedule/index.js +0 -1
- package/dist/modules/Schedule/utils.js +0 -1
- package/dist/modules/Step/index.js +0 -1
- package/dist/plugins/request.js +1 -4
- package/dist/plugins/window.js +2 -6
- package/dist/server/index.js +97 -129
- package/dist/server/modules/menu/index.js +32 -41
- package/dist/server/modules/order/index.js +2 -4
- package/dist/server/modules/products/index.js +24 -42
- package/dist/server/modules/quotation/index.js +29 -38
- package/dist/server/modules/resource/index.js +3 -4
- package/dist/server/modules/schedule/index.js +27 -35
- package/dist/server/utils/product.js +0 -1
- package/dist/solution/BaseSales/index.js +38 -41
- package/dist/solution/BookingByStep/index.js +7 -59
- package/dist/solution/BookingByStep/utils/capacity.js +1 -11
- package/dist/solution/BookingByStep/utils/resources.js +1 -3
- package/dist/solution/BookingByStep/utils/timeslots.js +2 -43
- package/dist/solution/BookingTicket/index.js +0 -2
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +6 -7
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +25 -31
- package/dist/solution/BookingTicket/utils/scan/index.js +6 -10
- package/dist/solution/BuyTickets/index.js +9 -12
- package/dist/solution/Checkout/index.js +177 -252
- package/dist/solution/Checkout/utils/index.js +4 -16
- package/dist/solution/RegisterAndLogin/index.js +30 -76
- package/dist/solution/ScanOrder/index.js +50 -60
- package/dist/solution/ShopDiscount/index.js +2 -7
- package/dist/solution/VenueBooking/index.js +45 -55
- package/dist/utils/task.js +15 -18
- package/dist/utils/watch.js +0 -1
- package/lib/apis/picoding.js +2 -0
- package/lib/core/index.js +134 -134
- package/lib/effects/index.js +46 -57
- package/lib/index.js +82 -49
- package/lib/model/index.js +14 -21
- package/lib/model/strategy/adapter/dataVariant/adapter.js +38 -50
- package/lib/model/strategy/adapter/dataVariant/evaluator.js +162 -236
- package/lib/model/strategy/adapter/dataVariant/examples.js +229 -237
- package/lib/model/strategy/adapter/dataVariant/index.js +39 -34
- package/lib/model/strategy/adapter/dataVariant/type.js +57 -28
- package/lib/model/strategy/adapter/index.js +100 -64
- package/lib/model/strategy/adapter/itemRule/adapter.js +156 -144
- package/lib/model/strategy/adapter/itemRule/evaluator.js +36 -48
- package/lib/model/strategy/adapter/itemRule/examples.js +295 -225
- package/lib/model/strategy/adapter/itemRule/index.js +83 -57
- package/lib/model/strategy/adapter/itemRule/type.js +97 -36
- package/lib/model/strategy/adapter/promotion/adapter.js +91 -69
- package/lib/model/strategy/adapter/promotion/evaluator.js +444 -310
- package/lib/model/strategy/adapter/promotion/examples.js +222 -234
- package/lib/model/strategy/adapter/promotion/index.js +1 -0
- package/lib/model/strategy/adapter/promotion/type.js +243 -36
- package/lib/model/strategy/adapter/type.js +4 -16
- package/lib/model/strategy/adapter/walletPass/evaluator.js +180 -150
- package/lib/model/strategy/adapter/walletPass/example.js +217 -190
- package/lib/model/strategy/adapter/walletPass/index.js +75 -51
- package/lib/model/strategy/adapter/walletPass/locales.js +36 -58
- package/lib/model/strategy/adapter/walletPass/type.js +4 -16
- package/lib/model/strategy/adapter/walletPass/utils.js +588 -378
- package/lib/model/strategy/engine.js +270 -168
- package/lib/model/strategy/index.js +49 -34
- package/lib/model/strategy/strategy-example.js +243 -239
- package/lib/model/strategy/type.js +100 -40
- package/lib/modules/Account/index.js +39 -53
- package/lib/modules/Account/types.js +20 -33
- package/lib/modules/AccountList/index.js +116 -154
- package/lib/modules/AccountList/types.js +30 -31
- package/lib/modules/AccountList/utils.js +18 -30
- package/lib/modules/BaseModule.js +23 -42
- package/lib/modules/BookingContext/index.js +158 -136
- package/lib/modules/BookingContext/types.js +46 -32
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +138 -146
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +78 -83
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +170 -150
- package/lib/modules/BookingContext/utils/flexible.js +38 -55
- package/lib/modules/BookingContext/utils/formatResourceList.js +19 -34
- package/lib/modules/BookingContext/utils/index.js +124 -41
- package/lib/modules/BookingContext/utils/noResource.js +58 -70
- package/lib/modules/BookingContext/utils/orderLineDisplay.js +14 -41
- package/lib/modules/BookingContext/utils/productExtend.js +202 -155
- package/lib/modules/BookingContext/utils/resourceErrors.js +53 -53
- package/lib/modules/BookingContext/utils/resourceSelection.js +19 -41
- package/lib/modules/BookingContext/utils/resources.js +209 -167
- package/lib/modules/BookingContext/utils/serviceTimes.js +115 -116
- package/lib/modules/BookingContext/utils/timeSlices.js +76 -86
- package/lib/modules/Cart/index.js +170 -124
- package/lib/modules/Cart/types.js +46 -51
- package/lib/modules/Cart/utils/cartAccount.js +40 -39
- package/lib/modules/Cart/utils/cartDate.js +56 -61
- package/lib/modules/Cart/utils/cartDiscount.js +28 -33
- package/lib/modules/Cart/utils/cartNote.js +27 -32
- package/lib/modules/Cart/utils/cartProduct.js +321 -251
- package/lib/modules/Cart/utils/cartRelationForms.js +29 -35
- package/lib/modules/Cart/utils/cartResource.js +70 -78
- package/lib/modules/Cart/utils/changePrice.js +22 -50
- package/lib/modules/Cart/utils/index.js +106 -48
- package/lib/modules/Customer/constants.js +13 -34
- package/lib/modules/Customer/index.js +235 -172
- package/lib/modules/Customer/types.js +38 -35
- package/lib/modules/Date/index.js +116 -115
- package/lib/modules/Date/types.js +16 -28
- package/lib/modules/Date/utils.js +174 -123
- package/lib/modules/Discount/index.js +122 -127
- package/lib/modules/Discount/types.js +9 -31
- package/lib/modules/Guests/index.js +30 -56
- package/lib/modules/Guests/types.js +23 -33
- package/lib/modules/Holder/index.js +209 -189
- package/lib/modules/Holder/types.js +4 -16
- package/lib/modules/Holder/utils.js +20 -49
- package/lib/modules/OpenData/index.js +70 -76
- package/lib/modules/OpenData/types.js +4 -16
- package/lib/modules/OpenData/utils.js +44 -78
- package/lib/modules/Order/index.js +1713 -2118
- package/lib/modules/Order/payment-utils.js +77 -120
- package/lib/modules/Order/types.js +88 -35
- package/lib/modules/Order/utils/bundleDiscountHydration.js +41 -74
- package/lib/modules/Order/utils/discountProductLineIdentity.js +142 -100
- package/lib/modules/Order/utils/manualProductDiscount.js +124 -123
- package/lib/modules/Order/utils/orderCollectionIdentity.js +184 -244
- package/lib/modules/Order/utils.js +814 -647
- package/lib/modules/Payment/cash.js +20 -33
- package/lib/modules/Payment/cashRecommendationAlgorithm.js +145 -76
- package/lib/modules/Payment/eftpos.js +16 -30
- package/lib/modules/Payment/index.js +532 -399
- package/lib/modules/Payment/mx51.js +1 -0
- package/lib/modules/Payment/types.js +230 -108
- package/lib/modules/Payment/utils.js +52 -51
- package/lib/modules/Payment/walletpass.js +485 -660
- package/lib/modules/Product/index.js +51 -46
- package/lib/modules/Product/types.js +4 -16
- package/lib/modules/Product/utils.js +32 -33
- package/lib/modules/ProductList/index.js +113 -123
- package/lib/modules/ProductList/types.js +9 -31
- package/lib/modules/Quotation/index.js +81 -118
- package/lib/modules/Quotation/types.js +4 -16
- package/lib/modules/Resource/index.js +27 -59
- package/lib/modules/Resource/types.js +22 -32
- package/lib/modules/Resource/utils.js +30 -38
- package/lib/modules/ResourcePlanner/index.js +25 -23
- package/lib/modules/ResourcePlanner/localClock.js +54 -119
- package/lib/modules/ResourcePlanner/planner.js +589 -770
- package/lib/modules/ResourcePlanner/types.js +10 -29
- package/lib/modules/Rules/index.js +1218 -959
- package/lib/modules/Rules/types.js +17 -40
- package/lib/modules/SalesSummary/index.js +85 -90
- package/lib/modules/SalesSummary/types.js +4 -16
- package/lib/modules/SalesSummary/utils.js +355 -430
- package/lib/modules/ScanOrderLogger/index.js +59 -79
- package/lib/modules/ScanOrderLogger/providers/feishu.js +54 -78
- package/lib/modules/ScanOrderLogger/providers/grafana.js +13 -36
- package/lib/modules/ScanOrderLogger/types.js +4 -16
- package/lib/modules/Schedule/getDateIsInSchedule.js +334 -163
- package/lib/modules/Schedule/index.js +100 -114
- package/lib/modules/Schedule/type.js +4 -16
- package/lib/modules/Schedule/types.js +4 -16
- package/lib/modules/Schedule/utils.js +433 -291
- package/lib/modules/Step/index.js +40 -52
- package/lib/modules/Step/tyeps.js +4 -16
- package/lib/modules/Summary/index.js +66 -71
- package/lib/modules/Summary/types.js +4 -16
- package/lib/modules/Summary/utils.js +773 -418
- package/lib/modules/SurchargeList/index.js +46 -60
- package/lib/modules/SurchargeList/types.js +4 -16
- package/lib/modules/index.js +245 -63
- package/lib/plugins/app.js +4 -16
- package/lib/plugins/index.js +36 -25
- package/lib/plugins/request.js +137 -126
- package/lib/plugins/shopStore.js +4 -16
- package/lib/plugins/user.js +4 -16
- package/lib/plugins/window.js +171 -179
- package/lib/server/index.js +3050 -2665
- package/lib/server/modules/floor-plan/index.js +118 -134
- package/lib/server/modules/floor-plan/types.js +15 -30
- package/lib/server/modules/index.js +106 -68
- package/lib/server/modules/menu/index.js +142 -122
- package/lib/server/modules/menu/types.js +18 -31
- package/lib/server/modules/order/index.js +784 -1002
- package/lib/server/modules/order/types.js +122 -33
- package/lib/server/modules/order/utils/filterBookings.js +219 -194
- package/lib/server/modules/order/utils/filterOrders.js +118 -92
- package/lib/server/modules/payment/index.js +59 -83
- package/lib/server/modules/payment/types.js +4 -16
- package/lib/server/modules/products/index.js +583 -471
- package/lib/server/modules/products/types.js +44 -34
- package/lib/server/modules/quotation/index.js +137 -172
- package/lib/server/modules/quotation/types.js +21 -31
- package/lib/server/modules/resource/index.js +220 -186
- package/lib/server/modules/resource/types.js +42 -33
- package/lib/server/modules/schedule/index.js +135 -123
- package/lib/server/modules/schedule/types.js +14 -21
- package/lib/server/modules/schedule/utils.js +334 -163
- package/lib/server/types.js +4 -16
- package/lib/server/utils/index.js +25 -23
- package/lib/server/utils/product.js +196 -139
- package/lib/server/utils/schedule.js +34 -41
- package/lib/server/utils/small-ticket.js +479 -456
- package/lib/server/utils/time.js +40 -49
- package/lib/solution/BaseSales/index.js +1186 -1410
- package/lib/solution/BaseSales/types.js +42 -38
- package/lib/solution/BaseSales/utils/cartPromotion.js +642 -498
- package/lib/solution/BaseSales/utils/parseSalesResponse.js +85 -105
- package/lib/solution/BaseSales/utils/quotationPrice.js +56 -114
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +108 -145
- package/lib/solution/BaseSales/utils.js +158 -143
- package/lib/solution/BookingByStep/index.js +1527 -1340
- package/lib/solution/BookingByStep/types.js +40 -99
- package/lib/solution/BookingByStep/utils/capacity.js +192 -160
- package/lib/solution/BookingByStep/utils/products.js +42 -52
- package/lib/solution/BookingByStep/utils/resources.js +527 -330
- package/lib/solution/BookingByStep/utils/stock.js +65 -44
- package/lib/solution/BookingByStep/utils/timeslots.js +129 -131
- package/lib/solution/BookingTicket/index.js +607 -522
- package/lib/solution/BookingTicket/types.js +99 -77
- package/lib/solution/BookingTicket/utils/addProductDecision.js +226 -189
- package/lib/solution/BookingTicket/utils/addTimeAvailability.js +58 -89
- package/lib/solution/BookingTicket/utils/bookingStatus.js +107 -78
- package/lib/solution/BookingTicket/utils/cartView.js +114 -99
- package/lib/solution/BookingTicket/utils/exampleData.js +185 -0
- package/lib/solution/BookingTicket/utils/orderCustomer.js +18 -41
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +219 -86
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +168 -116
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +79 -91
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +54 -41
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +84 -81
- package/lib/solution/BookingTicket/utils/scan/index.js +98 -104
- package/lib/solution/BookingTicket/utils/scan/scanCache.js +90 -43
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +52 -64
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +56 -58
- package/lib/solution/BookingTicket/utils/weighingProductSku.js +34 -48
- package/lib/solution/BuyTickets/index.js +67 -70
- package/lib/solution/BuyTickets/types.js +22 -38
- package/lib/solution/Checkout/index.js +1451 -1158
- package/lib/solution/Checkout/types.js +91 -61
- package/lib/solution/Checkout/utils/index.js +228 -156
- package/lib/solution/PlaceOrder/index.js +55 -0
- package/lib/solution/RegisterAndLogin/config.js +493 -460
- package/lib/solution/RegisterAndLogin/index.js +633 -630
- package/lib/solution/RegisterAndLogin/types.js +189 -76
- package/lib/solution/RegisterAndLogin/utils.js +183 -125
- package/lib/solution/Sales/index.js +328 -324
- package/lib/solution/Sales/types.js +27 -33
- package/lib/solution/ScanOrder/index.js +832 -864
- package/lib/solution/ScanOrder/types.js +33 -34
- package/lib/solution/ScanOrder/utils.js +409 -374
- package/lib/solution/ShopDiscount/index.js +226 -232
- package/lib/solution/ShopDiscount/types.js +15 -37
- package/lib/solution/ShopDiscount/utils.js +300 -172
- package/lib/solution/UnifiedBookingSales/index.js +1035 -1201
- package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.js +99 -159
- package/lib/solution/UnifiedBookingSales/types.js +10 -32
- package/lib/solution/VenueBooking/index.js +811 -879
- package/lib/solution/VenueBooking/types.js +19 -39
- package/lib/solution/VenueBooking/utils/dateSummary.js +27 -56
- package/lib/solution/VenueBooking/utils/resource.js +31 -54
- package/lib/solution/VenueBooking/utils/slotMerge.js +94 -107
- package/lib/solution/VenueBooking/utils/timeSlot.js +132 -132
- package/lib/solution/VenueBooking/utils.js +130 -67
- package/lib/solution/index.js +124 -41
- package/lib/store/createStore.js +32 -29
- package/lib/types/index.js +4 -16
- package/lib/utils/payment-number.js +26 -46
- package/lib/utils/task.js +36 -36
- package/lib/utils/watch.js +81 -47
- package/package.json +2 -1
|
@@ -84,9 +84,7 @@ export var MenuModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
84
84
|
app = appPlugin.getApp();
|
|
85
85
|
this.dbManager = app.dbManager;
|
|
86
86
|
this.logger = app.logger;
|
|
87
|
-
if (this.dbManager) {
|
|
88
|
-
console.log('[Menu] IndexDB Manager 已初始化');
|
|
89
|
-
} else {
|
|
87
|
+
if (this.dbManager) {} else {
|
|
90
88
|
console.warn('[Menu] IndexDB Manager 未找到');
|
|
91
89
|
}
|
|
92
90
|
}
|
|
@@ -262,7 +260,6 @@ export var MenuModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
262
260
|
} finally {
|
|
263
261
|
_iterator2.f();
|
|
264
262
|
}
|
|
265
|
-
console.log("[Menu] Map \u7F13\u5B58\u5DF2\u540C\u6B65\uFF0C\u5171 ".concat(this.store.map.size, " \u4E2A\u9910\u724C"));
|
|
266
263
|
}
|
|
267
264
|
|
|
268
265
|
/**
|
|
@@ -285,33 +282,31 @@ export var MenuModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
285
282
|
|
|
286
283
|
// 同时清空 IndexDB 中的数据
|
|
287
284
|
if (!this.dbManager) {
|
|
288
|
-
_context4.next =
|
|
285
|
+
_context4.next = 16;
|
|
289
286
|
break;
|
|
290
287
|
}
|
|
291
288
|
_context4.prev = 5;
|
|
292
289
|
_context4.next = 8;
|
|
293
290
|
return this.dbManager.clear(INDEXDB_STORE_NAME);
|
|
294
291
|
case 8:
|
|
295
|
-
console.log('[Menu] IndexDB 缓存已清空');
|
|
296
292
|
this.logInfo('IndexDB 缓存已清空');
|
|
297
|
-
_context4.next =
|
|
293
|
+
_context4.next = 16;
|
|
298
294
|
break;
|
|
299
|
-
case
|
|
300
|
-
_context4.prev =
|
|
295
|
+
case 11:
|
|
296
|
+
_context4.prev = 11;
|
|
301
297
|
_context4.t0 = _context4["catch"](5);
|
|
302
298
|
errorMessage = _context4.t0 instanceof Error ? _context4.t0.message : String(_context4.t0);
|
|
303
299
|
console.error('[Menu] 清空 IndexDB 缓存失败:', _context4.t0);
|
|
304
300
|
this.logError('清空 IndexDB 缓存失败', {
|
|
305
301
|
error: errorMessage
|
|
306
302
|
});
|
|
307
|
-
case
|
|
308
|
-
console.log('[Menu] 缓存已清空');
|
|
303
|
+
case 16:
|
|
309
304
|
this.logInfo('缓存清空完成');
|
|
310
|
-
case
|
|
305
|
+
case 17:
|
|
311
306
|
case "end":
|
|
312
307
|
return _context4.stop();
|
|
313
308
|
}
|
|
314
|
-
}, _callee4, this, [[5,
|
|
309
|
+
}, _callee4, this, [[5, 11]]);
|
|
315
310
|
}));
|
|
316
311
|
function clear() {
|
|
317
312
|
return _clear.apply(this, arguments);
|
|
@@ -421,17 +416,16 @@ export var MenuModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
421
416
|
writeDurationMs = +(performance.now() - writeStartedAt).toFixed(2);
|
|
422
417
|
return _context6.finish(20);
|
|
423
418
|
case 23:
|
|
424
|
-
console.log("[Menu] \u5DF2\u5C06 ".concat(menuList.length, " \u6761\u9910\u724C\u6570\u636E\u4FDD\u5B58\u5230 IndexDB"));
|
|
425
419
|
this.logInfo('餐牌数据已保存到 IndexDB', {
|
|
426
420
|
menuCount: menuList.length,
|
|
427
421
|
clearDurationMs: clearDurationMs,
|
|
428
422
|
writeDurationMs: writeDurationMs,
|
|
429
423
|
totalDurationMs: +(performance.now() - startedAt).toFixed(2)
|
|
430
424
|
});
|
|
431
|
-
_context6.next =
|
|
425
|
+
_context6.next = 31;
|
|
432
426
|
break;
|
|
433
|
-
case
|
|
434
|
-
_context6.prev =
|
|
427
|
+
case 26:
|
|
428
|
+
_context6.prev = 26;
|
|
435
429
|
_context6.t0 = _context6["catch"](7);
|
|
436
430
|
errorMessage = _context6.t0 instanceof Error ? _context6.t0.message : String(_context6.t0);
|
|
437
431
|
console.error('[Menu] 保存数据到 IndexDB 失败:', _context6.t0);
|
|
@@ -442,11 +436,11 @@ export var MenuModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
442
436
|
totalDurationMs: +(performance.now() - startedAt).toFixed(2),
|
|
443
437
|
error: errorMessage
|
|
444
438
|
});
|
|
445
|
-
case
|
|
439
|
+
case 31:
|
|
446
440
|
case "end":
|
|
447
441
|
return _context6.stop();
|
|
448
442
|
}
|
|
449
|
-
}, _callee6, this, [[7,
|
|
443
|
+
}, _callee6, this, [[7, 26], [9,, 12, 15], [17,, 20, 23]]);
|
|
450
444
|
}));
|
|
451
445
|
function saveMenuToIndexDB(_x4) {
|
|
452
446
|
return _saveMenuToIndexDB.apply(this, arguments);
|
|
@@ -466,19 +460,17 @@ export var MenuModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
466
460
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
467
461
|
while (1) switch (_context7.prev = _context7.next) {
|
|
468
462
|
case 0:
|
|
469
|
-
console.log('[Menu] 开始预加载数据...');
|
|
470
463
|
startTime = Date.now();
|
|
471
464
|
this.logInfo('开始预加载数据');
|
|
472
|
-
_context7.prev =
|
|
473
|
-
_context7.next =
|
|
465
|
+
_context7.prev = 2;
|
|
466
|
+
_context7.next = 5;
|
|
474
467
|
return this.loadMenuFromIndexDB();
|
|
475
|
-
case
|
|
468
|
+
case 5:
|
|
476
469
|
cachedData = _context7.sent;
|
|
477
470
|
if (!(cachedData && cachedData.length > 0)) {
|
|
478
|
-
_context7.next =
|
|
471
|
+
_context7.next = 13;
|
|
479
472
|
break;
|
|
480
473
|
}
|
|
481
|
-
console.log("[Menu] \u4ECE IndexDB \u52A0\u8F7D\u4E86 ".concat(cachedData.length, " \u6761\u9910\u724C\u6570\u636E"));
|
|
482
474
|
// 将缓存数据放入 store
|
|
483
475
|
this.store.menuList = cloneDeep(cachedData);
|
|
484
476
|
// 同步更新 Map 缓存
|
|
@@ -491,31 +483,30 @@ export var MenuModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
491
483
|
source: 'IndexDB'
|
|
492
484
|
});
|
|
493
485
|
return _context7.abrupt("return");
|
|
494
|
-
case
|
|
495
|
-
console.log('[Menu] IndexDB 中没有缓存数据,从服务器加载...');
|
|
486
|
+
case 13:
|
|
496
487
|
this.logInfo('IndexDB 中没有缓存数据,准备从服务器加载');
|
|
497
|
-
_context7.next =
|
|
488
|
+
_context7.next = 21;
|
|
498
489
|
break;
|
|
499
|
-
case
|
|
500
|
-
_context7.prev =
|
|
501
|
-
_context7.t0 = _context7["catch"](
|
|
490
|
+
case 16:
|
|
491
|
+
_context7.prev = 16;
|
|
492
|
+
_context7.t0 = _context7["catch"](2);
|
|
502
493
|
errorMessage = _context7.t0 instanceof Error ? _context7.t0.message : String(_context7.t0);
|
|
503
494
|
console.warn('[Menu] 从 IndexDB 加载数据失败:', _context7.t0);
|
|
504
495
|
this.logWarning('从 IndexDB 加载数据失败,准备从服务器加载', {
|
|
505
496
|
error: errorMessage
|
|
506
497
|
});
|
|
507
|
-
case
|
|
508
|
-
_context7.next =
|
|
498
|
+
case 21:
|
|
499
|
+
_context7.next = 23;
|
|
509
500
|
return this.loadMenuList();
|
|
510
|
-
case
|
|
501
|
+
case 23:
|
|
511
502
|
menuList = _context7.sent;
|
|
512
503
|
if (!(menuList && menuList.length > 0)) {
|
|
513
|
-
_context7.next =
|
|
504
|
+
_context7.next = 34;
|
|
514
505
|
break;
|
|
515
506
|
}
|
|
516
|
-
_context7.next =
|
|
507
|
+
_context7.next = 27;
|
|
517
508
|
return this.saveMenuToIndexDB(menuList);
|
|
518
|
-
case
|
|
509
|
+
case 27:
|
|
519
510
|
this.store.menuList = cloneDeep(menuList);
|
|
520
511
|
// 同步更新 Map 缓存
|
|
521
512
|
this.syncMenuMap();
|
|
@@ -526,18 +517,18 @@ export var MenuModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
526
517
|
duration: "".concat(_duration2, "ms"),
|
|
527
518
|
source: 'Server'
|
|
528
519
|
});
|
|
529
|
-
_context7.next =
|
|
520
|
+
_context7.next = 36;
|
|
530
521
|
break;
|
|
531
|
-
case
|
|
522
|
+
case 34:
|
|
532
523
|
_duration3 = Date.now() - startTime;
|
|
533
524
|
this.logWarning('预加载完成但未获取到数据', {
|
|
534
525
|
duration: "".concat(_duration3, "ms")
|
|
535
526
|
});
|
|
536
|
-
case
|
|
527
|
+
case 36:
|
|
537
528
|
case "end":
|
|
538
529
|
return _context7.stop();
|
|
539
530
|
}
|
|
540
|
-
}, _callee7, this, [[
|
|
531
|
+
}, _callee7, this, [[2, 16]]);
|
|
541
532
|
}));
|
|
542
533
|
function preload() {
|
|
543
534
|
return _preload.apply(this, arguments);
|
|
@@ -116,7 +116,6 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
116
116
|
case 0:
|
|
117
117
|
changedOrders = _args.length > 0 && _args[0] !== undefined ? _args[0] : [];
|
|
118
118
|
source = _args.length > 1 ? _args[1] : undefined;
|
|
119
|
-
console.log('触发emitOrdersChanged');
|
|
120
119
|
payload = {
|
|
121
120
|
list: this.store.list,
|
|
122
121
|
changedOrders: changedOrders.map(function (order) {
|
|
@@ -124,9 +123,9 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
124
123
|
}),
|
|
125
124
|
source: source
|
|
126
125
|
};
|
|
127
|
-
_context.next =
|
|
126
|
+
_context.next = 5;
|
|
128
127
|
return this.core.effects.emit(OrderHooks.onOrdersChanged, payload);
|
|
129
|
-
case
|
|
128
|
+
case 5:
|
|
130
129
|
case "end":
|
|
131
130
|
return _context.stop();
|
|
132
131
|
}
|
|
@@ -2183,7 +2182,6 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2183
2182
|
pubsub: {
|
|
2184
2183
|
callback: function callback(res) {
|
|
2185
2184
|
var _message$id, _message$order_id, _message$type;
|
|
2186
|
-
console.log('orderDataSource', res);
|
|
2187
2185
|
var pubsubReceivedAt = Date.now();
|
|
2188
2186
|
var message = _this14.normalizeOrderSyncMessage(res);
|
|
2189
2187
|
if (!message) return;
|
|
@@ -125,9 +125,7 @@ export var ProductsModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
125
125
|
app = appPlugin.getApp();
|
|
126
126
|
this.dbManager = app.dbManager;
|
|
127
127
|
this.logger = app.logger;
|
|
128
|
-
if (this.dbManager) {
|
|
129
|
-
console.log('[Products] IndexDB Manager 已初始化');
|
|
130
|
-
} else {
|
|
128
|
+
if (this.dbManager) {} else {
|
|
131
129
|
console.warn('[Products] IndexDB Manager 未找到');
|
|
132
130
|
}
|
|
133
131
|
}
|
|
@@ -859,14 +857,13 @@ export var ProductsModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
859
857
|
_context7.prev = 29;
|
|
860
858
|
_context7.t0 = _context7["catch"](4);
|
|
861
859
|
errorMessage = _context7.t0 instanceof Error ? _context7.t0.message : String(_context7.t0);
|
|
862
|
-
console.log("[ProductsModule] \uD83C\uDF10 ERROR", _context7.t0);
|
|
863
860
|
this.logError('prepareProductsWithPrice 处理失败', {
|
|
864
861
|
schedule_date: schedule_date,
|
|
865
862
|
error: errorMessage
|
|
866
863
|
});
|
|
867
|
-
case
|
|
864
|
+
case 33:
|
|
868
865
|
return _context7.abrupt("return", []);
|
|
869
|
-
case
|
|
866
|
+
case 34:
|
|
870
867
|
case "end":
|
|
871
868
|
return _context7.stop();
|
|
872
869
|
}
|
|
@@ -1095,10 +1092,8 @@ export var ProductsModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1095
1092
|
// 创建 legacy 报价单格式化器
|
|
1096
1093
|
var legacyPriceFormatter = function legacyPriceFormatter(products, context) {
|
|
1097
1094
|
if (!context.priceData || context.priceData.length === 0) {
|
|
1098
|
-
console.log('[ProductsModule] 💰 没有价格数据,跳过 legacy 报价单价格应用');
|
|
1099
1095
|
return products;
|
|
1100
1096
|
}
|
|
1101
|
-
console.log("[ProductsModule] \uD83D\uDCB0 \u5E94\u7528 legacy \u62A5\u4EF7\u5355\u4EF7\u683C\u5230 ".concat(products.length, " \u4E2A\u5546\u54C1"));
|
|
1102
1097
|
return applyPriceDataToProducts(products, context.priceData);
|
|
1103
1098
|
};
|
|
1104
1099
|
var i18nFormatter = function i18nFormatter(products, context) {
|
|
@@ -1114,7 +1109,6 @@ export var ProductsModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1114
1109
|
this.formatters.push(i18nFormatter);
|
|
1115
1110
|
this.formatters.push(detailValueFormatter);
|
|
1116
1111
|
this.isBuiltinFormatterRegistered = true;
|
|
1117
|
-
console.log('[ProductsModule] ✅ 内置商品格式化器已注册(智能定价优先)');
|
|
1118
1112
|
}
|
|
1119
1113
|
|
|
1120
1114
|
/**
|
|
@@ -1162,11 +1156,9 @@ export var ProductsModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1162
1156
|
// 插入到内置智能定价格式化器之后;legacy 报价单启用时需跳过它。
|
|
1163
1157
|
var insertIndex = this.isBuiltinFormatterRegistered ? this.isLegacyPriceFormatterEnabled ? 2 : 1 : 0;
|
|
1164
1158
|
this.formatters.splice(insertIndex, 0, formatter);
|
|
1165
|
-
console.log("[ProductsModule] \uD83D\uDCCC \u5DF2\u5728\u4F4D\u7F6E ".concat(insertIndex + 1, " \u63D2\u5165\u683C\u5F0F\u5316\u5668\uFF0C\u5F53\u524D\u5171 ").concat(this.formatters.length, " \u4E2A"));
|
|
1166
1159
|
} else {
|
|
1167
1160
|
// 追加到末尾
|
|
1168
1161
|
this.formatters.push(formatter);
|
|
1169
|
-
console.log("[ProductsModule] \uD83D\uDCCC \u5DF2\u6CE8\u518C\u683C\u5F0F\u5316\u5668\uFF0C\u5F53\u524D\u5171 ".concat(this.formatters.length, " \u4E2A"));
|
|
1170
1162
|
}
|
|
1171
1163
|
}
|
|
1172
1164
|
|
|
@@ -1182,11 +1174,9 @@ export var ProductsModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1182
1174
|
// 保留 legacy 兜底(如果启用)和智能定价格式化器。
|
|
1183
1175
|
var builtinCount = this.isLegacyPriceFormatterEnabled ? 2 : 1;
|
|
1184
1176
|
this.formatters = this.formatters.slice(0, builtinCount);
|
|
1185
|
-
console.log('[ProductsModule] 🧹 已清空自定义格式化器,保留内置智能定价格式化器');
|
|
1186
1177
|
} else {
|
|
1187
1178
|
this.formatters = [];
|
|
1188
1179
|
this.isBuiltinFormatterRegistered = false;
|
|
1189
|
-
console.log('[ProductsModule] 🧹 已清空所有格式化器');
|
|
1190
1180
|
}
|
|
1191
1181
|
}
|
|
1192
1182
|
|
|
@@ -1202,7 +1192,6 @@ export var ProductsModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1202
1192
|
var keys = Array.from(this.productsPriceCache.keys());
|
|
1203
1193
|
var oldestKey = keys[0];
|
|
1204
1194
|
this.productsPriceCache.delete(oldestKey);
|
|
1205
|
-
console.log("[ProductsModule] \uD83E\uDDF9 \u6E05\u7406\u8FC7\u671F\u5546\u54C1\u4EF7\u683C\u7F13\u5B58: ".concat(oldestKey));
|
|
1206
1195
|
}
|
|
1207
1196
|
}
|
|
1208
1197
|
|
|
@@ -1216,7 +1205,6 @@ export var ProductsModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1216
1205
|
this.productsPriceCache.clear();
|
|
1217
1206
|
this.quotationScheduleCache.clear();
|
|
1218
1207
|
this.quotationScheduleCacheLoaded = false;
|
|
1219
|
-
console.log('[ProductsModule] 🗑️ 商品价格缓存已清空');
|
|
1220
1208
|
}
|
|
1221
1209
|
|
|
1222
1210
|
/**
|
|
@@ -1744,33 +1732,31 @@ export var ProductsModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1744
1732
|
|
|
1745
1733
|
// 同时清空 IndexDB 中的所有数据(包括商品和元数据)
|
|
1746
1734
|
if (!this.dbManager) {
|
|
1747
|
-
_context17.next =
|
|
1735
|
+
_context17.next = 15;
|
|
1748
1736
|
break;
|
|
1749
1737
|
}
|
|
1750
1738
|
_context17.prev = 4;
|
|
1751
1739
|
_context17.next = 7;
|
|
1752
1740
|
return this.dbManager.clear(INDEXDB_STORE_NAME);
|
|
1753
1741
|
case 7:
|
|
1754
|
-
console.log('[Products] IndexDB 缓存已清空');
|
|
1755
1742
|
this.logInfo('IndexDB 缓存已清空');
|
|
1756
|
-
_context17.next =
|
|
1743
|
+
_context17.next = 15;
|
|
1757
1744
|
break;
|
|
1758
|
-
case
|
|
1759
|
-
_context17.prev =
|
|
1745
|
+
case 10:
|
|
1746
|
+
_context17.prev = 10;
|
|
1760
1747
|
_context17.t0 = _context17["catch"](4);
|
|
1761
1748
|
errorMessage = _context17.t0 instanceof Error ? _context17.t0.message : String(_context17.t0);
|
|
1762
1749
|
console.error('[Products] 清空 IndexDB 缓存失败:', _context17.t0);
|
|
1763
1750
|
this.logError('清空 IndexDB 缓存失败', {
|
|
1764
1751
|
error: errorMessage
|
|
1765
1752
|
});
|
|
1766
|
-
case
|
|
1767
|
-
console.log('[Products] 缓存已清空');
|
|
1753
|
+
case 15:
|
|
1768
1754
|
this.logInfo('缓存清空完成');
|
|
1769
|
-
case
|
|
1755
|
+
case 16:
|
|
1770
1756
|
case "end":
|
|
1771
1757
|
return _context17.stop();
|
|
1772
1758
|
}
|
|
1773
|
-
}, _callee17, this, [[4,
|
|
1759
|
+
}, _callee17, this, [[4, 10]]);
|
|
1774
1760
|
}));
|
|
1775
1761
|
function clear() {
|
|
1776
1762
|
return _clear.apply(this, arguments);
|
|
@@ -2141,23 +2127,21 @@ export var ProductsModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2141
2127
|
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
2142
2128
|
while (1) switch (_context24.prev = _context24.next) {
|
|
2143
2129
|
case 0:
|
|
2144
|
-
console.log('[Products] 开始预加载数据...');
|
|
2145
2130
|
tTotal = performance.now();
|
|
2146
2131
|
this.logInfo('开始预加载数据');
|
|
2147
|
-
_context24.prev =
|
|
2132
|
+
_context24.prev = 2;
|
|
2148
2133
|
tIndexDB = performance.now();
|
|
2149
|
-
_context24.next =
|
|
2134
|
+
_context24.next = 6;
|
|
2150
2135
|
return this.loadProductsFromIndexDB();
|
|
2151
|
-
case
|
|
2136
|
+
case 6:
|
|
2152
2137
|
cachedData = _context24.sent;
|
|
2153
2138
|
perfMark('preload.loadFromIndexDB', performance.now() - tIndexDB, {
|
|
2154
2139
|
count: (_cachedData$length = cachedData === null || cachedData === void 0 ? void 0 : cachedData.length) !== null && _cachedData$length !== void 0 ? _cachedData$length : 0
|
|
2155
2140
|
});
|
|
2156
2141
|
if (!(cachedData && cachedData.length > 0)) {
|
|
2157
|
-
_context24.next =
|
|
2142
|
+
_context24.next = 18;
|
|
2158
2143
|
break;
|
|
2159
2144
|
}
|
|
2160
|
-
console.log("[Products] \u4ECE IndexDB \u52A0\u8F7D\u4E86 ".concat(cachedData.length, " \u4E2A\u5546\u54C1"));
|
|
2161
2145
|
// IndexDB 反序列化的数据已经是全新的,无需 cloneDeep
|
|
2162
2146
|
this.store.list = cachedData;
|
|
2163
2147
|
tSync = performance.now();
|
|
@@ -2178,26 +2162,25 @@ export var ProductsModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2178
2162
|
});
|
|
2179
2163
|
this.lastPreloadCompletedAtMs = Date.now();
|
|
2180
2164
|
return _context24.abrupt("return");
|
|
2181
|
-
case
|
|
2182
|
-
console.log('[Products] IndexDB 中没有缓存数据,从服务器加载...');
|
|
2165
|
+
case 18:
|
|
2183
2166
|
this.logInfo('IndexDB 中没有缓存数据,准备从服务器加载');
|
|
2184
|
-
_context24.next =
|
|
2167
|
+
_context24.next = 26;
|
|
2185
2168
|
break;
|
|
2186
|
-
case
|
|
2187
|
-
_context24.prev =
|
|
2188
|
-
_context24.t0 = _context24["catch"](
|
|
2169
|
+
case 21:
|
|
2170
|
+
_context24.prev = 21;
|
|
2171
|
+
_context24.t0 = _context24["catch"](2);
|
|
2189
2172
|
errorMessage = _context24.t0 instanceof Error ? _context24.t0.message : String(_context24.t0);
|
|
2190
2173
|
console.warn('[Products] 从 IndexDB 加载数据失败:', _context24.t0);
|
|
2191
2174
|
this.logWarning('从 IndexDB 加载数据失败,准备从服务器加载', {
|
|
2192
2175
|
error: errorMessage
|
|
2193
2176
|
});
|
|
2194
|
-
case
|
|
2177
|
+
case 26:
|
|
2195
2178
|
tServer = performance.now();
|
|
2196
|
-
_context24.next =
|
|
2179
|
+
_context24.next = 29;
|
|
2197
2180
|
return this.loadProductsByServer({
|
|
2198
2181
|
trigger: 'preload'
|
|
2199
2182
|
});
|
|
2200
|
-
case
|
|
2183
|
+
case 29:
|
|
2201
2184
|
products = _context24.sent;
|
|
2202
2185
|
perfMark('preload.loadFromServer', performance.now() - tServer, {
|
|
2203
2186
|
count: (_products$length3 = products === null || products === void 0 ? void 0 : products.length) !== null && _products$length3 !== void 0 ? _products$length3 : 0
|
|
@@ -2230,11 +2213,11 @@ export var ProductsModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2230
2213
|
duration: "".concat(Math.round(performance.now() - tTotal), "ms")
|
|
2231
2214
|
});
|
|
2232
2215
|
}
|
|
2233
|
-
case
|
|
2216
|
+
case 32:
|
|
2234
2217
|
case "end":
|
|
2235
2218
|
return _context24.stop();
|
|
2236
2219
|
}
|
|
2237
|
-
}, _callee24, this, [[
|
|
2220
|
+
}, _callee24, this, [[2, 21]]);
|
|
2238
2221
|
}));
|
|
2239
2222
|
function preload() {
|
|
2240
2223
|
return _preload.apply(this, arguments);
|
|
@@ -2278,7 +2261,6 @@ export var ProductsModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2278
2261
|
return function (message) {
|
|
2279
2262
|
var data = (message === null || message === void 0 ? void 0 : message.data) || message;
|
|
2280
2263
|
if (!data) return;
|
|
2281
|
-
console.log("[ProductsModule] \u6536\u5230\u540C\u6B65\u6D88\u606F [".concat(channelKey, "]:"), data);
|
|
2282
2264
|
_this11.logInfo('收到同步消息', {
|
|
2283
2265
|
channelKey: channelKey,
|
|
2284
2266
|
action: data.action,
|
|
@@ -82,9 +82,7 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
82
82
|
if (appPlugin) {
|
|
83
83
|
app = appPlugin.getApp();
|
|
84
84
|
this.dbManager = app.dbManager;
|
|
85
|
-
if (this.dbManager) {
|
|
86
|
-
console.log('[Quotation] IndexDB Manager 已初始化');
|
|
87
|
-
} else {
|
|
85
|
+
if (this.dbManager) {} else {
|
|
88
86
|
console.warn('[Quotation] IndexDB Manager 未找到');
|
|
89
87
|
}
|
|
90
88
|
}
|
|
@@ -319,27 +317,24 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
319
317
|
|
|
320
318
|
// 同时清空 IndexDB 中的数据
|
|
321
319
|
if (!this.dbManager) {
|
|
322
|
-
_context5.next =
|
|
320
|
+
_context5.next = 10;
|
|
323
321
|
break;
|
|
324
322
|
}
|
|
325
323
|
_context5.prev = 2;
|
|
326
324
|
_context5.next = 5;
|
|
327
325
|
return this.dbManager.clear(INDEXDB_STORE_NAME);
|
|
328
326
|
case 5:
|
|
329
|
-
|
|
330
|
-
_context5.next = 11;
|
|
327
|
+
_context5.next = 10;
|
|
331
328
|
break;
|
|
332
|
-
case
|
|
333
|
-
_context5.prev =
|
|
329
|
+
case 7:
|
|
330
|
+
_context5.prev = 7;
|
|
334
331
|
_context5.t0 = _context5["catch"](2);
|
|
335
332
|
console.error('[Quotation] 清空 IndexDB 缓存失败:', _context5.t0);
|
|
336
|
-
case
|
|
337
|
-
console.log('[Quotation] 缓存已清空');
|
|
338
|
-
case 12:
|
|
333
|
+
case 10:
|
|
339
334
|
case "end":
|
|
340
335
|
return _context5.stop();
|
|
341
336
|
}
|
|
342
|
-
}, _callee5, this, [[2,
|
|
337
|
+
}, _callee5, this, [[2, 7]]);
|
|
343
338
|
}));
|
|
344
339
|
function clear() {
|
|
345
340
|
return _clear.apply(this, arguments);
|
|
@@ -495,18 +490,17 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
495
490
|
_context7.next = 8;
|
|
496
491
|
return Promise.all(savePromises);
|
|
497
492
|
case 8:
|
|
498
|
-
|
|
499
|
-
_context7.next = 14;
|
|
493
|
+
_context7.next = 13;
|
|
500
494
|
break;
|
|
501
|
-
case
|
|
502
|
-
_context7.prev =
|
|
495
|
+
case 10:
|
|
496
|
+
_context7.prev = 10;
|
|
503
497
|
_context7.t0 = _context7["catch"](2);
|
|
504
498
|
console.error('[Quotation] 保存数据到 IndexDB 失败:', _context7.t0);
|
|
505
|
-
case
|
|
499
|
+
case 13:
|
|
506
500
|
case "end":
|
|
507
501
|
return _context7.stop();
|
|
508
502
|
}
|
|
509
|
-
}, _callee7, this, [[2,
|
|
503
|
+
}, _callee7, this, [[2, 10]]);
|
|
510
504
|
}));
|
|
511
505
|
function saveQuotationToIndexDB(_x5) {
|
|
512
506
|
return _saveQuotationToIndexDB.apply(this, arguments);
|
|
@@ -526,48 +520,45 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
526
520
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
527
521
|
while (1) switch (_context8.prev = _context8.next) {
|
|
528
522
|
case 0:
|
|
529
|
-
|
|
530
|
-
_context8.
|
|
531
|
-
_context8.next = 4;
|
|
523
|
+
_context8.prev = 0;
|
|
524
|
+
_context8.next = 3;
|
|
532
525
|
return this.loadQuotationFromIndexDB();
|
|
533
|
-
case
|
|
526
|
+
case 3:
|
|
534
527
|
cachedData = _context8.sent;
|
|
535
528
|
if (!(cachedData && cachedData.length > 0)) {
|
|
536
|
-
_context8.next =
|
|
529
|
+
_context8.next = 8;
|
|
537
530
|
break;
|
|
538
531
|
}
|
|
539
|
-
console.log("[Quotation] \u4ECE IndexDB \u52A0\u8F7D\u4E86 ".concat(cachedData.length, " \u6761\u62A5\u4EF7\u5355\u6570\u636E"));
|
|
540
532
|
// 将缓存数据放入 store
|
|
541
533
|
this.store.quotationList = cloneDeep(cachedData);
|
|
542
534
|
this.core.effects.emit(QuotationHooks.onQuotationChanged, this.store.quotationList);
|
|
543
535
|
return _context8.abrupt("return");
|
|
544
|
-
case
|
|
545
|
-
|
|
546
|
-
_context8.next = 16;
|
|
536
|
+
case 8:
|
|
537
|
+
_context8.next = 13;
|
|
547
538
|
break;
|
|
548
|
-
case
|
|
549
|
-
_context8.prev =
|
|
550
|
-
_context8.t0 = _context8["catch"](
|
|
539
|
+
case 10:
|
|
540
|
+
_context8.prev = 10;
|
|
541
|
+
_context8.t0 = _context8["catch"](0);
|
|
551
542
|
console.warn('[Quotation] 从 IndexDB 加载数据失败:', _context8.t0);
|
|
552
|
-
case
|
|
553
|
-
_context8.next =
|
|
543
|
+
case 13:
|
|
544
|
+
_context8.next = 15;
|
|
554
545
|
return this.loadQuotationList();
|
|
555
|
-
case
|
|
546
|
+
case 15:
|
|
556
547
|
quotationList = _context8.sent;
|
|
557
548
|
if (!(quotationList && quotationList.length > 0)) {
|
|
558
|
-
_context8.next =
|
|
549
|
+
_context8.next = 21;
|
|
559
550
|
break;
|
|
560
551
|
}
|
|
561
|
-
_context8.next =
|
|
552
|
+
_context8.next = 19;
|
|
562
553
|
return this.saveQuotationToIndexDB(quotationList);
|
|
563
|
-
case
|
|
554
|
+
case 19:
|
|
564
555
|
this.store.quotationList = cloneDeep(quotationList);
|
|
565
556
|
this.core.effects.emit(QuotationHooks.onQuotationChanged, this.store.quotationList);
|
|
566
|
-
case
|
|
557
|
+
case 21:
|
|
567
558
|
case "end":
|
|
568
559
|
return _context8.stop();
|
|
569
560
|
}
|
|
570
|
-
}, _callee8, this, [[
|
|
561
|
+
}, _callee8, this, [[0, 10]]);
|
|
571
562
|
}));
|
|
572
563
|
function preload() {
|
|
573
564
|
return _preload.apply(this, arguments);
|
|
@@ -798,17 +798,16 @@ export var ResourceModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
798
798
|
});
|
|
799
799
|
case 4:
|
|
800
800
|
result = _context8.sent;
|
|
801
|
-
console.log('result', result);
|
|
802
801
|
this.logInfo('setupResourceSync: 资源列表查询结果', {
|
|
803
802
|
result: result
|
|
804
803
|
});
|
|
805
804
|
if (!(result !== null && result !== void 0 && (_result$data = result.data) !== null && _result$data !== void 0 && (_result$data = _result$data.list) !== null && _result$data !== void 0 && _result$data.length)) {
|
|
806
|
-
_context8.next =
|
|
805
|
+
_context8.next = 9;
|
|
807
806
|
break;
|
|
808
807
|
}
|
|
809
|
-
_context8.next =
|
|
808
|
+
_context8.next = 9;
|
|
810
809
|
return this.mergeResourcesToStore(result === null || result === void 0 || (_result$data2 = result.data) === null || _result$data2 === void 0 ? void 0 : _result$data2.list);
|
|
811
|
-
case
|
|
810
|
+
case 9:
|
|
812
811
|
case "end":
|
|
813
812
|
return _context8.stop();
|
|
814
813
|
}
|