@pisell/private-materials 3.4.127 → 3.4.129
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +2 -2
- package/build/lowcode/view.js +2 -2
- package/es/businessModel/SalesModel/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/TimeSlicing/components/SelectDateOS.d.ts +1 -0
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/forms/table/index.d.ts +0 -1
- package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/es/components/booking/info/index.d.ts +1 -0
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/service/Lists.d.ts +1 -0
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/materiels/startTime/index.d.ts +1 -0
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/ecocup/components/MoreDropdown/index.d.ts +1 -0
- package/es/components/ecocup/cupList/hooks/useColumns.d.ts +1 -0
- package/es/components/ecocup/cupList/hooks/useSummary.d.ts +1 -0
- package/es/components/eftpos/SettlementModal/index.d.ts +1 -0
- package/es/components/eftpos/hooks.d.ts +1 -0
- package/es/components/eftpos/surcharge/index.d.ts +1 -0
- package/es/components/eftposPay/app.d.ts +1 -0
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +4 -4
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
- package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/es/components/pay/toC/model.d.ts +1 -9
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/es/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/es/components/schedules/products/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/es/components/systemSettings/registry/components/DataSourceTreeSelect/index.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- package/es/plus/orderList/components/HandleActions.d.ts +1 -0
- package/es/plus/orderList/components/QuickFilter.d.ts +1 -0
- package/es/plus/orderList/components/Reset.d.ts +1 -0
- package/es/plus/orderList/components/Toolbar.d.ts +1 -0
- package/es/plus/orderList/config.d.ts +1 -0
- package/es/plus/pisellReservation/PisellReservation.js +62 -19
- package/es/plus/pisellReservation/components/blockTimeModal/demo.d.ts +1 -0
- package/es/plus/pisellReservation/floorMap/floorPlanApi.d.ts +2 -2
- package/es/plus/pisellReservation/floorRoomCard/views/RoomCardIcons.d.ts +1 -0
- package/es/plus/pisellReservation/hooks/usePicoCodingOpenData.js +31 -16
- package/es/plus/pisellReservation/hooks/usePisellReservationBookingData.d.ts +5 -0
- package/es/plus/pisellReservation/hooks/usePisellReservationBookingData.js +72 -24
- package/es/plus/pisellReservation/hooks/useReservationResourceWallPersist.d.ts +1 -0
- package/es/plus/pisellReservation/hooks/useReservationScheduleDebounced.d.ts +4 -3
- package/es/plus/pisellSalesGrid/serve.d.ts +4 -0
- package/es/plus/pisellSalesGrid/serve.js +109 -33
- package/es/plus/pisellSalesManagement/hooks/useSalesGridData.js +6 -0
- package/es/plus/pisellTopology/floorPlan/topologyFloorPlanApi.d.ts +1 -1
- package/es/plus/saasDevice/devicePlanning/hooks/useDevicePlanningDialogs.d.ts +1 -0
- package/es/plus/saasDevice/devicePlanning/modules/deviceConnections/hooks/useConnectDeviceModal.d.ts +1 -0
- package/es/plus/saasDevice/devicePlanning/modules/deviceDetail/hooks/useDeviceDetail.d.ts +1 -0
- package/es/plus/saasDevice/devicePlanning/modules/devices/hooks/useDeviceList.d.ts +1 -0
- package/es/plus/saasDevice/devicePlanning/modules/workAreas/hooks/useWorkAreas.d.ts +1 -0
- package/es/plus/selectHolder/components/ErrorTip/index.d.ts +1 -0
- package/es/plus/skuOptionsSelection/components/NormalCard/index.d.ts +1 -0
- package/es/plus/walletEditor/components/ImageUpload/index.d.ts +1 -1
- package/es/pro/Selector/demo.d.ts +1 -0
- package/lib/businessModel/SalesModel/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/TimeSlicing/components/SelectDateOS.d.ts +1 -0
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/forms/table/index.d.ts +0 -1
- package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/lib/components/booking/info/index.d.ts +1 -0
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/service/Lists.d.ts +1 -0
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/ecocup/components/MoreDropdown/index.d.ts +1 -0
- package/lib/components/ecocup/cupList/hooks/useColumns.d.ts +1 -0
- package/lib/components/ecocup/cupList/hooks/useSummary.d.ts +1 -0
- package/lib/components/eftpos/SettlementModal/index.d.ts +1 -0
- package/lib/components/eftpos/hooks.d.ts +1 -0
- package/lib/components/eftpos/surcharge/index.d.ts +1 -0
- package/lib/components/eftposPay/app.d.ts +1 -0
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +4 -4
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
- package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/lib/components/pay/toC/model.d.ts +1 -9
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/lib/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/lib/components/schedules/products/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/lib/components/systemSettings/registry/components/DataSourceTreeSelect/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- package/lib/plus/orderList/components/HandleActions.d.ts +1 -0
- package/lib/plus/orderList/components/QuickFilter.d.ts +1 -0
- package/lib/plus/orderList/components/Reset.d.ts +1 -0
- package/lib/plus/orderList/components/Toolbar.d.ts +1 -0
- package/lib/plus/orderList/config.d.ts +1 -0
- package/lib/plus/pisellReservation/PisellReservation.js +63 -22
- package/lib/plus/pisellReservation/components/blockTimeModal/demo.d.ts +1 -0
- package/lib/plus/pisellReservation/floorMap/floorPlanApi.d.ts +2 -2
- package/lib/plus/pisellReservation/floorRoomCard/views/RoomCardIcons.d.ts +1 -0
- package/lib/plus/pisellReservation/hooks/usePicoCodingOpenData.js +8 -2
- package/lib/plus/pisellReservation/hooks/usePisellReservationBookingData.d.ts +5 -0
- package/lib/plus/pisellReservation/hooks/usePisellReservationBookingData.js +63 -14
- package/lib/plus/pisellReservation/hooks/useReservationResourceWallPersist.d.ts +1 -0
- package/lib/plus/pisellReservation/hooks/useReservationScheduleDebounced.d.ts +4 -3
- package/lib/plus/pisellSalesGrid/serve.d.ts +4 -0
- package/lib/plus/pisellSalesGrid/serve.js +49 -7
- package/lib/plus/pisellSalesManagement/hooks/useSalesGridData.js +4 -0
- package/lib/plus/pisellTopology/floorPlan/topologyFloorPlanApi.d.ts +1 -1
- package/lib/plus/saasDevice/devicePlanning/hooks/useDevicePlanningDialogs.d.ts +1 -0
- package/lib/plus/saasDevice/devicePlanning/modules/deviceConnections/hooks/useConnectDeviceModal.d.ts +1 -0
- package/lib/plus/saasDevice/devicePlanning/modules/deviceDetail/hooks/useDeviceDetail.d.ts +1 -0
- package/lib/plus/saasDevice/devicePlanning/modules/devices/hooks/useDeviceList.d.ts +1 -0
- package/lib/plus/saasDevice/devicePlanning/modules/workAreas/hooks/useWorkAreas.d.ts +1 -0
- package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +1 -0
- package/lib/plus/skuOptionsSelection/components/NormalCard/index.d.ts +1 -0
- package/lib/plus/walletEditor/components/ImageUpload/index.d.ts +1 -1
- package/lib/pro/Selector/demo.d.ts +1 -0
- package/package.json +3 -3
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export interface FormState {
|
|
3
2
|
platform: 'pc' | 'h5' | '' | undefined;
|
|
4
3
|
order: any;
|
|
@@ -30,11 +29,4 @@ export interface PayGroup {
|
|
|
30
29
|
_order: any;
|
|
31
30
|
front_order_uuid?: string;
|
|
32
31
|
}
|
|
33
|
-
export declare const Provider:
|
|
34
|
-
state: FormState;
|
|
35
|
-
} & {
|
|
36
|
-
dispatch: (params: {
|
|
37
|
-
type: string;
|
|
38
|
-
payload: any;
|
|
39
|
-
}) => void;
|
|
40
|
-
}>;
|
|
32
|
+
export declare const Provider: any, Context: any;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { CalendarDataItem, ScheduleItem } from "./type";
|
|
3
2
|
import dayjs from "dayjs";
|
|
4
3
|
export interface FormState {
|
|
@@ -69,11 +68,4 @@ export interface FormState {
|
|
|
69
68
|
};
|
|
70
69
|
setGlobalState: Function | null;
|
|
71
70
|
}
|
|
72
|
-
export declare const Provider:
|
|
73
|
-
state: FormState;
|
|
74
|
-
} & {
|
|
75
|
-
dispatch: (params: {
|
|
76
|
-
type: string;
|
|
77
|
-
payload: any;
|
|
78
|
-
}) => void;
|
|
79
|
-
}>;
|
|
71
|
+
export declare const Provider: any, Context: any;
|
|
@@ -87,7 +87,7 @@ var PREVIEW_HTTP_CLIENT = {
|
|
|
87
87
|
custom: async () => ({ data: {} })
|
|
88
88
|
};
|
|
89
89
|
var PisellReservationCore = (props) => {
|
|
90
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
90
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
91
91
|
const {
|
|
92
92
|
gridDataSourceKey = import_reservationConstants.GRID_DS_KEY,
|
|
93
93
|
dataSources: dataSourcesProp,
|
|
@@ -156,6 +156,13 @@ var PisellReservationCore = (props) => {
|
|
|
156
156
|
const router = (_i = (_h = app == null ? void 0 : app.router) == null ? void 0 : _h.getRoutes) == null ? void 0 : _i.call(_h);
|
|
157
157
|
const params = (_k = (_j = app == null ? void 0 : app.history) == null ? void 0 : _j.useParams) == null ? void 0 : _k.call(_j);
|
|
158
158
|
const BIZ = reservationBizProp ?? (params == null ? void 0 : params.business_code);
|
|
159
|
+
const gridBookingRouteReady = (0, import_react.useMemo)(() => {
|
|
160
|
+
if (reservationBizProp != null && String(reservationBizProp).trim() !== "") {
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
163
|
+
if (params == null) return true;
|
|
164
|
+
return params.business_code != null && String(params.business_code).trim() !== "";
|
|
165
|
+
}, [reservationBizProp, params == null ? void 0 : params.business_code, params]);
|
|
159
166
|
const bookingListBusinessCodeExtra = (0, import_react.useMemo)(() => {
|
|
160
167
|
const s = BIZ != null && BIZ !== "" ? String(BIZ).trim() : "";
|
|
161
168
|
if (!s) return {};
|
|
@@ -254,24 +261,45 @@ var PisellReservationCore = (props) => {
|
|
|
254
261
|
),
|
|
255
262
|
[operatingDayBoundary, effectiveTimelineRange]
|
|
256
263
|
);
|
|
264
|
+
const [gridBookingBootstrapReady, setGridBookingBootstrapReady] = (0, import_react.useState)(false);
|
|
265
|
+
(0, import_react.useEffect)(() => {
|
|
266
|
+
if (!isInternalListData || !gridBookingRouteReady) {
|
|
267
|
+
setGridBookingBootstrapReady(false);
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
const id = window.setTimeout(() => setGridBookingBootstrapReady(true), 0);
|
|
271
|
+
return () => {
|
|
272
|
+
window.clearTimeout(id);
|
|
273
|
+
setGridBookingBootstrapReady(false);
|
|
274
|
+
};
|
|
275
|
+
}, [
|
|
276
|
+
isInternalListData,
|
|
277
|
+
gridBookingRouteReady,
|
|
278
|
+
operatingDayBoundary,
|
|
279
|
+
effectiveTimelineRange
|
|
280
|
+
]);
|
|
257
281
|
const resourceBoardData = (0, import_usePisellReservationResourceTableData.usePisellReservationResourceTableData)(isInternalListData);
|
|
258
|
-
const gridBookingData = (0, import_usePisellReservationBookingData.usePisellReservationBookingData)(
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
282
|
+
const gridBookingData = (0, import_usePisellReservationBookingData.usePisellReservationBookingData)(
|
|
283
|
+
isInternalListData && gridBookingRouteReady && gridBookingBootstrapReady,
|
|
284
|
+
{
|
|
285
|
+
listPageSize: 50,
|
|
286
|
+
getInitialSearchParams: getGridBookingInitialSearchParams,
|
|
287
|
+
extraRequestParams: bookingListBusinessCodeExtra,
|
|
288
|
+
/**
|
|
289
|
+
* 必须为 false:与 `floorDayBookingData` 两路并发开 `osServer` 时,宿主侧常共用一个
|
|
290
|
+
* booking 订阅槽或同 URL 请求互 abort,平面图那路 HTTP/推送会被挤掉,表现为 floor map 无预约。
|
|
291
|
+
* 表格只信 HTTP;实时合并以 `floorDayBookingData`(带 form_record_ids)为准。
|
|
292
|
+
*/
|
|
293
|
+
subscribeRealtimePush: true,
|
|
294
|
+
/**
|
|
295
|
+
* 表格与平面图并发请求同一 `/shop/schedule/booking`,开启 `abort` 会被后发起的平面图请求
|
|
296
|
+
* 取消(表现为表格 `req.data` 一直为空、列表不展示)。表格这一路关闭 HTTP abort,
|
|
297
|
+
* 由 ahooks 自身按调用序丢弃过期响应即可,避免被平面图请求挤掉。
|
|
298
|
+
*/
|
|
299
|
+
httpAbort: false,
|
|
300
|
+
requestScopeKey: "grid-booking"
|
|
301
|
+
}
|
|
302
|
+
);
|
|
275
303
|
const [shellBodyView, setShellBodyView] = (0, import_react.useState)(
|
|
276
304
|
() => (0, import_reservationDataUtils.readBodyViewFromStorageKey)(bodyViewStorageKey)
|
|
277
305
|
);
|
|
@@ -355,12 +383,24 @@ var PisellReservationCore = (props) => {
|
|
|
355
383
|
),
|
|
356
384
|
[operatingDayBoundary, effectiveTimelineRange]
|
|
357
385
|
);
|
|
386
|
+
const floorDayBookingBindingsReady = (0, import_react.useMemo)(() => {
|
|
387
|
+
var _a2;
|
|
388
|
+
if (lockedBodyView === "grid") return false;
|
|
389
|
+
if (floorPlanRemoteId != null) return true;
|
|
390
|
+
const propScene = (_a2 = floorMapProp == null ? void 0 : floorMapProp.floorMapConfig) == null ? void 0 : _a2.sceneElements;
|
|
391
|
+
return Array.isArray(propScene) && propScene.length > 0;
|
|
392
|
+
}, [
|
|
393
|
+
lockedBodyView,
|
|
394
|
+
floorPlanRemoteId,
|
|
395
|
+
(_n = floorMapProp == null ? void 0 : floorMapProp.floorMapConfig) == null ? void 0 : _n.sceneElements
|
|
396
|
+
]);
|
|
358
397
|
const floorDayBookingData = (0, import_usePisellReservationBookingData.usePisellReservationBookingData)(
|
|
359
|
-
floorBookingResourceReady,
|
|
398
|
+
floorBookingResourceReady && floorDayBookingBindingsReady,
|
|
360
399
|
{
|
|
361
400
|
listPageSize: 9999,
|
|
362
401
|
extraRequestParams: floorBookingExtraParams,
|
|
363
|
-
getInitialSearchParams: getFloorDayBookingInitialSearchParams
|
|
402
|
+
getInitialSearchParams: getFloorDayBookingInitialSearchParams,
|
|
403
|
+
requestScopeKey: "floor-day-booking"
|
|
364
404
|
}
|
|
365
405
|
);
|
|
366
406
|
const _getRelationTables = (0, import_ahooks.useRequest)(import_serve.getRelationTables);
|
|
@@ -562,7 +602,7 @@ var PisellReservationCore = (props) => {
|
|
|
562
602
|
});
|
|
563
603
|
(0, import_react.useEffect)(() => {
|
|
564
604
|
var _a2;
|
|
565
|
-
if (isInternalListData && bodyViewRef.current !== "calendar") {
|
|
605
|
+
if (isInternalListData && floorDayBookingBindingsReady && bodyViewRef.current !== "calendar") {
|
|
566
606
|
const d = debouncedSchedule.date;
|
|
567
607
|
floorDayBookingData.patchSearchParams(
|
|
568
608
|
(prevParams) => (0, import_reservationDataUtils.mergeSearchParamsBookingWindow)(
|
|
@@ -584,6 +624,7 @@ var PisellReservationCore = (props) => {
|
|
|
584
624
|
}, [
|
|
585
625
|
debouncedSchedule,
|
|
586
626
|
isInternalListData,
|
|
627
|
+
floorDayBookingBindingsReady,
|
|
587
628
|
floorDayBookingData.patchSearchParams,
|
|
588
629
|
operatingDayBoundary,
|
|
589
630
|
effectiveTimelineRange
|
|
@@ -858,7 +899,7 @@ var PisellReservationCore = (props) => {
|
|
|
858
899
|
scroll: { ...scrollBase, autoCalc: true }
|
|
859
900
|
};
|
|
860
901
|
}, [hudDrawerMobileGrid]);
|
|
861
|
-
const fillHeight = ((
|
|
902
|
+
const fillHeight = ((_o = mobileRecordBoardGrid == null ? void 0 : mobileRecordBoardGrid.scroll) == null ? void 0 : _o.autoCalc) ?? true;
|
|
862
903
|
const reservationResourceWallSlotProps = (0, import_react.useMemo)(
|
|
863
904
|
() => ({
|
|
864
905
|
cards: venueWallCards,
|
|
@@ -6,8 +6,8 @@ export declare const RESERVATION_DEFAULT_FLOOR_PLAN_ID = 1;
|
|
|
6
6
|
export type { PostShopFloorPlanBody, PutShopFloorPlanBody, ShopFloorPlanByCodeRequestOptions, ShopFloorPlanDetail, ShopFloorPlanLayoutItem, };
|
|
7
7
|
export { buildFloorPlanPutBody, floorMapSavedConfigToRemotePatch, inferCanvasSizeFromScene, mergeFloorPlanViewRemote, parseLayoutFieldToViewConfigPatch, pickFloorPlanDetail, sceneElementsToShopLayout, viewConfigToLayoutPayload, isShopFloorPlanNotFoundResponse, isHttpNotFoundError, } from '@pisell/materials';
|
|
8
8
|
export declare function isFloorPlanDuplicateCodeError(err: unknown): boolean;
|
|
9
|
-
export declare const getShopFloorPlanByCode: (code: string, subscribe?:
|
|
10
|
-
export declare const postShopFloorPlan: (body: PostShopFloorPlanBody) => Promise<
|
|
9
|
+
export declare const getShopFloorPlanByCode: (code: string, subscribe?: any) => Promise<any>;
|
|
10
|
+
export declare const postShopFloorPlan: (body: PostShopFloorPlanBody) => Promise<any>;
|
|
11
11
|
export declare const putShopFloorPlan: (id: number, body: PutShopFloorPlanBody) => Promise<unknown>;
|
|
12
12
|
export declare const unsubscribeShopFloorPlanCodeQuery: (subscriberId: string) => Promise<void>;
|
|
13
13
|
/**
|
|
@@ -49,9 +49,11 @@ async function loadPicoCodingOpenDataSnapshot(engineCtx, BIZ) {
|
|
|
49
49
|
reservationAssociatedMenuListIds: []
|
|
50
50
|
};
|
|
51
51
|
if (!engineCtx || !BIZ) return emptyResult;
|
|
52
|
+
const shopId = (_c = (_b = (_a = engineCtx == null ? void 0 : engineCtx.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.getData) == null ? void 0 : _c.call(_b, "shop_id");
|
|
53
|
+
if (shopId == null || String(shopId).trim() === "") return emptyResult;
|
|
52
54
|
const res = await (0, import_formResourcePage.getPicoCodingOpenData)(
|
|
53
55
|
{
|
|
54
|
-
shop_id: (
|
|
56
|
+
shop_id: String(shopId),
|
|
55
57
|
data: {
|
|
56
58
|
scope: SCOPE,
|
|
57
59
|
section_code: ["reservation", "fulfillment", "menu"],
|
|
@@ -91,13 +93,17 @@ async function loadPicoCodingOpenDataSnapshot(engineCtx, BIZ) {
|
|
|
91
93
|
};
|
|
92
94
|
}
|
|
93
95
|
function usePicoCodingOpenData(engineCtx, BIZ) {
|
|
96
|
+
var _a, _b, _c;
|
|
94
97
|
const [picoCodingOpenData, setPicoCodingOpenData] = (0, import_react.useState)(null);
|
|
95
98
|
const [reservationRuleProduct, setReservationRuleProduct] = (0, import_react.useState)(null);
|
|
96
99
|
const reservationAssociatedMenuListIds = (0, import_react.useMemo)(
|
|
97
100
|
() => (0, import_associatedMenuListIdsFromOpenData.mapAssociatedMenusToMenuListIds)(picoCodingOpenData),
|
|
98
101
|
[picoCodingOpenData]
|
|
99
102
|
);
|
|
103
|
+
const shopId = (_c = (_b = (_a = engineCtx == null ? void 0 : engineCtx.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.getData) == null ? void 0 : _c.call(_b, "shop_id");
|
|
104
|
+
const shopIdStr = shopId == null ? "" : String(shopId).trim();
|
|
100
105
|
(0, import_react.useEffect)(() => {
|
|
106
|
+
if (!shopIdStr) return;
|
|
101
107
|
let cancelled = false;
|
|
102
108
|
(async () => {
|
|
103
109
|
const snapshot = await loadPicoCodingOpenDataSnapshot(engineCtx, BIZ);
|
|
@@ -108,7 +114,7 @@ function usePicoCodingOpenData(engineCtx, BIZ) {
|
|
|
108
114
|
return () => {
|
|
109
115
|
cancelled = true;
|
|
110
116
|
};
|
|
111
|
-
}, []);
|
|
117
|
+
}, [shopIdStr, BIZ]);
|
|
112
118
|
return {
|
|
113
119
|
picoCodingOpenData,
|
|
114
120
|
reservationRuleProduct,
|
|
@@ -58,6 +58,11 @@ export interface UsePisellReservationBookingDataOptions {
|
|
|
58
58
|
*(后发起者取消先发起者)。需对表格这一路传 false,保证其 HTTP 结果不被平面图请求挤掉。
|
|
59
59
|
*/
|
|
60
60
|
httpAbort?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* 同一页面多实例 effect 去重作用域(如 grid / floor-day 两路 booking)。
|
|
63
|
+
* 不传时按单实例处理。
|
|
64
|
+
*/
|
|
65
|
+
requestScopeKey?: string;
|
|
61
66
|
}
|
|
62
67
|
/** 内置列表数据 hook 返回结构(booking / resource 页共用) */
|
|
63
68
|
export interface UsePisellReservationBookingDataResult {
|
|
@@ -119,6 +119,15 @@ function getGridTableBookingSearchParams(operatingDayBoundary, timelineRange = i
|
|
|
119
119
|
timelineRange
|
|
120
120
|
);
|
|
121
121
|
}
|
|
122
|
+
var BOOKING_HOOK_EFFECT_DEDUP_MS = 500;
|
|
123
|
+
var BOOKING_HOOK_DEDUP_GLOBAL = "__pisellBookingHookEffectDedup_v1";
|
|
124
|
+
function getBookingHookEffectDedup() {
|
|
125
|
+
const g = globalThis;
|
|
126
|
+
if (!g[BOOKING_HOOK_DEDUP_GLOBAL]) {
|
|
127
|
+
g[BOOKING_HOOK_DEDUP_GLOBAL] = /* @__PURE__ */ new Map();
|
|
128
|
+
}
|
|
129
|
+
return g[BOOKING_HOOK_DEDUP_GLOBAL];
|
|
130
|
+
}
|
|
122
131
|
function usePisellReservationBookingData(enabled, options) {
|
|
123
132
|
var _a, _b;
|
|
124
133
|
const listPageSize = (options == null ? void 0 : options.listPageSize) ?? 50;
|
|
@@ -126,6 +135,9 @@ function usePisellReservationBookingData(enabled, options) {
|
|
|
126
135
|
const extraRequestParams = options == null ? void 0 : options.extraRequestParams;
|
|
127
136
|
const subscribeRealtimePush = (options == null ? void 0 : options.subscribeRealtimePush) ?? true;
|
|
128
137
|
const httpAbort = (options == null ? void 0 : options.httpAbort) ?? true;
|
|
138
|
+
const requestScopeKey = (options == null ? void 0 : options.requestScopeKey) ?? "booking-list";
|
|
139
|
+
const lastEffectRequestKeyRef = (0, import_react.useRef)(null);
|
|
140
|
+
const forceNextFetchRef = (0, import_react.useRef)(false);
|
|
129
141
|
const [pagination, setPagination] = (0, import_react.useState)({
|
|
130
142
|
pageNumber: 1,
|
|
131
143
|
pageSize: listPageSize
|
|
@@ -167,17 +179,27 @@ function usePisellReservationBookingData(enabled, options) {
|
|
|
167
179
|
pagination.pageSize,
|
|
168
180
|
extraRequestParams
|
|
169
181
|
]);
|
|
182
|
+
const requestParamsKey = (0, import_react.useMemo)(
|
|
183
|
+
() => (0, import_serve.getBookingListRequestCacheKey)(requestParams, {
|
|
184
|
+
abort: httpAbort,
|
|
185
|
+
osServer: true
|
|
186
|
+
}),
|
|
187
|
+
[requestParams, httpAbort]
|
|
188
|
+
);
|
|
170
189
|
const fetchBookingList = (0, import_ahooks.useMemoizedFn)(
|
|
171
190
|
async (params) => {
|
|
191
|
+
const skipRecentDedup = forceNextFetchRef.current;
|
|
192
|
+
forceNextFetchRef.current = false;
|
|
193
|
+
const listOptions = {
|
|
194
|
+
osServer: true,
|
|
195
|
+
abort: httpAbort,
|
|
196
|
+
skipRecentDedup
|
|
197
|
+
};
|
|
172
198
|
if (!subscribeRealtimePush) {
|
|
173
|
-
return (0, import_serve.getBookingList)(params,
|
|
174
|
-
osServer: true,
|
|
175
|
-
abort: httpAbort
|
|
176
|
-
});
|
|
199
|
+
return (0, import_serve.getBookingList)(params, listOptions);
|
|
177
200
|
}
|
|
178
201
|
return (0, import_serve.getBookingList)(params, {
|
|
179
|
-
|
|
180
|
-
abort: httpAbort,
|
|
202
|
+
...listOptions,
|
|
181
203
|
subscriberId: subscriberIdRef.current,
|
|
182
204
|
/**
|
|
183
205
|
* 订阅推送会多次进 callback;若 payload 没有与列表接口一致的 `list` 数组,
|
|
@@ -189,7 +211,6 @@ function usePisellReservationBookingData(enabled, options) {
|
|
|
189
211
|
* 合并成 1 次,显著降低推送密集时的卡顿与画布闪烁。
|
|
190
212
|
*/
|
|
191
213
|
callback: (res) => {
|
|
192
|
-
console.log(res, "res123454321");
|
|
193
214
|
const payload = (res == null ? void 0 : res.data) ?? res;
|
|
194
215
|
if (payload == null || !Array.isArray(payload.list)) return;
|
|
195
216
|
pendingPayloadRef.current = payload;
|
|
@@ -208,11 +229,27 @@ function usePisellReservationBookingData(enabled, options) {
|
|
|
208
229
|
}
|
|
209
230
|
);
|
|
210
231
|
const req = (0, import_ahooks.useRequest)(fetchBookingList, { manual: true });
|
|
232
|
+
const reqRunRef = (0, import_react.useRef)(req.run);
|
|
233
|
+
reqRunRef.current = req.run;
|
|
211
234
|
bookingMutateRef.current = req.mutate;
|
|
212
235
|
(0, import_react.useEffect)(() => {
|
|
213
|
-
if (!enabled)
|
|
214
|
-
|
|
215
|
-
|
|
236
|
+
if (!enabled) {
|
|
237
|
+
lastEffectRequestKeyRef.current = null;
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
const now = Date.now();
|
|
241
|
+
const bookingHookEffectDedup = getBookingHookEffectDedup();
|
|
242
|
+
const crossMountDedup = bookingHookEffectDedup.get(requestScopeKey);
|
|
243
|
+
if (lastEffectRequestKeyRef.current === requestParamsKey || crossMountDedup && crossMountDedup.key === requestParamsKey && now - crossMountDedup.at < BOOKING_HOOK_EFFECT_DEDUP_MS) {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
lastEffectRequestKeyRef.current = requestParamsKey;
|
|
247
|
+
bookingHookEffectDedup.set(requestScopeKey, {
|
|
248
|
+
key: requestParamsKey,
|
|
249
|
+
at: now
|
|
250
|
+
});
|
|
251
|
+
void reqRunRef.current(requestParams);
|
|
252
|
+
}, [enabled, requestParamsKey, requestParams, requestScopeKey]);
|
|
216
253
|
const onPageChange = (0, import_react.useCallback)((pageNumber, pageSize) => {
|
|
217
254
|
if (pageNumber < 1 || pageSize < 1) return;
|
|
218
255
|
setPagination({ pageNumber, pageSize });
|
|
@@ -227,17 +264,29 @@ function usePisellReservationBookingData(enabled, options) {
|
|
|
227
264
|
}, [getInitialSearchParams]);
|
|
228
265
|
const patchSearchParams = (0, import_react.useCallback)(
|
|
229
266
|
(updater) => {
|
|
230
|
-
setSearchParams((prev) =>
|
|
231
|
-
|
|
267
|
+
setSearchParams((prev) => {
|
|
268
|
+
const next = updater({ ...prev });
|
|
269
|
+
if (next === prev) return prev;
|
|
270
|
+
setPagination(
|
|
271
|
+
(p) => p.pageNumber === 1 ? p : { ...p, pageNumber: 1 }
|
|
272
|
+
);
|
|
273
|
+
return next;
|
|
274
|
+
});
|
|
232
275
|
},
|
|
233
276
|
[]
|
|
234
277
|
);
|
|
235
278
|
const refresh = (0, import_react.useCallback)(() => {
|
|
279
|
+
lastEffectRequestKeyRef.current = null;
|
|
280
|
+
getBookingHookEffectDedup().delete(requestScopeKey);
|
|
281
|
+
forceNextFetchRef.current = true;
|
|
236
282
|
void req.run(requestParams);
|
|
237
|
-
}, [req, requestParams]);
|
|
283
|
+
}, [req, requestParams, requestScopeKey]);
|
|
238
284
|
const refreshAsync = (0, import_react.useCallback)(() => {
|
|
285
|
+
lastEffectRequestKeyRef.current = null;
|
|
286
|
+
getBookingHookEffectDedup().delete(requestScopeKey);
|
|
287
|
+
forceNextFetchRef.current = true;
|
|
239
288
|
return req.runAsync(requestParams);
|
|
240
|
-
}, [req, requestParams]);
|
|
289
|
+
}, [req, requestParams, requestScopeKey]);
|
|
241
290
|
const rawList = (_a = req.data) == null ? void 0 : _a.list;
|
|
242
291
|
const data = (0, import_react.useMemo)(() => {
|
|
243
292
|
if (!Array.isArray(rawList) || rawList.length === 0) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import type { RecordBoardResourceWallCardModel, RecordBoardResourceWallLayoutPersist, VenueWallAppearanceTheme } from '@pisell/materials';
|
|
2
3
|
export interface UseReservationResourceWallPersistParams {
|
|
3
4
|
bodyViewStorageKey: string | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import type { ReservationScheduleBandValue } from '@pisell/materials';
|
|
2
3
|
/**
|
|
3
4
|
* @returns `schedule` 绑定日程带 UI;`debouncedSchedule` 绑定 sales / patch / 外部 onSearch。
|
|
@@ -7,10 +8,10 @@ export declare function useReservationScheduleDebounced(options: {
|
|
|
7
8
|
scheduleValueProp: ReservationScheduleBandValue | undefined;
|
|
8
9
|
}): {
|
|
9
10
|
internalSchedule: ReservationScheduleBandValue;
|
|
10
|
-
setInternalSchedule: import("react").Dispatch<
|
|
11
|
-
schedule:
|
|
11
|
+
setInternalSchedule: import("react").Dispatch<any>;
|
|
12
|
+
schedule: any;
|
|
12
13
|
debouncedSchedule: ReservationScheduleBandValue;
|
|
13
|
-
scheduleRef: import("react").MutableRefObject<
|
|
14
|
+
scheduleRef: import("react").MutableRefObject<any>;
|
|
14
15
|
flushCommittedSchedule: (next: ReservationScheduleBandValue) => void;
|
|
15
16
|
queueCommittedSchedule: (next: ReservationScheduleBandValue) => void;
|
|
16
17
|
};
|
|
@@ -9,6 +9,8 @@ export interface RequestOptions {
|
|
|
9
9
|
* 避免后发起的请求把先发起的那路 abort 掉(表现为该路 `req.data` 永远为空、列表不展示)。
|
|
10
10
|
*/
|
|
11
11
|
abort?: boolean;
|
|
12
|
+
/** 为 true 时跳过后端短时去重缓存(用于手动 refresh) */
|
|
13
|
+
skipRecentDedup?: boolean;
|
|
12
14
|
}
|
|
13
15
|
/**
|
|
14
16
|
* 获取订单列表(支持 osServer 本地代理)。
|
|
@@ -39,6 +41,8 @@ export interface GetBookingListParams {
|
|
|
39
41
|
[key: string]: any;
|
|
40
42
|
}
|
|
41
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;
|
|
42
46
|
export declare const getBookingList: (params: Record<string, any>, options?: RequestOptions) => Promise<any>;
|
|
43
47
|
/** 取消订单列表订阅(组件卸载时调用,与 useProducts cleanup 一致) */
|
|
44
48
|
export declare const unsubscribeOrderQuery: (subscriberId: string) => Promise<void>;
|