@pisell/private-materials 3.0.27 → 3.0.29
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/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/booking/addons/index.d.ts +1 -1
- package/es/components/booking/addons/index.js +2 -0
- package/es/components/booking/addons/model.d.ts +2 -1
- package/es/components/booking/components/collapsibleList/index.js +1 -1
- package/es/components/booking/components/customSelect/index.js +2 -1
- package/es/components/booking/components/footer/utils.js +5 -1
- package/es/components/booking/components/tabPane/index.less +1 -0
- package/es/components/booking/deposit/ClientItem/index.d.ts +18 -0
- package/es/components/booking/deposit/ClientItem/index.js +43 -0
- package/es/components/booking/deposit/ClientItem/index.less +37 -0
- package/es/components/booking/deposit/DepositItem/index.d.ts +20 -0
- package/es/components/booking/deposit/DepositItem/index.js +105 -0
- package/es/components/booking/deposit/DepositItem/index.less +88 -0
- package/es/components/booking/deposit/EditDepositModal/index.d.ts +9 -0
- package/es/components/booking/deposit/EditDepositModal/index.js +126 -0
- package/es/components/booking/deposit/EditDepositModal/index.less +24 -0
- package/es/components/booking/deposit/index.d.ts +3 -0
- package/es/components/booking/deposit/index.js +164 -0
- package/es/components/booking/deposit/index.less +3 -0
- package/es/components/booking/deposit/serve.d.ts +8 -0
- package/es/components/booking/deposit/serve.js +27 -0
- package/es/components/booking/forms/forms.d.ts +1 -1
- package/es/components/booking/forms/index.d.ts +1 -1
- package/es/components/booking/forms/model.d.ts +2 -1
- package/es/components/booking/index.d.ts +1 -1
- package/es/components/booking/info/index.d.ts +1 -1
- package/es/components/booking/info/index.js +8 -5
- package/es/components/booking/info/model.d.ts +2 -1
- package/es/components/booking/info/service/addService/index.js +2 -2
- package/es/components/booking/info/service/editService/index.js +50 -21
- package/es/components/booking/locales.d.ts +54 -0
- package/es/components/booking/locales.js +57 -3
- package/es/components/booking/model.d.ts +2 -1
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +2 -1
- package/es/components/booking/payments/index.d.ts +1 -1
- package/es/components/booking/payments/model.d.ts +2 -1
- package/es/components/booking/utils.d.ts +37 -0
- package/es/components/booking/utils.js +71 -8
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/locales.d.ts +3 -0
- package/es/components/schedules/locales.js +6 -3
- package/es/components/schedules/model.d.ts +2 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.js +91 -3
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.less +20 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/lib/components/booking/addons/index.d.ts +1 -1
- package/lib/components/booking/addons/model.d.ts +2 -1
- package/lib/components/booking/components/collapsibleList/index.js +1 -1
- package/lib/components/booking/components/customSelect/index.js +2 -1
- package/lib/components/booking/components/footer/utils.js +4 -1
- package/lib/components/booking/components/tabPane/index.less +1 -0
- package/lib/components/booking/deposit/ClientItem/index.d.ts +18 -0
- package/lib/components/booking/deposit/ClientItem/index.js +71 -0
- package/lib/components/booking/deposit/ClientItem/index.less +37 -0
- package/lib/components/booking/deposit/DepositItem/index.d.ts +20 -0
- package/lib/components/booking/deposit/DepositItem/index.js +112 -0
- package/lib/components/booking/deposit/DepositItem/index.less +88 -0
- package/lib/components/booking/deposit/EditDepositModal/index.d.ts +9 -0
- package/lib/components/booking/deposit/EditDepositModal/index.js +131 -0
- package/lib/components/booking/deposit/EditDepositModal/index.less +24 -0
- package/lib/components/booking/deposit/index.d.ts +3 -0
- package/lib/components/booking/deposit/index.js +186 -0
- package/lib/components/booking/deposit/index.less +3 -0
- package/lib/components/booking/deposit/serve.d.ts +8 -0
- package/lib/components/booking/deposit/serve.js +30 -0
- package/lib/components/booking/forms/forms.d.ts +1 -1
- package/lib/components/booking/forms/index.d.ts +1 -1
- package/lib/components/booking/forms/model.d.ts +2 -1
- package/lib/components/booking/index.d.ts +1 -1
- package/lib/components/booking/info/index.d.ts +1 -1
- package/lib/components/booking/info/index.js +7 -2
- package/lib/components/booking/info/model.d.ts +2 -1
- package/lib/components/booking/info/service/addService/index.js +2 -2
- package/lib/components/booking/info/service/editService/index.js +33 -11
- package/lib/components/booking/locales.d.ts +54 -0
- package/lib/components/booking/locales.js +57 -3
- package/lib/components/booking/model.d.ts +2 -1
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +2 -1
- package/lib/components/booking/payments/index.d.ts +1 -1
- package/lib/components/booking/payments/model.d.ts +2 -1
- package/lib/components/booking/utils.d.ts +37 -0
- package/lib/components/booking/utils.js +33 -10
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/locales.d.ts +3 -0
- package/lib/components/schedules/locales.js +6 -3
- package/lib/components/schedules/model.d.ts +2 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.js +64 -3
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.less +20 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lowcode/booking-deposit/meta.ts +93 -0
- package/package.json +2 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
3
4
|
state: FormState;
|
|
4
5
|
} & {
|
|
5
6
|
dispatch: (params: {
|
|
@@ -13,7 +13,24 @@ declare class Request {
|
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
export declare const request: Request;
|
|
16
|
+
/**
|
|
17
|
+
* @title: 格式化持续时长用于展示
|
|
18
|
+
* @description:
|
|
19
|
+
* @param {number} service_times
|
|
20
|
+
* @return {*}
|
|
21
|
+
* @Author: zhiwei.Wang
|
|
22
|
+
* @Date: 2024-04-26 14:00
|
|
23
|
+
*/
|
|
16
24
|
export declare const getDiscountTime: (service_times: number) => string;
|
|
25
|
+
/**
|
|
26
|
+
* @title: 时间切片
|
|
27
|
+
* @description:
|
|
28
|
+
* @param {any} config
|
|
29
|
+
* @param {string} locale
|
|
30
|
+
* @return {*}
|
|
31
|
+
* @Author: zhiwei.Wang
|
|
32
|
+
* @Date: 2024-04-26 13:59
|
|
33
|
+
*/
|
|
17
34
|
export declare const sliceDayIntoFiveMinutes: (config: any, locale: string) => {
|
|
18
35
|
timeSlices: {
|
|
19
36
|
label: string;
|
|
@@ -24,6 +41,26 @@ export declare const sliceDayIntoFiveMinutes: (config: any, locale: string) => {
|
|
|
24
41
|
value: number;
|
|
25
42
|
}[];
|
|
26
43
|
};
|
|
44
|
+
export declare const getNowTime: () => string;
|
|
45
|
+
export declare const isNowTime: (time: string) => boolean;
|
|
46
|
+
/**
|
|
47
|
+
* @title: 获取服务的开始时间, 如果是now 转换为当前的时间
|
|
48
|
+
* @description:
|
|
49
|
+
* @param {string} start_time
|
|
50
|
+
* @return {*}
|
|
51
|
+
* @Author: zhiwei.Wang
|
|
52
|
+
* @Date: 2024-04-26 14:03
|
|
53
|
+
*/
|
|
54
|
+
export declare const getServeStartTime: (start_time: string) => string;
|
|
55
|
+
/**
|
|
56
|
+
* @title: 格式化服务的 开始时间-结束时间-时长, 用于展示
|
|
57
|
+
* @description:
|
|
58
|
+
* @param {any} item
|
|
59
|
+
* @param {any} currentDate
|
|
60
|
+
* @return {*}
|
|
61
|
+
* @Author: zhiwei.Wang
|
|
62
|
+
* @Date: 2024-04-26 14:04
|
|
63
|
+
*/
|
|
27
64
|
export declare const getServiceTime: (item: any, currentDate: any) => string;
|
|
28
65
|
export declare const findNextSlice: ({ timeSlices, index, date }: {
|
|
29
66
|
timeSlices: any[];
|
|
@@ -41,11 +41,14 @@ __export(utils_exports, {
|
|
|
41
41
|
getEndDate: () => getEndDate,
|
|
42
42
|
getErrorList: () => getErrorList,
|
|
43
43
|
getLastServer: () => getLastServer,
|
|
44
|
+
getNowTime: () => getNowTime,
|
|
44
45
|
getProductTotalPrice: () => getProductTotalPrice,
|
|
46
|
+
getServeStartTime: () => getServeStartTime,
|
|
45
47
|
getServerItemExtend: () => getServerItemExtend,
|
|
46
48
|
getServiceTime: () => getServiceTime,
|
|
47
49
|
getServiceTimes: () => getServiceTimes,
|
|
48
50
|
getShopOpeningHours: () => getShopOpeningHours,
|
|
51
|
+
isNowTime: () => isNowTime,
|
|
49
52
|
isWalkIn: () => isWalkIn,
|
|
50
53
|
request: () => request,
|
|
51
54
|
sliceDayIntoFiveMinutes: () => sliceDayIntoFiveMinutes
|
|
@@ -90,8 +93,8 @@ var sliceDayIntoFiveMinutes = (config, locale) => {
|
|
|
90
93
|
const startTime = (0, import_dayjs.default)().startOf("day");
|
|
91
94
|
const endTime = (0, import_dayjs.default)().endOf("day");
|
|
92
95
|
const timeSlice = (config == null ? void 0 : config.value) || 5;
|
|
93
|
-
|
|
94
|
-
|
|
96
|
+
let timeSlices = [];
|
|
97
|
+
let durationSlicesBasedOnTime = [];
|
|
95
98
|
let currentTime = startTime;
|
|
96
99
|
while (currentTime.isBefore(endTime)) {
|
|
97
100
|
const timeLabel = currentTime.format("hh:mm A");
|
|
@@ -116,8 +119,20 @@ var sliceDayIntoFiveMinutes = (config, locale) => {
|
|
|
116
119
|
}
|
|
117
120
|
return { timeSlices, durationSlicesBasedOnTime };
|
|
118
121
|
};
|
|
122
|
+
var getNowTime = () => {
|
|
123
|
+
return (0, import_dayjs.default)().format("HH:mm");
|
|
124
|
+
};
|
|
125
|
+
var isNowTime = (time) => {
|
|
126
|
+
return time === "now";
|
|
127
|
+
};
|
|
128
|
+
var getServeStartTime = (start_time) => {
|
|
129
|
+
if (isNowTime(start_time)) {
|
|
130
|
+
return getNowTime();
|
|
131
|
+
}
|
|
132
|
+
return start_time;
|
|
133
|
+
};
|
|
119
134
|
var getServiceTime = (item, currentDate) => {
|
|
120
|
-
const startDate = (0, import_dayjs.default)(currentDate.format("YYYY-MM-DD") + " " + item._extend.start_time);
|
|
135
|
+
const startDate = (0, import_dayjs.default)(currentDate.format("YYYY-MM-DD") + " " + getServeStartTime(item._extend.start_time));
|
|
121
136
|
const startTime = startDate.format("HH:mm");
|
|
122
137
|
const endTime = startDate.add(flexibleObj.getValue(item._extend.duration), "minute").format("HH:mm");
|
|
123
138
|
const duration = getDiscountTime(flexibleObj.getValue(item._extend.duration));
|
|
@@ -130,8 +145,10 @@ var findNextSlice = ({
|
|
|
130
145
|
}) => {
|
|
131
146
|
const currentTimeValue = date || (0, import_dayjs.default)().format("HH:mm");
|
|
132
147
|
for (let i = 0; i < timeSlices.length; i++) {
|
|
133
|
-
if (timeSlices[i].value
|
|
134
|
-
|
|
148
|
+
if (timeSlices[i].value !== "now") {
|
|
149
|
+
if (timeSlices[i].value >= currentTimeValue) {
|
|
150
|
+
return timeSlices[i].value;
|
|
151
|
+
}
|
|
135
152
|
}
|
|
136
153
|
}
|
|
137
154
|
return timeSlices[index].value;
|
|
@@ -190,7 +207,7 @@ var formatProductListByCategory = (list, filterItem) => {
|
|
|
190
207
|
var formatTimes = (resourceItem, cacheItem) => {
|
|
191
208
|
let usableTimes = [];
|
|
192
209
|
let _resourceItem = { ...resourceItem };
|
|
193
|
-
const startDate = (0, import_dayjs.default)(cacheItem._extend.start_date.format("YYYY-MM-DD") + " " + cacheItem._extend.start_time);
|
|
210
|
+
const startDate = (0, import_dayjs.default)(cacheItem._extend.start_date.format("YYYY-MM-DD") + " " + getServeStartTime(cacheItem._extend.start_time));
|
|
194
211
|
const isFlexible = flexibleObj.isFlexible(cacheItem._extend.duration);
|
|
195
212
|
_resourceItem.times = _resourceItem.times.map((d) => {
|
|
196
213
|
let isMaxLimitRange = false;
|
|
@@ -311,7 +328,7 @@ var getEndDate = (startDate, duration, endDate) => {
|
|
|
311
328
|
return startDate.add(duration, "minute");
|
|
312
329
|
};
|
|
313
330
|
var getServiceTimes = (service) => {
|
|
314
|
-
const startDate = (0, import_dayjs.default)((0, import_dayjs.default)(service._extend.start_date).format("YYYY-MM-DD ") + service._extend.start_time);
|
|
331
|
+
const startDate = (0, import_dayjs.default)((0, import_dayjs.default)(service._extend.start_date).format("YYYY-MM-DD ") + getServeStartTime(service._extend.start_time));
|
|
315
332
|
const endDate = startDate.add(flexibleObj.getValue(service._extend.duration), "minute");
|
|
316
333
|
return {
|
|
317
334
|
startDate,
|
|
@@ -357,7 +374,6 @@ var getErrorList = (resource, cacheItem) => {
|
|
|
357
374
|
}
|
|
358
375
|
}
|
|
359
376
|
}
|
|
360
|
-
console.log(cacheItem, "cacheItem");
|
|
361
377
|
return list;
|
|
362
378
|
};
|
|
363
379
|
var formatResource = (resourceItem, cacheItem, formatLabel) => {
|
|
@@ -404,7 +420,6 @@ var getServerItemExtend = (state, cacheItem, timeObj) => {
|
|
|
404
420
|
_extend.start_time = lastServerEndDate.format("HH:mm");
|
|
405
421
|
}
|
|
406
422
|
} else {
|
|
407
|
-
_extend.resource = 0;
|
|
408
423
|
let findNextSliceProps = {
|
|
409
424
|
timeSlices: timeObj.timeSlices,
|
|
410
425
|
index: 0,
|
|
@@ -421,7 +436,12 @@ var getServerItemExtend = (state, cacheItem, timeObj) => {
|
|
|
421
436
|
_extend.resource = Number(resourceId);
|
|
422
437
|
}
|
|
423
438
|
}
|
|
424
|
-
_extend
|
|
439
|
+
console.log("_extend", findNextSliceProps);
|
|
440
|
+
if (findNextSliceProps.date && findNextSliceProps.date !== "00:00") {
|
|
441
|
+
_extend.start_time = findNextSlice(findNextSliceProps);
|
|
442
|
+
} else {
|
|
443
|
+
_extend.start_time = "now";
|
|
444
|
+
}
|
|
425
445
|
}
|
|
426
446
|
_extend = {
|
|
427
447
|
..._extend,
|
|
@@ -479,11 +499,14 @@ var isWalkIn = (customer_id) => {
|
|
|
479
499
|
getEndDate,
|
|
480
500
|
getErrorList,
|
|
481
501
|
getLastServer,
|
|
502
|
+
getNowTime,
|
|
482
503
|
getProductTotalPrice,
|
|
504
|
+
getServeStartTime,
|
|
483
505
|
getServerItemExtend,
|
|
484
506
|
getServiceTime,
|
|
485
507
|
getServiceTimes,
|
|
486
508
|
getShopOpeningHours,
|
|
509
|
+
isNowTime,
|
|
487
510
|
isWalkIn,
|
|
488
511
|
request,
|
|
489
512
|
sliceDayIntoFiveMinutes
|
|
@@ -25,6 +25,7 @@ declare const _default: {
|
|
|
25
25
|
'pisell2.text.products.unsaved-back': string;
|
|
26
26
|
'pisell2.text.products.unsaved-yes': string;
|
|
27
27
|
'pisell2.text.products.max-participants-error': string;
|
|
28
|
+
'pisell2.text.schedules.create-new-schedule': string;
|
|
28
29
|
};
|
|
29
30
|
'zh-CN': {
|
|
30
31
|
'pisell2.text.schedules.all-day': string;
|
|
@@ -52,6 +53,7 @@ declare const _default: {
|
|
|
52
53
|
'pisell2.text.products.unsaved-back': string;
|
|
53
54
|
'pisell2.text.products.unsaved-yes': string;
|
|
54
55
|
'pisell2.text.products.max-participants-error': string;
|
|
56
|
+
'pisell2.text.schedules.create-new-schedule': string;
|
|
55
57
|
};
|
|
56
58
|
'zh-HK': {
|
|
57
59
|
'pisell2.text.schedules.all-day': string;
|
|
@@ -79,6 +81,7 @@ declare const _default: {
|
|
|
79
81
|
'pisell2.text.products.unsaved-back': string;
|
|
80
82
|
'pisell2.text.products.unsaved-yes': string;
|
|
81
83
|
'pisell2.text.products.max-participants-error': string;
|
|
84
|
+
'pisell2.text.schedules.create-new-schedule': string;
|
|
82
85
|
};
|
|
83
86
|
};
|
|
84
87
|
export default _default;
|
|
@@ -48,7 +48,8 @@ var locales_default = {
|
|
|
48
48
|
"pisell2.text.products.unsaved-content": "Navigating away without saving will discard your changes. Are you sure you want to proceed?",
|
|
49
49
|
"pisell2.text.products.unsaved-back": "Go back",
|
|
50
50
|
"pisell2.text.products.unsaved-yes": "Yes, discard",
|
|
51
|
-
"pisell2.text.products.max-participants-error": "Please set max participants"
|
|
51
|
+
"pisell2.text.products.max-participants-error": "Please set max participants",
|
|
52
|
+
"pisell2.text.schedules.create-new-schedule": "Create new schedule"
|
|
52
53
|
},
|
|
53
54
|
"zh-CN": {
|
|
54
55
|
"pisell2.text.schedules.all-day": "全天",
|
|
@@ -75,7 +76,8 @@ var locales_default = {
|
|
|
75
76
|
"pisell2.text.products.unsaved-content": "若不保存即离开,您所做的修改将会丢失。确定要继续吗?",
|
|
76
77
|
"pisell2.text.products.unsaved-back": "返回",
|
|
77
78
|
"pisell2.text.products.unsaved-yes": "是的,退出",
|
|
78
|
-
"pisell2.text.products.max-participants-error": "请设置最大参与人数"
|
|
79
|
+
"pisell2.text.products.max-participants-error": "请设置最大参与人数",
|
|
80
|
+
"pisell2.text.schedules.create-new-schedule": "创建新日程"
|
|
79
81
|
},
|
|
80
82
|
"zh-HK": {
|
|
81
83
|
"pisell2.text.schedules.all-day": "全天",
|
|
@@ -102,6 +104,7 @@ var locales_default = {
|
|
|
102
104
|
"pisell2.text.products.unsaved-content": "若不保即離開,您做的修改將會丟失。確定要繼續嗎?",
|
|
103
105
|
"pisell2.text.products.unsaved-back": "返回",
|
|
104
106
|
"pisell2.text.products.unsaved-yes": "是的,退出",
|
|
105
|
-
"pisell2.text.products.max-participants-error": "請設置最大參與人數"
|
|
107
|
+
"pisell2.text.products.max-participants-error": "請設置最大參與人數",
|
|
108
|
+
"pisell2.text.schedules.create-new-schedule": "創建新日程"
|
|
106
109
|
}
|
|
107
110
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { CalendarDataItem, ScheduleItem } from "./type";
|
|
2
3
|
import dayjs from "dayjs";
|
|
3
4
|
export interface FormState {
|
|
@@ -68,7 +69,7 @@ export interface FormState {
|
|
|
68
69
|
};
|
|
69
70
|
setGlobalState: Function | null;
|
|
70
71
|
}
|
|
71
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
72
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
72
73
|
state: FormState;
|
|
73
74
|
} & {
|
|
74
75
|
dispatch: (params: {
|
|
@@ -39,18 +39,58 @@ var import_react = __toESM(require("react"));
|
|
|
39
39
|
var import_customSelect = __toESM(require("../../../../../../booking/components/customSelect"));
|
|
40
40
|
var import_model = require("../../../../../model");
|
|
41
41
|
var import_serve = require("../../../../serve");
|
|
42
|
+
var import_useComponents = __toESM(require("../../../../../../../hooks/useComponents"));
|
|
43
|
+
var import_useEngineContext = __toESM(require("../../../../../../../hooks/useEngineContext"));
|
|
42
44
|
var import_index = require("./index.less");
|
|
43
45
|
var AddSchedules = ({ value, onChange, drawerContainer, isSelf }) => {
|
|
44
46
|
var _a;
|
|
45
47
|
const modalRef = (0, import_react.useRef)(null);
|
|
46
48
|
const { state } = (0, import_react.useContext)(import_model.Context);
|
|
49
|
+
const { appHelper } = (0, import_useEngineContext.default)();
|
|
50
|
+
const createSchedules = (0, import_react.useRef)();
|
|
51
|
+
const AllCreateScheduleRef = (0, import_react.useRef)(null);
|
|
52
|
+
const [ScheduleCreateType, AllCreateSchedule] = (0, import_useComponents.default)({
|
|
53
|
+
components: ["ScheduleCreateType", "AllCreateSchedule"]
|
|
54
|
+
});
|
|
47
55
|
const _getScheduleList = (0, import_ahooks.useRequest)(import_serve.getSchedules, {
|
|
48
56
|
manual: true,
|
|
49
57
|
onSuccess: (res) => {
|
|
50
58
|
}
|
|
51
59
|
});
|
|
52
60
|
const onFinish = (e) => {
|
|
53
|
-
|
|
61
|
+
var _a2;
|
|
62
|
+
const idMap = ((_a2 = _getScheduleList == null ? void 0 : _getScheduleList.data) == null ? void 0 : _a2.reduce((p, c) => {
|
|
63
|
+
return { ...p, [c.id]: c };
|
|
64
|
+
}, {})) || {};
|
|
65
|
+
onChange(e.map((item) => idMap[item.id]));
|
|
66
|
+
};
|
|
67
|
+
const handleCreateSchedule = () => {
|
|
68
|
+
var _a2, _b;
|
|
69
|
+
(_b = (_a2 = createSchedules.current) == null ? void 0 : _a2.open) == null ? void 0 : _b.call(_a2, {
|
|
70
|
+
getContainer: void 0
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
const handleAddSchedule = (data) => {
|
|
74
|
+
_getScheduleList.mutate((oldData) => [data, ...oldData || []]);
|
|
75
|
+
modalRef.current.setValue((v) => [...v, data]);
|
|
76
|
+
setTimeout(() => {
|
|
77
|
+
var _a2, _b;
|
|
78
|
+
(_b = (_a2 = document.getElementById(data.id)) == null ? void 0 : _a2.scrollIntoView) == null ? void 0 : _b.call(_a2, { block: "center", behavior: "smooth" });
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
const handleEdit = (e, id) => {
|
|
82
|
+
var _a2, _b;
|
|
83
|
+
e.stopPropagation();
|
|
84
|
+
(_b = (_a2 = AllCreateScheduleRef.current) == null ? void 0 : _a2.open) == null ? void 0 : _b.call(_a2, { id });
|
|
85
|
+
};
|
|
86
|
+
const handleChangeResData = (data) => {
|
|
87
|
+
_getScheduleList.mutate((oldData) => (oldData || []).map((item) => {
|
|
88
|
+
var _a2;
|
|
89
|
+
if (item.id === data.id) {
|
|
90
|
+
return { ...data, name: ((_a2 = appHelper == null ? void 0 : appHelper.utils) == null ? void 0 : _a2.translationShop(data.name)) || data.name };
|
|
91
|
+
}
|
|
92
|
+
return item;
|
|
93
|
+
}));
|
|
54
94
|
};
|
|
55
95
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
56
96
|
import_antd.Button,
|
|
@@ -73,9 +113,11 @@ var AddSchedules = ({ value, onChange, drawerContainer, isSelf }) => {
|
|
|
73
113
|
ref: modalRef,
|
|
74
114
|
rowKey: "id",
|
|
75
115
|
options: isSelf ? _getScheduleList.data || [] : ((_a = state == null ? void 0 : state.schedules) == null ? void 0 : _a.list) || [],
|
|
116
|
+
createItemText: import_utils.locales.getText("pisell2.text.schedules.create-new-schedule"),
|
|
76
117
|
loading: _getScheduleList.loading,
|
|
77
118
|
value,
|
|
78
119
|
onValueChange: onFinish,
|
|
120
|
+
handleCreateItem: handleCreateSchedule,
|
|
79
121
|
isPreview: false,
|
|
80
122
|
drawerProps: {
|
|
81
123
|
title: import_utils.locales.getText("pisell2.text.schedules.assign-schedule"),
|
|
@@ -91,18 +133,37 @@ var AddSchedules = ({ value, onChange, drawerContainer, isSelf }) => {
|
|
|
91
133
|
},
|
|
92
134
|
mode: "multiple",
|
|
93
135
|
optionRender: (item) => {
|
|
94
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.
|
|
136
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__add-schedule-list-item" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__add-schedule-list-item-content" }, /* @__PURE__ */ import_react.default.createElement(
|
|
95
137
|
"div",
|
|
96
138
|
{
|
|
97
139
|
className: "pisell-lowcode__add-schedule-list-item-color",
|
|
98
140
|
style: { backgroundColor: item.color }
|
|
99
141
|
}
|
|
100
|
-
), item.name)
|
|
142
|
+
), item.name), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__add-schedule-list-item-action-wrap" }, /* @__PURE__ */ import_react.default.createElement(
|
|
143
|
+
"div",
|
|
144
|
+
{
|
|
145
|
+
className: "pisell-lowcode__add-schedule-list-item-action-edit",
|
|
146
|
+
onClick: (e) => handleEdit(e, item.id)
|
|
147
|
+
},
|
|
148
|
+
import_utils.locales.getText("pisell2.text.edit")
|
|
149
|
+
)));
|
|
101
150
|
},
|
|
102
151
|
filterItem: (d, search) => {
|
|
103
152
|
return d.name.toLowerCase().indexOf(search.toLowerCase()) !== -1;
|
|
104
153
|
}
|
|
105
154
|
}
|
|
155
|
+
), ScheduleCreateType && /* @__PURE__ */ import_react.default.createElement(
|
|
156
|
+
ScheduleCreateType,
|
|
157
|
+
{
|
|
158
|
+
ref: createSchedules,
|
|
159
|
+
onChange: handleAddSchedule
|
|
160
|
+
}
|
|
161
|
+
), AllCreateSchedule && /* @__PURE__ */ import_react.default.createElement(
|
|
162
|
+
AllCreateSchedule,
|
|
163
|
+
{
|
|
164
|
+
ref: AllCreateScheduleRef,
|
|
165
|
+
onChange: handleChangeResData
|
|
166
|
+
}
|
|
106
167
|
));
|
|
107
168
|
};
|
|
108
169
|
var AddSchedules_default = AddSchedules;
|
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
.pisell-lowcode__add-schedule-list-item {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex: 1;
|
|
4
|
+
.pisell-lowcode__add-schedule-list-item-content {
|
|
5
|
+
flex: 1;
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
}
|
|
9
|
+
.pisell-lowcode__add-schedule-list-item-action-wrap {
|
|
10
|
+
.pisell-lowcode__add-schedule-list-item-action-edit {
|
|
11
|
+
display: flex;
|
|
12
|
+
height: 48px;
|
|
13
|
+
padding: 0px 16px;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
align-items: center;
|
|
16
|
+
border-radius: 30px;
|
|
17
|
+
border: 1px solid var(--Gray-true-300, #D5D5D5);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
1
21
|
.pisell-lowcode__add-schedule-list-item-color {
|
|
2
22
|
width: 12px;
|
|
3
23
|
height: 12px;
|
package/lib/index.d.ts
CHANGED
|
@@ -12,3 +12,4 @@ export { default as BookingStartTime } from './components/booking/materiels/star
|
|
|
12
12
|
export { default as BookingDuration } from './components/booking/materiels/duration';
|
|
13
13
|
export { default as BookingContacts } from './components/booking/materiels/contacts';
|
|
14
14
|
export { default as ProductExtension } from './components/productExtension';
|
|
15
|
+
export { default as BookingDeposit } from './components/booking/deposit';
|
package/lib/index.js
CHANGED
|
@@ -32,6 +32,7 @@ __export(src_exports, {
|
|
|
32
32
|
Booking: () => import_booking.default,
|
|
33
33
|
BookingAddons: () => import_addons.default,
|
|
34
34
|
BookingContacts: () => import_contacts.default,
|
|
35
|
+
BookingDeposit: () => import_deposit.default,
|
|
35
36
|
BookingDuration: () => import_duration.default,
|
|
36
37
|
BookingForms: () => import_forms.default,
|
|
37
38
|
BookingInfo: () => import_info.default,
|
|
@@ -60,6 +61,7 @@ var import_startTime = __toESM(require("./components/booking/materiels/startTime
|
|
|
60
61
|
var import_duration = __toESM(require("./components/booking/materiels/duration"));
|
|
61
62
|
var import_contacts = __toESM(require("./components/booking/materiels/contacts"));
|
|
62
63
|
var import_productExtension = __toESM(require("./components/productExtension"));
|
|
64
|
+
var import_deposit = __toESM(require("./components/booking/deposit"));
|
|
63
65
|
import_dayjs.default.extend(import_weekday.default);
|
|
64
66
|
import_dayjs.default.extend(import_localeData.default);
|
|
65
67
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -67,6 +69,7 @@ import_dayjs.default.extend(import_localeData.default);
|
|
|
67
69
|
Booking,
|
|
68
70
|
BookingAddons,
|
|
69
71
|
BookingContacts,
|
|
72
|
+
BookingDeposit,
|
|
70
73
|
BookingDuration,
|
|
71
74
|
BookingForms,
|
|
72
75
|
BookingInfo,
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
|
|
2
|
+
import { ComponentMetadata, Snippet } from '@alilc/lowcode-types';
|
|
3
|
+
|
|
4
|
+
const BookingDepositMeta: ComponentMetadata = {
|
|
5
|
+
"componentName": "BookingDeposit",
|
|
6
|
+
"title": "BookingDeposit",
|
|
7
|
+
"docUrl": "",
|
|
8
|
+
"screenshot": "",
|
|
9
|
+
"devMode": "proCode",
|
|
10
|
+
"npm": {
|
|
11
|
+
"package": "@pisell/private-materials",
|
|
12
|
+
"version": "1.0.4",
|
|
13
|
+
"exportName": "BookingDeposit",
|
|
14
|
+
"main": "src/index.ts",
|
|
15
|
+
"destructuring": true,
|
|
16
|
+
"subName": ""
|
|
17
|
+
},
|
|
18
|
+
"configure": {
|
|
19
|
+
"props": [
|
|
20
|
+
{
|
|
21
|
+
"title": {
|
|
22
|
+
"label": {
|
|
23
|
+
"type": "i18n",
|
|
24
|
+
"en-US": "style",
|
|
25
|
+
"zh-CN": "style"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"name": "style",
|
|
29
|
+
"setter": {
|
|
30
|
+
"componentName": "MixedSetter",
|
|
31
|
+
"isRequired": true,
|
|
32
|
+
"props": {}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"title": {
|
|
37
|
+
"label": {
|
|
38
|
+
"type": "i18n",
|
|
39
|
+
"en-US": "globalState",
|
|
40
|
+
"zh-CN": "globalState"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"name": "globalState",
|
|
44
|
+
"setter": ["JsonSetter", "VariableSetter"],
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"title": {
|
|
48
|
+
"label": {
|
|
49
|
+
"type": "i18n",
|
|
50
|
+
"en-US": "setGlobalState",
|
|
51
|
+
"zh-CN": "setGlobalState"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"name": "setGlobalState",
|
|
55
|
+
"setter": {
|
|
56
|
+
"componentName": "FunctionSetter",
|
|
57
|
+
"isRequired": true
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"title": {
|
|
62
|
+
"label": {
|
|
63
|
+
"type": "i18n",
|
|
64
|
+
"en-US": "setState",
|
|
65
|
+
"zh-CN": "setState"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"name": "setState",
|
|
69
|
+
"setter": {
|
|
70
|
+
"componentName": "FunctionSetter",
|
|
71
|
+
"isRequired": true
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
"supports": {},
|
|
76
|
+
"component": {}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
const snippets: Snippet[] = [
|
|
80
|
+
{
|
|
81
|
+
"title": "BookingDeposit",
|
|
82
|
+
"screenshot": "",
|
|
83
|
+
"schema": {
|
|
84
|
+
"componentName": "BookingDeposit",
|
|
85
|
+
"props": {}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
];
|
|
89
|
+
|
|
90
|
+
export default {
|
|
91
|
+
...BookingDepositMeta,
|
|
92
|
+
snippets
|
|
93
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.29",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"ahooks": "^3.7.6",
|
|
59
59
|
"react-infinite-scroll-component": "^6.1.0",
|
|
60
60
|
"rc-virtual-list": "^3.11.3",
|
|
61
|
-
"@pisell/utils": "1.0.23",
|
|
62
61
|
"@pisell/date-picker": "1.0.68",
|
|
62
|
+
"@pisell/utils": "1.0.23",
|
|
63
63
|
"@pisell/icon": "0.0.8"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|