@pisell/pisellos 0.0.108 → 0.0.110
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/modules/Date/index.d.ts +1 -0
- package/dist/modules/Date/index.js +5 -0
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/modules/Schedule/utils.js +1 -1
- package/dist/solution/BookingByStep/index.js +6 -2
- package/lib/modules/Date/index.d.ts +1 -0
- package/lib/modules/Date/index.js +3 -0
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/modules/Schedule/utils.js +1 -1
- package/lib/solution/BookingByStep/index.js +3 -1
- package/package.json +1 -1
|
@@ -15,6 +15,7 @@ export declare class DateModule extends BaseModule implements Module, DateModule
|
|
|
15
15
|
getDateRange(): ITime[];
|
|
16
16
|
getResourceDates(params: IGetAvailableTimeListParams): Promise<ITime[]>;
|
|
17
17
|
getDateList(): ITime[];
|
|
18
|
+
setDateList(dateList: ITime[]): void;
|
|
18
19
|
fetchResourceDates(params: IGetAvailableTimeListParams): Promise<any>;
|
|
19
20
|
getResourceAvailableTimeList(params: IGetAvailableTimeListParams): Promise<ITime[]>;
|
|
20
21
|
clearDateRange(): void;
|
|
@@ -112,6 +112,11 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
112
112
|
value: function getDateList() {
|
|
113
113
|
return this.store.dateList;
|
|
114
114
|
}
|
|
115
|
+
}, {
|
|
116
|
+
key: "setDateList",
|
|
117
|
+
value: function setDateList(dateList) {
|
|
118
|
+
this.store.dateList = dateList;
|
|
119
|
+
}
|
|
115
120
|
}, {
|
|
116
121
|
key: "fetchResourceDates",
|
|
117
122
|
value: function () {
|
|
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
|
|
|
49
49
|
getCategories(): ProductCategory[];
|
|
50
50
|
setOtherParams(key: string, value: any): void;
|
|
51
51
|
getOtherParams(): any;
|
|
52
|
-
getProductType(): "
|
|
52
|
+
getProductType(): "duration" | "session" | "normal";
|
|
53
53
|
}
|
|
@@ -143,7 +143,7 @@ var getDaysByRepeatWeek = function getDaysByRepeatWeek(params, isGetRange) {
|
|
|
143
143
|
var _end = _start.add(scheduleDiff, 'second');
|
|
144
144
|
if (isGetRange) {
|
|
145
145
|
if (excludedDaysMap.has(_start.format('YYYY-MM-DD'))) {
|
|
146
|
-
startTmp = startTmp.day(1).add(frequency, '
|
|
146
|
+
startTmp = startTmp.day(1).add(frequency, 'day');
|
|
147
147
|
continue;
|
|
148
148
|
}
|
|
149
149
|
var arr = getDataRange({
|
|
@@ -36,7 +36,7 @@ dayjs.extend(isSameOrAfter);
|
|
|
36
36
|
import { getResourcesMap } from "../../modules/Resource/utils";
|
|
37
37
|
import { cloneDeep } from 'lodash-es';
|
|
38
38
|
import { calcCalendarDataByScheduleResult, calcMinTimeMaxTimeBySchedules, getAllSortedDateRanges } from "../../modules/Schedule/utils";
|
|
39
|
-
import { disableAllDates, disableDatesBeforeOneDay, generateMonthDates } from "../../modules/Date/utils";
|
|
39
|
+
import { disableAllDates, disableDatesBeforeOneDay, generateMonthDates, handleAvailableDateByResource } from "../../modules/Date/utils";
|
|
40
40
|
export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
41
41
|
_inherits(BookingByStepImpl, _BaseModule);
|
|
42
42
|
var _super = _createSuper(BookingByStepImpl);
|
|
@@ -2801,6 +2801,10 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2801
2801
|
_context30.next = 22;
|
|
2802
2802
|
break;
|
|
2803
2803
|
case 28:
|
|
2804
|
+
// 最终把资源数据也加到日期内
|
|
2805
|
+
dates = handleAvailableDateByResource(res.data, dates);
|
|
2806
|
+
this.store.date.setDateList(dates);
|
|
2807
|
+
|
|
2804
2808
|
// 缓存这次结果,以防后面他小幅度范围内去修改天数
|
|
2805
2809
|
(_this$store$currentPr6 = this.store.currentProduct) === null || _this$store$currentPr6 === void 0 || _this$store$currentPr6.setOtherParams('timeSlotBySchedule', {
|
|
2806
2810
|
dateList: dates,
|
|
@@ -2812,7 +2816,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2812
2816
|
dateList: dates,
|
|
2813
2817
|
firstAvailableDate: firstAvailableDate
|
|
2814
2818
|
});
|
|
2815
|
-
case
|
|
2819
|
+
case 32:
|
|
2816
2820
|
case "end":
|
|
2817
2821
|
return _context30.stop();
|
|
2818
2822
|
}
|
|
@@ -15,6 +15,7 @@ export declare class DateModule extends BaseModule implements Module, DateModule
|
|
|
15
15
|
getDateRange(): ITime[];
|
|
16
16
|
getResourceDates(params: IGetAvailableTimeListParams): Promise<ITime[]>;
|
|
17
17
|
getDateList(): ITime[];
|
|
18
|
+
setDateList(dateList: ITime[]): void;
|
|
18
19
|
fetchResourceDates(params: IGetAvailableTimeListParams): Promise<any>;
|
|
19
20
|
getResourceAvailableTimeList(params: IGetAvailableTimeListParams): Promise<ITime[]>;
|
|
20
21
|
clearDateRange(): void;
|
|
@@ -65,6 +65,9 @@ var DateModule = class extends import_BaseModule.BaseModule {
|
|
|
65
65
|
getDateList() {
|
|
66
66
|
return this.store.dateList;
|
|
67
67
|
}
|
|
68
|
+
setDateList(dateList) {
|
|
69
|
+
this.store.dateList = dateList;
|
|
70
|
+
}
|
|
68
71
|
async fetchResourceDates(params) {
|
|
69
72
|
const { url, query } = params;
|
|
70
73
|
const fetchUrl = url || "/schedule/resource/list";
|
|
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
|
|
|
49
49
|
getCategories(): ProductCategory[];
|
|
50
50
|
setOtherParams(key: string, value: any): void;
|
|
51
51
|
getOtherParams(): any;
|
|
52
|
-
getProductType(): "
|
|
52
|
+
getProductType(): "duration" | "session" | "normal";
|
|
53
53
|
}
|
|
@@ -143,7 +143,7 @@ var getDaysByRepeatWeek = (params, isGetRange) => {
|
|
|
143
143
|
const _end = _start.add(scheduleDiff, "second");
|
|
144
144
|
if (isGetRange) {
|
|
145
145
|
if (excludedDaysMap.has(_start.format("YYYY-MM-DD"))) {
|
|
146
|
-
startTmp = startTmp.day(1).add(frequency, "
|
|
146
|
+
startTmp = startTmp.day(1).add(frequency, "day");
|
|
147
147
|
continue;
|
|
148
148
|
}
|
|
149
149
|
const arr = getDataRange({
|
|
@@ -1904,7 +1904,7 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
|
|
|
1904
1904
|
resource_ids: tempResourceIds
|
|
1905
1905
|
}
|
|
1906
1906
|
});
|
|
1907
|
-
|
|
1907
|
+
let dates = [];
|
|
1908
1908
|
let currentDate = (0, import_dayjs.default)(startDate);
|
|
1909
1909
|
let firstAvailableDate = "";
|
|
1910
1910
|
const openResources = ((_e = (_d = tempProducts == null ? void 0 : tempProducts.product_resource) == null ? void 0 : _d.resources) == null ? void 0 : _e.filter(
|
|
@@ -1995,6 +1995,8 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
|
|
|
1995
1995
|
}
|
|
1996
1996
|
currentDate = (0, import_dayjs.default)(currentDate).add(1, "day");
|
|
1997
1997
|
}
|
|
1998
|
+
dates = (0, import_utils3.handleAvailableDateByResource)(res.data, dates);
|
|
1999
|
+
this.store.date.setDateList(dates);
|
|
1998
2000
|
(_f = this.store.currentProduct) == null ? void 0 : _f.setOtherParams("timeSlotBySchedule", {
|
|
1999
2001
|
dateList: dates,
|
|
2000
2002
|
firstAvailableDate,
|