@pisell/private-materials 3.0.151-gray → 3.0.151

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +12 -12
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +12 -12
  11. package/es/components/booking/addons/model.d.ts +1 -2
  12. package/es/components/booking/components/footer/index.js +3 -3
  13. package/es/components/booking/forms/forms.d.ts +0 -1
  14. package/es/components/booking/forms/forms.js +2 -4
  15. package/es/components/booking/forms/model.d.ts +1 -2
  16. package/es/components/booking/forms/single/index.d.ts +1 -1
  17. package/es/components/booking/forms/single/index.js +3 -4
  18. package/es/components/booking/info/index.js +1 -2
  19. package/es/components/booking/info/index.less +0 -9
  20. package/es/components/booking/info/pet/index.js +1 -1
  21. package/es/components/booking/info/service/addService/index.d.ts +2 -8
  22. package/es/components/booking/info/service/addService/index.js +36 -82
  23. package/es/components/booking/info/service/addService/index.less +1 -27
  24. package/es/components/booking/info/service/editService/index.js +9 -7
  25. package/es/components/booking/locales.d.ts +0 -48
  26. package/es/components/booking/locales.js +3 -51
  27. package/es/components/booking/model.d.ts +0 -2
  28. package/es/components/booking/notes/index.d.ts +1 -1
  29. package/es/components/booking/notes/model.d.ts +1 -2
  30. package/es/components/booking/payments/model.d.ts +1 -2
  31. package/es/components/booking/utils.d.ts +1 -1
  32. package/es/components/booking/utils.js +51 -54
  33. package/es/components/eftposPay/index.js +2 -0
  34. package/es/components/eftposPay/tyro/index.js +11 -8
  35. package/es/components/pay/toC/PaymentMethods/ApplePay/index.js +2 -1
  36. package/es/components/pay/toC/PaymentMethods/BankDeposit/index.js +5 -4
  37. package/es/components/pay/toC/PaymentMethods/GooglePay/index.js +2 -1
  38. package/es/components/pay/toC/utils.d.ts +11 -0
  39. package/es/components/pay/toC/utils.js +27 -0
  40. package/es/components/schedules/index.d.ts +1 -1
  41. package/es/components/schedules/model.d.ts +1 -2
  42. package/es/index.d.ts +0 -2
  43. package/es/index.js +1 -3
  44. package/lib/components/booking/addons/model.d.ts +1 -2
  45. package/lib/components/booking/components/footer/index.js +3 -3
  46. package/lib/components/booking/forms/forms.d.ts +0 -1
  47. package/lib/components/booking/forms/forms.js +2 -5
  48. package/lib/components/booking/forms/model.d.ts +1 -2
  49. package/lib/components/booking/forms/single/index.d.ts +1 -1
  50. package/lib/components/booking/forms/single/index.js +2 -4
  51. package/lib/components/booking/info/client/index.js +8 -1
  52. package/lib/components/booking/info/index.js +1 -4
  53. package/lib/components/booking/info/index.less +0 -9
  54. package/lib/components/booking/info/pet/index.js +1 -2
  55. package/lib/components/booking/info/service/addService/index.d.ts +2 -8
  56. package/lib/components/booking/info/service/addService/index.js +29 -67
  57. package/lib/components/booking/info/service/addService/index.less +1 -27
  58. package/lib/components/booking/info/service/editService/index.js +3 -6
  59. package/lib/components/booking/locales.d.ts +0 -48
  60. package/lib/components/booking/locales.js +3 -51
  61. package/lib/components/booking/model.d.ts +0 -2
  62. package/lib/components/booking/notes/index.d.ts +1 -1
  63. package/lib/components/booking/notes/model.d.ts +1 -2
  64. package/lib/components/booking/payments/model.d.ts +1 -2
  65. package/lib/components/booking/utils.d.ts +1 -1
  66. package/lib/components/booking/utils.js +22 -57
  67. package/lib/components/eftposPay/index.js +2 -0
  68. package/lib/components/eftposPay/tyro/index.js +7 -6
  69. package/lib/components/pay/toC/PaymentMethods/ApplePay/index.js +5 -1
  70. package/lib/components/pay/toC/PaymentMethods/BankDeposit/index.js +6 -3
  71. package/lib/components/pay/toC/PaymentMethods/GooglePay/index.js +5 -1
  72. package/lib/components/pay/toC/utils.d.ts +11 -0
  73. package/lib/components/pay/toC/utils.js +26 -2
  74. package/lib/components/schedules/index.d.ts +1 -1
  75. package/lib/components/schedules/model.d.ts +1 -2
  76. package/lib/index.d.ts +0 -2
  77. package/lib/index.js +0 -6
  78. package/package.json +4 -4
  79. package/es/components/booking/dashboard/index.d.ts +0 -10
  80. package/es/components/booking/dashboard/index.js +0 -242
  81. package/es/components/booking/dashboard/serve.d.ts +0 -1
  82. package/es/components/booking/dashboard/serve.js +0 -27
  83. package/es/components/booking/info/addServiceVariant/index.d.ts +0 -7
  84. package/es/components/booking/info/addServiceVariant/index.js +0 -33
  85. package/lib/components/booking/dashboard/index.d.ts +0 -10
  86. package/lib/components/booking/dashboard/index.js +0 -225
  87. package/lib/components/booking/dashboard/serve.d.ts +0 -1
  88. package/lib/components/booking/dashboard/serve.js +0 -33
  89. package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -7
  90. package/lib/components/booking/info/addServiceVariant/index.js +0 -58
  91. package/lowcode/booking-dashboard/meta.ts +0 -130
  92. package/lowcode/booking-vertical-add-service/meta.ts +0 -124
  93. package/lowcode/vertical-add-service/meta.ts +0 -71
