@pisell/private-materials 3.0.13 → 3.0.15

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 (204) 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.css +1 -1
  8. package/build/lowcode/render/default/view.js +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +8 -8
  11. package/es/components/booking/addons/index.d.ts +1 -1
  12. package/es/components/booking/addons/model.d.ts +2 -1
  13. package/es/components/booking/components/addButton/index.d.ts +8 -8
  14. package/es/components/booking/components/addButton/index.js +1 -1
  15. package/es/components/booking/components/drawer/index.d.ts +1 -1
  16. package/es/components/booking/components/footer/FooterMenus/index.js +1 -1
  17. package/es/components/booking/components/footer/index.js +25 -23
  18. package/es/components/booking/components/footer/utils.js +4 -3
  19. package/es/components/booking/forms/forms.d.ts +1 -1
  20. package/es/components/booking/forms/forms.js +2 -1
  21. package/es/components/booking/forms/index.d.ts +1 -1
  22. package/es/components/booking/forms/model.d.ts +2 -1
  23. package/es/components/booking/index.d.ts +1 -1
  24. package/es/components/booking/info/client/index.js +0 -1
  25. package/es/components/booking/info/date/index.less +1 -1
  26. package/es/components/booking/info/index.d.ts +1 -1
  27. package/es/components/booking/info/index.js +23 -9
  28. package/es/components/booking/info/model.d.ts +2 -1
  29. package/es/components/booking/info/notes/index.d.ts +3 -0
  30. package/es/components/booking/info/notes/index.js +83 -0
  31. package/es/components/booking/info/pet/index.js +5 -7
  32. package/es/components/booking/info/service/addService/index.js +74 -15
  33. package/es/components/booking/info/service/editService/index.js +8 -7
  34. package/es/components/booking/info/service/index.js +1 -1
  35. package/es/components/booking/info/service/index.less +3 -0
  36. package/es/components/booking/locales.d.ts +3 -0
  37. package/es/components/booking/locales.js +3 -0
  38. package/es/components/booking/model.d.ts +13 -1
  39. package/es/components/booking/notes/index.d.ts +1 -1
  40. package/es/components/booking/notes/model.d.ts +2 -1
  41. package/es/components/booking/payments/index.d.ts +1 -1
  42. package/es/components/booking/payments/model.d.ts +2 -1
  43. package/es/components/booking/utils.js +2 -1
  44. package/es/components/index.d.ts +2 -1
  45. package/es/components/index.js +2 -1
  46. package/es/components/productExtension/card/index.d.ts +10 -0
  47. package/es/components/productExtension/card/index.js +20 -0
  48. package/es/components/productExtension/card/index.less +34 -0
  49. package/es/components/productExtension/fields/Actor/Container/index.d.ts +12 -0
  50. package/es/components/productExtension/fields/Actor/Container/index.js +34 -0
  51. package/es/components/productExtension/fields/Actor/Container/index.less +19 -0
  52. package/es/components/productExtension/fields/Actor/CutOffTime/index.d.ts +10 -0
  53. package/es/components/productExtension/fields/Actor/CutOffTime/index.js +94 -0
  54. package/es/components/productExtension/fields/Actor/CutOffTime/index.less +32 -0
  55. package/es/components/productExtension/fields/Actor/CutOffTime/status.d.ts +0 -0
  56. package/es/components/productExtension/fields/Actor/CutOffTime/status.js +0 -0
  57. package/es/components/productExtension/fields/Actor/index.d.ts +5 -0
  58. package/es/components/productExtension/fields/Actor/index.js +23 -0
  59. package/es/components/productExtension/fields/Forms/index.d.ts +10 -0
  60. package/es/components/productExtension/fields/Forms/index.js +184 -0
  61. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +4 -0
  62. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.js +30 -0
  63. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.less +69 -0
  64. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +4 -0
  65. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +39 -0
  66. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.less +62 -0
  67. package/es/components/productExtension/fields/SelectProducts/index.d.ts +10 -0
  68. package/es/components/productExtension/fields/SelectProducts/index.js +99 -0
  69. package/es/components/productExtension/fields/SelectProducts/index.less +30 -0
  70. package/es/components/productExtension/fields/SelectProducts/mock.d.ts +0 -0
  71. package/es/components/productExtension/fields/SelectProducts/mock.js +0 -0
  72. package/es/components/productExtension/fields/SelectProducts/server.d.ts +1 -0
  73. package/es/components/productExtension/fields/SelectProducts/server.js +29 -0
  74. package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +4 -0
  75. package/es/components/productExtension/fields/SelectResourcesTable/index.js +200 -0
  76. package/es/components/productExtension/fields/SelectResourcesTable/index.less +0 -0
  77. package/es/components/productExtension/fields/SelectResourcesTable/mock.d.ts +2681 -0
  78. package/es/components/productExtension/fields/SelectResourcesTable/mock.js +5072 -0
  79. package/es/components/productExtension/fields/SelectResourcesTable/server.d.ts +2 -0
  80. package/es/components/productExtension/fields/SelectResourcesTable/server.js +49 -0
  81. package/es/components/productExtension/fields/index.d.ts +1 -0
  82. package/es/components/productExtension/fields/index.js +33 -0
  83. package/es/components/productExtension/index.d.ts +7 -0
  84. package/es/components/productExtension/index.js +78 -0
  85. package/es/components/productExtension/index.less +0 -0
  86. package/es/components/productExtension/locales.d.ts +48 -0
  87. package/es/components/productExtension/locales.js +47 -0
  88. package/es/components/productExtension/server.d.ts +1 -0
  89. package/es/components/productExtension/server.js +29 -0
  90. package/es/components/schedules/index.d.ts +1 -1
  91. package/es/components/schedules/model.d.ts +2 -1
  92. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -1
  93. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.js +21 -5
  94. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +5 -2
  95. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +20 -5
  96. package/es/components/selectModal/index.d.ts +24 -0
  97. package/es/components/selectModal/index.js +108 -0
  98. package/es/components/selectModal/index.less +0 -0
  99. package/es/components/tabProduct/card/index.d.ts +2 -2
  100. package/es/components/tabProduct/card/index.js +3 -4
  101. package/es/components/tabProduct/index.d.ts +4 -2
  102. package/es/components/tabProduct/index.js +10 -9
  103. package/es/index.d.ts +1 -0
  104. package/es/index.js +2 -1
  105. package/es/utils/index.d.ts +22 -0
  106. package/es/utils/index.js +56 -0
  107. package/lib/components/booking/addons/index.d.ts +1 -1
  108. package/lib/components/booking/addons/model.d.ts +2 -1
  109. package/lib/components/booking/components/addButton/index.d.ts +8 -8
  110. package/lib/components/booking/components/addButton/index.js +1 -1
  111. package/lib/components/booking/components/drawer/index.d.ts +1 -1
  112. package/lib/components/booking/components/footer/FooterMenus/index.js +1 -1
  113. package/lib/components/booking/components/footer/index.js +5 -3
  114. package/lib/components/booking/components/footer/utils.js +4 -2
  115. package/lib/components/booking/forms/forms.d.ts +1 -1
  116. package/lib/components/booking/forms/forms.js +1 -1
  117. package/lib/components/booking/forms/index.d.ts +1 -1
  118. package/lib/components/booking/forms/model.d.ts +2 -1
  119. package/lib/components/booking/index.d.ts +1 -1
  120. package/lib/components/booking/info/client/index.js +0 -1
  121. package/lib/components/booking/info/date/index.less +1 -1
  122. package/lib/components/booking/info/index.d.ts +1 -1
  123. package/lib/components/booking/info/index.js +27 -9
  124. package/lib/components/booking/info/model.d.ts +2 -1
  125. package/lib/components/booking/info/notes/index.d.ts +3 -0
  126. package/lib/components/booking/info/notes/index.js +111 -0
  127. package/lib/components/booking/info/pet/index.js +5 -7
  128. package/lib/components/booking/info/service/addService/index.js +65 -10
  129. package/lib/components/booking/info/service/editService/index.js +7 -5
  130. package/lib/components/booking/info/service/index.js +1 -1
  131. package/lib/components/booking/info/service/index.less +3 -0
  132. package/lib/components/booking/locales.d.ts +3 -0
  133. package/lib/components/booking/locales.js +3 -0
  134. package/lib/components/booking/model.d.ts +13 -1
  135. package/lib/components/booking/notes/index.d.ts +1 -1
  136. package/lib/components/booking/notes/model.d.ts +2 -1
  137. package/lib/components/booking/payments/index.d.ts +1 -1
  138. package/lib/components/booking/payments/model.d.ts +2 -1
  139. package/lib/components/booking/utils.js +2 -1
  140. package/lib/components/index.d.ts +2 -1
  141. package/lib/components/index.js +3 -0
  142. package/lib/components/productExtension/card/index.d.ts +10 -0
  143. package/lib/components/productExtension/card/index.js +57 -0
  144. package/lib/components/productExtension/card/index.less +34 -0
  145. package/lib/components/productExtension/fields/Actor/Container/index.d.ts +12 -0
  146. package/lib/components/productExtension/fields/Actor/Container/index.js +64 -0
  147. package/lib/components/productExtension/fields/Actor/Container/index.less +19 -0
  148. package/lib/components/productExtension/fields/Actor/CutOffTime/index.d.ts +10 -0
  149. package/lib/components/productExtension/fields/Actor/CutOffTime/index.js +128 -0
  150. package/lib/components/productExtension/fields/Actor/CutOffTime/index.less +32 -0
  151. package/lib/components/productExtension/fields/Actor/CutOffTime/status.d.ts +0 -0
  152. package/lib/components/productExtension/fields/Actor/CutOffTime/status.js +0 -0
  153. package/lib/components/productExtension/fields/Actor/index.d.ts +5 -0
  154. package/lib/components/productExtension/fields/Actor/index.js +56 -0
  155. package/lib/components/productExtension/fields/Forms/index.d.ts +10 -0
  156. package/lib/components/productExtension/fields/Forms/index.js +108 -0
  157. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +4 -0
  158. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.js +65 -0
  159. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.less +69 -0
  160. package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +4 -0
  161. package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +79 -0
  162. package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.less +62 -0
  163. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +10 -0
  164. package/lib/components/productExtension/fields/SelectProducts/index.js +126 -0
  165. package/lib/components/productExtension/fields/SelectProducts/index.less +30 -0
  166. package/lib/components/productExtension/fields/SelectProducts/mock.d.ts +0 -0
  167. package/lib/components/productExtension/fields/SelectProducts/mock.js +0 -0
  168. package/lib/components/productExtension/fields/SelectProducts/server.d.ts +1 -0
  169. package/lib/components/productExtension/fields/SelectProducts/server.js +33 -0
  170. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +4 -0
  171. package/lib/components/productExtension/fields/SelectResourcesTable/index.js +178 -0
  172. package/lib/components/productExtension/fields/SelectResourcesTable/index.less +0 -0
  173. package/lib/components/productExtension/fields/SelectResourcesTable/mock.d.ts +2681 -0
  174. package/lib/components/productExtension/fields/SelectResourcesTable/mock.js +12723 -0
  175. package/lib/components/productExtension/fields/SelectResourcesTable/server.d.ts +2 -0
  176. package/lib/components/productExtension/fields/SelectResourcesTable/server.js +39 -0
  177. package/lib/components/productExtension/fields/index.d.ts +1 -0
  178. package/lib/components/productExtension/fields/index.js +69 -0
  179. package/lib/components/productExtension/index.d.ts +7 -0
  180. package/lib/components/productExtension/index.js +109 -0
  181. package/lib/components/productExtension/index.less +0 -0
  182. package/lib/components/productExtension/locales.d.ts +48 -0
  183. package/lib/components/productExtension/locales.js +71 -0
  184. package/lib/components/productExtension/server.d.ts +1 -0
  185. package/lib/components/productExtension/server.js +33 -0
  186. package/lib/components/schedules/index.d.ts +1 -1
  187. package/lib/components/schedules/model.d.ts +2 -1
  188. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -1
  189. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.js +11 -6
  190. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +5 -2
  191. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +18 -4
  192. package/lib/components/selectModal/index.d.ts +24 -0
  193. package/lib/components/selectModal/index.js +133 -0
  194. package/lib/components/selectModal/index.less +0 -0
  195. package/lib/components/tabProduct/card/index.d.ts +2 -2
  196. package/lib/components/tabProduct/card/index.js +1 -2
  197. package/lib/components/tabProduct/index.d.ts +4 -2
  198. package/lib/components/tabProduct/index.js +7 -8
  199. package/lib/index.d.ts +1 -0
  200. package/lib/index.js +3 -0
  201. package/lib/utils/index.d.ts +22 -0
  202. package/lib/utils/index.js +59 -0
  203. package/lowcode/product-extension/meta.ts +120 -0
  204. package/package.json +3 -3
