@pisell/private-materials 6.2.19 → 6.2.21

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 (228) 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/businessModel/SalesModel/index.d.ts +0 -1
  10. package/es/components/appointmentBooking/components/Content/index.js +19 -12
  11. package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  12. package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  13. package/es/components/appointmentBooking/components/TimeSlicing/index.js +7 -3
  14. package/es/components/booking/components/TabProduct/index.d.ts +0 -1
  15. package/es/components/booking/components/TabProduct/tabs/index.js +1 -5
  16. package/es/components/booking/components/browserSelect/index.js +1 -1
  17. package/es/components/booking/components/customSelect/index.js +0 -1
  18. package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
  19. package/es/components/booking/editBookingModal/index.js +58 -29
  20. package/es/components/booking/editBookingModal/serve.d.ts +1 -0
  21. package/es/components/booking/editBookingModal/serve.js +19 -11
  22. package/es/components/booking/forms/model.js +5 -5
  23. package/es/components/booking/forms/table/index.d.ts +0 -1
  24. package/es/components/booking/hooks/useClearCart.js +8 -11
  25. package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
  26. package/es/components/booking/info/client/index.js +2 -3
  27. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  28. package/es/components/booking/info/dateRange/index.d.ts +0 -1
  29. package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  30. package/es/components/booking/info/hooks/useInfoHolder.js +9 -16
  31. package/es/components/booking/info/index.d.ts +0 -1
  32. package/es/components/booking/info/service/Lists.js +26 -36
  33. package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
  34. package/es/components/booking/info/service/like/index.d.ts +0 -1
  35. package/es/components/booking/info/service/like/index.js +1 -1
  36. package/es/components/booking/info/service2/Lists.d.ts +0 -1
  37. package/es/components/booking/info/service2/utils.js +21 -20
  38. package/es/components/booking/info2/index.js +0 -1
  39. package/es/components/booking/info2/service/addService/utils.js +4 -7
  40. package/es/components/booking/info2/service/addTimeModal/index.js +0 -3
  41. package/es/components/booking/info2/service/editService/Resources/index.js +0 -5
  42. package/es/components/booking/info2/service/editService/ResourcesV2/index.js +1 -1
  43. package/es/components/booking/info2/service/editService/index.js +165 -258
  44. package/es/components/booking/info2/service/index.js +15 -19
  45. package/es/components/booking/materiels/duration/index.js +2 -9
  46. package/es/components/booking/materiels/holder/index.d.ts +0 -1
  47. package/es/components/booking/materiels/startTime/index.d.ts +0 -1
  48. package/es/components/booking/materiels/startTime/index.js +1 -1
  49. package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
  50. package/es/components/booking/notes/NoteBlock/index.js +11 -11
  51. package/es/components/booking/notes/model.js +5 -5
  52. package/es/components/booking/payments/model.js +5 -5
  53. package/es/components/eftpos/deviceList/index.d.ts +0 -1
  54. package/es/components/eftpos/form/index.d.ts +0 -1
  55. package/es/components/eftpos/group/index.d.ts +0 -1
  56. package/es/components/eftpos/hooks.d.ts +0 -1
  57. package/es/components/eftpos/icon/apiKey.d.ts +0 -1
  58. package/es/components/eftpos/icon/device.d.ts +0 -1
  59. package/es/components/eftpos/receipt/index.d.ts +0 -1
  60. package/es/components/eftpos/surcharge/index.d.ts +0 -1
  61. package/es/components/eftposPay/app.d.ts +0 -1
  62. package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
  63. package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
  64. package/es/components/eftposPay/component/step/index.d.ts +0 -1
  65. package/es/components/eftposPay/component/step/step.d.ts +0 -1
  66. package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
  67. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  68. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
  69. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  70. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  71. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  72. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  73. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  74. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  75. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  76. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  77. package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
  78. package/es/components/listComponent/index.js +5 -5
  79. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  80. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
  81. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  82. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
  83. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
  84. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  85. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
  86. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  87. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
  88. package/es/components/productExtension/card/index.js +3 -3
  89. package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
  90. package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
  91. package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
  92. package/es/components/productExtension/fields/Forms/index.js +12 -12
  93. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
  94. package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
  95. package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
  96. package/es/components/productExtension/server.js +2 -2
  97. package/es/components/ruleSetting/ruleBorder/index.js +1 -1
  98. package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
  99. package/es/components/schedules/calendar/index.js +4 -4
  100. package/es/components/schedules/calendar/serve.js +2 -2
  101. package/es/components/schedules/components/CurrentDay/index.d.ts +0 -1
  102. package/es/components/schedules/components/CurrentDay/index.js +5 -5
  103. package/es/components/schedules/components/CurrentDay/serve.js +2 -2
  104. package/es/components/schedules/components/DropdownSort/index.js +1 -1
  105. package/es/components/schedules/components/ResourceList/index.js +1 -1
  106. package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
  107. package/es/components/schedules/components/Search/index.js +5 -5
  108. package/es/components/schedules/model.js +5 -5
  109. package/es/components/schedules/openHours/index.js +1 -1
  110. package/es/components/schedules/openHours/serve.js +2 -2
  111. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
  112. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
  113. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
  114. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
  115. package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
  116. package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
  117. package/es/components/schedules/products/index.d.ts +0 -1
  118. package/es/components/schedules/products/serve.js +2 -2
  119. package/es/components/schedules/products/utils.js +5 -5
  120. package/es/components/schedules/resources/detail/detailContent.js +2 -2
  121. package/es/components/schedules/resources/detail/index.js +10 -10
  122. package/es/components/schedules/resources/list/index.js +2 -2
  123. package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
  124. package/es/components/schedules/resources/relationProduct/index.js +1 -1
  125. package/es/components/schedules/resources/serve.js +2 -2
  126. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
  127. package/es/components/schedules/utils.js +4 -4
  128. package/es/components/selectModal/index.js +2 -2
  129. package/es/components/shoppingCart/components/Cart/Product.d.ts +0 -1
  130. package/es/components/shoppingCart/components/Cart/Product.js +41 -48
  131. package/es/components/shoppingCart/components/Cart/index.js +18 -21
  132. package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
  133. package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
  134. package/es/components/ticketBooking/components/addServiceVariant/addService.js +157 -177
  135. package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
  136. package/es/components/ticketBooking/components/timeBar/index.js +71 -78
  137. package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
  138. package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
  139. package/es/hooks/useComponents.js +1 -1
  140. package/lib/businessModel/SalesModel/index.d.ts +0 -1
  141. package/lib/components/appointmentBooking/components/Content/index.js +7 -2
  142. package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  143. package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  144. package/lib/components/appointmentBooking/components/TimeSlicing/index.js +7 -3
  145. package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
  146. package/lib/components/booking/components/customSelect/index.js +0 -1
  147. package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
  148. package/lib/components/booking/editBookingModal/index.js +56 -21
  149. package/lib/components/booking/editBookingModal/serve.d.ts +1 -0
  150. package/lib/components/booking/editBookingModal/serve.js +12 -6
  151. package/lib/components/booking/forms/table/index.d.ts +0 -1
  152. package/lib/components/booking/hooks/useClearCart.js +13 -16
  153. package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
  154. package/lib/components/booking/info/client/index.js +4 -5
  155. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  156. package/lib/components/booking/info/dateRange/index.d.ts +0 -1
  157. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  158. package/lib/components/booking/info/hooks/useInfoHolder.js +9 -10
  159. package/lib/components/booking/info/index.d.ts +0 -1
  160. package/lib/components/booking/info/service/Lists.js +23 -35
  161. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
  162. package/lib/components/booking/info/service/like/index.d.ts +0 -1
  163. package/lib/components/booking/info/service2/Lists.d.ts +0 -1
  164. package/lib/components/booking/info/service2/utils.js +17 -17
  165. package/lib/components/booking/info2/service/addService/utils.js +3 -5
  166. package/lib/components/booking/info2/service/addTimeModal/index.js +0 -3
  167. package/lib/components/booking/info2/service/editService/Resources/index.js +0 -2
  168. package/lib/components/booking/info2/service/editService/ResourcesV2/index.js +1 -1
  169. package/lib/components/booking/info2/service/editService/index.js +70 -132
  170. package/lib/components/booking/info2/service/index.js +9 -13
  171. package/lib/components/booking/materiels/duration/index.js +2 -7
  172. package/lib/components/booking/materiels/holder/index.d.ts +0 -1
  173. package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
  174. package/lib/components/eftpos/deviceList/index.d.ts +0 -1
  175. package/lib/components/eftpos/form/index.d.ts +0 -1
  176. package/lib/components/eftpos/group/index.d.ts +0 -1
  177. package/lib/components/eftpos/hooks.d.ts +0 -1
  178. package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
  179. package/lib/components/eftpos/icon/device.d.ts +0 -1
  180. package/lib/components/eftpos/receipt/index.d.ts +0 -1
  181. package/lib/components/eftpos/surcharge/index.d.ts +0 -1
  182. package/lib/components/eftposPay/app.d.ts +0 -1
  183. package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
  184. package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
  185. package/lib/components/eftposPay/component/step/index.d.ts +0 -1
  186. package/lib/components/eftposPay/component/step/step.d.ts +0 -1
  187. package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
  188. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  189. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
  190. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  191. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  192. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  193. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  194. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  195. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  196. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  197. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  198. package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
  199. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  200. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
  201. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  202. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
  203. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
  204. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  205. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
  206. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  207. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
  208. package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
  209. package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
  210. package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
  211. package/lib/components/schedules/components/CurrentDay/index.d.ts +0 -1
  212. package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
  213. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
  214. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
  215. package/lib/components/schedules/products/index.d.ts +0 -1
  216. package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
  217. package/lib/components/schedules/utils.js +1 -1
  218. package/lib/components/shoppingCart/components/Cart/Product.d.ts +0 -1
  219. package/lib/components/shoppingCart/components/Cart/Product.js +21 -31
  220. package/lib/components/shoppingCart/components/Cart/index.js +15 -18
  221. package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
  222. package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
  223. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +127 -145
  224. package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
  225. package/lib/components/ticketBooking/components/timeBar/index.js +88 -95
  226. package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
  227. package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
  228. package/package.json +4 -4
