@pisell/private-materials 6.2.16 → 6.2.18

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.
Files changed (167) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.js +2 -2
  8. package/build/lowcode/view.js +8 -8
  9. package/es/components/Sales/Checkout/utils.d.ts +40 -0
  10. package/es/components/appointmentBooking/components/Cart/utils.d.ts +56 -0
  11. package/es/components/appointmentBooking/components/Content/index.d.ts +3 -0
  12. package/es/components/appointmentBooking/components/Services/index.d.ts +4 -0
  13. package/es/components/appointmentBooking/components/Voucher/index.d.ts +4 -0
  14. package/es/components/appointmentBooking/hooks.d.ts +106 -0
  15. package/es/components/appointmentBooking/index.d.ts +3 -0
  16. package/es/components/booking/addons/model.d.ts +10 -1
  17. package/es/components/booking/components/TabProduct/tabs/index.js +1 -5
  18. package/es/components/booking/components/browserSelect/index.js +1 -1
  19. package/es/components/booking/components/reloadResourceModal/index.d.ts +8 -0
  20. package/es/components/booking/components/voucher/index.d.ts +3 -0
  21. package/es/components/booking/editBookingModal/index.js +58 -29
  22. package/es/components/booking/editBookingModal/serve.d.ts +1 -0
  23. package/es/components/booking/editBookingModal/serve.js +19 -11
  24. package/es/components/booking/forms/model.d.ts +10 -1
  25. package/es/components/booking/forms/model.js +5 -5
  26. package/es/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
  27. package/es/components/booking/info/addServiceVariant/index.d.ts +6 -0
  28. package/es/components/booking/info/index.d.ts +3 -0
  29. package/es/components/booking/info/model.d.ts +10 -1
  30. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  31. package/es/components/booking/info/service/like/index.js +1 -1
  32. package/es/components/booking/info/utils.d.ts +50 -0
  33. package/es/components/booking/info2/index.d.ts +12 -0
  34. package/es/components/booking/info2/service/addService/index.d.ts +11 -0
  35. package/es/components/booking/info2/service/addService/utils.d.ts +98 -0
  36. package/es/components/booking/info2/service/addService/utils.js +1 -1
  37. package/es/components/booking/info2/service/addTimeModal/index.d.ts +3 -0
  38. package/es/components/booking/info2/service/editService/ResourcesV2/index.js +1 -1
  39. package/es/components/booking/locales.d.ts +828 -0
  40. package/es/components/booking/materiels/startTime/index.js +1 -1
  41. package/es/components/booking/model.d.ts +116 -0
  42. package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
  43. package/es/components/booking/notes/NoteBlock/index.js +11 -11
  44. package/es/components/booking/notes/model.d.ts +10 -1
  45. package/es/components/booking/notes/model.js +5 -5
  46. package/es/components/booking/payments/model.d.ts +10 -1
  47. package/es/components/booking/payments/model.js +5 -5
  48. package/es/components/eftposPay/const.d.ts +184 -0
  49. package/es/components/eftposPay/hooks.d.ts +35 -0
  50. package/es/components/eftposPay/index.d.ts +4 -0
  51. package/es/components/eftposPay/linkly/const.d.ts +23 -0
  52. package/es/components/eftposPay/linkly/hooks/index.d.ts +2 -0
  53. package/es/components/eftposPay/linkly/hooks/normal.d.ts +30 -0
  54. package/es/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +4 -0
  55. package/es/components/eftposPay/linkly/index.d.ts +2 -0
  56. package/es/components/eftposPay/linkly/service.d.ts +32 -0
  57. package/es/components/eftposPay/manufacturer.d.ts +7 -0
  58. package/es/components/eftposPay/pay.d.ts +20 -0
  59. package/es/components/eftposPay/store/index.d.ts +355 -0
  60. package/es/components/listComponent/index.js +5 -5
  61. package/es/components/pay/toC/PaymentMethods/index.d.ts +9 -0
  62. package/es/components/pay/toC/model.d.ts +9 -1
  63. package/es/components/productExtension/card/index.js +3 -3
  64. package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
  65. package/es/components/productExtension/fields/Forms/index.js +12 -12
  66. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
  67. package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
  68. package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
  69. package/es/components/productExtension/server.js +2 -2
  70. package/es/components/productSelect/components/TabProduct/index.d.ts +2 -0
  71. package/es/components/productSelect/index.d.ts +26 -0
  72. package/es/components/ruleSetting/ruleBorder/index.js +1 -1
  73. package/es/components/schedules/calendar/index.js +4 -4
  74. package/es/components/schedules/calendar/serve.js +2 -2
  75. package/es/components/schedules/components/CurrentDay/index.js +5 -5
  76. package/es/components/schedules/components/CurrentDay/serve.js +2 -2
  77. package/es/components/schedules/components/DropdownSort/index.js +1 -1
  78. package/es/components/schedules/components/ResourceList/index.js +1 -1
  79. package/es/components/schedules/components/Search/index.js +5 -5
  80. package/es/components/schedules/model.d.ts +9 -1
  81. package/es/components/schedules/model.js +5 -5
  82. package/es/components/schedules/openHours/index.js +1 -1
  83. package/es/components/schedules/openHours/serve.js +2 -2
  84. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
  85. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
  86. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
  87. package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
  88. package/es/components/schedules/products/serve.js +2 -2
  89. package/es/components/schedules/products/utils.js +5 -5
  90. package/es/components/schedules/resources/detail/detailContent.js +2 -2
  91. package/es/components/schedules/resources/detail/index.js +10 -10
  92. package/es/components/schedules/resources/list/index.js +2 -2
  93. package/es/components/schedules/resources/relationProduct/index.js +1 -1
  94. package/es/components/schedules/resources/serve.js +2 -2
  95. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
  96. package/es/components/schedules/utils.js +4 -4
  97. package/es/components/selectModal/index.js +2 -2
  98. package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
  99. package/es/components/ticketBooking/index.d.ts +7 -0
  100. package/es/components/wallet/Detail/model.d.ts +13 -1
  101. package/es/components/wallet/DiscountCard/model.d.ts +14 -1
  102. package/es/components/wallet/PointCard/model.d.ts +13 -1
  103. package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
  104. package/es/components/wallet/Voucher/model.d.ts +13 -1
  105. package/es/components/wallet/model.d.ts +9 -1
  106. package/es/components/walletList/index.d.ts +28 -0
  107. package/es/hooks/useComponents.js +1 -1
  108. package/es/utils/index.d.ts +23 -0
  109. package/lib/components/Sales/Checkout/utils.d.ts +40 -0
  110. package/lib/components/appointmentBooking/components/Cart/utils.d.ts +56 -0
  111. package/lib/components/appointmentBooking/components/Content/index.d.ts +3 -0
  112. package/lib/components/appointmentBooking/components/Services/index.d.ts +4 -0
  113. package/lib/components/appointmentBooking/components/Voucher/index.d.ts +4 -0
  114. package/lib/components/appointmentBooking/hooks.d.ts +106 -0
  115. package/lib/components/appointmentBooking/index.d.ts +3 -0
  116. package/lib/components/booking/addons/model.d.ts +10 -1
  117. package/lib/components/booking/components/reloadResourceModal/index.d.ts +8 -0
  118. package/lib/components/booking/components/voucher/index.d.ts +3 -0
  119. package/lib/components/booking/editBookingModal/index.js +56 -21
  120. package/lib/components/booking/editBookingModal/serve.d.ts +1 -0
  121. package/lib/components/booking/editBookingModal/serve.js +12 -6
  122. package/lib/components/booking/forms/model.d.ts +10 -1
  123. package/lib/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
  124. package/lib/components/booking/info/addServiceVariant/index.d.ts +6 -0
  125. package/lib/components/booking/info/index.d.ts +3 -0
  126. package/lib/components/booking/info/model.d.ts +10 -1
  127. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  128. package/lib/components/booking/info/utils.d.ts +50 -0
  129. package/lib/components/booking/info2/index.d.ts +12 -0
  130. package/lib/components/booking/info2/service/addService/index.d.ts +11 -0
  131. package/lib/components/booking/info2/service/addService/utils.d.ts +98 -0
  132. package/lib/components/booking/info2/service/addService/utils.js +1 -1
  133. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +3 -0
  134. package/lib/components/booking/info2/service/editService/ResourcesV2/index.js +1 -1
  135. package/lib/components/booking/locales.d.ts +828 -0
  136. package/lib/components/booking/model.d.ts +116 -0
  137. package/lib/components/booking/notes/model.d.ts +10 -1
  138. package/lib/components/booking/payments/model.d.ts +10 -1
  139. package/lib/components/eftposPay/const.d.ts +184 -0
  140. package/lib/components/eftposPay/hooks.d.ts +35 -0
  141. package/lib/components/eftposPay/index.d.ts +4 -0
  142. package/lib/components/eftposPay/linkly/const.d.ts +23 -0
  143. package/lib/components/eftposPay/linkly/hooks/index.d.ts +2 -0
  144. package/lib/components/eftposPay/linkly/hooks/normal.d.ts +30 -0
  145. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +4 -0
  146. package/lib/components/eftposPay/linkly/index.d.ts +2 -0
  147. package/lib/components/eftposPay/linkly/service.d.ts +32 -0
  148. package/lib/components/eftposPay/manufacturer.d.ts +7 -0
  149. package/lib/components/eftposPay/pay.d.ts +20 -0
  150. package/lib/components/eftposPay/store/index.d.ts +355 -0
  151. package/lib/components/pay/toC/PaymentMethods/index.d.ts +9 -0
  152. package/lib/components/pay/toC/model.d.ts +9 -1
  153. package/lib/components/productSelect/components/TabProduct/index.d.ts +2 -0
  154. package/lib/components/productSelect/index.d.ts +26 -0
  155. package/lib/components/schedules/model.d.ts +9 -1
  156. package/lib/components/schedules/utils.js +1 -1
  157. package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
  158. package/lib/components/ticketBooking/index.d.ts +7 -0
  159. package/lib/components/wallet/Detail/model.d.ts +13 -1
  160. package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
  161. package/lib/components/wallet/PointCard/model.d.ts +13 -1
  162. package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
  163. package/lib/components/wallet/Voucher/model.d.ts +13 -1
  164. package/lib/components/wallet/model.d.ts +9 -1
  165. package/lib/components/walletList/index.d.ts +28 -0
  166. package/lib/utils/index.d.ts +23 -0
  167. package/package.json +4 -4
