@pisell/private-materials 3.4.8 → 3.4.10

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 (78) 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/meta.js +1 -1
  5. package/build/lowcode/render/default/view.js +4 -4
  6. package/build/lowcode/view.js +4 -4
  7. package/es/components/booking/components/customSelect/index.js +1 -0
  8. package/es/components/booking/forms/single/RenderValueById.js +2 -2
  9. package/es/components/booking/hooks/useClearCart.js +11 -8
  10. package/es/components/booking/hooks/useQuotation.js +1 -1
  11. package/es/components/booking/info/client/index.js +3 -2
  12. package/es/components/booking/info/dateRange/index.d.ts +1 -0
  13. package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
  14. package/es/components/booking/info/hooks/useInfoHolder.js +16 -9
  15. package/es/components/booking/info/service/Lists.d.ts +1 -0
  16. package/es/components/booking/info/service/Lists.js +36 -26
  17. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  18. package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
  19. package/es/components/booking/info/service2/Lists.d.ts +1 -0
  20. package/es/components/booking/info/service2/utils.js +20 -21
  21. package/es/components/booking/info/utils.js +1 -1
  22. package/es/components/booking/info2/index.js +1 -0
  23. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  24. package/es/components/booking/info2/service/addService/utils.js +8 -4
  25. package/es/components/booking/info2/service/addTimeModal/index.js +3 -0
  26. package/es/components/booking/info2/service/editService/Resources/index.js +5 -0
  27. package/es/components/booking/info2/service/editService/index.js +266 -170
  28. package/es/components/booking/info2/service/index.js +19 -15
  29. package/es/components/booking/info2/utilsByBooking.js +3 -2
  30. package/es/components/booking/materiels/duration/index.js +9 -2
  31. package/es/components/booking/materiels/holder/index.d.ts +1 -0
  32. package/es/components/booking/materiels/startTime/index.d.ts +1 -0
  33. package/es/components/booking/materiels/startTime/index.js +2 -2
  34. package/es/components/booking/utils.js +3 -3
  35. package/es/components/schedules/components/CurrentDay/index.d.ts +1 -0
  36. package/es/components/schedules/products/index.d.ts +1 -0
  37. package/es/components/shoppingCart/components/Cart/Product.js +48 -41
  38. package/es/components/shoppingCart/components/Cart/index.js +21 -18
  39. package/es/components/ticketBooking/components/addServiceVariant/addService.js +249 -158
  40. package/es/components/ticketBooking/components/timeBar/index.js +78 -71
  41. package/es/components/ticketBooking/utils/index.d.ts +2 -0
  42. package/es/components/ticketBooking/utils/index.js +18 -1
  43. package/lib/components/booking/components/customSelect/index.js +1 -0
  44. package/lib/components/booking/forms/single/RenderValueById.js +6 -6
  45. package/lib/components/booking/hooks/useClearCart.js +16 -13
  46. package/lib/components/booking/hooks/useQuotation.js +1 -1
  47. package/lib/components/booking/info/client/index.js +5 -4
  48. package/lib/components/booking/info/dateRange/index.d.ts +1 -0
  49. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
  50. package/lib/components/booking/info/hooks/useInfoHolder.js +10 -9
  51. package/lib/components/booking/info/service/Lists.d.ts +1 -0
  52. package/lib/components/booking/info/service/Lists.js +35 -23
  53. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  54. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
  55. package/lib/components/booking/info/service2/Lists.d.ts +1 -0
  56. package/lib/components/booking/info/service2/utils.js +17 -17
  57. package/lib/components/booking/info/utils.js +2 -1
  58. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  59. package/lib/components/booking/info2/service/addService/utils.js +7 -5
  60. package/lib/components/booking/info2/service/addTimeModal/index.js +3 -0
  61. package/lib/components/booking/info2/service/editService/Resources/index.js +2 -0
  62. package/lib/components/booking/info2/service/editService/index.js +139 -74
  63. package/lib/components/booking/info2/service/index.js +13 -9
  64. package/lib/components/booking/info2/utilsByBooking.js +4 -4
  65. package/lib/components/booking/materiels/duration/index.js +7 -2
  66. package/lib/components/booking/materiels/holder/index.d.ts +1 -0
  67. package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
  68. package/lib/components/booking/materiels/startTime/index.js +1 -1
  69. package/lib/components/booking/utils.js +3 -3
  70. package/lib/components/schedules/components/CurrentDay/index.d.ts +1 -0
  71. package/lib/components/schedules/products/index.d.ts +1 -0
  72. package/lib/components/shoppingCart/components/Cart/Product.js +31 -21
  73. package/lib/components/shoppingCart/components/Cart/index.js +18 -15
  74. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +196 -127
  75. package/lib/components/ticketBooking/components/timeBar/index.js +95 -88
  76. package/lib/components/ticketBooking/utils/index.d.ts +2 -0
  77. package/lib/components/ticketBooking/utils/index.js +22 -0
  78. package/package.json +4 -4