@@ -13,5 +13,5 @@ export interface InfoProps {
13
13
  setGlobalState: any;
14
14
  }
15
15
  export declare const formatProducts: (values: any) => any;
16
- declare const Addons: (props: any) => JSX.Element;
16
+ declare const Addons: (props: any) => any;
17
17
  export default Addons;
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { FormState } from "../model";
2
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
3
+ export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
3
4
  state: FormState;
4
5
  } & {
5
6
  dispatch: (params: {
@@ -7,14 +7,14 @@
7
7
  */
8
8
  import React from "react";
9
9
  import "./index.less";
10
- interface AddButtonProps {
11
- onClick: () => void;
12
- title: string;
13
- subTitle: string;
14
- showSub: boolean;
15
- style: any;
16
- disabled: boolean;
17
- loading: any;
10
+ export interface AddButtonProps {
11
+ onClick?: () => void;
12
+ title?: string;
13
+ subTitle?: string;
14
+ showSub?: boolean;
15
+ style?: React.CSSProperties;
16
+ disabled?: boolean;
17
+ loading?: boolean;
18
18
  }
19
19
  declare const AddButton: React.FC<AddButtonProps>;
20
20
  export default AddButton;
@@ -26,7 +26,7 @@ var AddButton = function AddButton(_ref) {
26
26
  if (disabled) {
27
27
  message.warning(locales.getText("pisell2.text.please-select-the-customer-first"));
28
28
  } else {
29
- onClick();
29
+ onClick === null || onClick === void 0 ? void 0 : onClick();
30
30
  }
31
31
  };
32
32
 
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { DrawerProps } from "antd";
3
3
  import "./index.less";
4
- interface PisellDrawerProps extends DrawerProps {
4
+ export interface PisellDrawerProps extends DrawerProps {
5
5
  header?: React.ReactNode;
6
6
  titleNoWrap?: boolean;
7
7
  }
@@ -7,7 +7,7 @@ var FooterMenus = function FooterMenus(_ref) {
7
7
  dispatch = _ref.dispatch;
8
8
  var items = useMemo(function () {
9
9
  var list = [];
10
- if (state.bookingId) {
10
+ if (state.bookingId && state.renderType !== 'eventBooking') {
11
11
  list.push({
12
12
  label: locales.getText("pisell2.text.rebook"),
13
13
  key: "rebook"
@@ -259,7 +259,7 @@ var Footer = function Footer(props) {
259
259
  */
260
260
  var handleSave = /*#__PURE__*/function () {
261
261
  var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref4) {
262
- var type, _setLoading, saveOtherValue, _state$onSave, callbackData, values, api;
262
+ var type, _setLoading, editApi, createApi, saveOtherValue, _state$onSave, callbackData, values, api;
263
263
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
264
264
  while (1) switch (_context4.prev = _context4.next) {
265
265
  case 0:
@@ -267,60 +267,62 @@ var Footer = function Footer(props) {
267
267
  // 区分loading, 是点击的checkout 还是save
268
268
  _setLoading = type === "checkout" ? setCheckoutLoading : setLoading;
269
269
  _setLoading(true);
270
+ editApi = state.renderType === 'eventBooking' ? state.apis.editEventBooking : state.apis.editBooking;
271
+ createApi = state.renderType === 'eventBooking' ? state.apis.createEventBooking : state.apis.createBooking;
270
272
  saveOtherValue = {};
271
273
  if (!(type === "save")) {
272
- _context4.next = 11;
274
+ _context4.next = 13;
273
275
  break;
274
276
  }
275
- _context4.next = 7;
277
+ _context4.next = 9;
276
278
  return state === null || state === void 0 ? void 0 : (_state$onSave = state.onSave) === null || _state$onSave === void 0 ? void 0 : _state$onSave.call(state, state.client);
277
- case 7:
279
+ case 9:
278
280
  _context4.t0 = _context4.sent;
279
281
  if (_context4.t0) {
280
- _context4.next = 10;
282
+ _context4.next = 12;
281
283
  break;
282
284
  }
283
285
  _context4.t0 = {};
284
- case 10:
286
+ case 12:
285
287
  saveOtherValue = _context4.t0;
286
- case 11:
287
- _context4.prev = 11;
288
+ case 13:
289
+ _context4.prev = 13;
288
290
  callbackData = null; // 格式化提交的参数
289
291
  values = formatValues(_objectSpread(_objectSpread({}, state), saveOtherValue)); // 区分是新增还是编辑
290
- api = state.bookingId ? state.apis.editBooking : state.apis.createBooking; // 如果有addons改动, 则先保存
292
+ api = state.bookingId ? editApi : createApi; // 如果有addons改动, 则先保存
291
293
  if (!addonsEdit) {
292
- _context4.next = 18;
294
+ _context4.next = 20;
293
295
  break;
294
296
  }
295
- _context4.next = 18;
297
+ _context4.next = 20;
296
298
  return handleSaveAddons();
297
- case 18:
299
+ case 20:
298
300
  if (!infoEdit) {
299
- _context4.next = 23;
301
+ _context4.next = 25;
300
302
  break;
301
303
  }
302
- _context4.next = 21;
304
+ _context4.next = 23;
303
305
  return api(values);
304
- case 21:
306
+ case 23:
305
307
  callbackData = _context4.sent;
306
308
  message.success(locales.getText(state.bookingId ? "pisell2.text.appointment-updated" : "pisell2.text.created-successfully"));
307
- case 23:
309
+ case 25:
308
310
  // 回调关闭弹窗
309
311
  state === null || state === void 0 ? void 0 : state.callback(callbackData);
310
312
  _setLoading(false);
311
313
 
312
314
  // return数据 checkout时需要
313
315
  return _context4.abrupt("return", callbackData);
314
- case 28:
315
- _context4.prev = 28;
316
- _context4.t1 = _context4["catch"](11);
316
+ case 30:
317
+ _context4.prev = 30;
318
+ _context4.t1 = _context4["catch"](13);
317
319
  console.log(_context4.t1);
318
320
  _setLoading(false);
319
- case 32:
321
+ case 34:
320
322
  case "end":
321
323
  return _context4.stop();
322
324
  }
323
- }, _callee4, null, [[11, 28]]);
325
+ }, _callee4, null, [[13, 30]]);
324
326
  }));
325
327
  return function handleSave(_x3) {
326
328
  return _ref5.apply(this, arguments);
@@ -636,12 +638,12 @@ var Footer = function Footer(props) {
636
638
  if (!state.bookingDetail) {
637
639
  return true;
638
640
  }
639
- if (!((_state$addons3 = state.addons) !== null && _state$addons3 !== void 0 && _state$addons3.load)) {
641
+ if (!((_state$addons3 = state.addons) !== null && _state$addons3 !== void 0 && _state$addons3.load) && state.renderType !== 'eventBooking') {
640
642
  return true;
641
643
  }
642
644
  }
643
645
  return false;
644
- }, [state.bookingId, state.bookingDetail, (_state$addons4 = state.addons) === null || _state$addons4 === void 0 ? void 0 : _state$addons4.load]);
646
+ }, [state.bookingId, state.bookingDetail, (_state$addons4 = state.addons) === null || _state$addons4 === void 0 ? void 0 : _state$addons4.load, state.renderType]);
645
647
  return /*#__PURE__*/React.createElement(Skeleton, {
646
648
  title: false,
647
649
  round: true,
@@ -26,13 +26,14 @@ var formatCustomer = function formatCustomer(data) {
26
26
  };
27
27
  var formatBookings = function formatBookings(data) {
28
28
  var list = data.service.value;
29
+ var eventOtherParams = data.eventOtherParams;
29
30
  var bookings = [];
30
31
  bookings = list.map(function (item) {
31
32
  var start_date = item._extend.startDate.format('YYYY-MM-DD');
32
33
  var start_time = item._extend.startDate.format("HH:mm");
33
34
  var end_date = item._extend.endDate.format('YYYY-MM-DD');
34
35
  var end_time = item._extend.endDate.format("HH:mm");
35
- return {
36
+ return _objectSpread({
36
37
  "product": {
37
38
  "num": item._extend.quantity,
38
39
  "price": item.price,
@@ -60,7 +61,7 @@ var formatBookings = function formatBookings(data) {
60
61
  "start_date": start_date,
61
62
  "duration": flexibleObj.getValue(item._extend.duration),
62
63
  "number": item._extend.number || 1
63
- };
64
+ }, eventOtherParams || {});
64
65
  });
65
66
  return bookings;
66
67
  };
@@ -86,7 +87,7 @@ var formatHolder = function formatHolder(data, values) {
86
87
  // https://menutech.w.eolink.com/home/api-studio/inside/K2bI3n465fe7244b3dbd6679d87caedfbb0636bf8c29eda/api/2778666/detail/53001549?spaceKey=menutech
87
88
  export var formatValues = function formatValues(state) {
88
89
  var values = {
89
- type: "appointment_booking",
90
+ type: state.renderType === 'eventBooking' ? "event_booking_v2" : "appointment_booking",
90
91
  platform: "shop",
91
92
  sales_channel: "my_pisel",
92
93
  bookings: [],
@@ -21,5 +21,5 @@ export interface InfoProps {
21
21
  * @Author: zhiwei.Wang
22
22
  * @Date: 2024-01-30 17:10
23
23
  */
24
- declare const Forms: (props: any) => JSX.Element;
24
+ declare const Forms: (props: any) => any;
25
25
  export default Forms;
@@ -31,7 +31,8 @@ import "./index.less";
31
31
  */
32
32
  var Forms = Provider(function (props) {
33
33
  var forms = props.forms,
34
- value = props.value,
34
+ _props$value = props.value,
35
+ value = _props$value === void 0 ? [] : _props$value,
35
36
  modalOpen = props.modalOpen,
36
37
  onChange = props.onChange,
37
38
  action = props.action,
@@ -5,5 +5,5 @@ export interface InfoProps {
5
5
  globalState: any;
6
6
  setGlobalState: any;
7
7
  }
8
- declare const Forms: (props: any) => JSX.Element;
8
+ declare const Forms: (props: any) => any;
9
9
  export default Forms;
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { FormState } from "../model";
2
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
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,2 +1,2 @@
1
- declare const Booking: (props: any) => JSX.Element;
1
+ declare const Booking: (props: any) => any;
2
2
  export default Booking;
@@ -141,7 +141,6 @@ var Info = function Info() {
141
141
  return item.name || (item.display_name || "").trim() || (item.nickname || "").trim() || "";
142
142
  }, [locales.localeMap]);
143
143
  var handleSelectClient = function handleSelectClient(value) {
144
- console.log("valuevalue", value);
145
144
  var _value = (value === null || value === void 0 ? void 0 : value[value.length - 1]) || walkInData;
146
145
  if (_value.loading) {
147
146
  return;
@@ -1,5 +1,5 @@
1
1
  .pisell-lowcode__booking-body-select-date {
2
- padding: 24px 0;
2
+ padding: 24px 0 8px;
3
3
  font-weight: 550;
4
4
 
5
5
  .pisell-lowcode-picker-input>input {
@@ -8,5 +8,5 @@ export interface InfoProps {
8
8
  slot: any;
9
9
  setState: any;
10
10
  }
11
- declare const Info: (props: any) => JSX.Element;
11
+ declare const Info: (props: any) => any;
12
12
  export default Info;
@@ -18,6 +18,7 @@ import localeTexts from "../locales";
18
18
  import { locales } from "@pisell/utils";
19
19
  import { findNextDuration, flexibleObj, formatResource, getErrorList, sliceDayIntoFiveMinutes } from "../utils";
20
20
  import { updateServiceDate } from "./date";
21
+ import Notes from "./notes";
21
22
  import "./index.less";
22
23
  var defaultModules = {
23
24
  client: 1,
@@ -28,7 +29,7 @@ var defaultModules = {
28
29
  };
29
30
  locales.init(localeTexts, localStorage.getItem("umi_locale") || "en");
30
31
  var Info = Provider(function (props) {
31
- var _modal$state2, _modal$state2$booking, _modal$state2$booking2, _modal$state2$booking3, _modal$state3;
32
+ var _modal$state2, _modal$state2$booking, _modal$state2$booking2, _modal$state2$booking3, _modal$state4, _modal$state4$notes, _modal$state5;
32
33
  // return <Payments {...props} />;
33
34
  var style = props.style,
34
35
  globalState = props.globalState,
@@ -73,12 +74,28 @@ var Info = Provider(function (props) {
73
74
  }
74
75
  });
75
76
  };
76
- return /*#__PURE__*/React.createElement(React.Fragment, null, !!modal.state.setGlobalState ? /*#__PURE__*/React.createElement(TabPane, {
77
- style: style,
78
- header: globalState !== null && globalState !== void 0 && globalState.bookingId ? /*#__PURE__*/React.createElement(Header, {
77
+ var header = useMemo(function () {
78
+ if ((globalState === null || globalState === void 0 ? void 0 : globalState.renderType) === "eventBooking") {
79
+ return locales.getText("pisell2.text.enroll");
80
+ }
81
+ return globalState !== null && globalState !== void 0 && globalState.bookingId ? /*#__PURE__*/React.createElement(Header, {
79
82
  state: modal.state,
80
83
  dispatch: modal.dispatch
81
- }) : locales.getText("pisell2.text.new-appointment"),
84
+ }) : locales.getText("pisell2.text.new-appointment");
85
+ }, [globalState === null || globalState === void 0 ? void 0 : globalState.bookingId, modal.state, modal.dispatch, globalState === null || globalState === void 0 ? void 0 : globalState.renderType]);
86
+ var notes = useMemo(function () {
87
+ var _modal$state3, _modal$state3$notes;
88
+ if (!modules.note) {
89
+ return null;
90
+ }
91
+ return globalState !== null && globalState !== void 0 && globalState.bookingId ? globalState.renderType === "eventBooking" ? /*#__PURE__*/React.createElement(Notes, null) : null : /*#__PURE__*/React.createElement(AddNote, {
92
+ value: (_modal$state3 = modal.state) === null || _modal$state3 === void 0 ? void 0 : (_modal$state3$notes = _modal$state3.notes) === null || _modal$state3$notes === void 0 ? void 0 : _modal$state3$notes.orderNote,
93
+ onChange: addNote
94
+ });
95
+ }, [modules.note, globalState === null || globalState === void 0 ? void 0 : globalState.bookingId, globalState.render, (_modal$state4 = modal.state) === null || _modal$state4 === void 0 ? void 0 : (_modal$state4$notes = _modal$state4.notes) === null || _modal$state4$notes === void 0 ? void 0 : _modal$state4$notes.orderNote]);
96
+ return /*#__PURE__*/React.createElement(React.Fragment, null, !!modal.state.setGlobalState ? /*#__PURE__*/React.createElement(TabPane, {
97
+ style: style,
98
+ header: header,
82
99
  footer: /*#__PURE__*/React.createElement(Footer, {
83
100
  state: modal.state,
84
101
  dispatch: modal.dispatch,
@@ -87,9 +104,6 @@ var Info = Provider(function (props) {
87
104
  bodyClassName: "booking-info-warp"
88
105
  }, /*#__PURE__*/React.createElement("div", {
89
106
  className: "booking-info"
90
- }, modules.client ? /*#__PURE__*/React.createElement(Client, null) : null, modules.holder && !((_modal$state3 = modal.state) !== null && _modal$state3 !== void 0 && _modal$state3.disabledEdit) ? /*#__PURE__*/React.createElement(React.Fragment, null, params.type === "form" ? /*#__PURE__*/React.createElement(Pet, null) : null) : null, modules.date ? /*#__PURE__*/React.createElement(DateCom, null) : null, modules.service ? /*#__PURE__*/React.createElement(React.Fragment, null, modal.state.date.value ? /*#__PURE__*/React.createElement(Service, null) : null) : null, modules.note ? /*#__PURE__*/React.createElement(React.Fragment, null, globalState !== null && globalState !== void 0 && globalState.bookingId ? null : /*#__PURE__*/React.createElement(AddNote, {
91
- value: modal.state.notes.orderNote,
92
- onChange: addNote
93
- })) : null, slot ? slot : null)) : null);
107
+ }, modules.client ? /*#__PURE__*/React.createElement(Client, null) : null, modules.holder && !((_modal$state5 = modal.state) !== null && _modal$state5 !== void 0 && _modal$state5.disabledEdit) ? /*#__PURE__*/React.createElement(React.Fragment, null, params.type === "form" ? /*#__PURE__*/React.createElement(Pet, null) : null) : null, modules.date ? /*#__PURE__*/React.createElement(DateCom, null) : null, modules.service ? /*#__PURE__*/React.createElement(React.Fragment, null, modal.state.date.value ? /*#__PURE__*/React.createElement(Service, null) : null) : null, notes, slot ? slot : null)) : null);
94
108
  });
95
109
  export default Info;
@@ -1,9 +1,10 @@
1
+ /// <reference types="react" />
1
2
  import { FormState } from "../model";
2
3
  export declare const walkInData: {
3
4
  id: number;
4
5
  nickname: string;
5
6
  };
6
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
7
+ export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
7
8
  state: FormState;
8
9
  } & {
9
10
  dispatch: (params: {
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const Notes: () => React.JSX.Element;
3
+ export default Notes;
@@ -0,0 +1,83 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ 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."); }
3
+ 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); }
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); }
6
+ 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; }
7
+ import React, { useContext, useMemo } from 'react';
8
+ import { Context } from "../model";
9
+ import { locales } from "@pisell/utils";
10
+ import NoteBlock from "../../notes/NoteBlock";
11
+ var Notes = function Notes() {
12
+ var _modal$state3, _modal$state3$notes, _modal$state5;
13
+ var modal = useContext(Context);
14
+ var orderNote = useMemo(function () {
15
+ var _modal$state, _modal$state$notes, _modal$state2, _modal$state2$notes;
16
+ if (!((_modal$state = modal.state) !== null && _modal$state !== void 0 && (_modal$state$notes = _modal$state.notes) !== null && _modal$state$notes !== void 0 && _modal$state$notes.orderNote)) {
17
+ return [];
18
+ }
19
+ return [{
20
+ id: 0,
21
+ content: ((_modal$state2 = modal.state) === null || _modal$state2 === void 0 ? void 0 : (_modal$state2$notes = _modal$state2.notes) === null || _modal$state2$notes === void 0 ? void 0 : _modal$state2$notes.orderNote) || ""
22
+ }];
23
+ }, [(_modal$state3 = modal.state) === null || _modal$state3 === void 0 ? void 0 : (_modal$state3$notes = _modal$state3.notes) === null || _modal$state3$notes === void 0 ? void 0 : _modal$state3$notes.orderNote]);
24
+ var noteChange = function noteChange(_ref) {
25
+ var note = _ref.note,
26
+ status = _ref.status,
27
+ noteType = _ref.noteType;
28
+ if (noteType === "internal") {
29
+ var _modal$state4;
30
+ var _list = _toConsumableArray((_modal$state4 = modal.state) === null || _modal$state4 === void 0 ? void 0 : _modal$state4.notes.internalNotes);
31
+ if (status == "add") {
32
+ _list.push(note);
33
+ }
34
+ if (status == "remove") {
35
+ _list = _list.filter(function (item) {
36
+ return item.id != note.id;
37
+ });
38
+ }
39
+ if (status == "edit") {
40
+ _list = _list.map(function (item) {
41
+ if (item.id == note.id) {
42
+ return note;
43
+ }
44
+ return item;
45
+ });
46
+ }
47
+ modal.dispatch({
48
+ type: "setNotes",
49
+ payload: {
50
+ internalNotes: _list
51
+ }
52
+ });
53
+ return;
54
+ }
55
+ if (noteType === "order") {
56
+ modal.dispatch({
57
+ type: "setNotes",
58
+ payload: {
59
+ orderNote: note.content || "",
60
+ edit: false
61
+ }
62
+ });
63
+ }
64
+ };
65
+ return /*#__PURE__*/React.createElement(NoteBlock, {
66
+ noteType: "order",
67
+ maxLength: 1,
68
+ title: "".concat(locales.getText("pisell2.text.order-notes"), ":"),
69
+ describe: "",
70
+ notes: orderNote,
71
+ apis: modal === null || modal === void 0 ? void 0 : (_modal$state5 = modal.state) === null || _modal$state5 === void 0 ? void 0 : _modal$state5.apis,
72
+ placeholder: locales.getText("pisell2.text.add-order-notes"),
73
+ isEdit: true,
74
+ onChange: function onChange(e, type, noteType) {
75
+ noteChange({
76
+ note: e,
77
+ status: type,
78
+ noteType: noteType
79
+ });
80
+ }
81
+ });
82
+ };
83
+ export default Notes;
@@ -28,7 +28,7 @@ import FormsCom from "../../forms/forms";
28
28
  import { changeFormValues } from "../../forms/format";
29
29
  import { isWalkIn } from "../../utils";
30
30
  var Pet = function Pet() {
31
- var _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$pet, _state$client$value2, _state$client8, _state$client8$value, _state$client9;
31
+ var _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$client$value2, _state$client8, _state$client8$value, _state$client9;
32
32
  var _useState = useState(false),
33
33
  _useState2 = _slicedToArray(_useState, 2),
34
34
  loading = _useState2[0],
@@ -136,7 +136,6 @@ var Pet = function Pet() {
136
136
  return _ref2.apply(this, arguments);
137
137
  };
138
138
  }();
139
- console.log("values", (_state$pet = state.pet) === null || _state$pet === void 0 ? void 0 : _state$pet.value);
140
139
 
141
140
  /**
142
141
  * @title: 获取预约主体表单
@@ -167,7 +166,7 @@ var Pet = function Pet() {
167
166
  _context2.prev = 5;
168
167
  _context2.next = 8;
169
168
  return state.apis.getForms({
170
- relation_type: "appointment_booking",
169
+ relation_type: state.renderType === 'eventBooking' ? "event_booking_v2" : "appointment_booking",
171
170
  relation_id: ((_state$bookingDetail = state.bookingDetail) === null || _state$bookingDetail === void 0 ? void 0 : (_state$bookingDetail$ = _state$bookingDetail.bookings) === null || _state$bookingDetail$ === void 0 ? void 0 : _state$bookingDetail$.id) || 0
172
171
  // _config: { useCache: true },
173
172
  });
@@ -300,11 +299,11 @@ var Pet = function Pet() {
300
299
 
301
300
  // 当客户id 发生改变时, 检测当前表单是否是该客户的, 如果不是则移除
302
301
  useEffect(function () {
303
- var _state$pet2, _state$client7, _state$client7$value, _state$pet3;
302
+ var _state$pet, _state$client7, _state$client7$value, _state$pet2;
304
303
  var changeFormValuesData = changeFormValues({
305
- values: ((_state$pet2 = state.pet) === null || _state$pet2 === void 0 ? void 0 : _state$pet2.value) || {},
304
+ values: ((_state$pet = state.pet) === null || _state$pet === void 0 ? void 0 : _state$pet.value) || {},
306
305
  clientId: (_state$client7 = state.client) === null || _state$client7 === void 0 ? void 0 : (_state$client7$value = _state$client7.value) === null || _state$client7$value === void 0 ? void 0 : _state$client7$value.id,
307
- forms: ((_state$pet3 = state.pet) === null || _state$pet3 === void 0 ? void 0 : _state$pet3.formData) || []
306
+ forms: ((_state$pet2 = state.pet) === null || _state$pet2 === void 0 ? void 0 : _state$pet2.formData) || []
308
307
  });
309
308
  dispatch({
310
309
  type: "setPet",
@@ -326,7 +325,6 @@ var Pet = function Pet() {
326
325
  getForms(true);
327
326
  }
328
327
  }, [state.bookingId, state.bookingDetail, params.form_id, params.type, (_state$client8 = state.client) === null || _state$client8 === void 0 ? void 0 : (_state$client8$value = _state$client8.value) === null || _state$client8$value === void 0 ? void 0 : _state$client8$value.id]);
329
- console.log("state.pet.formData", state.pet.formData);
330
328
  return /*#__PURE__*/React.createElement("div", {
331
329
  className: "pisell-lowcode__booking-pet-wraps"
332
330
  }, /*#__PURE__*/React.createElement(FormsCom, {