@pisell/private-materials 3.4.126 → 3.4.128

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 (265) 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 +2 -2
  6. package/build/lowcode/view.js +2 -2
  7. package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
  8. package/es/components/appointmentBooking/components/Content/index.d.ts +1 -0
  9. package/es/components/appointmentBooking/components/Header/index.d.ts +1 -0
  10. package/es/components/appointmentBooking/components/TimeSlicing/components/SelectDateOS.d.ts +1 -0
  11. package/es/components/appointmentBooking/index.d.ts +1 -0
  12. package/es/components/booking/addons/model.d.ts +1 -10
  13. package/es/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
  14. package/es/components/booking/components/collapsibleList/utils.d.ts +1 -0
  15. package/es/components/booking/components/emptyBooking/index.d.ts +1 -0
  16. package/es/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
  17. package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
  18. package/es/components/booking/editBookingModal/index.js +6 -2
  19. package/es/components/booking/forms/model.d.ts +1 -10
  20. package/es/components/booking/forms/table/index.d.ts +1 -0
  21. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  22. package/es/components/booking/info/model.d.ts +1 -10
  23. package/es/components/booking/info/service/like/index.d.ts +1 -0
  24. package/es/components/booking/materiels/contacts/index.d.ts +1 -0
  25. package/es/components/booking/materiels/duration/index.d.ts +1 -0
  26. package/es/components/booking/materiels/startTime/index.d.ts +1 -0
  27. package/es/components/booking/model.d.ts +1 -9
  28. package/es/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
  29. package/es/components/booking/notes/addNote/index.d.ts +1 -0
  30. package/es/components/booking/notes/model.d.ts +1 -10
  31. package/es/components/booking/payments/model.d.ts +1 -10
  32. package/es/components/ecocup/components/CupInfoCard/index.d.ts +1 -0
  33. package/es/components/ecocup/components/CustomerCard/index.d.ts +1 -0
  34. package/es/components/eftpos/SettlementModal/Action.d.ts +1 -0
  35. package/es/components/eftpos/deviceList/index.d.ts +1 -0
  36. package/es/components/eftpos/form/index.d.ts +1 -0
  37. package/es/components/eftpos/group/index.d.ts +1 -0
  38. package/es/components/eftpos/hooks.d.ts +1 -0
  39. package/es/components/eftpos/icon/apiKey.d.ts +1 -0
  40. package/es/components/eftpos/icon/device.d.ts +1 -0
  41. package/es/components/eftpos/pos.d.ts +1 -0
  42. package/es/components/eftpos/receipt/index.d.ts +1 -0
  43. package/es/components/eftpos/surcharge/index.d.ts +1 -0
  44. package/es/components/eftposPay/amount.d.ts +1 -1
  45. package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
  46. package/es/components/eftposPay/component/fail/network.d.ts +1 -0
  47. package/es/components/eftposPay/component/fail/unknow.d.ts +1 -0
  48. package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
  49. package/es/components/eftposPay/component/manual/index.d.ts +1 -0
  50. package/es/components/eftposPay/component/signature/index.d.ts +1 -0
  51. package/es/components/eftposPay/component/step/index.d.ts +1 -0
  52. package/es/components/eftposPay/component/step/step.d.ts +1 -0
  53. package/es/components/eftposPay/device.d.ts +1 -2
  54. package/es/components/eftposPay/payo/config.d.ts +1 -0
  55. package/es/components/eftposPay/tip.d.ts +1 -0
  56. package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
  57. package/es/components/eftposPay/windcave/receiptAction.d.ts +1 -0
  58. package/es/components/eftposPay/windcave/windcave.d.ts +1 -0
  59. package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  60. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
  61. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  62. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  63. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
  64. package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
  65. package/es/components/login/index.d.ts +1 -0
  66. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
  67. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
  68. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  69. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
  70. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
  71. package/es/components/pay/toC/model.d.ts +1 -9
  72. package/es/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
  73. package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
  74. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
  75. package/es/components/ruleSetting/ruleBorder/index.d.ts +1 -0
  76. package/es/components/schedules/calendar/calendarItem.d.ts +1 -0
  77. package/es/components/schedules/calendar/index.d.ts +1 -0
  78. package/es/components/schedules/components/CurrentDay/index.d.ts +1 -0
  79. package/es/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
  80. package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
  81. package/es/components/schedules/components/ScheduleList/index.d.ts +1 -0
  82. package/es/components/schedules/model.d.ts +1 -9
  83. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
  84. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
  85. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
  86. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
  87. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
  88. package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
  89. package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
  90. package/es/components/schedules/products/index.d.ts +1 -0
  91. package/es/components/schedules/products/list/ProductItem/index.d.ts +1 -0
  92. package/es/components/schedules/products/list/index.d.ts +1 -0
  93. package/es/components/schedules/resources/index.d.ts +1 -0
  94. package/es/components/schedules/resources/list/index.d.ts +1 -0
  95. package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
  96. package/es/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
  97. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
  98. package/es/components/schedules/schedules/index.d.ts +1 -0
  99. package/es/components/taxSelect/index.d.ts +1 -0
  100. package/es/hooks/usePaymentLogger.d.ts +1 -0
  101. package/es/plus/clientName/index.d.ts +1 -0
  102. package/es/plus/clinetSearch/Add/BirthdayField/index.d.ts +1 -0
  103. package/es/plus/clinetSearch/Add/GenderField/index.d.ts +1 -0
  104. package/es/plus/pisellReservation/PisellReservation.js +68 -19
  105. package/es/plus/pisellReservation/hooks/usePicoCodingOpenData.js +31 -16
  106. package/es/plus/pisellReservation/hooks/usePisellReservationBookingData.d.ts +11 -0
  107. package/es/plus/pisellReservation/hooks/usePisellReservationBookingData.js +73 -22
  108. package/es/plus/pisellSalesGrid/serve.d.ts +10 -0
  109. package/es/plus/pisellSalesGrid/serve.js +109 -33
  110. package/es/plus/pisellSalesManagement/hooks/useSalesGridData.js +6 -0
  111. package/es/plus/saasCreateOrganization/components/Header.d.ts +1 -0
  112. package/es/plus/saasCreateOrganization/index.d.ts +1 -0
  113. package/es/plus/saasDevice/devicePlanning/locales/en.d.ts +4 -0
  114. package/es/plus/saasDevice/devicePlanning/locales/en.js +4 -0
  115. package/es/plus/saasDevice/devicePlanning/locales/index.d.ts +20 -0
  116. package/es/plus/saasDevice/devicePlanning/locales/ja.d.ts +4 -0
  117. package/es/plus/saasDevice/devicePlanning/locales/ja.js +4 -0
  118. package/es/plus/saasDevice/devicePlanning/locales/pt.d.ts +4 -0
  119. package/es/plus/saasDevice/devicePlanning/locales/pt.js +4 -0
  120. package/es/plus/saasDevice/devicePlanning/locales/zhCN.d.ts +4 -0
  121. package/es/plus/saasDevice/devicePlanning/locales/zhCN.js +4 -0
  122. package/es/plus/saasDevice/devicePlanning/locales/zhHk.d.ts +4 -0
  123. package/es/plus/saasDevice/devicePlanning/locales/zhHk.js +4 -0
  124. package/es/plus/saasDevice/devicePlanning/modules/deviceDetail/components/DeviceInfoPanel.js +20 -0
  125. package/es/plus/saasRegister/components/EntryEmail.d.ts +1 -0
  126. package/es/plus/saasRegister/components/EntryInfo.d.ts +1 -0
  127. package/es/plus/saasRegister/components/GoLogin.d.ts +1 -0
  128. package/es/plus/saasRegister/components/Header.d.ts +1 -0
  129. package/es/plus/saasRegister/components/VerifyError.d.ts +1 -0
  130. package/es/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
  131. package/es/plus/skuOptionsSelection/components/TitleExtra/index.d.ts +1 -0
  132. package/es/plus/skuOptionsSelection/components/VariantCard/index.d.ts +1 -0
  133. package/es/plus/walletEditor/components/relationProduct/index.d.ts +1 -0
  134. package/es/pro/Selector/demo.d.ts +1 -0
  135. package/es/pro/pisellPaymentList/example.d.ts +1 -0
  136. package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
  137. package/lib/components/appointmentBooking/components/Content/index.d.ts +1 -0
  138. package/lib/components/appointmentBooking/components/Header/index.d.ts +1 -0
  139. package/lib/components/appointmentBooking/components/TimeSlicing/components/SelectDateOS.d.ts +1 -0
  140. package/lib/components/appointmentBooking/index.d.ts +1 -0
  141. package/lib/components/booking/addons/model.d.ts +1 -10
  142. package/lib/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
  143. package/lib/components/booking/components/collapsibleList/utils.d.ts +1 -0
  144. package/lib/components/booking/components/emptyBooking/index.d.ts +1 -0
  145. package/lib/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
  146. package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
  147. package/lib/components/booking/editBookingModal/index.js +4 -4
  148. package/lib/components/booking/forms/model.d.ts +1 -10
  149. package/lib/components/booking/forms/table/index.d.ts +1 -0
  150. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  151. package/lib/components/booking/info/model.d.ts +1 -10
  152. package/lib/components/booking/info/service/like/index.d.ts +1 -0
  153. package/lib/components/booking/materiels/contacts/index.d.ts +1 -0
  154. package/lib/components/booking/materiels/duration/index.d.ts +1 -0
  155. package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
  156. package/lib/components/booking/model.d.ts +1 -9
  157. package/lib/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
  158. package/lib/components/booking/notes/addNote/index.d.ts +1 -0
  159. package/lib/components/booking/notes/model.d.ts +1 -10
  160. package/lib/components/booking/payments/model.d.ts +1 -10
  161. package/lib/components/ecocup/components/CupInfoCard/index.d.ts +1 -0
  162. package/lib/components/ecocup/components/CustomerCard/index.d.ts +1 -0
  163. package/lib/components/eftpos/SettlementModal/Action.d.ts +1 -0
  164. package/lib/components/eftpos/deviceList/index.d.ts +1 -0
  165. package/lib/components/eftpos/form/index.d.ts +1 -0
  166. package/lib/components/eftpos/group/index.d.ts +1 -0
  167. package/lib/components/eftpos/hooks.d.ts +1 -0
  168. package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
  169. package/lib/components/eftpos/icon/device.d.ts +1 -0
  170. package/lib/components/eftpos/pos.d.ts +1 -0
  171. package/lib/components/eftpos/receipt/index.d.ts +1 -0
  172. package/lib/components/eftpos/surcharge/index.d.ts +1 -0
  173. package/lib/components/eftposPay/amount.d.ts +1 -1
  174. package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
  175. package/lib/components/eftposPay/component/fail/network.d.ts +1 -0
  176. package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -0
  177. package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
  178. package/lib/components/eftposPay/component/manual/index.d.ts +1 -0
  179. package/lib/components/eftposPay/component/signature/index.d.ts +1 -0
  180. package/lib/components/eftposPay/component/step/index.d.ts +1 -0
  181. package/lib/components/eftposPay/component/step/step.d.ts +1 -0
  182. package/lib/components/eftposPay/device.d.ts +1 -2
  183. package/lib/components/eftposPay/payo/config.d.ts +1 -0
  184. package/lib/components/eftposPay/tip.d.ts +1 -0
  185. package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
  186. package/lib/components/eftposPay/windcave/receiptAction.d.ts +1 -0
  187. package/lib/components/eftposPay/windcave/windcave.d.ts +1 -0
  188. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  189. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
  190. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  191. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  192. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
  193. package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
  194. package/lib/components/login/index.d.ts +1 -0
  195. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
  196. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
  197. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  198. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
  199. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
  200. package/lib/components/pay/toC/model.d.ts +1 -9
  201. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
  202. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
  203. package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
  204. package/lib/components/ruleSetting/ruleBorder/index.d.ts +1 -0
  205. package/lib/components/schedules/calendar/calendarItem.d.ts +1 -0
  206. package/lib/components/schedules/calendar/index.d.ts +1 -0
  207. package/lib/components/schedules/components/CurrentDay/index.d.ts +1 -0
  208. package/lib/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
  209. package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
  210. package/lib/components/schedules/components/ScheduleList/index.d.ts +1 -0
  211. package/lib/components/schedules/model.d.ts +1 -9
  212. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
  213. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
  214. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
  215. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
  216. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
  217. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
  218. package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
  219. package/lib/components/schedules/products/index.d.ts +1 -0
  220. package/lib/components/schedules/products/list/ProductItem/index.d.ts +1 -0
  221. package/lib/components/schedules/products/list/index.d.ts +1 -0
  222. package/lib/components/schedules/resources/index.d.ts +1 -0
  223. package/lib/components/schedules/resources/list/index.d.ts +1 -0
  224. package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
  225. package/lib/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
  226. package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
  227. package/lib/components/schedules/schedules/index.d.ts +1 -0
  228. package/lib/components/taxSelect/index.d.ts +1 -0
  229. package/lib/hooks/usePaymentLogger.d.ts +1 -0
  230. package/lib/plus/clientName/index.d.ts +1 -0
  231. package/lib/plus/clinetSearch/Add/BirthdayField/index.d.ts +1 -0
  232. package/lib/plus/clinetSearch/Add/GenderField/index.d.ts +1 -0
  233. package/lib/plus/pisellReservation/PisellReservation.js +63 -16
  234. package/lib/plus/pisellReservation/hooks/usePicoCodingOpenData.js +8 -2
  235. package/lib/plus/pisellReservation/hooks/usePisellReservationBookingData.d.ts +11 -0
  236. package/lib/plus/pisellReservation/hooks/usePisellReservationBookingData.js +64 -12
  237. package/lib/plus/pisellSalesGrid/serve.d.ts +10 -0
  238. package/lib/plus/pisellSalesGrid/serve.js +49 -7
  239. package/lib/plus/pisellSalesManagement/hooks/useSalesGridData.js +4 -0
  240. package/lib/plus/saasCreateOrganization/components/Header.d.ts +1 -0
  241. package/lib/plus/saasCreateOrganization/index.d.ts +1 -0
  242. package/lib/plus/saasDevice/devicePlanning/locales/en.d.ts +4 -0
  243. package/lib/plus/saasDevice/devicePlanning/locales/en.js +4 -0
  244. package/lib/plus/saasDevice/devicePlanning/locales/index.d.ts +20 -0
  245. package/lib/plus/saasDevice/devicePlanning/locales/ja.d.ts +4 -0
  246. package/lib/plus/saasDevice/devicePlanning/locales/ja.js +4 -0
  247. package/lib/plus/saasDevice/devicePlanning/locales/pt.d.ts +4 -0
  248. package/lib/plus/saasDevice/devicePlanning/locales/pt.js +4 -0
  249. package/lib/plus/saasDevice/devicePlanning/locales/zhCN.d.ts +4 -0
  250. package/lib/plus/saasDevice/devicePlanning/locales/zhCN.js +4 -0
  251. package/lib/plus/saasDevice/devicePlanning/locales/zhHk.d.ts +4 -0
  252. package/lib/plus/saasDevice/devicePlanning/locales/zhHk.js +4 -0
  253. package/lib/plus/saasDevice/devicePlanning/modules/deviceDetail/components/DeviceInfoPanel.js +15 -1
  254. package/lib/plus/saasRegister/components/EntryEmail.d.ts +1 -0
  255. package/lib/plus/saasRegister/components/EntryInfo.d.ts +1 -0
  256. package/lib/plus/saasRegister/components/GoLogin.d.ts +1 -0
  257. package/lib/plus/saasRegister/components/Header.d.ts +1 -0
  258. package/lib/plus/saasRegister/components/VerifyError.d.ts +1 -0
  259. package/lib/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
  260. package/lib/plus/skuOptionsSelection/components/TitleExtra/index.d.ts +1 -0
  261. package/lib/plus/skuOptionsSelection/components/VariantCard/index.d.ts +1 -0
  262. package/lib/plus/walletEditor/components/relationProduct/index.d.ts +1 -0
  263. package/lib/pro/Selector/demo.d.ts +1 -0
  264. package/lib/pro/pisellPaymentList/example.d.ts +1 -0
  265. package/package.json +2 -2
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import "./index.less";
2
3
  declare type Item = any;
