@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
|
@@ -136,7 +136,25 @@ export default {
|
|
|
136
136
|
'pisell2.text.order.sales.channel.boxcocal': "Boxlocal",
|
|
137
137
|
'pisell2.text.order.sales.channel.tableorder': "Table Order",
|
|
138
138
|
'pisell2.text.order.sales.channel.reserve': "Google Reservation",
|
|
139
|
-
'pisell2.text.rebook': "Rebook"
|
|
139
|
+
'pisell2.text.rebook': "Rebook",
|
|
140
|
+
'pisell2.text.now': 'Now',
|
|
141
|
+
'pisell2.text.deposit-list': "Deposit List",
|
|
142
|
+
'pisell2.text.deposit-item-status-paid': "Paid",
|
|
143
|
+
'pisell2.text.deposit-item-status-unpaid': "Unpaid",
|
|
144
|
+
'pisell2.text.deposit-order-total': "Order Total",
|
|
145
|
+
'pisell2.text.deposit-order-detail': "Order Details",
|
|
146
|
+
'pisell2.text.deposit-collect-deposit': "Collect Deposit",
|
|
147
|
+
'pisell2.text.deposit-order-no': "Order No",
|
|
148
|
+
'pisell2.text.deposit-amount': "Amount",
|
|
149
|
+
'pisell2.text.deposit-deposit-amount': "Deposit Amount",
|
|
150
|
+
'pisell2.text.deposit-generate-payment-link': "Generate Payment Link",
|
|
151
|
+
'pisell2.text.deposit-list-empty': "Please add a deposit",
|
|
152
|
+
'pisell2.text.deposit-amount-message': "Amount must be greater than 0",
|
|
153
|
+
'pisell2.text.deposit-amount-message2': "The deposit amount cannot be greater than the total order amount",
|
|
154
|
+
'pisell2.text.deposit-amount-message3': "Please enter the deposit amount",
|
|
155
|
+
'pisell2.text.deposit-delete': "Delete deposit",
|
|
156
|
+
'pisell2.text.deposit-delete-message-title': "Prompt",
|
|
157
|
+
'pisell2.text.deposit-delete-message': "It cannot be restored after deletion. Please confirm the operation."
|
|
140
158
|
},
|
|
141
159
|
'zh-CN': {
|
|
142
160
|
'pisell2.text.refunded-amount': '已退金额',
|
|
@@ -280,7 +298,25 @@ export default {
|
|
|
280
298
|
'pisell2.text.order.sales.channel.boxcocal': "Boxlocal",
|
|
281
299
|
'pisell2.text.order.sales.channel.tableorder': "扫码点餐",
|
|
282
300
|
'pisell2.text.order.sales.channel.reserve': "谷歌预约",
|
|
283
|
-
'pisell2.text.rebook': "再次预约"
|
|
301
|
+
'pisell2.text.rebook': "再次预约",
|
|
302
|
+
'pisell2.text.now': '现在',
|
|
303
|
+
'pisell2.text.deposit-list': "定金列表",
|
|
304
|
+
'pisell2.text.deposit-item-status-paid': "已支付",
|
|
305
|
+
'pisell2.text.deposit-item-status-unpaid': "未支付",
|
|
306
|
+
'pisell2.text.deposit-order-total': "订单总额",
|
|
307
|
+
'pisell2.text.deposit-order-detail': "订单详情",
|
|
308
|
+
'pisell2.text.deposit-collect-deposit': "收定金",
|
|
309
|
+
'pisell2.text.deposit-order-no': "订单编号",
|
|
310
|
+
'pisell2.text.deposit-amount': "金额",
|
|
311
|
+
'pisell2.text.deposit-deposit-amount': "定金金额",
|
|
312
|
+
'pisell2.text.deposit-generate-payment-link': "生成支付链接",
|
|
313
|
+
'pisell2.text.deposit-list-empty': "请添加定金",
|
|
314
|
+
'pisell2.text.deposit-amount-message': "金额必须大于0",
|
|
315
|
+
'pisell2.text.deposit-amount-message2': "定金金额不能大于订单总额",
|
|
316
|
+
'pisell2.text.deposit-amount-message3': "请输入定金金额",
|
|
317
|
+
'pisell2.text.deposit-delete': "删除定金",
|
|
318
|
+
'pisell2.text.deposit-delete-message-title': "提示",
|
|
319
|
+
'pisell2.text.deposit-delete-message': "删除后不可恢复,请确认操作"
|
|
284
320
|
},
|
|
285
321
|
'zh-HK': {
|
|
286
322
|
'pisell2.text.refunded-amount': '已退金額',
|
|
@@ -424,6 +460,24 @@ export default {
|
|
|
424
460
|
'pisell2.text.order.sales.channel.boxcocal': "Boxlocal",
|
|
425
461
|
'pisell2.text.order.sales.channel.tableorder': "掃碼點餐",
|
|
426
462
|
'pisell2.text.order.sales.channel.reserve': "谷歌預約",
|
|
427
|
-
'pisell2.text.rebook': "再次預約"
|
|
463
|
+
'pisell2.text.rebook': "再次預約",
|
|
464
|
+
'pisell2.text.now': '現在',
|
|
465
|
+
'pisell2.text.deposit-list': "定金列表",
|
|
466
|
+
'pisell2.text.deposit-item-status-paid': "已支付",
|
|
467
|
+
'pisell2.text.deposit-item-status-unpaid': "未支付",
|
|
468
|
+
'pisell2.text.deposit-order-total': "訂單總額",
|
|
469
|
+
'pisell2.text.deposit-order-detail': "訂單詳情",
|
|
470
|
+
'pisell2.text.deposit-collect-deposit': "收定金",
|
|
471
|
+
'pisell2.text.deposit-order-no': "訂單編號",
|
|
472
|
+
'pisell2.text.deposit-amount': "金額",
|
|
473
|
+
'pisell2.text.deposit-deposit-amount': "定金金額",
|
|
474
|
+
'pisell2.text.deposit-generate-payment-link': "生成支付鏈接",
|
|
475
|
+
'pisell2.text.deposit-list-empty': "請添加定金",
|
|
476
|
+
'pisell2.text.deposit-amount-message': "金額必須大於0",
|
|
477
|
+
'pisell2.text.deposit-amount-message2': "定金金額不能大於訂單總額",
|
|
478
|
+
'pisell2.text.deposit-amount-message3': "請輸入定金金額",
|
|
479
|
+
'pisell2.text.deposit-delete': "刪除定金",
|
|
480
|
+
'pisell2.text.deposit-delete-message-title': "提示",
|
|
481
|
+
'pisell2.text.deposit-delete-message': "刪除後不可恢復,請確認操作"
|
|
428
482
|
}
|
|
429
483
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export interface FormState {
|
|
2
3
|
amountSymbol: string;
|
|
3
4
|
apis: {
|
|
@@ -86,7 +87,7 @@ export declare const walkInData: {
|
|
|
86
87
|
id: number;
|
|
87
88
|
nickname: string;
|
|
88
89
|
};
|
|
89
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
90
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
90
91
|
state: FormState;
|
|
91
92
|
} & {
|
|
92
93
|
dispatch: (params: {
|
|
@@ -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: {
|
|
@@ -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[];
|
|
@@ -35,6 +35,15 @@ var Request = /*#__PURE__*/function () {
|
|
|
35
35
|
return Request;
|
|
36
36
|
}();
|
|
37
37
|
export var request = new Request();
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @title: 格式化持续时长用于展示
|
|
41
|
+
* @description:
|
|
42
|
+
* @param {number} service_times
|
|
43
|
+
* @return {*}
|
|
44
|
+
* @Author: zhiwei.Wang
|
|
45
|
+
* @Date: 2024-04-26 14:00
|
|
46
|
+
*/
|
|
38
47
|
export var getDiscountTime = function getDiscountTime(service_times) {
|
|
39
48
|
if (!service_times) {
|
|
40
49
|
return "";
|
|
@@ -52,6 +61,16 @@ export var getDiscountTime = function getDiscountTime(service_times) {
|
|
|
52
61
|
return str;
|
|
53
62
|
}
|
|
54
63
|
};
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @title: 时间切片
|
|
67
|
+
* @description:
|
|
68
|
+
* @param {any} config
|
|
69
|
+
* @param {string} locale
|
|
70
|
+
* @return {*}
|
|
71
|
+
* @Author: zhiwei.Wang
|
|
72
|
+
* @Date: 2024-04-26 13:59
|
|
73
|
+
*/
|
|
55
74
|
export var sliceDayIntoFiveMinutes = function sliceDayIntoFiveMinutes(config, locale) {
|
|
56
75
|
var _locale = locale;
|
|
57
76
|
var dayjsLocale = _locale === 'en-US' || _locale === 'en' ? 'en' : 'zh-cn';
|
|
@@ -92,8 +111,41 @@ export var sliceDayIntoFiveMinutes = function sliceDayIntoFiveMinutes(config, lo
|
|
|
92
111
|
durationSlicesBasedOnTime: durationSlicesBasedOnTime
|
|
93
112
|
};
|
|
94
113
|
};
|
|
114
|
+
|
|
115
|
+
// 获取当前时间
|
|
116
|
+
export var getNowTime = function getNowTime() {
|
|
117
|
+
return dayjs().format("HH:mm");
|
|
118
|
+
};
|
|
119
|
+
export var isNowTime = function isNowTime(time) {
|
|
120
|
+
return time === 'now';
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* @title: 获取服务的开始时间, 如果是now 转换为当前的时间
|
|
125
|
+
* @description:
|
|
126
|
+
* @param {string} start_time
|
|
127
|
+
* @return {*}
|
|
128
|
+
* @Author: zhiwei.Wang
|
|
129
|
+
* @Date: 2024-04-26 14:03
|
|
130
|
+
*/
|
|
131
|
+
export var getServeStartTime = function getServeStartTime(start_time) {
|
|
132
|
+
if (isNowTime(start_time)) {
|
|
133
|
+
return getNowTime();
|
|
134
|
+
}
|
|
135
|
+
return start_time;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @title: 格式化服务的 开始时间-结束时间-时长, 用于展示
|
|
140
|
+
* @description:
|
|
141
|
+
* @param {any} item
|
|
142
|
+
* @param {any} currentDate
|
|
143
|
+
* @return {*}
|
|
144
|
+
* @Author: zhiwei.Wang
|
|
145
|
+
* @Date: 2024-04-26 14:04
|
|
146
|
+
*/
|
|
95
147
|
export var getServiceTime = function getServiceTime(item, currentDate) {
|
|
96
|
-
var startDate = dayjs(currentDate.format('YYYY-MM-DD') + ' ' + item._extend.start_time);
|
|
148
|
+
var startDate = dayjs(currentDate.format('YYYY-MM-DD') + ' ' + getServeStartTime(item._extend.start_time));
|
|
97
149
|
var startTime = startDate.format("HH:mm");
|
|
98
150
|
var endTime = startDate.add(flexibleObj.getValue(item._extend.duration), "minute").format("HH:mm");
|
|
99
151
|
var duration = getDiscountTime(flexibleObj.getValue(item._extend.duration));
|
|
@@ -110,8 +162,11 @@ export var findNextSlice = function findNextSlice(_ref) {
|
|
|
110
162
|
|
|
111
163
|
// 遍历时间切片数组,找到最接近的下一个切片时间
|
|
112
164
|
for (var i = 0; i < timeSlices.length; i++) {
|
|
113
|
-
|
|
114
|
-
|
|
165
|
+
// 排除掉当前时间
|
|
166
|
+
if (timeSlices[i].value !== 'now') {
|
|
167
|
+
if (timeSlices[i].value >= currentTimeValue) {
|
|
168
|
+
return timeSlices[i].value;
|
|
169
|
+
}
|
|
115
170
|
}
|
|
116
171
|
}
|
|
117
172
|
|
|
@@ -177,7 +232,7 @@ var formatTimes = function formatTimes(resourceItem, cacheItem) {
|
|
|
177
232
|
// 可用的time列表
|
|
178
233
|
var usableTimes = [];
|
|
179
234
|
var _resourceItem = _objectSpread({}, resourceItem);
|
|
180
|
-
var startDate = dayjs(cacheItem._extend.start_date.format("YYYY-MM-DD") + ' ' + cacheItem._extend.start_time);
|
|
235
|
+
var startDate = dayjs(cacheItem._extend.start_date.format("YYYY-MM-DD") + ' ' + getServeStartTime(cacheItem._extend.start_time));
|
|
181
236
|
var isFlexible = flexibleObj.isFlexible(cacheItem._extend.duration);
|
|
182
237
|
// 循环times 区分可用和不可用的 并打上标记
|
|
183
238
|
_resourceItem.times = _resourceItem.times.map(function (d) {
|
|
@@ -359,7 +414,7 @@ export var getEndDate = function getEndDate(startDate, duration, endDate) {
|
|
|
359
414
|
// export const get
|
|
360
415
|
|
|
361
416
|
export var getServiceTimes = function getServiceTimes(service) {
|
|
362
|
-
var startDate = dayjs(dayjs(service._extend.start_date).format("YYYY-MM-DD ") + service._extend.start_time);
|
|
417
|
+
var startDate = dayjs(dayjs(service._extend.start_date).format("YYYY-MM-DD ") + getServeStartTime(service._extend.start_time));
|
|
363
418
|
var endDate = startDate.add(flexibleObj.getValue(service._extend.duration), "minute");
|
|
364
419
|
return {
|
|
365
420
|
startDate: startDate,
|
|
@@ -411,7 +466,6 @@ export var getErrorList = function getErrorList(resource, cacheItem) {
|
|
|
411
466
|
}
|
|
412
467
|
}
|
|
413
468
|
}
|
|
414
|
-
console.log(cacheItem, "cacheItem");
|
|
415
469
|
return list;
|
|
416
470
|
};
|
|
417
471
|
|
|
@@ -493,7 +547,8 @@ export var getServerItemExtend = function getServerItemExtend(state, cacheItem,
|
|
|
493
547
|
}
|
|
494
548
|
} else {
|
|
495
549
|
// 没有上一个商品 资源为 0
|
|
496
|
-
_extend.resource = 0;
|
|
550
|
+
// _extend.resource = 0;
|
|
551
|
+
|
|
497
552
|
var findNextSliceProps = {
|
|
498
553
|
timeSlices: timeObj.timeSlices,
|
|
499
554
|
index: 0,
|
|
@@ -514,7 +569,15 @@ export var getServerItemExtend = function getServerItemExtend(state, cacheItem,
|
|
|
514
569
|
_extend.resource = Number(resourceId);
|
|
515
570
|
}
|
|
516
571
|
}
|
|
517
|
-
_extend
|
|
572
|
+
console.log("_extend", findNextSliceProps);
|
|
573
|
+
|
|
574
|
+
// 只有选择了带 HH:mm的日期才选中, 否则使用当前日期
|
|
575
|
+
if (findNextSliceProps.date && findNextSliceProps.date !== '00:00') {
|
|
576
|
+
_extend.start_time = findNextSlice(findNextSliceProps);
|
|
577
|
+
} else {
|
|
578
|
+
// 没有预设日期, 则使用当前 https://www.yuque.com/feg4xm/manual/tzvrnt05ifihkndg
|
|
579
|
+
_extend.start_time = 'now';
|
|
580
|
+
}
|
|
518
581
|
}
|
|
519
582
|
_extend = _objectSpread(_objectSpread({}, _extend), cacheItem._extend);
|
|
520
583
|
return _extend;
|
|
@@ -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;
|
|
@@ -24,7 +24,8 @@ export default {
|
|
|
24
24
|
'pisell2.text.products.unsaved-content': "Navigating away without saving will discard your changes. Are you sure you want to proceed?",
|
|
25
25
|
'pisell2.text.products.unsaved-back': "Go back",
|
|
26
26
|
'pisell2.text.products.unsaved-yes': "Yes, discard",
|
|
27
|
-
'pisell2.text.products.max-participants-error': "Please set max participants"
|
|
27
|
+
'pisell2.text.products.max-participants-error': "Please set max participants",
|
|
28
|
+
'pisell2.text.schedules.create-new-schedule': "Create new schedule"
|
|
28
29
|
},
|
|
29
30
|
'zh-CN': {
|
|
30
31
|
'pisell2.text.schedules.all-day': "全天",
|
|
@@ -51,7 +52,8 @@ export default {
|
|
|
51
52
|
'pisell2.text.products.unsaved-content': "若不保存即离开,您所做的修改将会丢失。确定要继续吗?",
|
|
52
53
|
'pisell2.text.products.unsaved-back': "返回",
|
|
53
54
|
'pisell2.text.products.unsaved-yes': "是的,退出",
|
|
54
|
-
'pisell2.text.products.max-participants-error': "请设置最大参与人数"
|
|
55
|
+
'pisell2.text.products.max-participants-error': "请设置最大参与人数",
|
|
56
|
+
'pisell2.text.schedules.create-new-schedule': "创建新日程"
|
|
55
57
|
},
|
|
56
58
|
'zh-HK': {
|
|
57
59
|
'pisell2.text.schedules.all-day': "全天",
|
|
@@ -78,6 +80,7 @@ export default {
|
|
|
78
80
|
'pisell2.text.products.unsaved-content': "若不保即離開,您做的修改將會丟失。確定要繼續嗎?",
|
|
79
81
|
'pisell2.text.products.unsaved-back': "返回",
|
|
80
82
|
'pisell2.text.products.unsaved-yes': "是的,退出",
|
|
81
|
-
'pisell2.text.products.max-participants-error': "請設置最大參與人數"
|
|
83
|
+
'pisell2.text.products.max-participants-error': "請設置最大參與人數",
|
|
84
|
+
'pisell2.text.schedules.create-new-schedule': "創建新日程"
|
|
82
85
|
}
|
|
83
86
|
};
|
|
@@ -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: {
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
2
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
8
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
9
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
10
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
15
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
16
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
17
|
import { locales } from "@pisell/utils";
|
|
8
18
|
import { useRequest } from "ahooks";
|
|
9
19
|
import { Button } from "antd";
|
|
@@ -11,6 +21,8 @@ import React, { useContext, useRef } from "react";
|
|
|
11
21
|
import CustomSelect from "../../../../../../booking/components/customSelect";
|
|
12
22
|
import { Context } from "../../../../../model";
|
|
13
23
|
import { getSchedules } from "../../../../serve";
|
|
24
|
+
import useComponents from "../../../../../../../hooks/useComponents";
|
|
25
|
+
import useEngineContext from "../../../../../../../hooks/useEngineContext";
|
|
14
26
|
import "./index.less";
|
|
15
27
|
var AddSchedules = function AddSchedules(_ref) {
|
|
16
28
|
var _state$schedules;
|
|
@@ -21,12 +33,69 @@ var AddSchedules = function AddSchedules(_ref) {
|
|
|
21
33
|
var modalRef = useRef(null);
|
|
22
34
|
var _useContext = useContext(Context),
|
|
23
35
|
state = _useContext.state;
|
|
36
|
+
var _useEngineContext = useEngineContext(),
|
|
37
|
+
appHelper = _useEngineContext.appHelper;
|
|
38
|
+
var createSchedules = useRef();
|
|
39
|
+
var AllCreateScheduleRef = useRef(null);
|
|
40
|
+
var _useComponents = useComponents({
|
|
41
|
+
components: ["ScheduleCreateType", "AllCreateSchedule"]
|
|
42
|
+
}),
|
|
43
|
+
_useComponents2 = _slicedToArray(_useComponents, 2),
|
|
44
|
+
ScheduleCreateType = _useComponents2[0],
|
|
45
|
+
AllCreateSchedule = _useComponents2[1];
|
|
24
46
|
var _getScheduleList = useRequest(getSchedules, {
|
|
25
47
|
manual: true,
|
|
26
48
|
onSuccess: function onSuccess(res) {}
|
|
27
49
|
});
|
|
28
50
|
var onFinish = function onFinish(e) {
|
|
29
|
-
|
|
51
|
+
var _getScheduleList$data;
|
|
52
|
+
var idMap = (_getScheduleList === null || _getScheduleList === void 0 ? void 0 : (_getScheduleList$data = _getScheduleList.data) === null || _getScheduleList$data === void 0 ? void 0 : _getScheduleList$data.reduce(function (p, c) {
|
|
53
|
+
return _objectSpread(_objectSpread({}, p), {}, _defineProperty({}, c.id, c));
|
|
54
|
+
}, {})) || {};
|
|
55
|
+
onChange(e.map(function (item) {
|
|
56
|
+
return idMap[item.id];
|
|
57
|
+
}));
|
|
58
|
+
};
|
|
59
|
+
var handleCreateSchedule = function handleCreateSchedule() {
|
|
60
|
+
var _createSchedules$curr, _createSchedules$curr2;
|
|
61
|
+
(_createSchedules$curr = createSchedules.current) === null || _createSchedules$curr === void 0 ? void 0 : (_createSchedules$curr2 = _createSchedules$curr.open) === null || _createSchedules$curr2 === void 0 ? void 0 : _createSchedules$curr2.call(_createSchedules$curr, {
|
|
62
|
+
getContainer: undefined
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
var handleAddSchedule = function handleAddSchedule(data) {
|
|
66
|
+
_getScheduleList.mutate(function (oldData) {
|
|
67
|
+
return [data].concat(_toConsumableArray(oldData || []));
|
|
68
|
+
});
|
|
69
|
+
modalRef.current.setValue(function (v) {
|
|
70
|
+
return [].concat(_toConsumableArray(v), [data]);
|
|
71
|
+
});
|
|
72
|
+
setTimeout(function () {
|
|
73
|
+
var _document$getElementB, _document$getElementB2;
|
|
74
|
+
(_document$getElementB = document.getElementById(data.id)) === null || _document$getElementB === void 0 ? void 0 : (_document$getElementB2 = _document$getElementB.scrollIntoView) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.call(_document$getElementB, {
|
|
75
|
+
block: "center",
|
|
76
|
+
behavior: "smooth"
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
var handleEdit = function handleEdit(e, id) {
|
|
81
|
+
var _AllCreateScheduleRef, _AllCreateScheduleRef2;
|
|
82
|
+
e.stopPropagation();
|
|
83
|
+
(_AllCreateScheduleRef = AllCreateScheduleRef.current) === null || _AllCreateScheduleRef === void 0 ? void 0 : (_AllCreateScheduleRef2 = _AllCreateScheduleRef.open) === null || _AllCreateScheduleRef2 === void 0 ? void 0 : _AllCreateScheduleRef2.call(_AllCreateScheduleRef, {
|
|
84
|
+
id: id
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
var handleChangeResData = function handleChangeResData(data) {
|
|
88
|
+
_getScheduleList.mutate(function (oldData) {
|
|
89
|
+
return (oldData || []).map(function (item) {
|
|
90
|
+
if (item.id === data.id) {
|
|
91
|
+
var _appHelper$utils;
|
|
92
|
+
return _objectSpread(_objectSpread({}, data), {}, {
|
|
93
|
+
name: (appHelper === null || appHelper === void 0 ? void 0 : (_appHelper$utils = appHelper.utils) === null || _appHelper$utils === void 0 ? void 0 : _appHelper$utils.translationShop(data.name)) || data.name
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
return item;
|
|
97
|
+
});
|
|
98
|
+
});
|
|
30
99
|
};
|
|
31
100
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
32
101
|
ghost: true,
|
|
@@ -46,9 +115,11 @@ var AddSchedules = function AddSchedules(_ref) {
|
|
|
46
115
|
ref: modalRef,
|
|
47
116
|
rowKey: "id",
|
|
48
117
|
options: isSelf ? _getScheduleList.data || [] : (state === null || state === void 0 ? void 0 : (_state$schedules = state.schedules) === null || _state$schedules === void 0 ? void 0 : _state$schedules.list) || [],
|
|
118
|
+
createItemText: locales.getText('pisell2.text.schedules.create-new-schedule'),
|
|
49
119
|
loading: _getScheduleList.loading,
|
|
50
120
|
value: value,
|
|
51
121
|
onValueChange: onFinish,
|
|
122
|
+
handleCreateItem: handleCreateSchedule,
|
|
52
123
|
isPreview: false,
|
|
53
124
|
drawerProps: _objectSpread({
|
|
54
125
|
title: locales.getText("pisell2.text.schedules.assign-schedule"),
|
|
@@ -67,12 +138,23 @@ var AddSchedules = function AddSchedules(_ref) {
|
|
|
67
138
|
} : {}),
|
|
68
139
|
mode: "multiple",
|
|
69
140
|
optionRender: function optionRender(item) {
|
|
70
|
-
return /*#__PURE__*/React.createElement(
|
|
141
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
142
|
+
className: "pisell-lowcode__add-schedule-list-item"
|
|
143
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
144
|
+
className: "pisell-lowcode__add-schedule-list-item-content"
|
|
145
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
71
146
|
className: "pisell-lowcode__add-schedule-list-item-color",
|
|
72
147
|
style: {
|
|
73
148
|
backgroundColor: item.color
|
|
74
149
|
}
|
|
75
|
-
}), item.name)
|
|
150
|
+
}), item.name), /*#__PURE__*/React.createElement("div", {
|
|
151
|
+
className: "pisell-lowcode__add-schedule-list-item-action-wrap"
|
|
152
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
153
|
+
className: "pisell-lowcode__add-schedule-list-item-action-edit",
|
|
154
|
+
onClick: function onClick(e) {
|
|
155
|
+
return handleEdit(e, item.id);
|
|
156
|
+
}
|
|
157
|
+
}, locales.getText("pisell2.text.edit"))));
|
|
76
158
|
}
|
|
77
159
|
// onVirtualListScroll={onScroll}
|
|
78
160
|
// loadMore={loadMore}
|
|
@@ -80,6 +162,12 @@ var AddSchedules = function AddSchedules(_ref) {
|
|
|
80
162
|
filterItem: function filterItem(d, search) {
|
|
81
163
|
return d.name.toLowerCase().indexOf(search.toLowerCase()) !== -1;
|
|
82
164
|
}
|
|
165
|
+
}), ScheduleCreateType && /*#__PURE__*/React.createElement(ScheduleCreateType, {
|
|
166
|
+
ref: createSchedules,
|
|
167
|
+
onChange: handleAddSchedule
|
|
168
|
+
}), AllCreateSchedule && /*#__PURE__*/React.createElement(AllCreateSchedule, {
|
|
169
|
+
ref: AllCreateScheduleRef,
|
|
170
|
+
onChange: handleChangeResData
|
|
83
171
|
}));
|
|
84
172
|
};
|
|
85
173
|
export 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/es/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/es/index.js
CHANGED
|
@@ -15,4 +15,5 @@ export { default as BookingResources } from "./components/booking/materiels/reso
|
|
|
15
15
|
export { default as BookingStartTime } from "./components/booking/materiels/startTime";
|
|
16
16
|
export { default as BookingDuration } from "./components/booking/materiels/duration";
|
|
17
17
|
export { default as BookingContacts } from "./components/booking/materiels/contacts";
|
|
18
|
-
export { default as ProductExtension } from "./components/productExtension";
|
|
18
|
+
export { default as ProductExtension } from "./components/productExtension";
|
|
19
|
+
export { default as BookingDeposit } from "./components/booking/deposit";
|
|
@@ -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: {
|
|
@@ -82,7 +82,10 @@ var formatBookings = (data) => {
|
|
|
82
82
|
const start_date = item._extend.startDate.format("YYYY-MM-DD");
|
|
83
83
|
const end_date = item._extend.endDate.format("YYYY-MM-DD");
|
|
84
84
|
const end_time = item._extend.endDate.format("HH:mm");
|
|
85
|
-
|
|
85
|
+
let start_time = item._extend.startDate.format("HH:mm");
|
|
86
|
+
if ((0, import_utils.isNowTime)(item._extend.start_time)) {
|
|
87
|
+
start_time = (0, import_utils.getNowTime)();
|
|
88
|
+
}
|
|
86
89
|
const total = Number(item._extend.total);
|
|
87
90
|
const origin_total = Number(item._extend.origin_total);
|
|
88
91
|
const discount_amount = origin_total - total;
|