@@ -1,242 +0,0 @@
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;
@@ -1 +0,0 @@
1
- export declare const getBookingList: (params: any) => Promise<any>;
@@ -1,27 +0,0 @@
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
- }();
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- interface AddServiceVariantProps {
3
- globalState: any;
4
- setGlobalState: any;
5
- }
6
- declare const AddServiceVariant: (props: AddServiceVariantProps) => React.JSX.Element;
7
- export default AddServiceVariant;
@@ -1,33 +0,0 @@
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;
@@ -1,10 +0,0 @@
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;
@@ -1,225 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/components/booking/dashboard/index.tsx
30
- var dashboard_exports = {};
31
- __export(dashboard_exports, {
32
- default: () => dashboard_default
33
- });
34
- module.exports = __toCommonJS(dashboard_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_materials = require("@pisell/materials");
37
- var import_utils = require("@pisell/utils");
38
- var import_dayjs = __toESM(require("dayjs"));
39
- var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
40
- var import_utils2 = require("../utils");
41
- var import_serve = require("./serve");
42
- var import_locales = __toESM(require("../locales"));
43
- import_utils.locales.init(import_locales.default, localStorage.getItem("umi_locale") || "en");
44
- var BookingDashboard = (props) => {
45
- const {
46
- otherParams = {},
47
- backgroundColors,
48
- labelColor,
49
- valueColor,
50
- refreshKey,
51
- ...others
52
- } = props;
53
- const context = (0, import_useEngineContext.default)();
54
- import_utils2.request.setRequest(context.appHelper.utils.request);
55
- const [data, setData] = (0, import_react.useState)([
56
- // 当前在场团体
57
- {
58
- label: import_utils.locales.getText("pisell2.booking.dashboard.groups-on-site-now"),
59
- value: "-",
60
- tip: import_utils.locales.getText("pisell2.booking.dashboard.groups-on-site-now-tip")
61
- },
62
- // 当前在场人数
63
- {
64
- label: import_utils.locales.getText("pisell2.booking.dashboard.people-on-site-now"),
65
- value: "-",
66
- tip: import_utils.locales.getText("pisell2.booking.dashboard.people-on-site-now-tip")
67
- },
68
- // 今日游客总数
69
- {
70
- label: import_utils.locales.getText("pisell2.booking.dashboard.total-visitors-today"),
71
- value: "-",
72
- tip: import_utils.locales.getText("pisell2.booking.dashboard.total-visitors-today-tip")
73
- },
74
- // 正在进行中的游客
75
- {
76
- label: import_utils.locales.getText("pisell2.booking.dashboard.ongoing-visitors"),
77
- value: "-",
78
- tip: import_utils.locales.getText("pisell2.booking.dashboard.ongoing-visitors-tip")
79
- },
80
- // 即将到达的游客
81
- {
82
- label: import_utils.locales.getText("pisell2.booking.dashboard.upcoming-visitors"),
83
- value: "-",
84
- tip: import_utils.locales.getText("pisell2.booking.dashboard.upcoming-visitors-tip")
85
- },
86
- // 超时的游客
87
- {
88
- label: import_utils.locales.getText("pisell2.booking.dashboard.overdue-visitors"),
89
- value: "-",
90
- tip: import_utils.locales.getText("pisell2.booking.dashboard.overdue-visitors-tip")
91
- },
92
- // 已完成的游客
93
- {
94
- label: import_utils.locales.getText("pisell2.booking.dashboard.completed-visitors"),
95
- value: "-",
96
- tip: import_utils.locales.getText("pisell2.booking.dashboard.completed-visitors-tip")
97
- },
98
- // 已离场的游客
99
- {
100
- label: import_utils.locales.getText("pisell2.booking.dashboard.departed-visitors"),
101
- value: "-",
102
- tip: import_utils.locales.getText("pisell2.booking.dashboard.departed-visitors-tip")
103
- }
104
- ]);
105
- const [bookingData, setBookingData] = (0, import_react.useState)([]);
106
- const getData = async () => {
107
- const data2 = await (0, import_serve.getBookingList)({
108
- ...otherParams,
109
- item_type: "appointment_booking",
110
- parent_id: 0,
111
- with: ["children"],
112
- child_booking: 0,
113
- skip: 1,
114
- num: 1e3
115
- });
116
- setBookingData(data2.list);
117
- };
118
- const calcBookingDataCount = (data2) => {
119
- let groupsOnSiteNow = "-";
120
- let peopleOnSiteNow = "-";
121
- let totalVisitorsToday = 0;
122
- let ongoing = 0;
123
- let upcoming = 0;
124
- let overdue = "-";
125
- let completed = 0;
126
- let departed = "-";
127
- data2.forEach((item) => {
128
- if ((0, import_utils.isArr)(item.children)) {
129
- item.children.forEach((child) => {
130
- const start = (0, import_dayjs.default)(`${child.start_date} ${child.start_time}`);
131
- const end = (0, import_dayjs.default)(`${child.end_date} ${child.end_time}`);
132
- totalVisitorsToday += child.number;
133
- if (start < (0, import_dayjs.default)() && end > (0, import_dayjs.default)()) {
134
- ongoing += child.number || 1;
135
- }
136
- if ((0, import_dayjs.default)() < start) {
137
- upcoming += child.number || 1;
138
- }
139
- if ((0, import_dayjs.default)() > end) {
140
- completed += child.number || 1;
141
- }
142
- });
143
- }
144
- });
145
- setData([
146
- // 当前在场团体
147
- {
148
- label: import_utils.locales.getText("pisell2.booking.dashboard.groups-on-site-now"),
149
- tip: import_utils.locales.getText("pisell2.booking.dashboard.groups-on-site-now-tip"),
150
- value: `${groupsOnSiteNow}`
151
- },
152
- // 当前在场人数
153
- {
154
- label: import_utils.locales.getText("pisell2.booking.dashboard.people-on-site-now"),
155
- tip: import_utils.locales.getText("pisell2.booking.dashboard.people-on-site-now-tip"),
156
- value: `${peopleOnSiteNow}`
157
- },
158
- // 今日游客总数
159
- {
160
- label: import_utils.locales.getText("pisell2.booking.dashboard.total-visitors-today"),
161
- tip: import_utils.locales.getText("pisell2.booking.dashboard.total-visitors-today-tip"),
162
- value: `${totalVisitorsToday}`
163
- },
164
- // 正在进行中的游客
165
- {
166
- label: import_utils.locales.getText("pisell2.booking.dashboard.ongoing-visitors"),
167
- tip: import_utils.locales.getText("pisell2.booking.dashboard.ongoing-visitors-tip"),
168
- value: `${ongoing}`
169
- },
170
- // 即将到达的游客
171
- {
172
- label: import_utils.locales.getText("pisell2.booking.dashboard.upcoming-visitors"),
173
- tip: import_utils.locales.getText("pisell2.booking.dashboard.upcoming-visitors-tip"),
174
- value: `${upcoming}`
175
- },
176
- // 超时的游客
177
- {
178
- label: import_utils.locales.getText("pisell2.booking.dashboard.overdue-visitors"),
179
- tip: import_utils.locales.getText("pisell2.booking.dashboard.overdue-visitors-tip"),
180
- value: `${overdue}`
181
- },
182
- // 已完成的游客
183
- {
184
- label: import_utils.locales.getText("pisell2.booking.dashboard.completed-visitors"),
185
- tip: import_utils.locales.getText("pisell2.booking.dashboard.completed-visitors-tip"),
186
- value: `${completed}`
187
- },
188
- // 已离场的游客
189
- {
190
- label: import_utils.locales.getText("pisell2.booking.dashboard.departed-visitors"),
191
- tip: import_utils.locales.getText("pisell2.booking.dashboard.departed-visitors-tip"),
192
- value: `${departed}`
193
- }
194
- ]);
195
- };
196
- (0, import_react.useEffect)(() => {
197
- calcBookingDataCount(bookingData);
198
- const timer = setInterval(() => {
199
- calcBookingDataCount(bookingData);
200
- }, 60 * 1e3);
201
- return () => {
202
- clearInterval(timer);
203
- };
204
- }, [bookingData]);
205
- (0, import_react.useEffect)(() => {
206
- getData();
207
- const timer = setInterval(() => {
208
- getData();
209
- }, 10 * 60 * 1e3);
210
- return () => {
211
- clearInterval(timer);
212
- };
213
- }, [JSON.stringify(otherParams), refreshKey]);
214
- return /* @__PURE__ */ import_react.default.createElement(
215
- import_materials.PisellStatisticList,
216
- {
217
- ...others,
218
- data,
219
- backgroundColors,
220
- labelColor,
221
- valueColor
222
- }
223
- );
224
- };
225
- var dashboard_default = BookingDashboard;
@@ -1 +0,0 @@
1
- export declare const getBookingList: (params: any) => Promise<any>;
@@ -1,33 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/components/booking/dashboard/serve.ts
20
- var serve_exports = {};
21
- __export(serve_exports, {
22
- getBookingList: () => getBookingList
23
- });
24
- module.exports = __toCommonJS(serve_exports);
25
- var import_utils = require("../utils");
26
- var getBookingList = async (params) => {
27
- let { data } = await import_utils.request.getRequest().get(`/shop/schedule/booking`, params);
28
- return data;
29
- };
30
- // Annotate the CommonJS export names for ESM import in node:
31
- 0 && (module.exports = {
32
- getBookingList
33
- });
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- interface AddServiceVariantProps {
3
- globalState: any;
4
- setGlobalState: any;
5
- }
6
- declare const AddServiceVariant: (props: AddServiceVariantProps) => React.JSX.Element;
7
- export default AddServiceVariant;