@@ -74,6 +74,7 @@ var CustomSelect = function CustomSelect(props, ref) {
74
74
  showDropDown = _props$showDropDown === void 0 ? true : _props$showDropDown,
75
75
  propsHandleOpenModal = props.handleOpenModal,
76
76
  handleDayChange = props.handleDayChange;
77
+ console.log('custom select');
77
78
  var searchRef = useRef();
78
79
 
79
80
  // 当前选择的值
@@ -5,14 +5,14 @@ import { useRequest } from "ahooks";
5
5
  import useEngineContext from "../../../../hooks/useEngineContext";
6
6
  import { getFormData } from "../serve";
7
7
  var RenderValueById = function RenderValueById(props) {
8
- var _field$setting, _field$setting6;
8
+ var _field$setting, _ref, _ref$toString, _field$setting6;
9
9
  var field = props.field,
10
10
  propsValue = props.value;
11
11
  var _useEngineContext = useEngineContext(),
12
12
  appHelper = _useEngineContext.appHelper;
13
13
  var _getFormData = useRequest(getFormData, {
14
14
  manual: true,
15
- cacheKey: "formOption-".concat((_field$setting = field.setting) === null || _field$setting === void 0 ? void 0 : _field$setting.linkedTable),
15
+ cacheKey: "formOption-".concat((_field$setting = field.setting) === null || _field$setting === void 0 ? void 0 : _field$setting.linkedTable, "-").concat((_ref = propsValue || []) === null || _ref === void 0 || (_ref$toString = _ref.toString) === null || _ref$toString === void 0 ? void 0 : _ref$toString.call(_ref)),
16
16
  staleTime: 500,
17
17
  cacheTime: 5000
18
18
  });
@@ -2,12 +2,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2
2
  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; }
3
3
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
4
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
- import React from 'react';
5
+ import React, { useMemo } from 'react';
6
6
  import classNames from 'classnames';
7
7
  import { Iconfont } from '@pisell/materials';
8
8
  import { locales } from "@pisell/utils";
9
9
  var useClearCart = function useClearCart(state, dispatch) {
10
- var _state$service, _state$service2;
10
+ var _state$service3;
11
11
  var handleClear = function handleClear() {
12
12
  // 清除购物车
13
13
  dispatch({
@@ -17,11 +17,14 @@ var useClearCart = function useClearCart(state, dispatch) {
17
17
  }
18
18
  });
19
19
  };
20
- return !!((_state$service = state.service) !== null && _state$service !== void 0 && (_state$service = _state$service.value) !== null && _state$service !== void 0 && _state$service.length) && !state.channelDisabledEdit && /*#__PURE__*/React.createElement("span", {
21
- className: classNames('pisell-lowcode__booking-service-clear-btn', _defineProperty({}, 'pisell-lowcode__booking-service-clear-btn-disabled', !((_state$service2 = state.service) !== null && _state$service2 !== void 0 && (_state$service2 = _state$service2.value) !== null && _state$service2 !== void 0 && _state$service2.length))),
22
- onClick: handleClear
23
- }, /*#__PURE__*/React.createElement(Iconfont, {
24
- type: "pisell2-trash-01"
25
- }), " ", /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.booking.info.text.clear-cart')));
20
+ return useMemo(function () {
21
+ var _state$service, _state$service2;
22
+ return !!((_state$service = state.service) !== null && _state$service !== void 0 && (_state$service = _state$service.value) !== null && _state$service !== void 0 && _state$service.length) && !state.channelDisabledEdit && /*#__PURE__*/React.createElement("span", {
23
+ className: classNames('pisell-lowcode__booking-service-clear-btn', _defineProperty({}, 'pisell-lowcode__booking-service-clear-btn-disabled', !((_state$service2 = state.service) !== null && _state$service2 !== void 0 && (_state$service2 = _state$service2.value) !== null && _state$service2 !== void 0 && _state$service2.length))),
24
+ onClick: handleClear
25
+ }, /*#__PURE__*/React.createElement(Iconfont, {
26
+ type: "pisell2-trash-01"
27
+ }), " ", /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.booking.info.text.clear-cart')));
28
+ }, [(_state$service3 = state.service) === null || _state$service3 === void 0 || (_state$service3 = _state$service3.value) === null || _state$service3 === void 0 ? void 0 : _state$service3.length, state.channelDisabledEdit]);
26
29
  };
27
30
  export default useClearCart;
@@ -15,7 +15,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
15
15
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
16
16
  import React, { useEffect, useMemo, useRef, useState } from 'react';
17
17
  import { getProductTotalPrice } from "../utils";
18
- import useEngineContext from "../../../../es/hooks/useEngineContext";
18
+ import useEngineContext from "../../../hooks/useEngineContext";
19
19
  import { locales } from "@pisell/utils";
20
20
  import { PisellModal } from "@pisell/materials";
21
21
  import { getProductPrice } from "../info/service/serve";
@@ -36,7 +36,7 @@ import { getWaiverTitle } from "../clientVariant/utils";
36
36
  import useGetHolderList from "../hooks/useGetHolderList";
37
37
  var isLoadClient = false;
38
38
  var Client = function Client() {
39
- var _state$client$value2, _state$client$value3, _state$client$value4, _state$client$value5, _state$client$value6, _state$client$value7, _state$client$value8, _state$client$value9, _state$client$value10, _state$client$value11;
39
+ var _state$client$value2, _state$client4, _state$client$value3, _state$client$value4, _state$client$value5, _state$client$value6, _state$client$value7, _state$client$value8, _state$client$value9, _state$client$value10, _state$client$value11;
40
40
  var modalRef = useRef();
41
41
  var _useState = useState(false),
42
42
  _useState2 = _slicedToArray(_useState, 2),
@@ -397,6 +397,7 @@ var Client = function Client() {
397
397
  }, locales.getText('pisell2.text.load-more'))) : null;
398
398
  }, [loadLoading, params, state.client.clients.length]);
