@pisell/private-materials 3.0.166 → 3.0.168
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.js +10 -10
- package/es/components/booking/components/footer/utils.js +1 -1
- package/es/components/booking/info/utils.js +1 -1
- package/es/components/booking/info2/service/addService/utils.js +26 -13
- package/es/components/booking/info2/service/editService/index.js +29 -25
- package/es/components/booking/info2/utilsByBooking.js +46 -34
- package/es/components/booking/materiels/duration/index.d.ts +2 -2
- package/es/components/booking/materiels/duration/index.js +11 -11
- package/lib/components/booking/components/footer/utils.js +1 -1
- package/lib/components/booking/info/utils.js +1 -1
- package/lib/components/booking/info2/service/addService/utils.js +13 -11
- package/lib/components/booking/info2/service/editService/index.js +20 -15
- package/lib/components/booking/info2/utilsByBooking.js +22 -14
- package/lib/components/booking/materiels/duration/index.d.ts +2 -2
- package/package.json +2 -2
|
@@ -70,6 +70,7 @@ var getResourceTimeIsUsable = (item, cacheItem, resourceItem) => {
|
|
|
70
70
|
const currentCount = getSumCapacity({ cacheItem });
|
|
71
71
|
const eventList = time.event_list || [];
|
|
72
72
|
let endDate = null;
|
|
73
|
+
let isCalcCount = true;
|
|
73
74
|
if (isFlexible) {
|
|
74
75
|
if (eventList.length) {
|
|
75
76
|
timeStartDate = eventList.reduce((max, event) => {
|
|
@@ -78,6 +79,11 @@ var getResourceTimeIsUsable = (item, cacheItem, resourceItem) => {
|
|
|
78
79
|
}, (0, import_dayjs.default)(eventList[0].end_at));
|
|
79
80
|
}
|
|
80
81
|
isDateRange = startDate.isAfter(timeStartDate) && startDate.isBefore(timeEndDate);
|
|
82
|
+
if (!isDateRange && eventList.length) {
|
|
83
|
+
isCalcCount = false;
|
|
84
|
+
isDateRange = true;
|
|
85
|
+
isCountRange = false;
|
|
86
|
+
}
|
|
81
87
|
} else {
|
|
82
88
|
endDate = startDate.add(import_utils2.flexibleObj.getValue(cacheItem._extend.duration), "minute");
|
|
83
89
|
const isTimeRange = startDate.isAfter(timeStartDate) && endDate.isBefore(timeEndDate);
|
|
@@ -85,21 +91,23 @@ var getResourceTimeIsUsable = (item, cacheItem, resourceItem) => {
|
|
|
85
91
|
isDateRange = true;
|
|
86
92
|
}
|
|
87
93
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
if (
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
let conflictCount = getUseableEventCount(conflict, resourceItem.capacity);
|
|
99
|
-
if (currentCount <= conflictCount) {
|
|
100
|
-
isCountRange = true;
|
|
94
|
+
if (isCalcCount) {
|
|
95
|
+
let conflict = (time.event_list || []).filter((d) => {
|
|
96
|
+
return isConflict({ start_at: d.start_at, end_at: d.end_at }, { start_at: startDate, end_at: endDate });
|
|
97
|
+
});
|
|
98
|
+
if (resourceItem.resourceType === "single") {
|
|
99
|
+
if (conflict.length === 0) {
|
|
100
|
+
isCountRange = true;
|
|
101
|
+
} else {
|
|
102
|
+
isCountRange = false;
|
|
103
|
+
}
|
|
101
104
|
} else {
|
|
102
|
-
|
|
105
|
+
let conflictCount = getUseableEventCount(conflict, resourceItem.capacity);
|
|
106
|
+
if (currentCount <= conflictCount) {
|
|
107
|
+
isCountRange = true;
|
|
108
|
+
} else {
|
|
109
|
+
isCountRange = false;
|
|
110
|
+
}
|
|
103
111
|
}
|
|
104
112
|
}
|
|
105
113
|
const isUsable = isDateRange && isCountRange;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.168",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"rc-virtual-list": "^3.11.3",
|
|
61
61
|
"decimal.js": "^10.4.3",
|
|
62
62
|
"@pisell/utils": "1.0.42",
|
|
63
|
-
"@pisell/icon": "0.0.11",
|
|
64
63
|
"@pisell/date-picker": "1.0.100",
|
|
64
|
+
"@pisell/icon": "0.0.11",
|
|
65
65
|
"@pisell/materials": "3.0.50"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|