@pisell/pisellos 3.0.7 → 3.0.8

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.
@@ -144,6 +144,8 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
144
144
  end_date: end_date,
145
145
  resource_ids: resource_ids,
146
146
  front_end_cache_id: this.cacheId
147
+ }, {
148
+ useCache: true
147
149
  });
148
150
  case 11:
149
151
  res = _context3.sent;
@@ -1216,6 +1216,14 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
1216
1216
  return canUseTime;
1217
1217
  });
1218
1218
  });
1219
+ } else {
1220
+ productResources.forEach(function (item) {
1221
+ // 如果资源的 capacity 已经小于了当前需要的 capacity ,则需要把资源给过滤掉
1222
+ item.renderList = item.renderList.filter(function (n) {
1223
+ var recordCount = n.capacity || 0;
1224
+ return recordCount >= currentCapacity;
1225
+ });
1226
+ });
1219
1227
  }
1220
1228
  arr.push({
1221
1229
  id: cartItem.id,
@@ -1510,6 +1518,11 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
1510
1518
  _resources.forEach(function (n) {
1511
1519
  var _n$renderList;
1512
1520
  if ((_n$renderList = n.renderList) !== null && _n$renderList !== void 0 && _n$renderList.length) {
1521
+ // 过滤掉 capacity 小于 currentCapacity 的资源
1522
+ n.renderList = n.renderList.filter(function (m) {
1523
+ var recordCount = m.capacity || 0;
1524
+ return recordCount >= currentCapacity;
1525
+ });
1513
1526
  currentResourcesRenderList.push.apply(currentResourcesRenderList, _toConsumableArray(n.renderList || []));
1514
1527
  }
1515
1528
  });
@@ -83,6 +83,8 @@ var DateModule = class extends import_BaseModule.BaseModule {
83
83
  end_date,
84
84
  resource_ids,
85
85
  front_end_cache_id: this.cacheId
86
+ }, {
87
+ useCache: true
86
88
  });
87
89
  if (!((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.length)) {
88
90
  return (0, import_utils.disableAllDates)(dates);
@@ -667,6 +667,13 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
667
667
  return canUseTime;
668
668
  });
669
669
  });
670
+ } else {
671
+ productResources.forEach((item) => {
672
+ item.renderList = item.renderList.filter((n) => {
673
+ const recordCount = n.capacity || 0;
674
+ return recordCount >= currentCapacity;
675
+ });
676
+ });
670
677
  }
671
678
  arr.push({
672
679
  id: cartItem.id,
@@ -918,6 +925,10 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
918
925
  resources2.forEach((n) => {
919
926
  var _a3;
920
927
  if ((_a3 = n.renderList) == null ? void 0 : _a3.length) {
928
+ n.renderList = n.renderList.filter((m) => {
929
+ const recordCount = m.capacity || 0;
930
+ return recordCount >= currentCapacity;
931
+ });
921
932
  currentResourcesRenderList.push(...n.renderList || []);
922
933
  }
923
934
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "3.0.7",
4
+ "version": "3.0.8",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",