@@ -0,0 +1,106 @@
1
+ export declare const useAppointmentBooking: () => any;
2
+ export declare const useShopDiscount: () => any;
3
+ export declare const contextUtils: () => any;
4
+ /**
5
+ * @title: 监听步骤发生变化
6
+ * @description:
7
+ * @return {*}
8
+ * @Author: WangHan
9
+ * @Date: 2025-04-15 11:11
10
+ */
11
+ export declare const useAppointmentBookingStep: () => {
12
+ getStepIndex: (type: string, skipNumber?: number) => any;
13
+ stepList: any;
14
+ removeStep: (key: string) => any;
15
+ addStep: (props: any, stepKey?: string) => any;
16
+ updateStep: (key: string, step: any) => void;
17
+ nextStep: () => any;
18
+ };
19
+ /**
20
+ * @title: 获取商品数据
21
+ * @description:
22
+ * @return {*}
23
+ * @Author: WangHan
24
+ * @Date: 2025-04-15 11:12
25
+ */
26
+ export declare const useAppointmentBookingProduct: () => {
27
+ checkProductType: (productId: number) => Promise<any>;
28
+ getProducts: () => Promise<any>;
29
+ };
30
+ /**
31
+ * @title: 更新购物车数据
32
+ * @description:
33
+ * @return {*}
34
+ * @Author: WangHan
35
+ * @Date: 2025-04-15 11:12
36
+ */
37
+ export declare const useAppointmentBookingCart: () => void;
38
+ /**
39
+ * @title: 获取登录状态
40
+ * @description:
41
+ * @return {*}
42
+ * @Author: WangHan
43
+ * @Date: 2025-04-15 11:14
44
+ */
45
+ export declare const useAppointmentBookingLogin: () => {
46
+ isLogin: boolean;
47
+ openLoginModal: (params: {
48
+ callback: any;
49
+ }) => void;
50
+ };
51
+ /**
52
+ * @title: 获取账户
53
+ * @description:
54
+ * @return {*}
55
+ * @Author: WangHan
56
+ * @Date: 2025-04-15 11:15
57
+ */
58
+ export declare const useAppointmentBookingAccount: () => {
59
+ accountLists: any;
60
+ getHolders: () => Promise<any>;
61
+ form_id: any;
62
+ addAccount: (val: any, type?: string) => Promise<any>;
63
+ checkAccount: (type: any) => any;
64
+ };
65
+ /**
66
+ * @title: 获取资源数据
67
+ * @description:
68
+ * @return {*}
69
+ * @Author: WangHan
70
+ * @Date: 2025-04-15 11:29
71
+ */
72
+ export declare const useAppointmentBookingResource: () => {
73
+ getResourceTimeSlot: (index?: number) => Promise<void>;
74
+ getResourceList: () => {
75
+ resources: any;
76
+ resourceCodes: any;
77
+ };
78
+ };
79
+ /**
80
+ * @title: 是否跳过资源选择步骤
81
+ * @description:
82
+ * @return {*}
83
+ * @Author: WangHan
84
+ * @Date: 2025-04-21 11:47
85
+ */
86
+ export declare const useIsSkipResourceStep: () => {
87
+ checkSkipResourceStep: () => Promise<boolean>;
88
+ };
89
+ /**
90
+ * @title: 获取预约配置
91
+ * @description:
92
+ * @return {*}
93
+ * @Author: WangHan
94
+ * @Date: 2025-04-24 18:15
95
+ */
96
+ export declare const useAppointmentBookingSetting: () => {
97
+ isDateSelectedFirst: boolean;
98
+ isFormSubject: boolean;
99
+ isRetailTemplate: any;
100
+ customPageId: any;
101
+ channel: any;
102
+ bookingSubject: any;
103
+ setOtherData: (key: string, val: any) => any;
104
+ getOtherData: (key: string) => any;
105
+ formName: any;
106
+ };
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const AppointmentBooking: () => JSX.Element;
3
+ export default AppointmentBooking;
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -0,0 +1,8 @@
1
+ import './index.less';
2
+ interface IProps {
3
+ modal: any;
4
+ onReload: () => Promise<any>;
5
+ onCancel: () => void;
6
+ }
7
+ declare const ReloadResourceModal: ({ modal, onReload, onCancel }: IProps) => JSX.Element;
8
+ export default ReloadResourceModal;
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const VoucherCard: (props: any) => JSX.Element | null;
3
+ export default VoucherCard;
@@ -66,50 +66,62 @@ var EditBookingModal = (props, ref) => {
66
66
  };