399
399
  var customSelect = useMemo(function () {
400
+ console.log('render customSelect');
400
401
  return /*#__PURE__*/React.createElement(CustomSelect, {
401
402
  autoFocus: !state.isTerminal,
402
403
  modalOpen: state.modalOpen,
@@ -459,7 +460,7 @@ var Client = function Client() {
459
460
  return true;
460
461
  }
461
462
  });
462
- }, [state, renderList, loading, franchiseeLoading, params.search, loadMore]);
463
+ }, [state.isTerminal, state.modalOpen, (_state$client4 = state.client) === null || _state$client4 === void 0 ? void 0 : _state$client4.value, state.drawerMask, renderList, loading, franchiseeLoading, params.search, loadMore]);
463
464
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
464
465
  className: "pisell-lowcode__booking-client",
465
466
  onClick: function onClick() {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  export declare const disabledDate: (current: any, position: any, currentDate: any) => any;
3
4
  declare const DateRange: ({ state, dispatch, key }: any) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { EditServiceRef } from "../service/editService";
2
3
  declare const useInfoHolder: (state: any, dispatch: any) => {
3
4
  detailRef: import("react").MutableRefObject<EditServiceRef | undefined>;
@@ -4,6 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  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
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ import { useMemoizedFn } from "ahooks";
7
8
  import { useEffect, useMemo, useRef } from "react";
8
9
  import useHolderConfig from "./useHolderConfig";
9
10
  import { isOpenAddTime } from "../utils";
@@ -29,21 +30,27 @@ var useInfoHolder = function useInfoHolder(state, dispatch) {
29
30
  };
30
31
  }, [state === null || state === void 0 || (_state$bookingConfig2 = state.bookingConfig) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.config) === null || _state$bookingConfig2 === void 0 ? void 0 : _state$bookingConfig2.information_tab]);