3
4
  interface ProductItemProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  interface ProductListProps {
3
4
  loading: boolean;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Resources: () => JSX.Element;
3
4
  export default Resources;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import "./index.less";
2
3
  declare type ResourcesListProps = {
3
4
  list: any;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import "./index.less";
2
3
  declare const RelationProduct: ({ value, onChange, }: {
3
4
  value?: any;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ScheduleItem } from '../../type';
2
3
  import './index.less';
3
4
  declare type AllSchedulesPropsType = {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { DrawerProps } from "antd";
2
3
  import { ScheduleItem } from "../../type";
3
4
  import "./index.less";
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const SchedulesConnect: () => JSX.Element;
2
3
  export default SchedulesConnect;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { SelectProps } from "antd";
2
3
  import "./index.less";
3
4
  interface TaxSelectProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface LogData {
2
3
  key: string;
3
4
  value: any;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  import { IClientNameProps } from './type';
3
4
  declare const ClientName: ({ className, dataSource, style }: IClientNameProps) => JSX.Element | null;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const DateSectionCom: ({ value, onChange, showTime, className, style, useSpace, format, itemStyle, }: any) => JSX.Element;
2
3
  export default DateSectionCom;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const GenderField: (props: any) => JSX.Element;
2
3
  export default GenderField;
@@ -179,7 +179,7 @@ var PREVIEW_HTTP_CLIENT = {
179
179
  * {@link PisellVenueWallPage} / {@link PisellReservationTablePage} 通过 props 组合默认行为。
180
180
  */
181
181
  export var PisellReservationCore = function PisellReservationCore(props) {
182
- var _engineCtx$appHelper, _engineCtx$engine, _engineCtx$appHelper2, _engineCtx$appHelper3, _app$router, _app$router$getRoutes, _app$history, _app$history$useParam, _engineCtx$appHelper8, _floorMapProp$mode, _scroll$autoCalc, _scroll;
182
+ var _engineCtx$appHelper, _engineCtx$engine, _engineCtx$appHelper2, _engineCtx$appHelper3, _app$router, _app$router$getRoutes, _app$history, _app$history$useParam, _engineCtx$appHelper8, _floorMapProp$floorMa2, _floorMapProp$mode, _scroll$autoCalc, _scroll;
183
183
  var _props$gridDataSource = props.gridDataSourceKey,
184
184
  gridDataSourceKey = _props$gridDataSource === void 0 ? GRID_DS_KEY : _props$gridDataSource,
185
185
  dataSourcesProp = props.dataSources,
@@ -252,6 +252,14 @@ export var PisellReservationCore = function PisellReservationCore(props) {
252
252
  var router = app === null || app === void 0 || (_app$router = app.router) === null || _app$router === void 0 || (_app$router$getRoutes = _app$router.getRoutes) === null || _app$router$getRoutes === void 0 ? void 0 : _app$router$getRoutes.call(_app$router);
253
253
  var params = app === null || app === void 0 || (_app$history = app.history) === null || _app$history === void 0 || (_app$history$useParam = _app$history.useParams) === null || _app$history$useParam === void 0 ? void 0 : _app$history$useParam.call(_app$history);
254
254
  var BIZ = reservationBizProp !== null && reservationBizProp !== void 0 ? reservationBizProp : params === null || params === void 0 ? void 0 : params.business_code;
255
+ /** 路由带 business_code 时等 params 就绪再拉列表,避免无 code 首包 + 有 code 二包 */
256
+ var gridBookingRouteReady = useMemo(function () {
257
+ if (reservationBizProp != null && String(reservationBizProp).trim() !== '') {
258
+ return true;
259
+ }
260
+ if (params == null) return true;
261
+ return params.business_code != null && String(params.business_code).trim() !== '';
262
+ }, [reservationBizProp, params === null || params === void 0 ? void 0 : params.business_code, params]);
255
263
 
256
264
  /** 路由有 business_code 时,表格/平面图两路 booking 列表请求扁平带上 business_code */
257
265
  var bookingListBusinessCodeExtra = useMemo(function () {
@@ -347,10 +355,32 @@ export var PisellReservationCore = function PisellReservationCore(props) {
347
355
  return getGridTableBookingSearchParams(operatingDayBoundary, effectiveTimelineRange);
348
356
  }, [operatingDayBoundary, effectiveTimelineRange]);
349
357
 
358
+ /**
359
+ * 等路由 business_code + 营业边界派生完成后再拉 grid 列表。
360
+ * Strict Mode 首挂载时 `operatingDayBoundary` 常未就绪,立即请求会与重挂载后参数不一致各打一遍。
361
+ */
362
+ var _useState = useState(false),
363
+ _useState2 = _slicedToArray(_useState, 2),
364
+ gridBookingBootstrapReady = _useState2[0],
365
+ setGridBookingBootstrapReady = _useState2[1];
366
+ useEffect(function () {
367
+ if (!isInternalListData || !gridBookingRouteReady) {
368
+ setGridBookingBootstrapReady(false);
369
+ return;
370
+ }
371
+ var id = window.setTimeout(function () {
372
+ return setGridBookingBootstrapReady(true);
373
+ }, 0);
374
+ return function () {
375
+ window.clearTimeout(id);
376
+ setGridBookingBootstrapReady(false);
377
+ };
378
+ }, [isInternalListData, gridBookingRouteReady, operatingDayBoundary, effectiveTimelineRange]);
379
+
350
380
  // --- 三套 booking 相关数据:表格列表 / 平面图绑定桌当日列表 / 远程 floor plan ---
351
381
 
352
382
  var resourceBoardData = usePisellReservationResourceTableData(isInternalListData);
353
- var gridBookingData = usePisellReservationBookingData(isInternalListData, {
383
+ var gridBookingData = usePisellReservationBookingData(isInternalListData && gridBookingRouteReady && gridBookingBootstrapReady, {
354
384
  listPageSize: 50,
355
385
  getInitialSearchParams: getGridBookingInitialSearchParams,
356
386
  extraRequestParams: bookingListBusinessCodeExtra,
@@ -359,16 +389,23 @@ export var PisellReservationCore = function PisellReservationCore(props) {
359
389
  * booking 订阅槽或同 URL 请求互 abort,平面图那路 HTTP/推送会被挤掉,表现为 floor map 无预约。
360
390
  * 表格只信 HTTP;实时合并以 `floorDayBookingData`(带 form_record_ids)为准。
361
391
  */
362
- subscribeRealtimePush: true
392
+ subscribeRealtimePush: true,
393
+ /**
394
+ * 表格与平面图并发请求同一 `/shop/schedule/booking`,开启 `abort` 会被后发起的平面图请求
395
+ * 取消(表现为表格 `req.data` 一直为空、列表不展示)。表格这一路关闭 HTTP abort,
396
+ * 由 ahooks 自身按调用序丢弃过期响应即可,避免被平面图请求挤掉。
397
+ */
398
+ httpAbort: false,
399
+ requestScopeKey: 'grid-booking'
363
400
  });
364
401
 
365
402
  /** 与 RecordBoard 当前子视图同步,用于资源墙下按所选资源切换 floorDayBooking 的 form_record_ids */
366
- var _useState = useState(function () {
403
+ var _useState3 = useState(function () {
367
404
  return readBodyViewFromStorageKey(bodyViewStorageKey);
368
405
  }),
369
- _useState2 = _slicedToArray(_useState, 2),
370
- shellBodyView = _useState2[0],
371
- setShellBodyView = _useState2[1];
406
+ _useState4 = _slicedToArray(_useState3, 2),
407
+ shellBodyView = _useState4[0],
408
+ setShellBodyView = _useState4[1];
372
409
 
373
410
  /** 锁定大屏子视图、显式 prop、或 Segmented 切到「大屏」:强制墙钟跟随且不可关 */
374
411
  var wallClockFollowLocked = useMemo(function () {
@@ -456,10 +493,22 @@ export var PisellReservationCore = function PisellReservationCore(props) {
456
493
  var getFloorDayBookingInitialSearchParams = useCallback(function () {
457
494
  return getDefaultMonitorSearchParams(dayjs(), operatingDayBoundary, effectiveTimelineRange);
458
495
  }, [operatingDayBoundary, effectiveTimelineRange]);
459
- var floorDayBookingData = usePisellReservationBookingData(floorBookingResourceReady, {
496
+ /**
497
+ * 平面图当日列表:等远程 layout / 低代码 sceneElements 就绪后再拉,避免
498
+ * `form_record_ids: []` 与带 id 的两次重复请求;表格专用页无需此路数据。
499
+ */
500
+ var floorDayBookingBindingsReady = useMemo(function () {
501
+ var _floorMapProp$floorMa;
502
+ if (lockedBodyView === 'grid') return false;
503
+ if (floorPlanRemoteId != null) return true;
504
+ var propScene = floorMapProp === null || floorMapProp === void 0 || (_floorMapProp$floorMa = floorMapProp.floorMapConfig) === null || _floorMapProp$floorMa === void 0 ? void 0 : _floorMapProp$floorMa.sceneElements;
505
+ return Array.isArray(propScene) && propScene.length > 0;
506
+ }, [lockedBodyView, floorPlanRemoteId, floorMapProp === null || floorMapProp === void 0 || (_floorMapProp$floorMa2 = floorMapProp.floorMapConfig) === null || _floorMapProp$floorMa2 === void 0 ? void 0 : _floorMapProp$floorMa2.sceneElements]);
507
+ var floorDayBookingData = usePisellReservationBookingData(floorBookingResourceReady && floorDayBookingBindingsReady, {
460
508
  listPageSize: 9999,
461
509
  extraRequestParams: floorBookingExtraParams,
462
- getInitialSearchParams: getFloorDayBookingInitialSearchParams
510
+ getInitialSearchParams: getFloorDayBookingInitialSearchParams,
511
+ requestScopeKey: 'floor-day-booking'
463
512
  });
464
513
  var _getRelationTables = useRequest(getRelationTables);
465
514
  var bookingPerspectiveParams = useMemo(function () {
@@ -692,7 +741,7 @@ export var PisellReservationCore = function PisellReservationCore(props) {
692
741
  * - 外部 data + 当前 bodyView 为平面图:把 reservationDate/At 透传给外部 onSearch。
693
742
  */
694
743
  useEffect(function () {
695
- if (isInternalListData && bodyViewRef.current !== 'calendar') {
744
+ if (isInternalListData && floorDayBookingBindingsReady && bodyViewRef.current !== 'calendar') {
696
745
  var d = debouncedSchedule.date;
697
746
  floorDayBookingData.patchSearchParams(function (prevParams) {
698
747
  return mergeSearchParamsBookingWindow(prevParams, d, operatingDayBoundary, effectiveTimelineRange, dayjs());
@@ -705,7 +754,7 @@ export var PisellReservationCore = function PisellReservationCore(props) {
705
754
  reservationAt: debouncedSchedule.at.toISOString()
706
755
  }));
707
756
  }
708
- }, [debouncedSchedule, isInternalListData, floorDayBookingData.patchSearchParams, operatingDayBoundary, effectiveTimelineRange]);
757
+ }, [debouncedSchedule, isInternalListData, floorDayBookingBindingsReady, floorDayBookingData.patchSearchParams, operatingDayBoundary, effectiveTimelineRange]);
709
758
  var handleScheduleChange = useCallback(function (next) {
710
759
  if (!wallClockFollowLocked) {
711
760
  setFollowWallClock(false);
@@ -724,10 +773,10 @@ export var PisellReservationCore = function PisellReservationCore(props) {
724
773
  return _objectSpread(_objectSpread({}, dataSourcesProp), {}, _defineProperty({}, gridDataSourceKey, tables));
725
774
  }, [gridDataSourceKey, tables, dataSourcesProp]);
726
775
  var isFloorModeControlled = (floorMapProp === null || floorMapProp === void 0 ? void 0 : floorMapProp.mode) !== undefined;
727
- var _useState3 = useState(false),
728
- _useState4 = _slicedToArray(_useState3, 2),
729
- mapEditInternal = _useState4[0],
730
- setMapEditInternal = _useState4[1];
776
+ var _useState5 = useState(false),
777
+ _useState6 = _slicedToArray(_useState5, 2),
778
+ mapEditInternal = _useState6[0],
779
+ setMapEditInternal = _useState6[1];
731
780
  var effectiveMapMode = (_floorMapProp$mode = floorMapProp === null || floorMapProp === void 0 ? void 0 : floorMapProp.mode) !== null && _floorMapProp$mode !== void 0 ? _floorMapProp$mode : mapEditInternal ? 'edit' : 'read';
732
781
  var _useReservationHudDra = useReservationHudDrawer({
733
782
  floorMapHudTableDrawer: floorMapHudTableDrawer,
@@ -762,10 +811,10 @@ export var PisellReservationCore = function PisellReservationCore(props) {
762
811
  handleHudDrawerFormRecordIdsChange = _useReservationHudDra.handleHudDrawerFormRecordIdsChange,
763
812
  reservationFloorMapViewportOverlay = _useReservationHudDra.reservationFloorMapViewportOverlay,
764
813
  renderItemByKind = _useReservationHudDra.renderItemByKind;
765
- var _useState5 = useState('light'),
766
- _useState6 = _slicedToArray(_useState5, 2),
767
- floorMapAppearanceMode = _useState6[0],
768
- setFloorMapAppearanceMode = _useState6[1];
814
+ var _useState7 = useState('light'),
815
+ _useState8 = _slicedToArray(_useState7, 2),
816
+ floorMapAppearanceMode = _useState8[0],
817
+ setFloorMapAppearanceMode = _useState8[1];
769
818
  var toggleFloorMapAppearanceMode = useCallback(function () {
770
819
  setFloorMapAppearanceMode(function (prev) {
771
820
  return prev === 'light' ? 'dark' : 'light';
@@ -28,8 +28,8 @@ export function loadPicoCodingOpenDataSnapshot(_x, _x2) {
28
28
  */
29
29
  function _loadPicoCodingOpenDataSnapshot() {
30
30
  _loadPicoCodingOpenDataSnapshot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(engineCtx, BIZ) {
31
- var _engineCtx$appHelper, _engineCtx$appHelper$, _engineCtx$appHelper2, _engineCtx$appHelper3;
32
- var emptyResult, res, picoCodingOpenData, reservationAssociatedMenuListIds, linkIds, now, products;
31
+ var _engineCtx$appHelper2, _engineCtx$appHelper3, _engineCtx$appHelper4, _engineCtx$appHelper5;
32
+ var emptyResult, shopId, res, picoCodingOpenData, reservationAssociatedMenuListIds, linkIds, now, products;
33
33
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
34
34
  while (1) switch (_context2.prev = _context2.next) {
35
35
  case 0:
@@ -44,9 +44,17 @@ function _loadPicoCodingOpenDataSnapshot() {
44
44
  }
45
45
  return _context2.abrupt("return", emptyResult);
46
46
  case 3:
47
- _context2.next = 5;
47
+ /** shop_id 取不到时跳过请求,避免拼出 `/open/my-pisell/undefined/setting` 的无效请求 */
48
+ shopId = engineCtx === null || engineCtx === void 0 || (_engineCtx$appHelper2 = engineCtx.appHelper) === null || _engineCtx$appHelper2 === void 0 || (_engineCtx$appHelper2 = _engineCtx$appHelper2.utils) === null || _engineCtx$appHelper2 === void 0 || (_engineCtx$appHelper3 = _engineCtx$appHelper2.getData) === null || _engineCtx$appHelper3 === void 0 ? void 0 : _engineCtx$appHelper3.call(_engineCtx$appHelper2, 'shop_id');
49
+ if (!(shopId == null || String(shopId).trim() === '')) {
50
+ _context2.next = 6;
51
+ break;
52
+ }
53
+ return _context2.abrupt("return", emptyResult);
54
+ case 6:
55
+ _context2.next = 8;
48
56
  return getPicoCodingOpenData({
49
- shop_id: engineCtx === null || engineCtx === void 0 || (_engineCtx$appHelper = engineCtx.appHelper) === null || _engineCtx$appHelper === void 0 || (_engineCtx$appHelper = _engineCtx$appHelper.utils) === null || _engineCtx$appHelper === void 0 || (_engineCtx$appHelper$ = _engineCtx$appHelper.getData) === null || _engineCtx$appHelper$ === void 0 ? void 0 : _engineCtx$appHelper$.call(_engineCtx$appHelper, 'shop_id'),
57
+ shop_id: String(shopId),
50
58
  data: {
51
59
  scope: SCOPE,
52
60
  section_code: ['reservation', 'fulfillment', 'menu'],
@@ -55,22 +63,22 @@ function _loadPicoCodingOpenDataSnapshot() {
55
63
  }, {
56
64
  prefix: false,
57
65
  headers: {
58
- 'Tenant-Id': engineCtx === null || engineCtx === void 0 || (_engineCtx$appHelper2 = engineCtx.appHelper) === null || _engineCtx$appHelper2 === void 0 || (_engineCtx$appHelper2 = _engineCtx$appHelper2.utils) === null || _engineCtx$appHelper2 === void 0 || (_engineCtx$appHelper3 = _engineCtx$appHelper2.getData) === null || _engineCtx$appHelper3 === void 0 ? void 0 : _engineCtx$appHelper3.call(_engineCtx$appHelper2, 'tenant_id')
66
+ 'Tenant-Id': engineCtx === null || engineCtx === void 0 || (_engineCtx$appHelper4 = engineCtx.appHelper) === null || _engineCtx$appHelper4 === void 0 || (_engineCtx$appHelper4 = _engineCtx$appHelper4.utils) === null || _engineCtx$appHelper4 === void 0 || (_engineCtx$appHelper5 = _engineCtx$appHelper4.getData) === null || _engineCtx$appHelper5 === void 0 ? void 0 : _engineCtx$appHelper5.call(_engineCtx$appHelper4, 'tenant_id')
59
67
  }
60
68
  });
61
- case 5:
69
+ case 8:
62
70
  res = _context2.sent;
63
71
  if (!((res === null || res === void 0 ? void 0 : res.code) !== 200)) {
64
- _context2.next = 8;
72
+ _context2.next = 11;
65
73
  break;
66
74
  }
67
75
  return _context2.abrupt("return", emptyResult);
68
- case 8:
76
+ case 11:
69
77
  picoCodingOpenData = res.data;
70
78
  reservationAssociatedMenuListIds = mapAssociatedMenusToMenuListIds(picoCodingOpenData);
71
79
  linkIds = collectLinkProductIdsFromReservationRules(picoCodingOpenData === null || picoCodingOpenData === void 0 ? void 0 : picoCodingOpenData['fulfillment.enabled_resource_rules']);
72
80
  if (!(linkIds.length === 0)) {
73
- _context2.next = 13;
81
+ _context2.next = 16;
74
82
  break;
75
83
  }
76
84
  return _context2.abrupt("return", {
@@ -78,22 +86,22 @@ function _loadPicoCodingOpenDataSnapshot() {
78
86
  reservationRuleProduct: null,
79
87
  reservationAssociatedMenuListIds: reservationAssociatedMenuListIds
80
88
  });
81
- case 13:
89
+ case 16:
82
90
  now = dayjs();
83
- _context2.next = 16;
91
+ _context2.next = 19;
84
92
  return queryProductsByIds({
85
93
  product_ids: linkIds,
86
94
  schedule_date: now.format('YYYY-MM-DD'),
87
95
  schedule_datetime: now.format('YYYY-MM-DD HH:mm:ss')
88
96
  });
89
- case 16:
97
+ case 19:
90
98
  products = _context2.sent;
91
99
  return _context2.abrupt("return", {
92
100
  picoCodingOpenData: picoCodingOpenData,
93
101
  reservationRuleProduct: pickFirstDurationProduct(products),
94
102
  reservationAssociatedMenuListIds: reservationAssociatedMenuListIds
95
103
  });
96
- case 18:
104
+ case 21:
97
105
  case "end":
98
106
  return _context2.stop();
99
107
  }
@@ -102,6 +110,7 @@ function _loadPicoCodingOpenDataSnapshot() {
102
110
  return _loadPicoCodingOpenDataSnapshot.apply(this, arguments);
103
111
  }
104
112
  export function usePicoCodingOpenData(engineCtx, BIZ) {
113
+ var _engineCtx$appHelper, _engineCtx$appHelper$;
105
114
  var _useState = useState(null),
106
115
  _useState2 = _slicedToArray(_useState, 2),
107
116
  picoCodingOpenData = _useState2[0],
@@ -113,7 +122,13 @@ export function usePicoCodingOpenData(engineCtx, BIZ) {
113
122
  var reservationAssociatedMenuListIds = useMemo(function () {
114
123
  return mapAssociatedMenusToMenuListIds(picoCodingOpenData);
115
124
  }, [picoCodingOpenData]);
125
+
126
+ /** 原始 shop_id:作为 effect 依赖,从无到有时再触发一次请求(晚到的 shop_id 也能拉到数据) */
127
+ var shopId = engineCtx === null || engineCtx === void 0 || (_engineCtx$appHelper = engineCtx.appHelper) === null || _engineCtx$appHelper === void 0 || (_engineCtx$appHelper = _engineCtx$appHelper.utils) === null || _engineCtx$appHelper === void 0 || (_engineCtx$appHelper$ = _engineCtx$appHelper.getData) === null || _engineCtx$appHelper$ === void 0 ? void 0 : _engineCtx$appHelper$.call(_engineCtx$appHelper, 'shop_id');
128
+ var shopIdStr = shopId == null ? '' : String(shopId).trim();
116
129
  useEffect(function () {
130
+ // shop_id 未就绪:跳过本次(就绪后依赖变化会再次进入本 effect)
131
+ if (!shopIdStr) return;
117
132
  var cancelled = false;
118
133
  _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
119
134
  var snapshot;
@@ -141,9 +156,9 @@ export function usePicoCodingOpenData(engineCtx, BIZ) {
141
156
  return function () {
142
157
  cancelled = true;
143
158
  };
144
- // 与 PisellReservation 旧版一致:仅首 mount 拉取一次(避免 engineCtx 引用抖动重复请求)
145
- // eslint-disable-next-line react-hooks/exhaustive-deps -- intentional mount-once
146
- }, []);
159
+ // 依赖 shopIdStr / BIZ(primitive)触发:避免 engineCtx 引用抖动重复请求,又能在 shop_id 晚到时补拉
160
+ // eslint-disable-next-line react-hooks/exhaustive-deps
161
+ }, [shopIdStr, BIZ]);
147
162
  return {
148
163
  picoCodingOpenData: picoCodingOpenData,
149
164
  reservationRuleProduct: reservationRuleProduct,
@@ -52,6 +52,17 @@ export interface UsePisellReservationBookingDataOptions {
52
52
  * 平面图合并用 booking 请求可保持默认 `true`。
53
53
  */
54
54
  subscribeRealtimePush?: boolean;
55
+ /**
56
+ * 是否启用 HTTP「同 URL 互 abort」。默认 true。
57
+ * 表格与平面图两路并发请求同一 `/shop/schedule/booking`,会因同 URL abort 互相取消
58
+ *(后发起者取消先发起者)。需对表格这一路传 false,保证其 HTTP 结果不被平面图请求挤掉。
59
+ */
60
+ httpAbort?: boolean;
61
+ /**
62
+ * 同一页面多实例 effect 去重作用域(如 grid / floor-day 两路 booking)。
63
+ * 不传时按单实例处理。
64
+ */
65
+ requestScopeKey?: string;
55
66
  }
56
67
  /** 内置列表数据 hook 返回结构(booking / resource 页共用) */
57
68
  export interface UsePisellReservationBookingDataResult {
@@ -24,7 +24,7 @@ import { getRangeBounds, pickReferenceDateContainingNow } from '@pisell/material
24
24
  import { boundaryClockFromOperatingDayBoundary } from "../data/reservationOperatingDayRange";
25
25
  import { RESERVATION_TIMELINE_BUSINESS_RANGE } from "../reservationConstants";
26
26
  import { defaultPaymentStatusKeys } from "../../pisellSalesManagement/config/booking";
27
- import { formatBookingResult, getBookingList } from "../../pisellSalesGrid/serve";
27
+ import { formatBookingResult, getBookingList, getBookingListRequestCacheKey } from "../../pisellSalesGrid/serve";
28
28
 
29
29
  /** 避免 `?? []` 每次 render 新数组引用,触发依赖 list 的 effect 死循环 */
30
30
  export var EMPTY_RESERVATION_LIST = [];
@@ -134,14 +134,30 @@ export function getGridTableBookingSearchParams(operatingDayBoundary) {
134
134
 
135
135
  /** 内置列表数据 hook 返回结构(booking / resource 页共用) */
136
136
 
137
+ /** 跨 Strict Mode 重挂载:短时间窗内相同来源+参数不重复触发 effect run */
138
+ var BOOKING_HOOK_EFFECT_DEDUP_MS = 500;
139
+ var BOOKING_HOOK_DEDUP_GLOBAL = '__pisellBookingHookEffectDedup_v1';
140
+ function getBookingHookEffectDedup() {
141
+ var g = globalThis;
142
+ if (!g[BOOKING_HOOK_DEDUP_GLOBAL]) {
143
+ g[BOOKING_HOOK_DEDUP_GLOBAL] = new Map();
144
+ }
145
+ return g[BOOKING_HOOK_DEDUP_GLOBAL];
146
+ }
137
147
  export function usePisellReservationBookingData(enabled, options) {
138
- var _options$listPageSize, _options$getInitialSe, _options$subscribeRea, _req$data, _req$data$count, _req$data2;
148
+ var _options$listPageSize, _options$getInitialSe, _options$subscribeRea, _options$httpAbort, _options$requestScope, _req$data, _req$data$count, _req$data2;
139
149
  var listPageSize = (_options$listPageSize = options === null || options === void 0 ? void 0 : options.listPageSize) !== null && _options$listPageSize !== void 0 ? _options$listPageSize : 50;
140
150
  var getInitialSearchParams = (_options$getInitialSe = options === null || options === void 0 ? void 0 : options.getInitialSearchParams) !== null && _options$getInitialSe !== void 0 ? _options$getInitialSe : function () {
141
151
  return getDefaultMonitorSearchParams(dayjs());
142
152
  };
143
153
  var extraRequestParams = options === null || options === void 0 ? void 0 : options.extraRequestParams;
144
154
  var subscribeRealtimePush = (_options$subscribeRea = options === null || options === void 0 ? void 0 : options.subscribeRealtimePush) !== null && _options$subscribeRea !== void 0 ? _options$subscribeRea : true;
155
+ var httpAbort = (_options$httpAbort = options === null || options === void 0 ? void 0 : options.httpAbort) !== null && _options$httpAbort !== void 0 ? _options$httpAbort : true;
156
+ var requestScopeKey = (_options$requestScope = options === null || options === void 0 ? void 0 : options.requestScopeKey) !== null && _options$requestScope !== void 0 ? _options$requestScope : 'booking-list';
157
+ /** 避免 effect 在相同查询参数下重复发起 HTTP(如 Strict Mode 重挂载、patch 无实质变更) */
158
+ var lastEffectRequestKeyRef = useRef(null);
159
+ /** 手动 refresh 时跳过后端短时去重 */
160
+ var forceNextFetchRef = useRef(false);
145
161
  var _useState = useState({
146
162
  pageNumber: 1,
147
163
  pageSize: listPageSize
@@ -207,21 +223,32 @@ export function usePisellReservationBookingData(enabled, options) {
207
223
  num: pagination.pageSize
208
224
  });
209
225
  }, [searchParams, pagination.pageNumber, pagination.pageSize, extraRequestParams]);
226
+ var requestParamsKey = useMemo(function () {
227
+ return getBookingListRequestCacheKey(requestParams, {
228
+ abort: httpAbort,
229
+ osServer: true
230
+ });
231
+ }, [requestParams, httpAbort]);
210
232
  var fetchBookingList = useMemoizedFn( /*#__PURE__*/function () {
211
233
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
234
+ var skipRecentDedup, listOptions;
212
235
  return _regeneratorRuntime().wrap(function _callee$(_context) {
213
236
  while (1) switch (_context.prev = _context.next) {
214
237
  case 0:
238
+ skipRecentDedup = forceNextFetchRef.current;
239
+ forceNextFetchRef.current = false;
240
+ listOptions = {
241
+ osServer: true,
242
+ abort: httpAbort,
243
+ skipRecentDedup: skipRecentDedup
244
+ };
215
245
  if (subscribeRealtimePush) {
216
- _context.next = 2;
246
+ _context.next = 5;
217
247
  break;
218
248
  }
219
- return _context.abrupt("return", getBookingList(params, {
220
- osServer: true
221
- }));
222
- case 2:
223
- return _context.abrupt("return", getBookingList(params, {
224
- osServer: true,
249
+ return _context.abrupt("return", getBookingList(params, listOptions));
250
+ case 5:
251
+ return _context.abrupt("return", getBookingList(params, _objectSpread(_objectSpread({}, listOptions), {}, {
225
252
  subscriberId: subscriberIdRef.current,
226
253
  /**
227
254
  * 订阅推送会多次进 callback;若 payload 没有与列表接口一致的 `list` 数组,
@@ -234,7 +261,6 @@ export function usePisellReservationBookingData(enabled, options) {
234
261
  */
235
262
  callback: function callback(res) {
236
263
  var _res$data;
237
- console.log(res, 'res123454321');
238
264
  var payload = (_res$data = res === null || res === void 0 ? void 0 : res.data) !== null && _res$data !== void 0 ? _res$data : res;
239
265
  if (payload == null || !Array.isArray(payload.list)) return;
240
266
  /**
@@ -259,8 +285,8 @@ export function usePisellReservationBookingData(enabled, options) {
259
285
  });
260
286
  });
261
287
  }
262
- }));
263
- case 3:
288
+ })));
289
+ case 6:
264
290
  case "end":
265
291
  return _context.stop();
266
292
  }
@@ -273,11 +299,28 @@ export function usePisellReservationBookingData(enabled, options) {
273
299
  var req = useRequest(fetchBookingList, {
274
300
  manual: true
275
301
  });
302
+ var reqRunRef = useRef(req.run);
303
+ reqRunRef.current = req.run;
276
304
  bookingMutateRef.current = req.mutate;
277
305
  useEffect(function () {
278
- if (!enabled) return;
279
- void req.run(requestParams);
280
- }, [enabled, requestParams]);
306
+ if (!enabled) {
307
+ lastEffectRequestKeyRef.current = null;
308
+ return;
309
+ }
310
+ var now = Date.now();
311
+ var bookingHookEffectDedup = getBookingHookEffectDedup();
312
+ var crossMountDedup = bookingHookEffectDedup.get(requestScopeKey);
313
+ if (lastEffectRequestKeyRef.current === requestParamsKey || crossMountDedup && crossMountDedup.key === requestParamsKey && now - crossMountDedup.at < BOOKING_HOOK_EFFECT_DEDUP_MS) {
314
+ return;
315
+ }
316
+ lastEffectRequestKeyRef.current = requestParamsKey;
317
+ bookingHookEffectDedup.set(requestScopeKey, {
318
+ key: requestParamsKey,
319
+ at: now
320
+ });
321
+ void reqRunRef.current(requestParams);
322
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- req.run 引用每轮变,走 ref
323
+ }, [enabled, requestParamsKey, requestParams, requestScopeKey]);
281
324
  var onPageChange = useCallback(function (pageNumber, pageSize) {
282
325
  if (pageNumber < 1 || pageSize < 1) return;
283
326
  setPagination({
@@ -303,20 +346,28 @@ export function usePisellReservationBookingData(enabled, options) {
303
346
  }, [getInitialSearchParams]);
304
347
  var patchSearchParams = useCallback(function (updater) {
305
348
  setSearchParams(function (prev) {
306
- return updater(_objectSpread({}, prev));
307
- });
308
- setPagination(function (p) {
309
- return _objectSpread(_objectSpread({}, p), {}, {
310
- pageNumber: 1
349
+ var next = updater(_objectSpread({}, prev));
350
+ if (next === prev) return prev;
351
+ setPagination(function (p) {
352
+ return p.pageNumber === 1 ? p : _objectSpread(_objectSpread({}, p), {}, {
353
+ pageNumber: 1
354
+ });
311
355
  });
356
+ return next;
312
357
  });
313
358
  }, []);
314
359
  var refresh = useCallback(function () {
360
+ lastEffectRequestKeyRef.current = null;
361
+ getBookingHookEffectDedup().delete(requestScopeKey);
362
+ forceNextFetchRef.current = true;
315
363
  void req.run(requestParams);
316
- }, [req, requestParams]);
364
+ }, [req, requestParams, requestScopeKey]);
317
365
  var refreshAsync = useCallback(function () {
366
+ lastEffectRequestKeyRef.current = null;
367
+ getBookingHookEffectDedup().delete(requestScopeKey);
368
+ forceNextFetchRef.current = true;
318
369
  return req.runAsync(requestParams);
319
- }, [req, requestParams]);
370
+ }, [req, requestParams, requestScopeKey]);
320
371
 
321
372
  /** 接口常返回新的 `[]`,勿直接作依赖否则下游 effect(如 sales 合并)死循环 */
322
373
  var rawList = (_req$data = req.data) === null || _req$data === void 0 ? void 0 : _req$data.list;
@@ -3,6 +3,14 @@ export interface RequestOptions {
3
3
  osServer?: boolean;
4
4
  subscriberId?: string;
5
5
  callback?: (res: any) => void;
6
+ /**
7
+ * 是否启用「同 URL 请求互相 abort」。默认 true。
8
+ * 同一页面有两路并发请求同一 booking URL(如表格 + 平面图)时,需对其中一路传 false,
9
+ * 避免后发起的请求把先发起的那路 abort 掉(表现为该路 `req.data` 永远为空、列表不展示)。
10
+ */
11
+ abort?: boolean;
12
+ /** 为 true 时跳过后端短时去重缓存(用于手动 refresh) */
13
+ skipRecentDedup?: boolean;
6
14
  }
7
15
  /**
8
16
  * 获取订单列表(支持 osServer 本地代理)。
@@ -33,6 +41,8 @@ export interface GetBookingListParams {
33
41
  [key: string]: any;
34
42
  }
35
43
  export declare const formatBookingResult: (data: any) => any;
44
+ /** 与 HTTP 去重一致;供 hook effect 比对使用 */
45
+ export declare function getBookingListRequestCacheKey(params: Record<string, any>, options?: Pick<RequestOptions, 'abort' | 'osServer'>): string;
36
46
  export declare const getBookingList: (params: Record<string, any>, options?: RequestOptions) => Promise<any>;
37
47
  /** 取消订单列表订阅(组件卸载时调用,与 useProducts cleanup 一致) */
38
48
  export declare const unsubscribeOrderQuery: (subscriberId: string) => Promise<void>;