@pisell/private-materials 3.0.149 → 3.0.151-gray
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/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +12 -12
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +12 -12
- package/es/components/booking/addons/model.d.ts +2 -1
- package/es/components/booking/components/footer/index.js +3 -3
- package/es/components/booking/dashboard/index.d.ts +10 -0
- package/es/components/booking/dashboard/index.js +242 -0
- package/es/components/booking/dashboard/serve.d.ts +1 -0
- package/es/components/booking/dashboard/serve.js +27 -0
- package/es/components/booking/forms/forms.d.ts +1 -0
- package/es/components/booking/forms/forms.js +4 -2
- package/es/components/booking/forms/model.d.ts +2 -1
- package/es/components/booking/forms/single/index.d.ts +1 -1
- package/es/components/booking/forms/single/index.js +4 -3
- package/es/components/booking/info/addServiceVariant/index.d.ts +7 -0
- package/es/components/booking/info/addServiceVariant/index.js +33 -0
- package/es/components/booking/info/index.js +2 -1
- package/es/components/booking/info/index.less +9 -0
- package/es/components/booking/info/pet/index.js +1 -1
- package/es/components/booking/info/service/addService/index.d.ts +8 -2
- package/es/components/booking/info/service/addService/index.js +82 -36
- package/es/components/booking/info/service/addService/index.less +27 -1
- package/es/components/booking/info/service/editService/index.js +7 -9
- package/es/components/booking/locales.d.ts +48 -0
- package/es/components/booking/locales.js +51 -3
- package/es/components/booking/model.d.ts +2 -0
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +2 -1
- package/es/components/booking/payments/model.d.ts +2 -1
- package/es/components/booking/utils.d.ts +1 -1
- package/es/components/booking/utils.js +54 -51
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +2 -1
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/lib/components/booking/addons/model.d.ts +2 -1
- package/lib/components/booking/components/footer/index.js +3 -3
- package/lib/components/booking/dashboard/index.d.ts +10 -0
- package/lib/components/booking/dashboard/index.js +225 -0
- package/lib/components/booking/dashboard/serve.d.ts +1 -0
- package/lib/components/booking/dashboard/serve.js +33 -0
- package/lib/components/booking/forms/forms.d.ts +1 -0
- package/lib/components/booking/forms/forms.js +5 -2
- package/lib/components/booking/forms/model.d.ts +2 -1
- package/lib/components/booking/forms/single/index.d.ts +1 -1
- package/lib/components/booking/forms/single/index.js +4 -2
- package/lib/components/booking/info/addServiceVariant/index.d.ts +7 -0
- package/lib/components/booking/info/addServiceVariant/index.js +58 -0
- package/lib/components/booking/info/client/index.js +1 -8
- package/lib/components/booking/info/index.js +4 -1
- package/lib/components/booking/info/index.less +9 -0
- package/lib/components/booking/info/pet/index.js +2 -1
- package/lib/components/booking/info/service/addService/index.d.ts +8 -2
- package/lib/components/booking/info/service/addService/index.js +67 -29
- package/lib/components/booking/info/service/addService/index.less +27 -1
- package/lib/components/booking/info/service/editService/index.js +6 -3
- package/lib/components/booking/locales.d.ts +48 -0
- package/lib/components/booking/locales.js +51 -3
- package/lib/components/booking/model.d.ts +2 -0
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +2 -1
- package/lib/components/booking/payments/model.d.ts +2 -1
- package/lib/components/booking/utils.d.ts +1 -1
- package/lib/components/booking/utils.js +57 -22
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +2 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -0
- package/lowcode/booking-dashboard/meta.ts +130 -0
- package/lowcode/booking-vertical-add-service/meta.ts +124 -0
- package/lowcode/vertical-add-service/meta.ts +71 -0
- package/package.json +2 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
3
4
|
state: FormState;
|
|
4
5
|
} & {
|
|
5
6
|
dispatch: (params: {
|
|
@@ -891,7 +891,7 @@ var Footer = function Footer(props) {
|
|
|
891
891
|
}
|
|
892
892
|
if (transaction_habit_selection.button_rows == 1) {
|
|
893
893
|
if (state.appointment_status !== 'cancelled') {
|
|
894
|
-
if (!state.disabledEdit) {
|
|
894
|
+
if (!state.disabledEdit && !state.isBookingCreatePage) {
|
|
895
895
|
arr.push(actionMap.sale);
|
|
896
896
|
}
|
|
897
897
|
}
|
|
@@ -1032,7 +1032,7 @@ var Footer = function Footer(props) {
|
|
|
1032
1032
|
if (!state.bookingDetail) {
|
|
1033
1033
|
return true;
|
|
1034
1034
|
}
|
|
1035
|
-
if (!((_state$addons3 = state.addons) !== null && _state$addons3 !== void 0 && _state$addons3.load) && state.renderType !== 'eventBooking') {
|
|
1035
|
+
if (!((_state$addons3 = state.addons) !== null && _state$addons3 !== void 0 && _state$addons3.load) && state.renderType !== 'eventBooking' && !state.isBookingCreatePage) {
|
|
1036
1036
|
return true;
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
@@ -1182,7 +1182,7 @@ var Footer = function Footer(props) {
|
|
|
1182
1182
|
style: {
|
|
1183
1183
|
marginTop: 12
|
|
1184
1184
|
}
|
|
1185
|
-
}, state.appointment_status !== 'cancelled' ? /*#__PURE__*/React.createElement(Button, {
|
|
1185
|
+
}, state.appointment_status !== 'cancelled' && !state.isBookingCreatePage ? /*#__PURE__*/React.createElement(Button, {
|
|
1186
1186
|
onClick: function onClick() {
|
|
1187
1187
|
return handleSale();
|
|
1188
1188
|
},
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface BookingDashboardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
backgroundColors?: string[];
|
|
4
|
+
labelColor?: string;
|
|
5
|
+
valueColor?: string;
|
|
6
|
+
otherParams?: Record<string, any>;
|
|
7
|
+
refreshKey?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const BookingDashboard: (props: BookingDashboardProps) => React.JSX.Element;
|
|
10
|
+
export default BookingDashboard;
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["otherParams", "backgroundColors", "labelColor", "valueColor", "refreshKey"];
|
|
3
|
+
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); }
|
|
4
|
+
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 exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
10
|
+
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); } }
|
|
11
|
+
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); }); }; }
|
|
12
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
15
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
16
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
17
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
import React, { useEffect, useState } from 'react';
|
|
21
|
+
import { PisellStatisticList } from '@pisell/materials';
|
|
22
|
+
import { isArr, locales } from '@pisell/utils';
|
|
23
|
+
import dayjs from 'dayjs';
|
|
24
|
+
import useEngineContext from "../../../hooks/useEngineContext";
|
|
25
|
+
import { request } from "../utils";
|
|
26
|
+
import { getBookingList } from "./serve";
|
|
27
|
+
import localeTexts from "../locales";
|
|
28
|
+
locales.init(localeTexts, localStorage.getItem('umi_locale') || 'en');
|
|
29
|
+
var BookingDashboard = function BookingDashboard(props) {
|
|
30
|
+
var _props$otherParams = props.otherParams,
|
|
31
|
+
otherParams = _props$otherParams === void 0 ? {} : _props$otherParams,
|
|
32
|
+
backgroundColors = props.backgroundColors,
|
|
33
|
+
labelColor = props.labelColor,
|
|
34
|
+
valueColor = props.valueColor,
|
|
35
|
+
refreshKey = props.refreshKey,
|
|
36
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
37
|
+
var context = useEngineContext();
|
|
38
|
+
request.setRequest(context.appHelper.utils.request);
|
|
39
|
+
var _useState = useState([
|
|
40
|
+
// 当前在场团体
|
|
41
|
+
{
|
|
42
|
+
label: locales.getText('pisell2.booking.dashboard.groups-on-site-now'),
|
|
43
|
+
value: '-',
|
|
44
|
+
tip: locales.getText('pisell2.booking.dashboard.groups-on-site-now-tip')
|
|
45
|
+
},
|
|
46
|
+
// 当前在场人数
|
|
47
|
+
{
|
|
48
|
+
label: locales.getText('pisell2.booking.dashboard.people-on-site-now'),
|
|
49
|
+
value: '-',
|
|
50
|
+
tip: locales.getText('pisell2.booking.dashboard.people-on-site-now-tip')
|
|
51
|
+
},
|
|
52
|
+
// 今日游客总数
|
|
53
|
+
{
|
|
54
|
+
label: locales.getText('pisell2.booking.dashboard.total-visitors-today'),
|
|
55
|
+
value: '-',
|
|
56
|
+
tip: locales.getText('pisell2.booking.dashboard.total-visitors-today-tip')
|
|
57
|
+
},
|
|
58
|
+
// 正在进行中的游客
|
|
59
|
+
{
|
|
60
|
+
label: locales.getText('pisell2.booking.dashboard.ongoing-visitors'),
|
|
61
|
+
value: '-',
|
|
62
|
+
tip: locales.getText('pisell2.booking.dashboard.ongoing-visitors-tip')
|
|
63
|
+
},
|
|
64
|
+
// 即将到达的游客
|
|
65
|
+
{
|
|
66
|
+
label: locales.getText('pisell2.booking.dashboard.upcoming-visitors'),
|
|
67
|
+
value: '-',
|
|
68
|
+
tip: locales.getText('pisell2.booking.dashboard.upcoming-visitors-tip')
|
|
69
|
+
},
|
|
70
|
+
// 超时的游客
|
|
71
|
+
{
|
|
72
|
+
label: locales.getText('pisell2.booking.dashboard.overdue-visitors'),
|
|
73
|
+
value: '-',
|
|
74
|
+
tip: locales.getText('pisell2.booking.dashboard.overdue-visitors-tip')
|
|
75
|
+
},
|
|
76
|
+
// 已完成的游客
|
|
77
|
+
{
|
|
78
|
+
label: locales.getText('pisell2.booking.dashboard.completed-visitors'),
|
|
79
|
+
value: '-',
|
|
80
|
+
tip: locales.getText('pisell2.booking.dashboard.completed-visitors-tip')
|
|
81
|
+
},
|
|
82
|
+
// 已离场的游客
|
|
83
|
+
{
|
|
84
|
+
label: locales.getText('pisell2.booking.dashboard.departed-visitors'),
|
|
85
|
+
value: '-',
|
|
86
|
+
tip: locales.getText('pisell2.booking.dashboard.departed-visitors-tip')
|
|
87
|
+
}]),
|
|
88
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
89
|
+
data = _useState2[0],
|
|
90
|
+
setData = _useState2[1];
|
|
91
|
+
var _useState3 = useState([]),
|
|
92
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
93
|
+
bookingData = _useState4[0],
|
|
94
|
+
setBookingData = _useState4[1];
|
|
95
|
+
var getData = /*#__PURE__*/function () {
|
|
96
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
97
|
+
var data;
|
|
98
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
99
|
+
while (1) switch (_context.prev = _context.next) {
|
|
100
|
+
case 0:
|
|
101
|
+
_context.next = 2;
|
|
102
|
+
return getBookingList(_objectSpread(_objectSpread({}, otherParams), {}, {
|
|
103
|
+
item_type: 'appointment_booking',
|
|
104
|
+
parent_id: 0,
|
|
105
|
+
with: ['children'],
|
|
106
|
+
child_booking: 0,
|
|
107
|
+
skip: 1,
|
|
108
|
+
num: 1000
|
|
109
|
+
}));
|
|
110
|
+
case 2:
|
|
111
|
+
data = _context.sent;
|
|
112
|
+
setBookingData(data.list);
|
|
113
|
+
case 4:
|
|
114
|
+
case "end":
|
|
115
|
+
return _context.stop();
|
|
116
|
+
}
|
|
117
|
+
}, _callee);
|
|
118
|
+
}));
|
|
119
|
+
return function getData() {
|
|
120
|
+
return _ref.apply(this, arguments);
|
|
121
|
+
};
|
|
122
|
+
}();
|
|
123
|
+
var calcBookingDataCount = function calcBookingDataCount(data) {
|
|
124
|
+
// 当前在场团体
|
|
125
|
+
var groupsOnSiteNow = '-';
|
|
126
|
+
// 当前在场人数
|
|
127
|
+
var peopleOnSiteNow = '-';
|
|
128
|
+
// 今日游客总数
|
|
129
|
+
var totalVisitorsToday = 0;
|
|
130
|
+
// 正在进行中的游客
|
|
131
|
+
var ongoing = 0;
|
|
132
|
+
// 即将到达的游客
|
|
133
|
+
var upcoming = 0;
|
|
134
|
+
// 超时的游客
|
|
135
|
+
var overdue = '-';
|
|
136
|
+
// 已完成的游客
|
|
137
|
+
var completed = 0;
|
|
138
|
+
// 已离场的游客
|
|
139
|
+
var departed = '-';
|
|
140
|
+
data.forEach(function (item) {
|
|
141
|
+
if (isArr(item.children)) {
|
|
142
|
+
item.children.forEach(function (child) {
|
|
143
|
+
var start = dayjs("".concat(child.start_date, " ").concat(child.start_time));
|
|
144
|
+
var end = dayjs("".concat(child.end_date, " ").concat(child.end_time));
|
|
145
|
+
|
|
146
|
+
// 今日游客总数
|
|
147
|
+
totalVisitorsToday += child.number;
|
|
148
|
+
// 正在进行中的游客
|
|
149
|
+
if (start < dayjs() && end > dayjs()) {
|
|
150
|
+
ongoing += child.number || 1;
|
|
151
|
+
}
|
|
152
|
+
// 即将到达的游客
|
|
153
|
+
if (dayjs() < start) {
|
|
154
|
+
upcoming += child.number || 1;
|
|
155
|
+
}
|
|
156
|
+
// 已完成的游客
|
|
157
|
+
if (dayjs() > end) {
|
|
158
|
+
completed += child.number || 1;
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
setData([
|
|
164
|
+
// 当前在场团体
|
|
165
|
+
{
|
|
166
|
+
label: locales.getText('pisell2.booking.dashboard.groups-on-site-now'),
|
|
167
|
+
tip: locales.getText('pisell2.booking.dashboard.groups-on-site-now-tip'),
|
|
168
|
+
value: "".concat(groupsOnSiteNow)
|
|
169
|
+
},
|
|
170
|
+
// 当前在场人数
|
|
171
|
+
{
|
|
172
|
+
label: locales.getText('pisell2.booking.dashboard.people-on-site-now'),
|
|
173
|
+
tip: locales.getText('pisell2.booking.dashboard.people-on-site-now-tip'),
|
|
174
|
+
value: "".concat(peopleOnSiteNow)
|
|
175
|
+
},
|
|
176
|
+
// 今日游客总数
|
|
177
|
+
{
|
|
178
|
+
label: locales.getText('pisell2.booking.dashboard.total-visitors-today'),
|
|
179
|
+
tip: locales.getText('pisell2.booking.dashboard.total-visitors-today-tip'),
|
|
180
|
+
value: "".concat(totalVisitorsToday)
|
|
181
|
+
},
|
|
182
|
+
// 正在进行中的游客
|
|
183
|
+
{
|
|
184
|
+
label: locales.getText('pisell2.booking.dashboard.ongoing-visitors'),
|
|
185
|
+
tip: locales.getText('pisell2.booking.dashboard.ongoing-visitors-tip'),
|
|
186
|
+
value: "".concat(ongoing)
|
|
187
|
+
},
|
|
188
|
+
// 即将到达的游客
|
|
189
|
+
{
|
|
190
|
+
label: locales.getText('pisell2.booking.dashboard.upcoming-visitors'),
|
|
191
|
+
tip: locales.getText('pisell2.booking.dashboard.upcoming-visitors-tip'),
|
|
192
|
+
value: "".concat(upcoming)
|
|
193
|
+
},
|
|
194
|
+
// 超时的游客
|
|
195
|
+
{
|
|
196
|
+
label: locales.getText('pisell2.booking.dashboard.overdue-visitors'),
|
|
197
|
+
tip: locales.getText('pisell2.booking.dashboard.overdue-visitors-tip'),
|
|
198
|
+
value: "".concat(overdue)
|
|
199
|
+
},
|
|
200
|
+
// 已完成的游客
|
|
201
|
+
{
|
|
202
|
+
label: locales.getText('pisell2.booking.dashboard.completed-visitors'),
|
|
203
|
+
tip: locales.getText('pisell2.booking.dashboard.completed-visitors-tip'),
|
|
204
|
+
value: "".concat(completed)
|
|
205
|
+
},
|
|
206
|
+
// 已离场的游客
|
|
207
|
+
{
|
|
208
|
+
label: locales.getText('pisell2.booking.dashboard.departed-visitors'),
|
|
209
|
+
tip: locales.getText('pisell2.booking.dashboard.departed-visitors-tip'),
|
|
210
|
+
value: "".concat(departed)
|
|
211
|
+
}]);
|
|
212
|
+
};
|
|
213
|
+
useEffect(function () {
|
|
214
|
+
calcBookingDataCount(bookingData);
|
|
215
|
+
|
|
216
|
+
// 每分钟重新计算预约数据
|
|
217
|
+
var timer = setInterval(function () {
|
|
218
|
+
calcBookingDataCount(bookingData);
|
|
219
|
+
}, 60 * 1000);
|
|
220
|
+
return function () {
|
|
221
|
+
clearInterval(timer);
|
|
222
|
+
};
|
|
223
|
+
}, [bookingData]);
|
|
224
|
+
useEffect(function () {
|
|
225
|
+
getData();
|
|
226
|
+
|
|
227
|
+
// 10分钟更新一次数据
|
|
228
|
+
var timer = setInterval(function () {
|
|
229
|
+
getData();
|
|
230
|
+
}, 10 * 60 * 1000);
|
|
231
|
+
return function () {
|
|
232
|
+
clearInterval(timer);
|
|
233
|
+
};
|
|
234
|
+
}, [JSON.stringify(otherParams), refreshKey]);
|
|
235
|
+
return /*#__PURE__*/React.createElement(PisellStatisticList, _extends({}, others, {
|
|
236
|
+
data: data,
|
|
237
|
+
backgroundColors: backgroundColors,
|
|
238
|
+
labelColor: labelColor,
|
|
239
|
+
valueColor: valueColor
|
|
240
|
+
}));
|
|
241
|
+
};
|
|
242
|
+
export default BookingDashboard;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getBookingList: (params: any) => Promise<any>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
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 exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3
|
+
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); } }
|
|
4
|
+
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); }); }; }
|
|
5
|
+
import { request } from "../utils";
|
|
6
|
+
export var getBookingList = /*#__PURE__*/function () {
|
|
7
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
|
8
|
+
var _yield$request$getReq, data;
|
|
9
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
10
|
+
while (1) switch (_context.prev = _context.next) {
|
|
11
|
+
case 0:
|
|
12
|
+
_context.next = 2;
|
|
13
|
+
return request.getRequest().get("/shop/schedule/booking", params);
|
|
14
|
+
case 2:
|
|
15
|
+
_yield$request$getReq = _context.sent;
|
|
16
|
+
data = _yield$request$getReq.data;
|
|
17
|
+
return _context.abrupt("return", data);
|
|
18
|
+
case 5:
|
|
19
|
+
case "end":
|
|
20
|
+
return _context.stop();
|
|
21
|
+
}
|
|
22
|
+
}, _callee);
|
|
23
|
+
}));
|
|
24
|
+
return function getBookingList(_x) {
|
|
25
|
+
return _ref.apply(this, arguments);
|
|
26
|
+
};
|
|
27
|
+
}();
|
|
@@ -43,7 +43,8 @@ var Forms = Provider(function (props) {
|
|
|
43
43
|
addCallback = props.addCallback,
|
|
44
44
|
client = props.client,
|
|
45
45
|
loading = props.loading,
|
|
46
|
-
addButtonProps = props.addButtonProps
|
|
46
|
+
addButtonProps = props.addButtonProps,
|
|
47
|
+
drawerProps = props.drawerProps;
|
|
47
48
|
|
|
48
49
|
// 新增数据
|
|
49
50
|
var onAction = useMemoizedFn( /*#__PURE__*/function () {
|
|
@@ -171,6 +172,7 @@ var Forms = Provider(function (props) {
|
|
|
171
172
|
onChange: function onChange(val) {
|
|
172
173
|
onValueChange(d, val);
|
|
173
174
|
},
|
|
175
|
+
drawerProps: drawerProps,
|
|
174
176
|
onAdd: function onAdd() {
|
|
175
177
|
onAction(d, true);
|
|
176
178
|
},
|
|
@@ -194,6 +196,6 @@ var Forms = Provider(function (props) {
|
|
|
194
196
|
optionRender: optionRender
|
|
195
197
|
})));
|
|
196
198
|
}));
|
|
197
|
-
}, [forms, hideTitle, modalOpen, value, loading, client === null || client === void 0 ? void 0 : client.id, addButtonProps, customSelectProps, optionRender]);
|
|
199
|
+
}, [forms, hideTitle, modalOpen, value, loading, client === null || client === void 0 ? void 0 : client.id, addButtonProps, customSelectProps, optionRender, drawerProps]);
|
|
198
200
|
});
|
|
199
201
|
export default Forms;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
3
4
|
state: FormState;
|
|
4
5
|
} & {
|
|
5
6
|
dispatch: (params: {
|
|
@@ -7,5 +7,5 @@ import "./index.less";
|
|
|
7
7
|
* @Author: zhiwei.Wang
|
|
8
8
|
* @Date: 2024-01-30 17:06
|
|
9
9
|
*/
|
|
10
|
-
declare const Single: ({ value, onChange, form, mode, optionRender, loading, customSelectProps, onAdd, addButtonProps, modalOpen, watch, }: any) => React.JSX.Element;
|
|
10
|
+
declare const Single: ({ value, onChange, form, mode, optionRender, loading, customSelectProps, onAdd, addButtonProps, modalOpen, watch, drawerProps, }: any) => React.JSX.Element;
|
|
11
11
|
export default Single;
|
|
@@ -41,7 +41,8 @@ var Single = function Single(_ref) {
|
|
|
41
41
|
onAdd = _ref.onAdd,
|
|
42
42
|
addButtonProps = _ref.addButtonProps,
|
|
43
43
|
modalOpen = _ref.modalOpen,
|
|
44
|
-
watch = _ref.watch
|
|
44
|
+
watch = _ref.watch,
|
|
45
|
+
drawerProps = _ref.drawerProps;
|
|
45
46
|
// const primaryField = useMemo(() => {
|
|
46
47
|
// return field.field[0]?.key || "";
|
|
47
48
|
// }, [field]);
|
|
@@ -234,10 +235,10 @@ var Single = function Single(_ref) {
|
|
|
234
235
|
},
|
|
235
236
|
name: ((_form$form3 = form.form) === null || _form$form3 === void 0 ? void 0 : _form$form3.title) || "-",
|
|
236
237
|
addButtonProps: _addButtonProps,
|
|
237
|
-
drawerProps: {
|
|
238
|
+
drawerProps: _objectSpread({
|
|
238
239
|
title: "".concat(locales.getText("pisell2.text.select"), " ").concat(((_form$form4 = form.form) === null || _form$form4 === void 0 ? void 0 : _form$form4.title) || "-"),
|
|
239
240
|
destroyOnClose: true
|
|
240
|
-
},
|
|
241
|
+
}, drawerProps || {}),
|
|
241
242
|
optionRender: _optionRender,
|
|
242
243
|
rowKey: "form_record_id"
|
|
243
244
|
}, customSelectProps || {})));
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
import React, { useRef } from 'react';
|
|
8
|
+
import AddService from "../service/addService";
|
|
9
|
+
var AddServiceVariant = function AddServiceVariant(props) {
|
|
10
|
+
var globalState = props.globalState,
|
|
11
|
+
setGlobalState = props.setGlobalState;
|
|
12
|
+
var stateRef = useRef(globalState);
|
|
13
|
+
stateRef.current = globalState;
|
|
14
|
+
var dispatch = function dispatch(_ref) {
|
|
15
|
+
var type = _ref.type,
|
|
16
|
+
payload = _ref.payload;
|
|
17
|
+
if (type === 'setService') {
|
|
18
|
+
setGlobalState({
|
|
19
|
+
service: _objectSpread(_objectSpread({}, stateRef.current.service), payload)
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
return /*#__PURE__*/React.createElement(AddService, {
|
|
24
|
+
renderMode: "current",
|
|
25
|
+
dispatch: dispatch,
|
|
26
|
+
state: globalState,
|
|
27
|
+
drawerProps: {
|
|
28
|
+
open: true,
|
|
29
|
+
getContainer: false
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
export default AddServiceVariant;
|
|
@@ -21,6 +21,7 @@ import { updateServiceDate } from "./date";
|
|
|
21
21
|
import useEngineContext from "../../../hooks/useEngineContext";
|
|
22
22
|
import Notes from "./notes";
|
|
23
23
|
import "./index.less";
|
|
24
|
+
import classNames from "classnames";
|
|
24
25
|
var defaultModules = {
|
|
25
26
|
client: 1,
|
|
26
27
|
date: 1,
|
|
@@ -117,7 +118,7 @@ var Info = Provider(function (props) {
|
|
|
117
118
|
})
|
|
118
119
|
}, _defineProperty(_React$createElement, "style", {
|
|
119
120
|
height: context !== null && context !== void 0 && (_context$appHelper4 = context.appHelper) !== null && _context$appHelper4 !== void 0 && (_context$appHelper4$u = _context$appHelper4.utils) !== null && _context$appHelper4$u !== void 0 && _context$appHelper4$u.isMobile ? "100%" : "100vh"
|
|
120
|
-
}), _defineProperty(_React$createElement, "bodyClassName",
|
|
121
|
+
}), _defineProperty(_React$createElement, "bodyClassName", classNames('booking-info-warp', _defineProperty({}, 'create-booking-page-info-wrap', modal.state.isBookingCreatePage))), _React$createElement), /*#__PURE__*/React.createElement("div", {
|
|
121
122
|
className: "booking-info"
|
|
122
123
|
}, modules.client ? /*#__PURE__*/React.createElement(Client, null) : null, modules.holder && !((_modal$state5 = modal.state) !== null && _modal$state5 !== void 0 && _modal$state5.disabledEdit) ? /*#__PURE__*/React.createElement(React.Fragment, null, params.type === "form" ? /*#__PURE__*/React.createElement(Pet, null) : null) : null, modules.date ? /*#__PURE__*/React.createElement(DateCom, null) : null, modules.service ? /*#__PURE__*/React.createElement(React.Fragment, null, modal.state.date.value ? /*#__PURE__*/React.createElement(Service, null) : null) : null, notes, slot ? slot : null)) : null);
|
|
123
124
|
});
|
|
@@ -15,4 +15,13 @@
|
|
|
15
15
|
// height: 42px;
|
|
16
16
|
// background: #069456;
|
|
17
17
|
// }
|
|
18
|
+
}
|
|
19
|
+
#create-booking-page-info-wrap {
|
|
20
|
+
.pisell-lowcode__booking-tab-pane-footer {
|
|
21
|
+
padding: 12px 16px !important;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
.create-booking-page-info-wrap {
|
|
25
|
+
position: initial !important;
|
|
26
|
+
padding: 0 16px !important;
|
|
18
27
|
}
|
|
@@ -527,6 +527,6 @@ var Pet = function Pet(props) {
|
|
|
527
527
|
}()
|
|
528
528
|
}, addButtonProps)
|
|
529
529
|
})));
|
|
530
|
-
}, [valueLoading, hideTitle, state.pet.value, state.pet.formData, state.action, state.modalOpen, state.pet.value, (_state$client11 = state.client) === null || _state$client11 === void 0 ? void 0 : _state$client11.value, loading, state.disabledEdit, state.isTerminal, state.disableEventBookingEdit, params.search, loadMore, addButtonProps]);
|
|
530
|
+
}, [valueLoading, hideTitle, state.pet.value, state.pet.formData, state.action, state.modalOpen, state.pet.value, (_state$client11 = state.client) === null || _state$client11 === void 0 ? void 0 : _state$client11.value, loading, state.disabledEdit, state.isTerminal, state.disableEventBookingEdit, params.search, loadMore, addButtonProps, state.isBookingCreatePage]);
|
|
531
531
|
};
|
|
532
532
|
export default Pet;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { PisellDrawerProps } from '../../../components/drawer';
|
|
2
3
|
import './index.less';
|
|
3
|
-
|
|
4
|
+
interface AddServiceProps {
|
|
4
5
|
onEdit: any;
|
|
5
|
-
|
|
6
|
+
dispatch?: any;
|
|
7
|
+
state?: any;
|
|
8
|
+
drawerProps?: PisellDrawerProps;
|
|
9
|
+
renderMode?: 'current' | 'drawer';
|
|
10
|
+
}
|
|
11
|
+
declare const Info: (props: AddServiceProps) => React.JSX.Element;
|
|
6
12
|
export default Info;
|