@pisell/pisellos 2.1.22 → 2.1.24
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.
|
@@ -2598,17 +2598,21 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2598
2598
|
});
|
|
2599
2599
|
// 这里为什么要设置个 map,因为有可能日程有重叠,所以要把重叠的 event_list 去除
|
|
2600
2600
|
var mSet = new Map();
|
|
2601
|
-
|
|
2602
|
-
//
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2601
|
+
mTimes.forEach(function (n) {
|
|
2602
|
+
// acc += n.event_list?.reduce((acc: any, curr: any) => acc + curr.pax, 0);
|
|
2603
|
+
// mSet.set(n)
|
|
2604
|
+
n.event_list.forEach(function (m) {
|
|
2605
|
+
// 需要确认 m 的时间段是否和 item 的时间段有交集
|
|
2606
|
+
if (isConflict({
|
|
2607
|
+
start_at: m.start_at,
|
|
2608
|
+
end_at: m.end_at
|
|
2609
|
+
}, {
|
|
2610
|
+
start_at: dayjs(item.start),
|
|
2611
|
+
end_at: dayjs(item.end)
|
|
2612
|
+
})) {
|
|
2613
|
+
mSet.set(m.id, m.pax || 1);
|
|
2614
|
+
}
|
|
2615
|
+
});
|
|
2612
2616
|
});
|
|
2613
2617
|
acc += Array.from(mSet.values()).reduce(function (acc, curr) {
|
|
2614
2618
|
return acc + curr;
|
|
@@ -1826,13 +1826,15 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
|
|
|
1826
1826
|
return !(0, import_dayjs.default)(n2.start_at).isAfter((0, import_dayjs.default)(item.start), "minute") && !(0, import_dayjs.default)(n2.end_at).isBefore((0, import_dayjs.default)(item.end), "minute") || (0, import_dayjs.default)(n2.start_at).isBefore((0, import_dayjs.default)(item.end), "minute") && (0, import_dayjs.default)(n2.end_at).isAfter((0, import_dayjs.default)(item.start), "minute");
|
|
1827
1827
|
});
|
|
1828
1828
|
const mSet = /* @__PURE__ */ new Map();
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1829
|
+
mTimes.forEach((n2) => {
|
|
1830
|
+
n2.event_list.forEach((m) => {
|
|
1831
|
+
if ((0, import_resources.isConflict)(
|
|
1832
|
+
{ start_at: m.start_at, end_at: m.end_at },
|
|
1833
|
+
{ start_at: (0, import_dayjs.default)(item.start), end_at: (0, import_dayjs.default)(item.end) }
|
|
1834
|
+
)) {
|
|
1835
|
+
mSet.set(m.id, m.pax || 1);
|
|
1836
|
+
}
|
|
1837
|
+
});
|
|
1836
1838
|
});
|
|
1837
1839
|
acc += Array.from(mSet.values()).reduce((acc2, curr2) => acc2 + curr2, 0);
|
|
1838
1840
|
return acc;
|