@pisell/private-materials 6.11.180 → 6.11.182
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 +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/es/components/checkout/PaymentModal.js +2 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/app.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +16 -0
- package/es/plus/pisellReservation/PisellReservation.js +126 -16
- package/es/plus/pisellReservation/PisellVenueWallPage.d.ts +1 -0
- package/es/plus/pisellReservation/PisellVenueWallPage.js +1 -0
- package/es/plus/pisellReservation/components/bookingDetailModal/ReservationBookingDetailModal.js +2 -2
- package/es/plus/pisellReservation/floorMap/useReservationFloorPlan.d.ts +0 -1
- package/es/plus/pisellReservation/hooks/useReservationSalesHostData.d.ts +5 -0
- package/es/plus/pisellReservation/hooks/useReservationSalesHostData.js +7 -3
- package/es/plus/pisellReservation/hooks/useReservationWallClockFollow.d.ts +7 -4
- package/es/plus/pisellReservation/hooks/useReservationWallClockFollow.js +54 -15
- package/es/plus/pisellReservation/types.d.ts +6 -0
- package/es/plus/pisellSalesManagement/config/booking.d.ts +6 -7
- package/es/plus/pisellSalesManagement/hooks/useBookingPerspective.js +3 -1
- package/es/plus/pisellSalesManagement/hooks/useSalesGridData.d.ts +0 -1
- package/es/plus/pisellSalesManagement/index.js +1 -1
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/lib/components/checkout/PaymentModal.js +2 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/app.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +16 -0
- package/lib/plus/pisellReservation/PisellReservation.js +21 -6
- package/lib/plus/pisellReservation/PisellVenueWallPage.d.ts +1 -0
- package/lib/plus/pisellReservation/components/bookingDetailModal/ReservationBookingDetailModal.js +2 -2
- package/lib/plus/pisellReservation/floorMap/useReservationFloorPlan.d.ts +0 -1
- package/lib/plus/pisellReservation/hooks/useReservationSalesHostData.d.ts +5 -0
- package/lib/plus/pisellReservation/hooks/useReservationSalesHostData.js +4 -2
- package/lib/plus/pisellReservation/hooks/useReservationWallClockFollow.d.ts +7 -4
- package/lib/plus/pisellReservation/hooks/useReservationWallClockFollow.js +47 -16
- package/lib/plus/pisellReservation/types.d.ts +6 -0
- package/lib/plus/pisellSalesManagement/config/booking.d.ts +6 -7
- package/lib/plus/pisellSalesManagement/hooks/useBookingPerspective.js +2 -1
- package/lib/plus/pisellSalesManagement/hooks/useSalesGridData.d.ts +0 -1
- package/lib/plus/pisellSalesManagement/index.js +1 -1
- package/package.json +4 -4
- package/es/plus/pisellReservation/docs/booking-detail-modal-data-ui-map.html +0 -357
- package/es/plus/pisellReservation/docs/floor-room-card-data-ui-map.html +0 -841
- package/lib/plus/pisellReservation/docs/booking-detail-modal-data-ui-map.html +0 -357
- package/lib/plus/pisellReservation/docs/floor-room-card-data-ui-map.html +0 -841
|
@@ -1091,7 +1091,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1091
1091
|
select.forEach(function (item) {
|
|
1092
1092
|
var mapCode = item.code ? WALLET_PASS_CODE_MAP[item.code] : null;
|
|
1093
1093
|
if (mapCode && walletPassDetail.map[mapCode]) {
|
|
1094
|
-
var _walletPassDetail$map, _walletPassDetail$map2, _walletPassDetail$map3, _walletPassDetail$map4;
|
|
1094
|
+
var _walletPassDetail$map, _walletPassDetail$map2, _walletPassDetail$map3, _walletPassDetail$map4, _walletPassDetail$map5;
|
|
1095
1095
|
voucherItems.push({
|
|
1096
1096
|
/** 支付金额 */
|
|
1097
1097
|
amount: item.amount,
|
|
@@ -1104,6 +1104,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1104
1104
|
/** 支付类型type,跟支付列表上对应的支付方式保持一致 */
|
|
1105
1105
|
type: (_walletPassDetail$map4 = walletPassDetail.map[mapCode]) === null || _walletPassDetail$map4 === void 0 ? void 0 : _walletPassDetail$map4.type,
|
|
1106
1106
|
/** 代金券、充值卡、积分卡等wallet pass id */
|
|
1107
|
+
custom_payment_id: Number((_walletPassDetail$map5 = walletPassDetail.map[mapCode]) === null || _walletPassDetail$map5 === void 0 ? void 0 : _walletPassDetail$map5.id) || 0,
|
|
1107
1108
|
voucher_id: item.voucher_id,
|
|
1108
1109
|
wallet_pass_usage_unit: item.wallet_pass_usage_unit,
|
|
1109
1110
|
wallet_pass_use_value: convertCurrencyAmountToWalletPassValue({
|
|
@@ -9,7 +9,7 @@ import { PosProps } from './const';
|
|
|
9
9
|
*/
|
|
10
10
|
declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
|
|
11
11
|
className?: string | undefined;
|
|
12
|
-
onChange?: ((status: "
|
|
12
|
+
onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
|
13
13
|
[keys: string]: unknown;
|
|
14
14
|
} | undefined, other?: any) => void) | undefined;
|
|
15
15
|
onClose: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PosProps, RouteType } from './const';
|
|
3
|
-
declare const App: ({ action, api, device_number, terminal, tyroUrl, tyroVersion, onChangeParams, isMobile, channel, formatAmount, ...props }: Omit<PosProps, "
|
|
3
|
+
declare const App: ({ action, api, device_number, terminal, tyroUrl, tyroVersion, onChangeParams, isMobile, channel, formatAmount, ...props }: Omit<PosProps, "type" | "mode" | "getApi"> & {
|
|
4
4
|
action: RouteType;
|
|
5
5
|
device_number: string | number;
|
|
6
6
|
api: ReturnType<PosProps['getApi']>;
|
|
@@ -11,7 +11,7 @@ import './device.less';
|
|
|
11
11
|
declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, containerStyle, }: {
|
|
12
12
|
api: PayProps['api'];
|
|
13
13
|
className?: string | undefined;
|
|
14
|
-
onChange?: ((status: "
|
|
14
|
+
onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
|
15
15
|
[keys: string]: unknown;
|
|
16
16
|
} | undefined, other?: any) => void) | undefined;
|
|
17
17
|
onClose: () => void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type TicketBookingSecondaryDisplayConfig } from './useTicketBookingSecondaryScreen';
|
|
3
|
+
import './index.less';
|
|
4
|
+
import { ProductDisplayConfig, ProductDisplayPresetKey } from '../ProductDisplayAdapter/types';
|
|
5
|
+
import { BaseResponsiveProps } from '../../../../responsive/type';
|
|
6
|
+
export declare const _formatBookingDetail: (data: any, modalState: any) => any;
|
|
7
|
+
interface TicketBookingProps {
|
|
8
|
+
onPrerenderComplete?: () => void;
|
|
9
|
+
productDisplayConfig?: ProductDisplayPresetKey | ProductDisplayConfig;
|
|
10
|
+
isShowTimeBar?: boolean;
|
|
11
|
+
isShowFloatButtons?: boolean;
|
|
12
|
+
/** 副屏展示:购物车列数、是否显示客户信息等 */
|
|
13
|
+
secondaryScreenDisplay?: TicketBookingSecondaryDisplayConfig;
|
|
14
|
+
}
|
|
15
|
+
declare const _default: React.ForwardRefExoticComponent<TicketBookingProps & BaseResponsiveProps & React.RefAttributes<unknown>>;
|
|
16
|
+
export default _default;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
var _excluded = ["gridDataSourceKey", "dataSources", "scheduleValue", "onScheduleChange", "toolBar", "floorMap", "scheduleStartSlot", "scheduleEndSlot", "onNewReservation", "timeNavigatorProps", "scheduleProps", "fab", "defaultBodyView", "data", "total", "pagination", "onPageChange", "onSearch", "onReset", "searchParams", "loading", "rowKey", "className", "style", "floorPlanId", "floorPlanCanvasWidth", "floorPlanCanvasHeight", "floorPlanCode", "floorPlanName", "floorPlanSort", "floorPlanStatus", "onFloorPlanPersisted", "putFloorPlan", "onFloorMapBookingClick", "bodyViewSwitchable", "lockedBodyView", "bodyViewStorageKey", "floorMapHudTableDrawer"];
|
|
1
|
+
var _excluded = ["gridDataSourceKey", "dataSources", "scheduleValue", "onScheduleChange", "toolBar", "floorMap", "scheduleStartSlot", "scheduleEndSlot", "onNewReservation", "timeNavigatorProps", "scheduleProps", "fab", "defaultBodyView", "data", "total", "pagination", "onPageChange", "onSearch", "onReset", "searchParams", "loading", "rowKey", "className", "style", "floorPlanId", "floorPlanCanvasWidth", "floorPlanCanvasHeight", "floorPlanCode", "floorPlanName", "floorPlanSort", "floorPlanStatus", "onFloorPlanPersisted", "putFloorPlan", "onFloorMapBookingClick", "bodyViewSwitchable", "lockedBodyView", "bodyViewStorageKey", "floorMapHudTableDrawer", "forceFollowWallClock"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
3
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
4
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
5
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
6
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
8
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
10
7
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
11
8
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
12
9
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -22,6 +19,9 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
22
19
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
23
20
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
24
21
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
22
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
23
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
24
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
25
25
|
import React, { useEffect, useMemo, useState, useCallback, useRef } from 'react';
|
|
26
26
|
import dayjs from 'dayjs';
|
|
27
27
|
import 'dayjs/locale/zh-cn';
|
|
@@ -67,6 +67,109 @@ import { useReservationResourceWallPersist } from "./hooks/useReservationResourc
|
|
|
67
67
|
import { useReservationDebugLoggers } from "./hooks/useReservationDebugLoggers";
|
|
68
68
|
import { ReservationHudDrawer } from "./components/ReservationHudDrawer";
|
|
69
69
|
|
|
70
|
+
/**
|
|
71
|
+
* Dumi / Story 等无低代码引擎时,`utils` 的 request 未被注入;
|
|
72
|
+
* 子模块仍会调用 `request.getRequest().post/get`,未 setRequest 会抛错。
|
|
73
|
+
* 仅在无引擎请求实例时使用占位(返回空 data),不影响真实环境中 `appHelper.utils.request` 优先注入。
|
|
74
|
+
*/
|
|
75
|
+
var PREVIEW_HTTP_CLIENT = {
|
|
76
|
+
get: function () {
|
|
77
|
+
var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
78
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
79
|
+
while (1) switch (_context.prev = _context.next) {
|
|
80
|
+
case 0:
|
|
81
|
+
return _context.abrupt("return", {
|
|
82
|
+
data: {}
|
|
83
|
+
});
|
|
84
|
+
case 1:
|
|
85
|
+
case "end":
|
|
86
|
+
return _context.stop();
|
|
87
|
+
}
|
|
88
|
+
}, _callee);
|
|
89
|
+
}));
|
|
90
|
+
function get() {
|
|
91
|
+
return _get.apply(this, arguments);
|
|
92
|
+
}
|
|
93
|
+
return get;
|
|
94
|
+
}(),
|
|
95
|
+
post: function () {
|
|
96
|
+
var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
97
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
98
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
99
|
+
case 0:
|
|
100
|
+
return _context2.abrupt("return", {
|
|
101
|
+
data: {}
|
|
102
|
+
});
|
|
103
|
+
case 1:
|
|
104
|
+
case "end":
|
|
105
|
+
return _context2.stop();
|
|
106
|
+
}
|
|
107
|
+
}, _callee2);
|
|
108
|
+
}));
|
|
109
|
+
function post() {
|
|
110
|
+
return _post.apply(this, arguments);
|
|
111
|
+
}
|
|
112
|
+
return post;
|
|
113
|
+
}(),
|
|
114
|
+
put: function () {
|
|
115
|
+
var _put = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
116
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
117
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
118
|
+
case 0:
|
|
119
|
+
return _context3.abrupt("return", {
|
|
120
|
+
data: {}
|
|
121
|
+
});
|
|
122
|
+
case 1:
|
|
123
|
+
case "end":
|
|
124
|
+
return _context3.stop();
|
|
125
|
+
}
|
|
126
|
+
}, _callee3);
|
|
127
|
+
}));
|
|
128
|
+
function put() {
|
|
129
|
+
return _put.apply(this, arguments);
|
|
130
|
+
}
|
|
131
|
+
return put;
|
|
132
|
+
}(),
|
|
133
|
+
remove: function () {
|
|
134
|
+
var _remove = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
135
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
136
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
137
|
+
case 0:
|
|
138
|
+
return _context4.abrupt("return", {
|
|
139
|
+
data: {}
|
|
140
|
+
});
|
|
141
|
+
case 1:
|
|
142
|
+
case "end":
|
|
143
|
+
return _context4.stop();
|
|
144
|
+
}
|
|
145
|
+
}, _callee4);
|
|
146
|
+
}));
|
|
147
|
+
function remove() {
|
|
148
|
+
return _remove.apply(this, arguments);
|
|
149
|
+
}
|
|
150
|
+
return remove;
|
|
151
|
+
}(),
|
|
152
|
+
custom: function () {
|
|
153
|
+
var _custom = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
154
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
155
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
156
|
+
case 0:
|
|
157
|
+
return _context5.abrupt("return", {
|
|
158
|
+
data: {}
|
|
159
|
+
});
|
|
160
|
+
case 1:
|
|
161
|
+
case "end":
|
|
162
|
+
return _context5.stop();
|
|
163
|
+
}
|
|
164
|
+
}, _callee5);
|
|
165
|
+
}));
|
|
166
|
+
function custom() {
|
|
167
|
+
return _custom.apply(this, arguments);
|
|
168
|
+
}
|
|
169
|
+
return custom;
|
|
170
|
+
}()
|
|
171
|
+
};
|
|
172
|
+
|
|
70
173
|
/**
|
|
71
174
|
* 预约看板 Core:内置 Sales 预约列表 + 时间轴 + 平面图。
|
|
72
175
|
* 页面壳 {@link PisellReservationBookingPage} / {@link PisellVenueControlPage} / PisellVenueWallPage 通过 props 组合默认行为。
|
|
@@ -115,6 +218,7 @@ export var PisellReservationCore = function PisellReservationCore(props) {
|
|
|
115
218
|
bodyViewStorageKey = props.bodyViewStorageKey,
|
|
116
219
|
_props$floorMapHudTab = props.floorMapHudTableDrawer,
|
|
117
220
|
floorMapHudTableDrawer = _props$floorMapHudTab === void 0 ? false : _props$floorMapHudTab,
|
|
221
|
+
forceFollowWallClockProp = props.forceFollowWallClock,
|
|
118
222
|
rest = _objectWithoutProperties(props, _excluded);
|
|
119
223
|
void _unusedDefaultBodyView;
|
|
120
224
|
|
|
@@ -127,9 +231,7 @@ export var PisellReservationCore = function PisellReservationCore(props) {
|
|
|
127
231
|
|
|
128
232
|
var engineCtx = useEngineContext();
|
|
129
233
|
var r = engineCtx === null || engineCtx === void 0 || (_engineCtx$appHelper = engineCtx.appHelper) === null || _engineCtx$appHelper === void 0 || (_engineCtx$appHelper = _engineCtx$appHelper.utils) === null || _engineCtx$appHelper === void 0 ? void 0 : _engineCtx$appHelper.request;
|
|
130
|
-
|
|
131
|
-
request.setRequest(r);
|
|
132
|
-
}
|
|
234
|
+
request.setRequest(r !== null && r !== void 0 ? r : PREVIEW_HTTP_CLIENT);
|
|
133
235
|
var pisellos = usePisellOS();
|
|
134
236
|
/** 低代码里 context 常每次给新 `pisellos` 对象,勿把 `pisellos` 放进 effect 依赖 */
|
|
135
237
|
var pisellosRef = useRef(pisellos);
|
|
@@ -236,6 +338,11 @@ export var PisellReservationCore = function PisellReservationCore(props) {
|
|
|
236
338
|
_useState2 = _slicedToArray(_useState, 2),
|
|
237
339
|
shellBodyView = _useState2[0],
|
|
238
340
|
setShellBodyView = _useState2[1];
|
|
341
|
+
|
|
342
|
+
/** 锁定大屏子视图、显式 prop、或 Segmented 切到「大屏」:强制墙钟跟随且不可关 */
|
|
343
|
+
var wallClockFollowLocked = useMemo(function () {
|
|
344
|
+
return Boolean(forceFollowWallClockProp) || lockedBodyView === 'resourceWall' || shellBodyView === 'resourceWall';
|
|
345
|
+
}, [forceFollowWallClockProp, lockedBodyView, shellBodyView]);
|
|
239
346
|
var _useReservationFloorP = useReservationFloorPlan({
|
|
240
347
|
resolvedFloorPlanId: resolvedFloorPlanId,
|
|
241
348
|
effectiveFloorPlanCode: effectiveFloorPlanCode,
|
|
@@ -338,17 +445,17 @@ export var PisellReservationCore = function PisellReservationCore(props) {
|
|
|
338
445
|
floorDayBookingData.refresh();
|
|
339
446
|
},
|
|
340
447
|
refreshAsync: function () {
|
|
341
|
-
var _refreshAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
342
|
-
return _regeneratorRuntime().wrap(function
|
|
343
|
-
while (1) switch (
|
|
448
|
+
var _refreshAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
449
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
450
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
344
451
|
case 0:
|
|
345
|
-
|
|
452
|
+
_context6.next = 2;
|
|
346
453
|
return Promise.all([resourceBoardData.refreshAsync(), gridBookingData.refreshAsync(), floorDayBookingData.refreshAsync()]);
|
|
347
454
|
case 2:
|
|
348
455
|
case "end":
|
|
349
|
-
return
|
|
456
|
+
return _context6.stop();
|
|
350
457
|
}
|
|
351
|
-
},
|
|
458
|
+
}, _callee6);
|
|
352
459
|
}));
|
|
353
460
|
function refreshAsync() {
|
|
354
461
|
return _refreshAsync.apply(this, arguments);
|
|
@@ -374,7 +481,7 @@ export var PisellReservationCore = function PisellReservationCore(props) {
|
|
|
374
481
|
debouncedSchedule = _useReservationSchedu.debouncedSchedule,
|
|
375
482
|
flushCommittedSchedule = _useReservationSchedu.flushCommittedSchedule,
|
|
376
483
|
queueCommittedSchedule = _useReservationSchedu.queueCommittedSchedule;
|
|
377
|
-
var _useReservationWallCl = useReservationWallClockFollow(scheduleValueProp, setInternalSchedule, flushCommittedSchedule, onScheduleChange),
|
|
484
|
+
var _useReservationWallCl = useReservationWallClockFollow(scheduleValueProp, setInternalSchedule, flushCommittedSchedule, onScheduleChange, wallClockFollowLocked),
|
|
378
485
|
followWallClock = _useReservationWallCl.followWallClock,
|
|
379
486
|
setFollowWallClock = _useReservationWallCl.setFollowWallClock,
|
|
380
487
|
onFollowWallClockToggle = _useReservationWallCl.onFollowWallClockToggle,
|
|
@@ -387,6 +494,7 @@ export var PisellReservationCore = function PisellReservationCore(props) {
|
|
|
387
494
|
pisellosRef: pisellosRef,
|
|
388
495
|
hasPisellosGetModule: hasPisellosGetModule,
|
|
389
496
|
debouncedSchedule: debouncedSchedule,
|
|
497
|
+
followWallClock: followWallClock,
|
|
390
498
|
resourceBoardLoading: resourceBoardData.loading,
|
|
391
499
|
floorDayBookingLoading: floorDayBookingData.loading,
|
|
392
500
|
floorDayBookingData: floorDayBookingData.data,
|
|
@@ -530,13 +638,15 @@ export var PisellReservationCore = function PisellReservationCore(props) {
|
|
|
530
638
|
}
|
|
531
639
|
}, [debouncedSchedule, isInternalListData, floorDayBookingData.patchSearchParams, operatingDayBoundary]);
|
|
532
640
|
var handleScheduleChange = useCallback(function (next) {
|
|
533
|
-
|
|
641
|
+
if (!wallClockFollowLocked) {
|
|
642
|
+
setFollowWallClock(false);
|
|
643
|
+
}
|
|
534
644
|
if (scheduleValueProp === undefined) {
|
|
535
645
|
setInternalSchedule(next);
|
|
536
646
|
}
|
|
537
647
|
onScheduleChange === null || onScheduleChange === void 0 || onScheduleChange(next);
|
|
538
648
|
queueCommittedSchedule(next);
|
|
539
|
-
}, [scheduleValueProp, onScheduleChange, setFollowWallClock, queueCommittedSchedule]);
|
|
649
|
+
}, [scheduleValueProp, onScheduleChange, setFollowWallClock, queueCommittedSchedule, wallClockFollowLocked]);
|
|
540
650
|
|
|
541
651
|
// --- 平面图:合并 props、点击预约、HUD;loading 防抖后交给 RecordBoard ---
|
|
542
652
|
|
|
@@ -7,6 +7,7 @@ import type { PisellReservationProps } from './types';
|
|
|
7
7
|
* - `lockedBodyView="resourceWall"`:锁定在大屏视图。
|
|
8
8
|
*
|
|
9
9
|
* **无需新增 props 类型**:沿用 {@link PisellReservationProps};可选行为与预约页相同(如 `toolBar`、`scheduleValue`、`floorMap` 等)。
|
|
10
|
+
* Core 在锁定大屏或预约页内 Segmented 切到「大屏」时(`shellBodyView === 'resourceWall'`)均 **强制跟随当前时间**(不可关闭)。
|
|
10
11
|
* 默认使用 {@link PISELL_RESERVATION_VENUE_WALL_PAGE_STORAGE_KEY} 作为 `bodyViewStorageKey`,以便大屏筛选与主预约页 localStorage 隔离;可传入自定义 key 覆盖。
|
|
11
12
|
*/
|
|
12
13
|
export declare const PisellVenueWallPage: React.FC<PisellReservationProps>;
|
|
@@ -12,6 +12,7 @@ import { PISELL_RESERVATION_VENUE_WALL_PAGE_STORAGE_KEY } from "./reservationCon
|
|
|
12
12
|
* - `lockedBodyView="resourceWall"`:锁定在大屏视图。
|
|
13
13
|
*
|
|
14
14
|
* **无需新增 props 类型**:沿用 {@link PisellReservationProps};可选行为与预约页相同(如 `toolBar`、`scheduleValue`、`floorMap` 等)。
|
|
15
|
+
* Core 在锁定大屏或预约页内 Segmented 切到「大屏」时(`shellBodyView === 'resourceWall'`)均 **强制跟随当前时间**(不可关闭)。
|
|
15
16
|
* 默认使用 {@link PISELL_RESERVATION_VENUE_WALL_PAGE_STORAGE_KEY} 作为 `bodyViewStorageKey`,以便大屏筛选与主预约页 localStorage 隔离;可传入自定义 key 覆盖。
|
|
16
17
|
*/
|
|
17
18
|
export var PisellVenueWallPage = function PisellVenueWallPage(props) {
|
package/es/plus/pisellReservation/components/bookingDetailModal/ReservationBookingDetailModal.js
CHANGED
|
@@ -143,7 +143,7 @@ export function ReservationBookingDetailModal(props) {
|
|
|
143
143
|
var _engineContext$appHel3;
|
|
144
144
|
stopUiClick(e);
|
|
145
145
|
if (!raw) return;
|
|
146
|
-
var _ref2 = ((_engineContext$appHel3 = engineContext.appHelper) === null || _engineContext$appHel3 === void 0 ? void 0 : _engineContext$appHel3.utils) || {},
|
|
146
|
+
var _ref2 = (engineContext === null || engineContext === void 0 || (_engineContext$appHel3 = engineContext.appHelper) === null || _engineContext$appHel3 === void 0 ? void 0 : _engineContext$appHel3.utils) || {},
|
|
147
147
|
action = _ref2.action,
|
|
148
148
|
NativePage = _ref2.NativePage;
|
|
149
149
|
var orderId = resolveOrderIdForHostActions(raw);
|
|
@@ -212,7 +212,7 @@ export function ReservationBookingDetailModal(props) {
|
|
|
212
212
|
default:
|
|
213
213
|
break;
|
|
214
214
|
}
|
|
215
|
-
}, [raw, engineContext.appHelper, reservationBiz, associatedMenuListIds]);
|
|
215
|
+
}, [raw, engineContext === null || engineContext === void 0 ? void 0 : engineContext.appHelper, reservationBiz, associatedMenuListIds]);
|
|
216
216
|
return /*#__PURE__*/React.createElement(PisellModal, {
|
|
217
217
|
platform: "pc",
|
|
218
218
|
open: canShow,
|
|
@@ -10,12 +10,17 @@ declare type PisellOSLike = {
|
|
|
10
10
|
* 内置列表且资源台 + floorDayBooking 均就绪后,向宿主 sales 拉两套数据:
|
|
11
11
|
* - `getResourceBookingList`:游标时刻下的预约子集,参与合并进平面图 dataSources;
|
|
12
12
|
* - `getTimelineHighlights`:时间轴密度折线(无则退回 PisellReservation 内本地计算)。
|
|
13
|
+
*
|
|
14
|
+
* **跟随当前**:`followWallClock === true` 时第三个参数 `currentTimeStr` 与 `timeStr` 相同(均来自 `debouncedSchedule.at`),
|
|
15
|
+
* 避免与墙钟 `dayjs()` 差一分钟;手动关闭跟随后仍传实时 `dayjs()`,保留「游标 vs 此刻」双通道语义。
|
|
13
16
|
*/
|
|
14
17
|
export declare function useReservationSalesHostData(options: {
|
|
15
18
|
isInternalListData: boolean;
|
|
16
19
|
pisellosRef: MutableRefObject<PisellOSLike>;
|
|
17
20
|
hasPisellosGetModule: boolean;
|
|
18
21
|
debouncedSchedule: ReservationScheduleBandValue;
|
|
22
|
+
/** 顶栏「跟随当前时间」:为 true 时 `getResourceBookingList` 的 currentTime 与 timeStr 一致 */
|
|
23
|
+
followWallClock: boolean;
|
|
19
24
|
resourceBoardLoading: boolean;
|
|
20
25
|
floorDayBookingLoading: boolean;
|
|
21
26
|
floorDayBookingData: unknown[];
|
|
@@ -12,12 +12,16 @@ import { normalizeSalesResourceBookingListResult } from "../data/reservationTabl
|
|
|
12
12
|
* 内置列表且资源台 + floorDayBooking 均就绪后,向宿主 sales 拉两套数据:
|
|
13
13
|
* - `getResourceBookingList`:游标时刻下的预约子集,参与合并进平面图 dataSources;
|
|
14
14
|
* - `getTimelineHighlights`:时间轴密度折线(无则退回 PisellReservation 内本地计算)。
|
|
15
|
+
*
|
|
16
|
+
* **跟随当前**:`followWallClock === true` 时第三个参数 `currentTimeStr` 与 `timeStr` 相同(均来自 `debouncedSchedule.at`),
|
|
17
|
+
* 避免与墙钟 `dayjs()` 差一分钟;手动关闭跟随后仍传实时 `dayjs()`,保留「游标 vs 此刻」双通道语义。
|
|
15
18
|
*/
|
|
16
19
|
export function useReservationSalesHostData(options) {
|
|
17
20
|
var isInternalListData = options.isInternalListData,
|
|
18
21
|
pisellosRef = options.pisellosRef,
|
|
19
22
|
hasPisellosGetModule = options.hasPisellosGetModule,
|
|
20
23
|
debouncedSchedule = options.debouncedSchedule,
|
|
24
|
+
followWallClock = options.followWallClock,
|
|
21
25
|
resourceBoardLoading = options.resourceBoardLoading,
|
|
22
26
|
floorDayBookingLoading = options.floorDayBookingLoading,
|
|
23
27
|
floorDayBookingData = options.floorDayBookingData,
|
|
@@ -106,7 +110,7 @@ export function useReservationSalesHostData(options) {
|
|
|
106
110
|
if (!Array.isArray(list)) {
|
|
107
111
|
return;
|
|
108
112
|
}
|
|
109
|
-
var retryGateKey = "".concat(debouncedAtMs !== null && debouncedAtMs !== void 0 ? debouncedAtMs : 'na', "|").concat(floorDayBookingDepKey, "|v").concat(floorDayBookingDataVersion, "|").concat(hasPisellosGetModule ? 1 : 0);
|
|
113
|
+
var retryGateKey = "".concat(debouncedAtMs !== null && debouncedAtMs !== void 0 ? debouncedAtMs : 'na', "|").concat(floorDayBookingDepKey, "|v").concat(floorDayBookingDataVersion, "|").concat(hasPisellosGetModule ? 1 : 0, "|fw").concat(followWallClock ? 1 : 0);
|
|
110
114
|
if (retryGateKey !== resourceListRetryGateRef.current) {
|
|
111
115
|
resourceListRetryGateRef.current = retryGateKey;
|
|
112
116
|
resourceListHostSkipRef.current = false;
|
|
@@ -139,7 +143,7 @@ export function useReservationSalesHostData(options) {
|
|
|
139
143
|
|
|
140
144
|
var resourceBookingListTimeFormat = 'YYYY-MM-DD HH:mm';
|
|
141
145
|
var timeStr = dayjs(debouncedSchedule.at).format(resourceBookingListTimeFormat);
|
|
142
|
-
var currentTimeStr = dayjs().format(resourceBookingListTimeFormat);
|
|
146
|
+
var currentTimeStr = followWallClock ? timeStr : dayjs().format(resourceBookingListTimeFormat);
|
|
143
147
|
var applyHostList = function applyHostList(raw) {
|
|
144
148
|
if (salesBookingRequestRef.current !== reqId) return;
|
|
145
149
|
var normalized = normalizeSalesResourceBookingListResult(raw);
|
|
@@ -177,7 +181,7 @@ export function useReservationSalesHostData(options) {
|
|
|
177
181
|
* 兜底信号:哪怕 cheap hash 没变,只要有 WS 推送 mutate 就重跑 host call。
|
|
178
182
|
* 配合 `resourceListRetryGateRef` 保证非宿主场景不会重复打接口。
|
|
179
183
|
*/
|
|
180
|
-
floorDayBookingDataVersion, debouncedAtMs, pisellosRef]);
|
|
184
|
+
floorDayBookingDataVersion, debouncedAtMs, followWallClock, pisellosRef]);
|
|
181
185
|
var _useState3 = useState(null),
|
|
182
186
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
183
187
|
salesTimelineHighlights = _useState4[0],
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import { type SetStateAction } from 'react';
|
|
2
2
|
import type { ReservationScheduleBandValue } from '@pisell/materials';
|
|
3
3
|
declare type OnScheduleChange = ((v: ReservationScheduleBandValue) => void) | undefined;
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* 顶栏「跟随当前时间」:在每自然分钟整点(*: * :00)对齐日程,`at` 使用当前分钟的 `startOf('minute')`,
|
|
6
|
+
* 并通过 flushCommittedSchedule 触发防抖链。
|
|
7
|
+
*
|
|
8
|
+
* @param wallClockFollowLocked 为 true 时(如大屏锁定 resourceWall):定时器始终运行,且不可通过交互关闭跟随。
|
|
6
9
|
*/
|
|
7
|
-
export declare function useReservationWallClockFollow(scheduleValueProp: ReservationScheduleBandValue | undefined, setInternalSchedule: (v: ReservationScheduleBandValue) => void, flushCommittedSchedule: (v: ReservationScheduleBandValue) => void, onScheduleChange: OnScheduleChange): {
|
|
10
|
+
export declare function useReservationWallClockFollow(scheduleValueProp: ReservationScheduleBandValue | undefined, setInternalSchedule: (v: ReservationScheduleBandValue) => void, flushCommittedSchedule: (v: ReservationScheduleBandValue) => void, onScheduleChange: OnScheduleChange, wallClockFollowLocked?: boolean): {
|
|
8
11
|
followWallClock: boolean;
|
|
9
|
-
setFollowWallClock:
|
|
12
|
+
setFollowWallClock: (value: SetStateAction<boolean>) => void;
|
|
10
13
|
onFollowWallClockToggle: () => void;
|
|
11
14
|
onTimeNavigatorUserInteraction: () => void;
|
|
12
15
|
};
|
|
@@ -7,51 +7,90 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
7
7
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
8
8
|
import dayjs from 'dayjs';
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* 顶栏「跟随当前时间」:在每自然分钟整点(*: * :00)对齐日程,`at` 使用当前分钟的 `startOf('minute')`,
|
|
11
|
+
* 并通过 flushCommittedSchedule 触发防抖链。
|
|
12
|
+
*
|
|
13
|
+
* @param wallClockFollowLocked 为 true 时(如大屏锁定 resourceWall):定时器始终运行,且不可通过交互关闭跟随。
|
|
11
14
|
*/
|
|
12
15
|
export function useReservationWallClockFollow(scheduleValueProp, setInternalSchedule, flushCommittedSchedule, onScheduleChange) {
|
|
16
|
+
var wallClockFollowLocked = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
13
17
|
var _useState = useState(true),
|
|
14
18
|
_useState2 = _slicedToArray(_useState, 2),
|
|
15
19
|
followWallClock = _useState2[0],
|
|
16
|
-
|
|
20
|
+
setFollowWallClockInternal = _useState2[1];
|
|
17
21
|
var onScheduleChangeRef = useRef(onScheduleChange);
|
|
22
|
+
/** 避免 effect 依赖整个 `scheduleValueProp` 引用:父级每次 render 新对象会误重置定时器并多次首帧 tick */
|
|
23
|
+
var scheduleValuePropRef = useRef(scheduleValueProp);
|
|
24
|
+
scheduleValuePropRef.current = scheduleValueProp;
|
|
25
|
+
var scheduleControlled = scheduleValueProp !== undefined;
|
|
26
|
+
var followWallClockEffective = wallClockFollowLocked || followWallClock;
|
|
27
|
+
|
|
28
|
+
/** 锁定模式下始终保持内部开关为 true,避免闭包里读到 false */
|
|
29
|
+
useEffect(function () {
|
|
30
|
+
if (wallClockFollowLocked) setFollowWallClockInternal(true);
|
|
31
|
+
}, [wallClockFollowLocked]);
|
|
18
32
|
useEffect(function () {
|
|
19
33
|
onScheduleChangeRef.current = onScheduleChange;
|
|
20
34
|
});
|
|
21
35
|
useEffect(function () {
|
|
22
|
-
if (!
|
|
36
|
+
if (!followWallClockEffective) return;
|
|
37
|
+
var timeoutId = null;
|
|
38
|
+
var cancelled = false;
|
|
39
|
+
|
|
40
|
+
/** 距下一自然分钟整点的毫秒数(下一分钟的 :00.000) */
|
|
41
|
+
var msUntilNextMinuteBoundary = function msUntilNextMinuteBoundary() {
|
|
42
|
+
var now = dayjs();
|
|
43
|
+
return Math.max(0, now.startOf('minute').add(1, 'minute').diff(now));
|
|
44
|
+
};
|
|
23
45
|
var tick = function tick() {
|
|
24
46
|
var _onScheduleChangeRef$;
|
|
25
|
-
var now = dayjs();
|
|
47
|
+
var now = dayjs().startOf('minute');
|
|
26
48
|
var next = {
|
|
27
49
|
date: now.startOf('day'),
|
|
28
50
|
at: now
|
|
29
51
|
};
|
|
30
|
-
if (
|
|
52
|
+
if (scheduleValuePropRef.current === undefined) {
|
|
31
53
|
setInternalSchedule(next);
|
|
32
54
|
}
|
|
33
55
|
(_onScheduleChangeRef$ = onScheduleChangeRef.current) === null || _onScheduleChangeRef$ === void 0 || _onScheduleChangeRef$.call(onScheduleChangeRef, next);
|
|
34
56
|
/** 跟随当前:立即提交日程,patch / 外部 onSearch 由 debouncedSchedule effect 统一处理 */
|
|
35
57
|
flushCommittedSchedule(next);
|
|
36
58
|
};
|
|
59
|
+
var scheduleNextBoundary = function scheduleNextBoundary() {
|
|
60
|
+
if (cancelled) return;
|
|
61
|
+
timeoutId = window.setTimeout(function () {
|
|
62
|
+
if (cancelled) return;
|
|
63
|
+
tick();
|
|
64
|
+
scheduleNextBoundary();
|
|
65
|
+
}, msUntilNextMinuteBoundary());
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/** 首帧:立刻对齐到当前整分;之后仅在每分钟 rollover 时再 tick */
|
|
37
69
|
tick();
|
|
38
|
-
|
|
70
|
+
scheduleNextBoundary();
|
|
39
71
|
return function () {
|
|
40
|
-
|
|
72
|
+
cancelled = true;
|
|
73
|
+
if (timeoutId != null) window.clearTimeout(timeoutId);
|
|
41
74
|
};
|
|
42
|
-
// setInternalSchedule 为 schedule hook 的 setState
|
|
43
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps --
|
|
44
|
-
}, [
|
|
75
|
+
// setInternalSchedule 为 schedule hook 的 setState,引用稳定;不把 scheduleValueProp 放进 deps(见 ref)
|
|
76
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- scheduleControlled:仅受控/非受控切换时重启定时器
|
|
77
|
+
}, [followWallClockEffective, flushCommittedSchedule, scheduleControlled]);
|
|
78
|
+
var setFollowWallClock = useCallback(function (value) {
|
|
79
|
+
if (wallClockFollowLocked) return;
|
|
80
|
+
setFollowWallClockInternal(value);
|
|
81
|
+
}, [wallClockFollowLocked]);
|
|
45
82
|
var onFollowWallClockToggle = useCallback(function () {
|
|
46
|
-
|
|
83
|
+
if (wallClockFollowLocked) return;
|
|
84
|
+
setFollowWallClockInternal(function (v) {
|
|
47
85
|
return !v;
|
|
48
86
|
});
|
|
49
|
-
}, []);
|
|
87
|
+
}, [wallClockFollowLocked]);
|
|
50
88
|
var onTimeNavigatorUserInteraction = useCallback(function () {
|
|
51
|
-
|
|
52
|
-
|
|
89
|
+
if (wallClockFollowLocked) return;
|
|
90
|
+
setFollowWallClockInternal(false);
|
|
91
|
+
}, [wallClockFollowLocked]);
|
|
53
92
|
return {
|
|
54
|
-
followWallClock:
|
|
93
|
+
followWallClock: followWallClockEffective,
|
|
55
94
|
setFollowWallClock: setFollowWallClock,
|
|
56
95
|
onFollowWallClockToggle: onFollowWallClockToggle,
|
|
57
96
|
onTimeNavigatorUserInteraction: onTimeNavigatorUserInteraction
|
|
@@ -165,4 +165,10 @@ export interface PisellReservationProps extends Omit<RecordBoardProps, 'toolBar'
|
|
|
165
165
|
bodyViewStorageKey?: string;
|
|
166
166
|
/** 点击平面图左上角 HUD 打开窄屏表格抽屉(画布已绑定资源行) */
|
|
167
167
|
floorMapHudTableDrawer?: boolean;
|
|
168
|
+
/**
|
|
169
|
+
* 强制「跟随当前时间」不可关闭(定时对齐墙钟、`getResourceBookingList` 与游标时间一致)。
|
|
170
|
+
* - **默认**:{@link lockedBodyView} 为 `resourceWall`,或用户在 RecordBoard 内**切换到「大屏 / resourceWall」子视图**时自动启用。
|
|
171
|
+
* - 设为 `true` 可在其它场景也强制跟随。
|
|
172
|
+
*/
|
|
173
|
+
forceFollowWallClock?: boolean;
|
|
168
174
|
}
|