67
67
  });
68
68
  const getInitData = async (params2) => {
69
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
69
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
70
70
  let mockProps = params2;
71
71
  const _data = await (0, import_serve2.init)(mockProps);
72
72
  setData(_data);
73
73
  let _initResourceVal = _data.childrenBooking._extend.resource;
74
- const toResourceFormId = (_a = _data.toResource) == null ? void 0 : _a.form_id;
75
- if (params2.fromResourceId !== params2.toResourceId && toResourceFormId) {
74
+ const fromResourceFormId = (_a = _data.fromResource) == null ? void 0 : _a.form_id;
75
+ const toResourceFormId = (_b = _data.toResource) == null ? void 0 : _b.form_id;
76
+ const _form_id = toResourceFormId || fromResourceFormId;
77
+ if (params2.fromResourceId !== params2.toResourceId && !!_form_id) {
76
78
  const { list, maps } = (0, import_utils3.formatResources)({
77
79
  cacheItem: _data.childrenBooking,
78
80
  resourcesOrigin: _data.resourcesOrigin
79
81
  });
80
- const currentForm = maps[toResourceFormId];
81
- const relation_id = (_b = _data.toResource) == null ? void 0 : _b.id;
82
- if (currentForm && relation_id) {
82
+ const currentForm = maps[_form_id];
83
+ const relation_id = (_c = _data.toResource) == null ? void 0 : _c.id;
84
+ if (currentForm && (relation_id || relation_id === 0)) {
83
85
  let _targetResource = {
84
- relation_type: ((_d = (_c = currentForm.renderListMaps[relation_id]) == null ? void 0 : _c.usable) == null ? void 0 : _d.relation_type) || "form",
85
- form_id: toResourceFormId,
86
+ relation_type: ((_e = (_d = currentForm.renderListMaps[relation_id]) == null ? void 0 : _d.usable) == null ? void 0 : _e.relation_type) || "form",
87
+ form_id: _form_id,
86
88
  relation_id,
87
89
  like_status: "common",
88
- children: (_f = (_e = currentForm.renderListMaps) == null ? void 0 : _e[relation_id]) == null ? void 0 : _f.children,
90
+ children: (_g = (_f = currentForm.renderListMaps) == null ? void 0 : _f[relation_id]) == null ? void 0 : _g.children,
89
91
  metadata: {
90
- ...(_h = (_g = currentForm.renderListMaps) == null ? void 0 : _g[relation_id]) == null ? void 0 : _h.metadata,
92
+ ...(_i = (_h = currentForm.renderListMaps) == null ? void 0 : _h[relation_id]) == null ? void 0 : _i.metadata,
91
93
  form_name: currentForm.title,
92
- resource_name: (_i = currentForm.renderListMaps[relation_id]) == null ? void 0 : _i.main_field
94
+ resource_name: (_j = currentForm.renderListMaps[relation_id]) == null ? void 0 : _j.main_field
93
95
  }
94
96
  };
95
- if (Array.isArray(_initResourceVal[toResourceFormId])) {
96
- const _cloned = [..._initResourceVal[toResourceFormId]];
97
- const _idx = _cloned.findIndex(
98
- (rs) => rs.relation_id == params2.fromResourceId
99
- );
97
+ if (Array.isArray(_initResourceVal[_form_id])) {
98
+ const _cloned = [..._initResourceVal[_form_id]];
99
+ const _idx = _cloned.findIndex((rs) => {
100
+ var _a2;
101
+ return rs.relation_id == params2.fromResourceId || ((_a2 = rs.children) == null ? void 0 : _a2.find(
102
+ (child) => child.relation_id == params2.fromResourceId
103
+ ));
104
+ });
100
105
  if (_idx !== -1) {
101
- _cloned[_idx] = _targetResource;
106
+ const _sameResource = _cloned.find(
107
+ (_clonedItem) => _clonedItem.relation_id === (_targetResource == null ? void 0 : _targetResource.relation_id)
108
+ );
109
+ if (_sameResource) {
110
+ _cloned.splice(_idx, 1);
111
+ } else {
112
+ _cloned[_idx] = _targetResource;
113
+ }
102
114
  } else {
103
115
  _cloned.push(_targetResource);
104
116
  }
105
117
  _initResourceVal = {
106
118
  ..._initResourceVal,
107
- [toResourceFormId]: _cloned
119
+ [_form_id]: _cloned
108
120
  };
109
121
  } else {
110
122
  _initResourceVal = {
111
123
  ..._initResourceVal,
112
- [toResourceFormId]: [_targetResource]
124
+ [_form_id]: [_targetResource]
113
125
  };
114
126
  }
115
127
  }
@@ -216,8 +228,30 @@ var EditBookingModal = (props, ref) => {
216
228
  const start_time = values.toDate[0].format("HH:mm");
217
229
  const end_date = values.toDate[1].format("YYYY-MM-DD");
218
230
  const end_time = values.toDate[1].format("HH:mm");
231
+ console.log("extend data", _extend);
232
+ const {
233
+ id,
234
+ relation_id,
235
+ like_status,
236
+ relation_type,
237
+ is_all,
238
+ schedule_id,
239
+ sub_type,
240
+ select_date,
241
+ number,
242
+ metadata
243
+ } = _extend;
219
244
  await (0, import_serve.updateChildBooking)(order_id, {
220
- ..._extend,
245
+ id,
246
+ relation_id,
247
+ like_status,
248
+ relation_type,
249
+ is_all,
250
+ schedule_id,
251
+ sub_type,
252
+ select_date,
253
+ number,
254
+ metadata,
221
255
  resources: Object.values(values.resource).reduce(
222
256
  (pre, cur) => {
223
257
  const newList = (0, import_utils4.checkResourcesFormat)(cur, cacheItem);
@@ -232,7 +266,7 @@ var EditBookingModal = (props, ref) => {
232
266
  end_time,
233
267
  duration: values.toDate[1].diff(values.toDate[0], "minutes")
234
268
  });
235
- setOpen(false);
269
+ initState();
236
270
  props == null ? void 0 : props.onOk();
237
271
  } catch (error) {
238
272
  console.error(error);
@@ -352,6 +386,7 @@ var EditBookingModal = (props, ref) => {
352
386
  onClick: onOk,
353
387
  block: true,
354
388
  size: "large",
389
+ disabled: !data,
355
390
  loading: updating,
356
391
  style: { borderRadius: 20 }
357
392
  },
@@ -46,6 +46,7 @@ export declare const init: (params: EditBookingModalParams) => Promise<{
46
46
  start_date: any;
47
47
  };
48
48
  resourcesOrigin: any[];
49
+ fromResource: any;
49
50
  toResource: any;
50
51
  }>;
51
52
  export declare const createCacheItem: (cacheItem: any, values?: any) => any;
@@ -94,6 +94,7 @@ var updateResourceErrors = (resourceMaps, cacheItem) => {
94
94
  }
95
95
  };
96
96
  var init = async (params) => {
97
+ var _a;
97
98
  const { toStartDate, toEndDate, event, fromResourceId, toResourceId } = params;
98
99
  let bookingOrigin = await _getBookingDetail(event.order.id);
99
100
  let booking = (0, import_ticketBooking._formatBookingDetail)(bookingOrigin, {});
@@ -102,15 +103,18 @@ var init = async (params) => {
102
103
  });
103
104
  let childrenBooking = getChildrenBookingById(booking.service.value, event.id);
104
105
  console.log("childrenBooking", childrenBooking);
106
+ const fromResource = resources.listMap[fromResourceId];
107
+ const toResource = resources.listMap[toResourceId];
105
108
  const extraParams = {
106
109
  extraResources: []
107
110
  };
108
- const fromResource = resources.listMap[fromResourceId];
109
- const toResource = resources.listMap[toResourceId];
110
- if (fromResource) {
111
- extraParams.extraResources.push({
112
- form_id: fromResource.form_id,
113
- id: fromResource.id
111
+ const _eventResources = (_a = childrenBooking._extend) == null ? void 0 : _a.event_resources;
112
+ if (Array.isArray(_eventResources)) {
113
+ _eventResources.forEach((item) => {
114
+ extraParams.extraResources.push({
115
+ id: item.relation_id,
116
+ form_id: item.form_id
117
+ });
114
118
  });
115
119
  }
116
120
  if (toResource) {
@@ -138,6 +142,8 @@ var init = async (params) => {
138
142
  },
139
143
  // 总资源列表
140
144
  resourcesOrigin,
145
+ // 源资源
146
+ fromResource,
141
147
  // 目标资源
142
148
  toResource
143
149
  };
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -0,0 +1 @@
1
+ export declare const useIsBooking4Shop: (state: any) => any;
@@ -0,0 +1,6 @@
1
+ interface AddServiceVariantProps {
2
+ globalState: any;
3
+ setGlobalState: any;
4
+ }
5
+ declare const AddServiceVariant: (props: AddServiceVariantProps) => JSX.Element;
6
+ export default AddServiceVariant;
@@ -0,0 +1,3 @@
1
+ import { InfoProps } from './main';
2
+ declare const APP: (props: InfoProps) => JSX.Element;
3
+ export default APP;
@@ -1,5 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { FormState } from '../model';
1
3
  export declare const walkInData: {
2
4
  id: number;
3
5
  nickname: string;
4
6
  };
5
- export declare const Provider: any, Context: any;
7
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
8
+ state: FormState;
9
+ } & {
10
+ dispatch: (params: {
11
+ type: string;
12
+ payload: any;
13
+ }) => void;
14
+ }>;
@@ -6,7 +6,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
6
6
  type: string;
7
7
  value: number;
8
8
  };
9
- locale: any;
9
+ locale: string;
10
10
  slice: any;
11
11
  selectProps: {
12
12
  size: string;
@@ -0,0 +1,50 @@
1
+ export declare const getIsBundleOrCombination: (productDetail: any) => boolean;
2
+ export declare const uniqueByField: (arr: any[], field: string) => any[];
3
+ export declare const moveItemToFront: (arr: any[], targetId: string | number) => any[];
4
+ /**
5
+ * @title: 判断两个时间是否在同一个时间段内
6
+ * @description:
7
+ * @param {number} time1 开始时间
8
+ * @param {number} time2 结束时间
9
+ * @param {number} interval 时间间隔
10
+ * @return {*}
11
+ * @Author: zhiwei.Wang
12
+ * @Date: 2024-08-13 19:37
13
+ */
14
+ export declare const isInterval: (time1: number, time2: number, interval?: number) => boolean;
15
+ /**
16
+ * @title: 根据时间间隔格式化服务列表
17
+ * @description: 防止短时间内添加多个相同服务, 如果两个服务的时间间隔小于1秒,则合并为一个服务
18
+ * @param {any} list 服务列表
19
+ * @return {*}
20
+ * @Author: zhiwei.Wang
21
+ * @Date: 2024-08-13 19:36
22
+ */
23
+ export declare const formatServiceListByTime: (list: any[]) => any[];
24
+ export declare const isBooking4Shop: (shopId: number, renderType?: string, businessUtils?: any) => any;
25
+ declare type DataEntry = {
26
+ total: number;
27
+ origin_total: number;
28
+ num: number;
29
+ quotation_id: number;
30
+ start_date: string;
31
+ end_date: string;
32
+ };
33
+ declare type ResultStructure = Record<string, Record<string, any>>;
34
+ export declare const getMultiDayPrices: (data: DataEntry[]) => ResultStructure;
35
+ /**
36
+ * @title: 是否是跨日预约
37
+ * @description:
38
+ * @param {number} shopId
39
+ * @return {*}
40
+ * @Author: WangHan
41
+ * @Date: 2024-11-29 11:19
42
+ */
43
+ export declare const isDayBooking: (shopId: number) => boolean;
44
+ export declare const isOpenAddTime: (state: any) => boolean;
45
+ export declare const isShowAddTime: (state: any, currentService: any) => boolean;
46
+ export declare const editSessionProduct: (cacheItem: any, session: any) => {
47
+ duration: any;
48
+ start_time: any;
49
+ } | undefined;
50
+ export {};
@@ -0,0 +1,12 @@
1
+ import '../info/index.less';
2
+ export interface InfoProps {
3
+ style: any;
4
+ globalState: any;
5
+ callback: any;
6
+ setGlobalState: any;
7
+ modules: any;
8
+ slot: any;
9
+ setState: any;
10
+ }
11
+ declare const Info: any;
12
+ export default Info;
@@ -0,0 +1,11 @@
1
+ import { PisellDrawerProps } from '../../../components/drawer';
2
+ import '../../../info/service/addService/index.less';
3
+ interface AddServiceProps {
4
+ onEdit: any;
5
+ dispatch?: any;
6
+ state?: any;
7
+ drawerProps?: PisellDrawerProps;
8
+ renderMode?: 'current' | 'drawer';
9
+ }
10
+ declare const Info: (props: AddServiceProps) => JSX.Element;
11
+ export default Info;
@@ -0,0 +1,98 @@
1
+ import dayjs from 'dayjs';
2
+ export declare const getUsableTime: (cacheItem: any) => any;
3
+ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResource, slice, }: any) => {
4
+ startDate: dayjs.Dayjs;
5
+ usableTime: any;
6
+ duration: string | number | {
7
+ type: string;
8
+ value: number;
9
+ };
10
+ locale: string;
11
+ slice: any;
12
+ selectProps: {
13
+ size: string;
14
+ };
15
+ };
16
+ /**
17
+ * @title: 灵活时长选项
18
+ * @description:
19
+ * @param {*} useMemo
20
+ * @return {*}
21
+ * @Author: zhiwei.Wang
22
+ * @Date: 2024-02-23 10:10
23
+ */
24
+ export declare const getFlexibleOption: ({ cacheItem, useStartTime, currentResource, slice, durationProps, }: any) => {
25
+ label: any;
26
+ value: any;
27
+ } | null;
28
+ export declare const getTimeSlices: ({ state }: any) => {
29
+ timeSlices: {
30
+ label: string;
31
+ value: string;
32
+ }[];
33
+ };
34
+ /**
35
+ * @title: 时间切片
36
+ * @description:
37
+ * @return {*}
38
+ * @Author: zhiwei.Wang
39
+ * @Date: 2024-01-09 13:37
40
+ */
41
+ export declare const getTimeObj: ({ cacheItem, useStartTime, currentResource, state, useDuration, durationProps, }: any) => {
42
+ timeSlices: {
43
+ label: string;
44
+ value: string;
45
+ }[];
46
+ durationSlicesBasedOnTime: {
47
+ label: string;
48
+ value: number;
49
+ }[];
50
+ };
51
+ /**
52
+ * @title: 获取资源列表
53
+ * @description:
54
+ * @return {*}
55
+ * @Author: zhiwei.Wang
56
+ * @Date: 2024-01-09 13:38
57
+ */
58
+ export declare const formatResources: ({ cacheItem, resourcesOrigin, id }: any) => {
59
+ list: any;
60
+ maps: any;
61
+ };
62
+ export declare const setDefaultResource: ({ cacheItem, resources }: any) => any;
63
+ /**
64
+ * @title: 设置默认容量
65
+ * @description:
66
+ * @param {any} param1
67
+ * @return {*}
68
+ * @Author: zhiwei.Wang
69
+ * @Date: 2024-09-19 20:26
70
+ */
71
+ export declare const setDefaultCapacitys: ({ capacitys, cacheItem }: any) => any;
72
+ /**
73
+ * @title: 将商品内关联的资源id还原成数据
74
+ * @description:
75
+ * @param {any} resourcesOriginMap
76
+ * @param {any} cacheItem
77
+ * @return {*}
78
+ * @Author: zhiwei.Wang
79
+ * @Date: 2024-09-19 20:23
80
+ */
81
+ export declare const getResourceByIds: (resourcesOriginMap: any, cacheItem: any, extraParams?: any) => any[];
82
+ /**
83
+ * @title: 预生成服务的 extend
84
+ * @description:
85
+ * @param {any} param1
86
+ * @return {*}
87
+ * @Author: zhiwei.Wang
88
+ * @Date: 2024-06-01 13:25
89
+ */
90
+ export declare const getProductExtend: ({ cacheItem, state, isDisabledTime }: any) => any;
91
+ /**
92
+ * @title: 格式化服务列表
93
+ * @description: 后端列表返回的product_resource.resources 的optional_resource等不是最新数据
94
+ * 使用with resourceRelation后 返回的resource_relation是实时数据
95
+ * 这里做一次转换
96
+ * @param list
97
+ */
98
+ export declare const transServiceList: (list: any[]) => any[];
@@ -302,7 +302,7 @@ var getResourceByIds = (resourcesOriginMap, cacheItem, extraParams) => {
302
302
  extraResourceIds = (resourcesOrigin || []).filter((d) => d.form_code === item.code).map((d) => d.id);
303
303
  } else {
304
304
  extraResourceIds = extraResources.filter((_extraItem) => {
305
- return _extraItem.form_id === form_id && !item.optional_resource.includes(_extraItem.id) && !item.default_resource.includes(_extraItem.id);
305
+ return _extraItem.form_id === form_id && !!_extraItem.id && !item.optional_resource.includes(_extraItem.id) && !item.default_resource.includes(_extraItem.id);
306
306
  }).map((_extraItem) => _extraItem.id);
307
307
  }
308
308
  extraResourceIds = Array.from(new Set(extraResourceIds));
@@ -0,0 +1,3 @@
1
+ import '../../../info/service/addTimeModal/index.less';
2
+ declare const AddTimeModal: () => JSX.Element;
3
+ export default AddTimeModal;
@@ -72,7 +72,7 @@ var Resources = ({
72
72
  const originData = (0, import_react.useMemo)(() => {
73
73
  var _a2;
74
74
  return ((_a2 = cacheItem == null ? void 0 : cacheItem._data) == null ? void 0 : _a2.resources) || [];
75
- }, [(_b = originCacheItem == null ? void 0 : originCacheItem._data) == null ? void 0 : _b.resource]);
75
+ }, [(_b = originCacheItem == null ? void 0 : originCacheItem._data) == null ? void 0 : _b.resources]);
76
76
  const resourceMaps = (0, import_react.useMemo)(() => {
77
77
  var _a2;
78
78
  return ((_a2 = cacheItem == null ? void 0 : cacheItem._data) == null ? void 0 : _a2.resourceMaps) || [];