31
32
  var showAddTimeModal = useMemo(function () {
32
- return isOpenAddTime(state);
33
+ return isOpenAddTime(state) && !state.isBookingTicket2;
33
34
  }, [state, appointment_card.quick_time]);
34
- var handleEdit = function handleEdit(cacheItem, type) {
35
- setTimeout(function () {
36
- var _detailRef$current, _detailRef$current$in;
37
- (_detailRef$current = detailRef.current) === null || _detailRef$current === void 0 || (_detailRef$current$in = _detailRef$current.init) === null || _detailRef$current$in === void 0 || _detailRef$current$in.call(_detailRef$current, cacheItem, false, type === 'edit_product');
38
- }, 100);
39
- };
35
+ var handleEdit = useMemoizedFn(function (cacheItem, type) {
36
+ var _detailRef$current, _detailRef$current$in;
37
+ // console.timeEnd('handleChange');
38
+ console.time('handleEdit');
39
+ console.log(performance.now() - window.pp1, '打开商品4');
40
+ (_detailRef$current = detailRef.current) === null || _detailRef$current === void 0 || (_detailRef$current$in = _detailRef$current.init) === null || _detailRef$current$in === void 0 || _detailRef$current$in.call(_detailRef$current, cacheItem, false, type === 'edit_product');
41
+ // setTimeout(() => {
42
+ // console.log(performance.now() - window.pp1, '打开商品5');
43
+ // console.timeEnd('handleEdit')
44
+ // detailRef.current?.init?.(cacheItem, false, type === 'edit_product');
45
+ // }, );
46
+ });
40
47
  var dispatchService = function dispatchService(type, payload) {
41
48
  dispatch({
42
49
  type: type,
43
50
  payload: _objectSpread({}, payload)
44
51
  });
45
52
  };