@@ -36,8 +36,9 @@ var import_react = __toESM(require("react"));
36
36
  var import_materials = require("@pisell/materials");
37
37
  var import_utils = require("@pisell/utils");
38
38
  var import_context = require("../../context");
39
+ var import_utils2 = require("../Resource/utils");
39
40
  var import_hooks = require("../../hooks");
40
- var import_utils2 = require("../../utils");
41
+ var import_utils3 = require("../../utils");
41
42
  var import_index = require("./index.less");
42
43
  var TimeSlicing = (0, import_react.forwardRef)((props, ref) => {
43
44
  const [selectedResource, setSelectedResource] = (0, import_react.useState)("");
@@ -54,7 +55,7 @@ var TimeSlicing = (0, import_react.forwardRef)((props, ref) => {
54
55
  next: () => {
55
56
  const isUnSelectedTimes = appointmentBooking.checkCartItems("date");
56
57
  if ((isUnSelectedTimes == null ? void 0 : isUnSelectedTimes.length) > 0) {
57
- (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unselect.time"));
58
+ (0, import_utils3.Toast)(import_utils.locales.getText("pisell2.appointment.unselect.time"));
58
59
  return;
59
60
  }
60
61
  nextStep();
@@ -65,11 +66,14 @@ var TimeSlicing = (0, import_react.forwardRef)((props, ref) => {
65
66
  }, []);
66
67
  const getAutoSelect = async (val) => {
67
68
  setSelectedTime(val);
69
+ (0, import_utils2.scrollToFirstErrorCard)(".pisell-lowcode-product-card-error");
68
70
  const result = await appointmentBooking.submitTimeSlot(val);
69
71
  };
70
72
  (0, import_react.useEffect)(() => {
71
73
  var _a, _b, _c;
72
- let appoimentBookingProductCart = carts.filter((item) => !appointmentBooking.isTargetCartIdNormalProduct(item == null ? void 0 : item._id));
74
+ let appoimentBookingProductCart = carts.filter(
75
+ (item) => !appointmentBooking.isTargetCartIdNormalProduct(item == null ? void 0 : item._id)
76
+ );
73
77
  if ((times == null ? void 0 : times.length) > 0 && (appoimentBookingProductCart == null ? void 0 : appoimentBookingProductCart.length) > 0) {
74
78
  const startTime = ((_a = appoimentBookingProductCart == null ? void 0 : appoimentBookingProductCart[0]) == null ? void 0 : _a.start_time) || ((_b = times == null ? void 0 : times[0]) == null ? void 0 : _b.start_time);
75
79
  setSelectedResource(startTime);
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./index.less";
3
2
  interface TabProductProps {
4
3
  list: any[];
@@ -78,7 +78,6 @@ var CustomSelect = (props, ref) => {
78
78
  handleOpenModal: propsHandleOpenModal,
79
79
  handleDayChange
80
80
  } = props;
81
- console.log("custom select");
82
81
  const searchRef = (0, import_react.useRef)();
83
82
  const [_value, set_value] = (0, import_react.useState)([]);
84
83
  const [search, setSearch] = (0, import_react.useState)("");
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const FormItemChildrenWrap: (props: any) => JSX.Element;
3
2
  export default FormItemChildrenWrap;
@@ -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,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./index.less";
3
2
  declare const Table: ({ value, onChange, field, mode, onAdd }: any) => JSX.Element;
4
3
  export default Table;
@@ -37,7 +37,7 @@ var import_classnames = __toESM(require("classnames"));
37
37
  var import_materials = require("@pisell/materials");
38
38
  var import_utils = require("@pisell/utils");
39
39
  var useClearCart = (state, dispatch) => {
40
- var _a, _b;
40
+ var _a, _b, _c, _d;
41
41
  const handleClear = () => {
42
42
  dispatch({
43
43
  type: "setService",
@@ -46,20 +46,17 @@ var useClearCart = (state, dispatch) => {
46
46
  }
47
47
  });
48
48
  };
49
- return (0, import_react.useMemo)(() => {
50
- var _a2, _b2, _c, _d;
51
- return !!((_b2 = (_a2 = state.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.length) && !state.channelDisabledEdit && /* @__PURE__ */ import_react.default.createElement(
52
- "span",
53
- {
54
- className: (0, import_classnames.default)("pisell-lowcode__booking-service-clear-btn", {
55
- ["pisell-lowcode__booking-service-clear-btn-disabled"]: !((_d = (_c = state.service) == null ? void 0 : _c.value) == null ? void 0 : _d.length)
56
- }),
57
- onClick: handleClear
58
- },
59
- /* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-trash-01" }),
60
- " ",
61
- /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell2.booking.info.text.clear-cart"))
62
- );
63
- }, [(_b = (_a = state.service) == null ? void 0 : _a.value) == null ? void 0 : _b.length, state.channelDisabledEdit]);
49
+ return !!((_b = (_a = state.service) == null ? void 0 : _a.value) == null ? void 0 : _b.length) && !state.channelDisabledEdit && /* @__PURE__ */ import_react.default.createElement(
50
+ "span",
51
+ {
52
+ className: (0, import_classnames.default)("pisell-lowcode__booking-service-clear-btn", {
53
+ ["pisell-lowcode__booking-service-clear-btn-disabled"]: !((_d = (_c = state.service) == null ? void 0 : _c.value) == null ? void 0 : _d.length)
54
+ }),
55
+ onClick: handleClear
56
+ },
57
+ /* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-trash-01" }),
58
+ " ",
59
+ /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell2.booking.info.text.clear-cart"))
60
+ );
64
61
  };
65
62
  var useClearCart_default = useClearCart;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface AddServiceVariantProps {
3
2
  globalState: any;
4
3
  setGlobalState: any;
@@ -48,7 +48,7 @@ var import_utils3 = require("../clientVariant/utils");
48
48
  var import_useGetHolderList = __toESM(require("../hooks/useGetHolderList"));
49
49
  var isLoadClient = false;
50
50
  var Client = () => {
51
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
51
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
52
52
  const modalRef = (0, import_react.useRef)();
53
53
  const [loadLoading, setLoadLoading] = (0, import_react.useState)(false);
54
54
  const [loading, setLoading] = (0, import_react.useState)(false);
@@ -298,7 +298,6 @@ var Client = () => {
298
298
  )) : null;
299
299
  }, [loadLoading, params, state.client.clients.length]);
300
300
  const customSelect = (0, import_react.useMemo)(() => {
301
- console.log("render customSelect");
302
301
  return /* @__PURE__ */ import_react.default.createElement(
303
302
  import_customSelect.default,
304
303
  {
@@ -341,7 +340,7 @@ var Client = () => {
341
340
  }
342
341
  }
343
342
  );
344
- }, [state.isTerminal, state.modalOpen, (_b = state.client) == null ? void 0 : _b.value, state.drawerMask, renderList, loading, franchiseeLoading, params.search, loadMore]);
343
+ }, [state, renderList, loading, franchiseeLoading, params.search, loadMore]);
345
344
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
346
345
  "div",
347
346
  {
@@ -358,11 +357,11 @@ var Client = () => {
358
357
  import_antd.Avatar,
359
358
  {
360
359
  className: "pisell-lowcode__booking-client-list-item-avatar",
361
- src: import_utils.image.ali((_c = state.client.value) == null ? void 0 : _c.cover, 100),
360
+ src: import_utils.image.ali((_b = state.client.value) == null ? void 0 : _b.cover, 100),
362
361
  icon: /* @__PURE__ */ import_react.default.createElement(import_User01.default, { className: "pisell-lowcode__booking-client-list-item-avatar-icon" })
363
362
  }
364
363
  ),
365
- /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-left" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-name" }, getNickname(state.client.value)), isWalkIn ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-desc" }, import_utils.locales.getText("pisell2.text.leave-empty-for-walk-in")) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, ((_d = state.client.value) == null ? void 0 : _d.email) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-email" }, (_e = state.client.value) == null ? void 0 : _e.email) : null, ((_f = state.client.value) == null ? void 0 : _f.phone) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-phone" }, (_g = state.client.value) == null ? void 0 : _g.phone) : null, !!((_i = (_h = state.client.value) == null ? void 0 : _h.waiver_form) == null ? void 0 : _i.length) && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-waiver", title: (0, import_utils3.getWaiverTitle)((_j = state.client.value) == null ? void 0 : _j.waiver_form) }, (_m = (_l = (_k = state.client.value) == null ? void 0 : _k.waiver_form) == null ? void 0 : _l.map) == null ? void 0 : _m.call(_l, (item) => {
364
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-left" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-name" }, getNickname(state.client.value)), isWalkIn ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-desc" }, import_utils.locales.getText("pisell2.text.leave-empty-for-walk-in")) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, ((_c = state.client.value) == null ? void 0 : _c.email) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-email" }, (_d = state.client.value) == null ? void 0 : _d.email) : null, ((_e = state.client.value) == null ? void 0 : _e.phone) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-phone" }, (_f = state.client.value) == null ? void 0 : _f.phone) : null, !!((_h = (_g = state.client.value) == null ? void 0 : _g.waiver_form) == null ? void 0 : _h.length) && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-waiver", title: (0, import_utils3.getWaiverTitle)((_i = state.client.value) == null ? void 0 : _i.waiver_form) }, (_l = (_k = (_j = state.client.value) == null ? void 0 : _j.waiver_form) == null ? void 0 : _k.map) == null ? void 0 : _l.call(_k, (item) => {
366
365
  return /* @__PURE__ */ import_react.default.createElement("span", null, item.form_title, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-client-waiver-colon" }, ":"), item.is_filled ? /* @__PURE__ */ import_react.default.createElement(
367
366
  "span",
368
367
  {
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const useIsLowSpeedNetwork: () => import("react").MutableRefObject<boolean>;
3
2
  export default useIsLowSpeedNetwork;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  export declare const disabledDate: (current: any, position: any, currentDate: any) => any;
4
3
  declare const DateRange: ({ state, dispatch, key }: any) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { EditServiceRef } from "../service/editService";
3
2
  declare const useInfoHolder: (state: any, dispatch: any) => {
4
3
  detailRef: import("react").MutableRefObject<EditServiceRef | undefined>;
@@ -32,7 +32,6 @@ __export(useInfoHolder_exports, {
32
32
  default: () => useInfoHolder_default
33
33
  });
34
34
  module.exports = __toCommonJS(useInfoHolder_exports);
35
- var import_ahooks = require("ahooks");
36
35
  var import_react = require("react");
37
36
  var import_useHolderConfig = __toESM(require("./useHolderConfig"));
38
37
  var import_utils = require("../utils");
@@ -55,21 +54,21 @@ var useInfoHolder = (state, dispatch) => {
55
54
  };
56
55
  }, [(_d = (_c = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _c.config) == null ? void 0 : _d.information_tab]);
57
56
  const showAddTimeModal = (0, import_react.useMemo)(() => {
58
- return (0, import_utils.isOpenAddTime)(state) && !state.isBookingTicket2;
57
+ return (0, import_utils.isOpenAddTime)(state);
59
58
  }, [state, appointment_card.quick_time]);
60
- const handleEdit = (0, import_ahooks.useMemoizedFn)((cacheItem, type) => {
61
- var _a2, _b2;
62
- console.time("handleEdit");
63
- console.log(performance.now() - window.pp1, "打开商品4");
64
- (_b2 = (_a2 = detailRef.current) == null ? void 0 : _a2.init) == null ? void 0 : _b2.call(_a2, cacheItem, false, type === "edit_product");
65
- });
59
+ const handleEdit = (cacheItem, type) => {
60
+ setTimeout(() => {
61
+ var _a2, _b2;
62
+ (_b2 = (_a2 = detailRef.current) == null ? void 0 : _a2.init) == null ? void 0 : _b2.call(_a2, cacheItem, false, type === "edit_product");
63
+ }, 100);
64
+ };
66
65
  const dispatchService = (type, payload) => {
67
66
  dispatch({
68
67
  type,
69
68
  payload: { ...payload }
70
69
  });
71
70
  };
72
- const handleAction = (0, import_ahooks.useMemoizedFn)((dataSource) => {
71
+ const handleAction = (dataSource) => {
73
72
  const cacheItem = (0, import_utils2.getProductExtend)({
74
73
  cacheItem: { ...dataSource._origin, new: 0 },
75
74
  state
@@ -81,7 +80,7 @@ var useInfoHolder = (state, dispatch) => {
81
80
  cacheItem
82
81
  }
83
82
  });
84
- });
83
+ };
85
84
  return {
86
85
  detailRef,
87
86
  handleEdit,
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { InfoProps } from './main';
3
2
  declare const APP: (props: InfoProps) => JSX.Element;
4
3
  export default APP;
@@ -48,12 +48,10 @@ var Lists = ({ onEdit, onChange, onAction, isParallelResource }) => {
48
48
  const { handleAddHolder } = (0, import_useAddHolder.default)(state, dispatch);
49
49
  const handleChange = (0, import_ahooks.useMemoizedFn)(
50
50
  (currentItem, type, other) => {
51
- console.time("handleChange");
52
- console.log(window.pp1 = performance.now(), "打开商品");
53
51
  if (state.disabledEdit || state.disableEventBookingEdit) {
54
52
  return;
55
53
  }
56
- let products2 = (0, import_utils.updateServices)(state, currentItem, type, other, {
54
+ let products = (0, import_utils.updateServices)(state, currentItem, type, other, {
57
55
  handleAddHolder
58
56
  });
59
57
  if (type === "view" || type === "edit_product") {
@@ -66,11 +64,11 @@ var Lists = ({ onEdit, onChange, onAction, isParallelResource }) => {
66
64
  });
67
65
  }
68
66
  onChange({ editModal: true, cacheItem });
69
- return onEdit == null ? void 0 : onEdit(cacheItem, type);
67
+ return onEdit == null ? void 0 : onEdit({ ...product, new: 0 }, type);
70
68
  }
71
69
  const params = {
72
70
  editModal: false,
73
- value: products2,
71
+ value: products,
74
72
  edit: true,
75
73
  cacheItem: null
76
74
  };
@@ -97,36 +95,26 @@ var Lists = ({ onEdit, onChange, onAction, isParallelResource }) => {
97
95
  isShowChangeHolder,
98
96
  state.isBookingCreatePage
99
97
  ]);
100
- const products = (0, import_react.useMemo)(() => {
101
- var _a2;
102
- console.time("products");
103
- const p = (0, import_utils.formatProducts)(
104
- ((_a2 = state == null ? void 0 : state.service) == null ? void 0 : _a2.value) || [],
105
- state,
106
- false,
107
- true,
108
- isParallelResource
109
- );
110
- console.timeEnd("products");
111
- return p;
112
- }, [(_a = state == null ? void 0 : state.service) == null ? void 0 : _a.value, state]);
113
- return (0, import_react.useMemo)(() => {
114
- console.log("render List");
115
- return /* @__PURE__ */ import_react.default.createElement(import_Provider.CartContext.Provider, { value: { state } }, /* @__PURE__ */ import_react.default.createElement(
116
- import_shoppingCart.default,
117
- {
118
- isParallelResource,
119
- onAction,
120
- onChange: handleChange,
121
- isOpenGroup: false,
122
- isHideClearCart: true,
123
- onAddProduct: () => onChange({ addModal: true }),
124
- productParams: {
125
- ...productParams,
126
- products
127
- }
98
+ return /* @__PURE__ */ import_react.default.createElement(import_Provider.CartContext.Provider, { value: { state } }, /* @__PURE__ */ import_react.default.createElement(
99
+ import_shoppingCart.default,
100
+ {
101
+ isParallelResource,
102
+ onAction,
103
+ onChange: handleChange,
104
+ isOpenGroup: false,
105
+ isHideClearCart: true,
106
+ onAddProduct: () => onChange({ addModal: true }),
107
+ productParams: {
108
+ ...productParams,
109
+ products: (0, import_utils.formatProducts)(
110
+ ((_a = state == null ? void 0 : state.service) == null ? void 0 : _a.value) || [],
111
+ state,
112
+ false,
113
+ true,
114
+ isParallelResource
115
+ )
128
116
  }
129
- ));
130
- }, [products, state, productParams]);
117
+ }
118
+ ));
131
119
  };
132
120
  var Lists_default = Lists;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const BookingList: ({ items }: {
3
2
  items: any[];
4
3
  }) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./index.less";
3
2
  declare const Like: ({ status, onChange, className, style, }: {
4
3
  style?: any;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const Lists: ({ onEdit, onChange }: any) => JSX.Element;
3
2
  export default Lists;
@@ -579,25 +579,25 @@ var formatProducts = (lists, state, isRenderGroup = true, isGeneral, isParallelR
579
579
  _origin: item
580
580
  };
581
581
  };
582
+ lists.forEach((item) => {
583
+ var _a;
584
+ if (!((_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.groupId)) {
585
+ normalList.push(formItem(item));
586
+ } else {
587
+ groupList.push(item);
588
+ }
589
+ });
590
+ let groups = groupList.reduce((prev, item) => {
591
+ var _a;
592
+ const groupId = (_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.groupId;
593
+ if (!prev[groupId]) {
594
+ prev[groupId] = [];
595
+ }
596
+ prev[groupId].push(item);
597
+ return prev;
598
+ }, {});
582
599
  console.log(normalList, "normalList");
583
600
  if (isRenderGroup) {
584
- lists.forEach((item) => {
585
- var _a;
586
- if (!((_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.groupId)) {
587
- normalList.push(formItem(item));
588
- } else {
589
- groupList.push(item);
590
- }
591
- });
592
- let groups = groupList.reduce((prev, item) => {
593
- var _a;
594
- const groupId = (_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.groupId;
595
- if (!prev[groupId]) {
596
- prev[groupId] = [];
597
- }
598
- prev[groupId].push(item);
599
- return prev;
600
- }, {});
601
601
  return Object.values(groups).map((d) => formItem((0, import_utils3.concatBookings)(d))).concat(normalList);
602
602
  } else {
603
603
  return lists == null ? void 0 : lists.map((item) => formItem(item));
@@ -142,8 +142,7 @@ var getTimeObj = ({
142
142
  cacheItem,
143
143
  useStartTime,
144
144
  currentResource,
145
- // 没有使用该参数
146
- // state,
145
+ state,
147
146
  durationProps
148
147
  });
149
148
  let obj = (0, import_utils.sliceDayIntoFiveMinutes)(
@@ -243,8 +242,7 @@ var setDefaultResource = ({ cacheItem, resources }) => {
243
242
  }
244
243
  const defaultResource = defaultOriginalResource.map((d) => {
245
244
  return {
246
- // ...d,
247
- children: d.children,
245
+ ...d,
248
246
  relation_type: d.relation_type,
249
247
  form_id: item.form_id,
250
248
  relation_id: d.id,
@@ -304,7 +302,7 @@ var getResourceByIds = (resourcesOriginMap, cacheItem, extraParams) => {
304
302
  extraResourceIds = (resourcesOrigin || []).filter((d) => d.form_code === item.code).map((d) => d.id);
305
303
  } else {
306
304
  extraResourceIds = extraResources.filter((_extraItem) => {
307
- 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);
308
306
  }).map((_extraItem) => _extraItem.id);
309
307
  }
310
308
  extraResourceIds = Array.from(new Set(extraResourceIds));
@@ -65,7 +65,6 @@ var AddTimeModal = () => {
65
65
  const [number, setNumber] = (0, import_react.useState)(1);
66
66
  const originServices = (0, import_react.useRef)([]);
67
67
  const [renderList, setRenderList] = (0, import_react.useState)([]);
68
- console.log(renderList, "renderListrenderList");
69
68
  const context = (0, import_useEngineContext.default)();
70
69
  const { interaction } = (_a = context.appHelper) == null ? void 0 : _a.utils;
71
70
  const statusMap = {
@@ -127,7 +126,6 @@ var AddTimeModal = () => {
127
126
  }
128
127
  return arr.filter(Boolean);
129
128
  }, [(_f = (_e = (_d = state.service) == null ? void 0 : _d.cacheItem) == null ? void 0 : _e._extend) == null ? void 0 : _f.resource]);
130
- console.log(currentResource, "currentResource");
131
129
  const getTimeUsableStatus = (time) => {
132
130
  var _a2, _b2;
133
131
  if (!((_a2 = state.service.cacheItem) == null ? void 0 : _a2._extend) || !currentResource.length) {
@@ -208,7 +206,6 @@ var AddTimeModal = () => {
208
206
  setLoading("list");
209
207
  const newList = await _getAddTimeProducts();
210
208
  let list = newList.map((d) => {
211
- debugger;
212
209
  let isUsable = (0, import_utils2.isUsableProduct)(d.add_time, state.service.cacheItem);
213
210
  return {
214
211
  ...d,
@@ -168,11 +168,9 @@ var Resources = ({
168
168
  const getIsAutoAllocation = (id) => {
169
169
  return (0, import_utils2.getAutoAllocationStorage)(id);
170
170
  };
171
- console.log("resourcesss");
172
171
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, data.map((item) => {
173
172
  var _a2;
174
173
  const cur = _value[item.form_id];
175
- console.log(cur, "curcur");
176
174
  const errors = (cur || []).reduce((pre, d) => {
177
175
  return pre.concat((d == null ? void 0 : d.errors) || []);
178
176
  }, []);
@@ -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) || [];