46
- var handleAction = function handleAction(dataSource) {
53
+ var handleAction = useMemoizedFn(function (dataSource) {
47
54
  var cacheItem = getProductExtend({
48
55
  cacheItem: _objectSpread(_objectSpread({}, dataSource._origin), {}, {
49
56
  new: 0
@@ -57,7 +64,7 @@ var useInfoHolder = function useInfoHolder(state, dispatch) {
57
64
  cacheItem: cacheItem
58
65
  }
59
66
  });
60
- };
67
+ });
61
68
  return {
62
69
  detailRef: detailRef,
63
70
  handleEdit: handleEdit,
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const Lists: ({ onEdit, onChange, onAction, isParallelResource }: any) => JSX.Element;
2
3
  export default Lists;
@@ -14,7 +14,7 @@ import { useMemoizedFn } from 'ahooks';
14
14
  import { getProductExtend } from "../../info2/service/addService/utils";
15
15
  import useAddHolder from "../hooks/useAddHolder";
16
16
  var Lists = function Lists(_ref) {
17
- var _state$service;
17
+ var _state$service2;
18
18
  var onEdit = _ref.onEdit,
19
19
  onChange = _ref.onChange,
20
20
  onAction = _ref.onAction,
@@ -36,6 +36,8 @@ var Lists = function Lists(_ref) {
36
36
  * @Date: 2024-11-29 16:35
37
37
  */
38
38
  var handleChange = useMemoizedFn(function (currentItem, type, other) {
39
+ console.time('handleChange');
40
+ console.log(window.pp1 = performance.now(), '打开商品');
39
41
  if (state.disabledEdit || state.disableEventBookingEdit) {
40
42
  return;
41
43
  }
@@ -59,9 +61,7 @@ var Lists = function Lists(_ref) {
59
61
  editModal: true,
60
62
  cacheItem: cacheItem
61
63
  });
62
- return onEdit === null || onEdit === void 0 ? void 0 : onEdit(_objectSpread(_objectSpread({}, product), {}, {
63
- new: 0
64
- }), type);
64
+ return onEdit === null || onEdit === void 0 ? void 0 : onEdit(cacheItem, type);
65
65
  }
66
66
  var params = {
67
67
  editModal: false,
@@ -95,27 +95,37 @@ var Lists = function Lists(_ref) {
95
95
  isShowEditProduct: !state.isBookingCreatePage
96
96
  };
97
97
  }, [state === null || state === void 0 ? void 0 : state.bookingId, state === null || state === void 0 ? void 0 : state.disabledEdit, isShowChangeHolder, state.isBookingCreatePage]);
98
- return /*#__PURE__*/React.createElement(CartContext.Provider, {
99
- value: {
100
- state: state
101
- }
102
- }, /*#__PURE__*/React.createElement(ShoppingCart, {
103
- isParallelResource: isParallelResource,
104
- onAction: onAction,
105
- onChange: handleChange,
106
- isOpenGroup: false,
107
- isHideClearCart: true,
108
- onAddProduct: function onAddProduct() {
109
- return onChange({
110
- addModal: true
111
- });
112
- }
113
- // onActiveKey={handleActiveKey}
114
- // collapseParams={CollapseParams}
115
- ,
116
- productParams: _objectSpread(_objectSpread({}, productParams), {}, {
117
- products: formatProducts((state === null || state === void 0 || (_state$service = state.service) === null || _state$service === void 0 ? void 0 : _state$service.value) || [], state, false, true, isParallelResource)
118
- })
119
- }));
98
+ var products = useMemo(function () {
99
+ var _state$service;
100
+ console.time('products');
101
+ var p = formatProducts((state === null || state === void 0 || (_state$service = state.service) === null || _state$service === void 0 ? void 0 : _state$service.value) || [], state, false, true, isParallelResource);
102
+ console.timeEnd('products');
103
+ return p;
104
+ }, [state === null || state === void 0 || (_state$service2 = state.service) === null || _state$service2 === void 0 ? void 0 : _state$service2.value, state]);
105
+ return useMemo(function () {
106
+ console.log('render List');
107
+ return /*#__PURE__*/React.createElement(CartContext.Provider, {
108
+ value: {
109
+ state: state
110
+ }
111
+ }, /*#__PURE__*/React.createElement(ShoppingCart, {
112
+ isParallelResource: isParallelResource,
113
+ onAction: onAction,
114
+ onChange: handleChange,
115
+ isOpenGroup: false,
116
+ isHideClearCart: true,
117
+ onAddProduct: function onAddProduct() {
118
+ return onChange({
119
+ addModal: true
120
+ });
121
+ }
122
+ // onActiveKey={handleActiveKey}
123
+ // collapseParams={CollapseParams}
124
+ ,
125
+ productParams: _objectSpread(_objectSpread({}, productParams), {}, {
126
+ products: products
127
+ })
128
+ }));
129
+ }, [products, state, productParams]);
120
130
  };
121
131
  export default Lists;
@@ -6,7 +6,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
6
6
  type: string;
7
7
  value: number;
8
8
  };
9
- locale: string;
9
+ locale: any;
10
10
  slice: any;
11
11
  selectProps: {
12
12
  size: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const BookingList: ({ items }: {
2
3
  items: any[];
3
4
  }) => JSX.Element;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const Lists: ({ onEdit, onChange }: any) => JSX.Element;
2
3
  export default Lists;
@@ -691,29 +691,28 @@ export var formatProducts = function formatProducts(lists, state) {
691
691
  _origin: item
692
692
  });
693
693
  };
694
-
695
- // 将商品分为组商品和非组商品
696
- lists.forEach(function (item) {
697
- var _item$_extend28;
698
- if (!(item !== null && item !== void 0 && (_item$_extend28 = item._extend) !== null && _item$_extend28 !== void 0 && _item$_extend28.groupId)) {
699
- normalList.push(formItem(item));
700
- } else {
701
- groupList.push(item);
702
- }
703
- });
704
-
705
- // 根据item._extend.groupId 进行分组
706
- var groups = groupList.reduce(function (prev, item) {
707
- var _item$_extend29;
708
- var groupId = item === null || item === void 0 || (_item$_extend29 = item._extend) === null || _item$_extend29 === void 0 ? void 0 : _item$_extend29.groupId;
709
- if (!prev[groupId]) {
710
- prev[groupId] = [];
711
- }
712
- prev[groupId].push(item);
713
- return prev;
714
- }, {});
715
694
  console.log(normalList, 'normalList');
716
695
  if (isRenderGroup) {
696
+ // 将商品分为组商品和非组商品
697
+ lists.forEach(function (item) {
698
+ var _item$_extend28;
699
+ if (!(item !== null && item !== void 0 && (_item$_extend28 = item._extend) !== null && _item$_extend28 !== void 0 && _item$_extend28.groupId)) {
700
+ normalList.push(formItem(item));
701
+ } else {
702
+ groupList.push(item);
703
+ }
704
+ });
705
+
706
+ // 根据item._extend.groupId 进行分组
707
+ var groups = groupList.reduce(function (prev, item) {
708
+ var _item$_extend29;
709
+ var groupId = item === null || item === void 0 || (_item$_extend29 = item._extend) === null || _item$_extend29 === void 0 ? void 0 : _item$_extend29.groupId;
710
+ if (!prev[groupId]) {
711
+ prev[groupId] = [];
712
+ }
713
+ prev[groupId].push(item);
714
+ return prev;
715
+ }, {});
717
716
  return Object.values(groups).map(function (d) {
718
717
  return formItem(concatBookings(d));
719
718
  }).concat(normalList);
@@ -95,7 +95,7 @@ export var isBooking4Shop = function isBooking4Shop(shopId, renderType, business
95
95
  if (renderType === 'eventBooking') {
96
96
  return false;
97
97
  }
98
- var booking4Shops = [8390, 1350, 1401, 3013, 7154, 7572, 7007, 8119, 7320, 7362, 6497, 6087, 6303, 6726, 8191, 6812, 6813, 6814, 7651, 8586, 8581, 9, 2155, 8030, 1749, 8194, 2327, 8609, 8610, 8782, 1285, 6124, 8727, 5538, 6988, 8872, 6930, 8824, 8913, 8918, 6413];
98
+ var booking4Shops = [8390, 1350, 1401, 3013, 7154, 7572, 7007, 8119, 7320, 7362, 6497, 6087, 6303, 6726, 8191, 6812, 6813, 6814, 7651, 8586, 8581, 9, 2155, 8030, 1749, 8194, 2327, 8609, 8610, 8782, 1285, 6124, 8727, 5538, 6988, 8872, 6930, 8824, 8913, 8918, 6413, 8943];
99
99
 
100
100
  // 固定的shopId 或者安装 Resource Kit 应用,则认为是booking4Shop
101
101
  return booking4Shops.includes(shopId) || (businessUtils === null || businessUtils === void 0 ? void 0 : businessUtils.getAppByModal('resourcekit'));
@@ -79,6 +79,7 @@ var Info = Provider(function (props) {
79
79
  }, []);
80
80
  useMemo(function () {
81
81
  var _context$appHelper, _context$appHelper$ge, _context$appHelper2, _context$appHelper2$i, _context$appHelper3;
82
+ // TODO: 优化 内部每次设置state会触发两次渲染
82
83
  var isFranchisee = context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.businessUtils) === null || _context$appHelper === void 0 || (_context$appHelper$ge = _context$appHelper.getAppByModal) === null || _context$appHelper$ge === void 0 ? void 0 : _context$appHelper$ge.call(_context$appHelper, 'franchisee');
83
84
  modal.dispatch({
84
85
  type: 'setState',
@@ -7,7 +7,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
7
7
  type: string;
8
8
  value: number;
9
9
  };
10
- locale: string;
10
+ locale: any;
11
11
  slice: any;
12
12
  selectProps: {
13
13
  size: string;
@@ -128,7 +128,8 @@ export var getTimeObj = function getTimeObj(_ref4) {
128
128
  cacheItem: cacheItem,
129
129
  useStartTime: useStartTime,
130
130
  currentResource: currentResource,
131
- state: state,
131
+ // 没有使用该参数
132
+ // state,
132
133
  durationProps: durationProps
133
134
  });
134
135
  var obj = sliceDayIntoFiveMinutes((_state$bookingConfig2 = state.bookingConfig) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.config) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.basic) === null || _state$bookingConfig2 === void 0 ? void 0 : _state$bookingConfig2.service_time, locales.locale);
@@ -286,7 +287,9 @@ export var setDefaultResource = function setDefaultResource(_ref6) {
286
287
  defaultOriginalResource = renderList;
287
288
  }
288
289
  var defaultResource = defaultOriginalResource.map(function (d) {
289
- return _objectSpread(_objectSpread({}, d), {}, {
290
+ return {
291
+ // ...d,
292
+ children: d.children,
290
293
  relation_type: d.relation_type,
291
294
  form_id: item.form_id,
292
295
  relation_id: d.id,
@@ -297,7 +300,7 @@ export var setDefaultResource = function setDefaultResource(_ref6) {
297
300
  form_name: item.title,
298
301
  resource_name: d.main_field
299
302
  }
300
- });
303
+ };
301
304
  });
302
305
  obj[item.form_id] = defaultResource;
303
306
  };
@@ -581,7 +584,8 @@ export var getProductExtend = function getProductExtend(_ref11) {
581
584
  state: state
582
585
  });
583
586
  if (getDuration(_cacheItem === null || _cacheItem === void 0 ? void 0 : _cacheItem.duration) === 'flexible') {
584
- _cacheItem._extend.duration = _cacheItem._data.timeObj.durationSlicesBasedOnTime[0].value;
587
+ var _cacheItem$_data$time;
588
+ _cacheItem._extend.duration = (_cacheItem$_data$time = _cacheItem._data.timeObj) === null || _cacheItem$_data$time === void 0 || (_cacheItem$_data$time = _cacheItem$_data$time.durationSlicesBasedOnTime) === null || _cacheItem$_data$time === void 0 || (_cacheItem$_data$time = _cacheItem$_data$time[0]) === null || _cacheItem$_data$time === void 0 ? void 0 : _cacheItem$_data$time.value;
585
589
 
586
590
  // 计算服务的开始和结束时间
587
591
  var _getServiceTimes = getServiceTimes({
@@ -70,6 +70,7 @@ var AddTimeModal = function AddTimeModal() {
70
70
  _useState10 = _slicedToArray(_useState9, 2),
71
71
  renderList = _useState10[0],
72
72
  setRenderList = _useState10[1];
73
+ console.log(renderList, 'renderListrenderList');
73
74
  var context = useEngineContext();
74
75
  var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
75
76
  interaction = _context$appHelper$ut.interaction;
@@ -148,6 +149,7 @@ var AddTimeModal = function AddTimeModal() {
148
149
  }
149
150
  return arr.filter(Boolean);
150
151
  }, [(_state$service = state.service) === null || _state$service === void 0 || (_state$service = _state$service.cacheItem) === null || _state$service === void 0 || (_state$service = _state$service._extend) === null || _state$service === void 0 ? void 0 : _state$service.resource]);
152
+ console.log(currentResource, 'currentResource');
151
153
  var getTimeUsableStatus = function getTimeUsableStatus(time) {
152
154
  var _state$service$cacheI3;
153
155
  if (!((_state$service$cacheI3 = state.service.cacheItem) !== null && _state$service$cacheI3 !== void 0 && _state$service$cacheI3._extend) || !currentResource.length) {
@@ -270,6 +272,7 @@ var AddTimeModal = function AddTimeModal() {
270
272
  case 3:
271
273
  newList = _context2.sent;
272
274
  list = newList.map(function (d) {
275
+ debugger;
273
276
  // 是否可用
274
277
  var isUsable = isUsableProduct(d.add_time, state.service.cacheItem);
275
278
  return _objectSpread(_objectSpread({}, d), {}, {
@@ -189,9 +189,14 @@ var Resources = function Resources(_ref, ref) {
189
189
  var getIsAutoAllocation = function getIsAutoAllocation(id) {
190
190
  return getAutoAllocationStorage(id);
191
191
  };
192
+ console.log('resourcesss');
193
+
194
+ /* todo: 此处value变化渲染三次 */
195
+
192
196
  return /*#__PURE__*/React.createElement(React.Fragment, null, data.map(function (item) {
193
197
  var _cur$2;
194
198
  var cur = _value[item.form_id];
199
+ console.log(cur, 'curcur');
195
200
  var errors = (cur || []).reduce(function (pre, d) {
196
201
  return pre.concat((d === null || d === void 0 ? void 0 : d.errors) || []);
197
202
  }, []);