@pisell/private-materials 3.3.89 → 3.3.91
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 +13 -13
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +11 -11
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +11 -11
- package/es/businessModel/SalesModel/Sales/index.js +4 -37
- package/es/components/Sales/Cart/index.js +1 -5
- package/es/components/Sales/Cart/utils.d.ts +0 -40
- package/es/components/Sales/Cart/utils.js +0 -167
- package/es/components/Sales/Checkout/index.d.ts +0 -4
- package/es/components/Sales/Checkout/index.js +8 -52
- package/es/components/Sales/Checkout/serve.d.ts +0 -13
- package/es/components/Sales/Checkout/serve.js +2 -16
- package/es/components/Sales/Checkout/utils.js +1 -7
- package/es/components/Sales/Resource/index.js +2 -2
- package/es/components/Sales/Resource/serve.d.ts +0 -7
- package/es/components/Sales/Resource/serve.js +0 -10
- package/es/components/Sales/Summary/index.d.ts +0 -10
- package/es/components/Sales/Summary/index.js +2 -17
- package/es/components/Sales/Summary/serve.d.ts +0 -1
- package/es/components/Sales/Summary/serve.js +0 -6
- package/es/components/Sales/Summary/utils.d.ts +1 -16
- package/es/components/Sales/Summary/utils.js +1 -43
- package/es/components/appointmentBooking/components/Cart/Item/index.less +3 -3
- package/es/components/appointmentBooking/components/Content/index.less +1 -1
- package/es/components/appointmentBooking/components/Deposit/index.d.ts +0 -6
- package/es/components/appointmentBooking/components/Deposit/index.js +7 -27
- package/es/components/appointmentBooking/components/Services/index.js +27 -23
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +20 -25
- package/es/components/appointmentBooking/deposit/index.js +2 -4
- package/es/components/appointmentBooking/index.js +0 -14
- package/es/components/appointmentBooking/index.less +1 -1
- package/es/components/booking/components/footer/utils.d.ts +0 -1
- package/es/components/booking/components/footer/utils.js +1 -1
- package/es/components/booking/components/voucher/index.js +2 -2
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info/service2/utils.js +2 -3
- package/es/components/booking/info2/service/addService/utils.d.ts +0 -10
- package/es/components/booking/info2/service/addService/utils.js +13 -44
- package/es/components/booking/info2/service/editService/Resources/index.js +8 -22
- package/es/components/booking/info2/service/editService/Resources/index.less +0 -6
- package/es/components/booking/info2/utilsByBooking.js +0 -9
- package/es/components/booking/locales.d.ts +0 -3
- package/es/components/booking/locales.js +0 -3
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/const.d.ts +1 -4
- package/es/components/eftposPay/const.js +1 -3
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/hooks.js +1 -3
- package/es/components/eftposPay/index.js +1 -1
- package/es/components/eftposPay/manufacturer.d.ts +0 -1
- package/es/components/eftposPay/manufacturer.js +0 -4
- package/es/components/eftposPay/pay.d.ts +1 -1
- package/es/components/eftposPay/pay.js +2 -6
- package/es/components/eftposPay/store/index.d.ts +4 -4
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +17 -29
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.js +6 -10
- package/es/components/eventBooking/components/Provider/Cart/Item/index.js +2 -4
- package/es/components/eventBooking/components/Provider/Event/index.js +4 -13
- package/es/components/eventBooking/components/bookingDetailModal/index.js +4 -22
- package/es/components/eventBooking/index.js +7 -21
- package/es/components/eventBooking/locales.d.ts +0 -24
- package/es/components/eventBooking/locales.js +6 -30
- package/es/components/index.d.ts +1 -3
- package/es/components/index.js +1 -3
- package/es/components/pay/toC/PaymentMethods/index.js +4 -5
- package/es/components/schedules/utils.d.ts +1 -1
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
- package/es/components/ticketBooking/components/ticketBooking/index.js +138 -257
- package/es/components/ticketBooking/locales.d.ts +146 -164
- package/es/components/ticketBooking/locales.js +147 -195
- package/es/index.d.ts +0 -2
- package/es/index.js +1 -3
- package/es/utils/index.d.ts +1 -1
- package/lib/businessModel/SalesModel/Sales/index.js +8 -22
- package/lib/components/Sales/Cart/index.js +0 -1
- package/lib/components/Sales/Cart/utils.d.ts +0 -40
- package/lib/components/Sales/Cart/utils.js +0 -117
- package/lib/components/Sales/Checkout/index.d.ts +0 -4
- package/lib/components/Sales/Checkout/index.js +7 -39
- package/lib/components/Sales/Checkout/serve.d.ts +0 -13
- package/lib/components/Sales/Checkout/serve.js +2 -7
- package/lib/components/Sales/Checkout/utils.js +0 -2
- package/lib/components/Sales/Resource/index.js +1 -1
- package/lib/components/Sales/Resource/serve.d.ts +0 -7
- package/lib/components/Sales/Resource/serve.js +2 -9
- package/lib/components/Sales/Summary/index.d.ts +0 -10
- package/lib/components/Sales/Summary/index.js +1 -7
- package/lib/components/Sales/Summary/serve.d.ts +0 -1
- package/lib/components/Sales/Summary/serve.js +0 -32
- package/lib/components/Sales/Summary/utils.d.ts +1 -16
- package/lib/components/Sales/Summary/utils.js +1 -30
- package/lib/components/appointmentBooking/components/Cart/Item/index.less +3 -3
- package/lib/components/appointmentBooking/components/Content/index.less +1 -1
- package/lib/components/appointmentBooking/components/Deposit/index.d.ts +0 -6
- package/lib/components/appointmentBooking/components/Deposit/index.js +4 -36
- package/lib/components/appointmentBooking/components/Services/index.js +11 -6
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +4 -8
- package/lib/components/appointmentBooking/deposit/index.js +2 -4
- package/lib/components/appointmentBooking/index.js +0 -11
- package/lib/components/appointmentBooking/index.less +1 -1
- package/lib/components/booking/components/footer/utils.d.ts +0 -1
- package/lib/components/booking/components/footer/utils.js +0 -2
- package/lib/components/booking/components/voucher/index.js +2 -2
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info/service2/utils.js +2 -2
- package/lib/components/booking/info2/service/addService/utils.d.ts +0 -10
- package/lib/components/booking/info2/service/addService/utils.js +4 -27
- package/lib/components/booking/info2/service/editService/Resources/index.js +10 -54
- package/lib/components/booking/info2/service/editService/Resources/index.less +0 -6
- package/lib/components/booking/info2/utilsByBooking.js +0 -6
- package/lib/components/booking/locales.d.ts +0 -3
- package/lib/components/booking/locales.js +0 -3
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/const.d.ts +1 -4
- package/lib/components/eftposPay/const.js +0 -2
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/hooks.js +4 -11
- package/lib/components/eftposPay/index.js +1 -1
- package/lib/components/eftposPay/manufacturer.d.ts +0 -1
- package/lib/components/eftposPay/manufacturer.js +0 -6
- package/lib/components/eftposPay/pay.d.ts +1 -1
- package/lib/components/eftposPay/pay.js +2 -13
- package/lib/components/eftposPay/store/index.d.ts +4 -4
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +3 -16
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.js +5 -8
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +2 -4
- package/lib/components/eventBooking/components/Provider/Event/index.js +3 -10
- package/lib/components/eventBooking/components/bookingDetailModal/index.js +4 -10
- package/lib/components/eventBooking/index.js +7 -11
- package/lib/components/eventBooking/locales.d.ts +0 -24
- package/lib/components/eventBooking/locales.js +6 -30
- package/lib/components/index.d.ts +1 -3
- package/lib/components/index.js +0 -6
- package/lib/components/pay/toC/PaymentMethods/index.js +9 -10
- package/lib/components/schedules/utils.d.ts +1 -1
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.js +139 -263
- package/lib/components/ticketBooking/locales.d.ts +146 -164
- package/lib/components/ticketBooking/locales.js +4 -22
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -6
- package/lib/utils/index.d.ts +1 -1
- package/package.json +3 -3
- package/es/components/booking/editBookingModal/index.d.ts +0 -5
- package/es/components/booking/editBookingModal/index.js +0 -386
- package/es/components/booking/editBookingModal/index.less +0 -8
- package/es/components/booking/editBookingModal/locales.d.ts +0 -21
- package/es/components/booking/editBookingModal/locales.js +0 -20
- package/es/components/booking/editBookingModal/mock.d.ts +0 -807
- package/es/components/booking/editBookingModal/mock.js +0 -2993
- package/es/components/booking/editBookingModal/serve.d.ts +0 -51
- package/es/components/booking/editBookingModal/serve.js +0 -288
- package/es/components/booking/editBookingModal/type.d.ts +0 -12
- package/es/components/booking/editBookingModal/type.js +0 -1
- package/es/components/booking/editBookingModal/utils.d.ts +0 -12
- package/es/components/booking/editBookingModal/utils.js +0 -157
- package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +0 -7
- package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +0 -26
- package/es/components/booking/info2/service/editService/ResourcesV2/index.d.ts +0 -10
- package/es/components/booking/info2/service/editService/ResourcesV2/index.js +0 -308
- package/es/components/booking/info2/service/editService/ResourcesV2/index.less +0 -44
- package/es/components/eftposPay/linkly/const.d.ts +0 -23
- package/es/components/eftposPay/linkly/const.js +0 -82
- package/es/components/eftposPay/linkly/hooks/index.d.ts +0 -2
- package/es/components/eftposPay/linkly/hooks/index.js +0 -2
- package/es/components/eftposPay/linkly/hooks/normal.d.ts +0 -30
- package/es/components/eftposPay/linkly/hooks/normal.js +0 -318
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +0 -4
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +0 -273
- package/es/components/eftposPay/linkly/index.d.ts +0 -2
- package/es/components/eftposPay/linkly/index.js +0 -197
- package/es/components/eftposPay/linkly/service.d.ts +0 -32
- package/es/components/eftposPay/linkly/service.js +0 -73
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -2
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.js +0 -17
- package/es/components/stepController/components/Content/index.d.ts +0 -7
- package/es/components/stepController/components/Content/index.js +0 -9
- package/es/components/stepController/components/Content/index.less +0 -8
- package/es/components/stepController/components/Footer/index.d.ts +0 -8
- package/es/components/stepController/components/Footer/index.js +0 -15
- package/es/components/stepController/components/Footer/index.less +0 -39
- package/es/components/stepController/components/Header/index.d.ts +0 -20
- package/es/components/stepController/components/Header/index.js +0 -97
- package/es/components/stepController/components/Header/index.less +0 -21
- package/es/components/stepController/index.d.ts +0 -5
- package/es/components/stepController/index.js +0 -64
- package/es/components/stepController/index.less +0 -11
- package/es/components/stepController/locales.d.ts +0 -27
- package/es/components/stepController/locales.js +0 -32
- package/es/components/stepController/types.d.ts +0 -23
- package/es/components/stepController/types.js +0 -1
- package/es/components/ticketBooking/utils/formatProductMessage.d.ts +0 -2
- package/es/components/ticketBooking/utils/formatProductMessage.js +0 -62
- package/es/components/ticketBooking/utils/formatTime.d.ts +0 -31
- package/es/components/ticketBooking/utils/formatTime.js +0 -144
- package/es/hooks/useWindowSize.d.ts +0 -5
- package/es/hooks/useWindowSize.js +0 -26
- package/lib/components/booking/editBookingModal/index.d.ts +0 -5
- package/lib/components/booking/editBookingModal/index.js +0 -363
- package/lib/components/booking/editBookingModal/index.less +0 -8
- package/lib/components/booking/editBookingModal/locales.d.ts +0 -21
- package/lib/components/booking/editBookingModal/locales.js +0 -44
- package/lib/components/booking/editBookingModal/mock.d.ts +0 -807
- package/lib/components/booking/editBookingModal/mock.js +0 -3314
- package/lib/components/booking/editBookingModal/serve.d.ts +0 -51
- package/lib/components/booking/editBookingModal/serve.js +0 -178
- package/lib/components/booking/editBookingModal/type.d.ts +0 -12
- package/lib/components/booking/editBookingModal/type.js +0 -17
- package/lib/components/booking/editBookingModal/utils.d.ts +0 -12
- package/lib/components/booking/editBookingModal/utils.js +0 -158
- package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +0 -7
- package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +0 -53
- package/lib/components/booking/info2/service/editService/ResourcesV2/index.d.ts +0 -10
- package/lib/components/booking/info2/service/editService/ResourcesV2/index.js +0 -311
- package/lib/components/booking/info2/service/editService/ResourcesV2/index.less +0 -44
- package/lib/components/eftposPay/linkly/const.d.ts +0 -23
- package/lib/components/eftposPay/linkly/const.js +0 -102
- package/lib/components/eftposPay/linkly/hooks/index.d.ts +0 -2
- package/lib/components/eftposPay/linkly/hooks/index.js +0 -25
- package/lib/components/eftposPay/linkly/hooks/normal.d.ts +0 -30
- package/lib/components/eftposPay/linkly/hooks/normal.js +0 -239
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +0 -4
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +0 -222
- package/lib/components/eftposPay/linkly/index.d.ts +0 -2
- package/lib/components/eftposPay/linkly/index.js +0 -208
- package/lib/components/eftposPay/linkly/service.d.ts +0 -32
- package/lib/components/eftposPay/linkly/service.js +0 -55
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -2
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.js +0 -55
- package/lib/components/stepController/components/Content/index.d.ts +0 -7
- package/lib/components/stepController/components/Content/index.js +0 -40
- package/lib/components/stepController/components/Content/index.less +0 -8
- package/lib/components/stepController/components/Footer/index.d.ts +0 -8
- package/lib/components/stepController/components/Footer/index.js +0 -49
- package/lib/components/stepController/components/Footer/index.less +0 -39
- package/lib/components/stepController/components/Header/index.d.ts +0 -20
- package/lib/components/stepController/components/Header/index.js +0 -104
- package/lib/components/stepController/components/Header/index.less +0 -21
- package/lib/components/stepController/index.d.ts +0 -5
- package/lib/components/stepController/index.js +0 -89
- package/lib/components/stepController/index.less +0 -11
- package/lib/components/stepController/locales.d.ts +0 -27
- package/lib/components/stepController/locales.js +0 -50
- package/lib/components/stepController/types.d.ts +0 -23
- package/lib/components/stepController/types.js +0 -17
- package/lib/components/ticketBooking/utils/formatProductMessage.d.ts +0 -2
- package/lib/components/ticketBooking/utils/formatProductMessage.js +0 -84
- package/lib/components/ticketBooking/utils/formatTime.d.ts +0 -31
- package/lib/components/ticketBooking/utils/formatTime.js +0 -139
- package/lib/hooks/useWindowSize.d.ts +0 -5
- package/lib/hooks/useWindowSize.js +0 -51
- package/lowcode/edit-booking-modal/meta.ts +0 -53
- package/lowcode/step-controller/meta.ts +0 -88
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
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 ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
-
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; }
|
|
7
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
|
-
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."); }
|
|
11
|
-
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); }
|
|
12
|
-
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; }
|
|
13
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
14
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
|
-
import React, { useState, useMemo, forwardRef, useCallback, useImperativeHandle } from 'react';
|
|
16
|
-
import classNames from 'classnames';
|
|
17
|
-
import { Col, Form, Select, Button, Alert, Checkbox, Tooltip, Row } from 'antd';
|
|
18
|
-
import { Iconfont } from '@pisell/materials';
|
|
19
|
-
import MaxLengthSelect from "./MaxLengthSelect";
|
|
20
|
-
import Like from "../../../../info/service/like";
|
|
21
|
-
import "./index.less";
|
|
22
|
-
import { locales } from '@pisell/utils';
|
|
23
|
-
import { getErrorList } from "../../../utilsByBooking";
|
|
24
|
-
import { isArray } from 'lodash';
|
|
25
|
-
import { getAutoAllocationStorage, setAutoAllocationStorage } from "../utils";
|
|
26
|
-
import { useUpdate } from 'ahooks';
|
|
27
|
-
import { QuestionCircleOutlined } from '@ant-design/icons';
|
|
28
|
-
var Resources = function Resources(_ref, ref) {
|
|
29
|
-
var _cacheItem$_data2, _originCacheItem$_dat, _cacheItem$_data5;
|
|
30
|
-
var state = _ref.state,
|
|
31
|
-
cacheItem = _ref.cacheItem,
|
|
32
|
-
originCacheItem = _ref.originCacheItem,
|
|
33
|
-
getCurrentCacheItem = _ref.getCurrentCacheItem,
|
|
34
|
-
onChange = _ref.onChange,
|
|
35
|
-
value = _ref.value,
|
|
36
|
-
originValue = _ref.originValue,
|
|
37
|
-
_ref$config = _ref.config,
|
|
38
|
-
config = _ref$config === void 0 ? {
|
|
39
|
-
// 是否显示自动分配
|
|
40
|
-
autoAllocation: true,
|
|
41
|
-
// 是否显示资源错误图标
|
|
42
|
-
resourceErrorIcon: true,
|
|
43
|
-
disabled: false,
|
|
44
|
-
size: 'large'
|
|
45
|
-
} : _ref$config;
|
|
46
|
-
var _useState = useState(false),
|
|
47
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
48
|
-
showError = _useState2[0],
|
|
49
|
-
setShowError = _useState2[1];
|
|
50
|
-
var update = useUpdate();
|
|
51
|
-
|
|
52
|
-
// 需要渲染的列表, 资源二级结构数据
|
|
53
|
-
var data = useMemo(function () {
|
|
54
|
-
var _cacheItem$_data;
|
|
55
|
-
return (cacheItem === null || cacheItem === void 0 || (_cacheItem$_data = cacheItem._data) === null || _cacheItem$_data === void 0 ? void 0 : _cacheItem$_data.resources) || [];
|
|
56
|
-
}, [cacheItem === null || cacheItem === void 0 || (_cacheItem$_data2 = cacheItem._data) === null || _cacheItem$_data2 === void 0 ? void 0 : _cacheItem$_data2.resources]);
|
|
57
|
-
var originData = useMemo(function () {
|
|
58
|
-
var _cacheItem$_data3;
|
|
59
|
-
return (cacheItem === null || cacheItem === void 0 || (_cacheItem$_data3 = cacheItem._data) === null || _cacheItem$_data3 === void 0 ? void 0 : _cacheItem$_data3.resources) || [];
|
|
60
|
-
}, [originCacheItem === null || originCacheItem === void 0 || (_originCacheItem$_dat = originCacheItem._data) === null || _originCacheItem$_dat === void 0 ? void 0 : _originCacheItem$_dat.resource]);
|
|
61
|
-
|
|
62
|
-
// 同上, 只是map结构,方便计算
|
|
63
|
-
var resourceMaps = useMemo(function () {
|
|
64
|
-
var _cacheItem$_data4;
|
|
65
|
-
return (cacheItem === null || cacheItem === void 0 || (_cacheItem$_data4 = cacheItem._data) === null || _cacheItem$_data4 === void 0 ? void 0 : _cacheItem$_data4.resourceMaps) || [];
|
|
66
|
-
}, [cacheItem === null || cacheItem === void 0 || (_cacheItem$_data5 = cacheItem._data) === null || _cacheItem$_data5 === void 0 ? void 0 : _cacheItem$_data5.resourceMaps]);
|
|
67
|
-
|
|
68
|
-
// 默认值
|
|
69
|
-
var defaultValue = useMemo(function () {
|
|
70
|
-
return data.reduce(function (pre, cur) {
|
|
71
|
-
pre[cur.form_id] = [];
|
|
72
|
-
return pre;
|
|
73
|
-
}, {});
|
|
74
|
-
}, [data]);
|
|
75
|
-
|
|
76
|
-
// 当前的值
|
|
77
|
-
var _value = useMemo(function () {
|
|
78
|
-
return value || defaultValue;
|
|
79
|
-
}, [value, defaultValue]);
|
|
80
|
-
var handleCheckAutoAllocation = function handleCheckAutoAllocation(id, checked) {
|
|
81
|
-
setAutoAllocationStorage(_defineProperty({}, id, checked));
|
|
82
|
-
update();
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* @title: 当选择资源时
|
|
87
|
-
* @description:
|
|
88
|
-
* @param {any} val
|
|
89
|
-
* @param {number} form_id
|
|
90
|
-
* @param {string} key
|
|
91
|
-
* @return {*}
|
|
92
|
-
* @Author: zhiwei.Wang
|
|
93
|
-
* @Date: 2024-09-19 21:04
|
|
94
|
-
*/
|
|
95
|
-
var _onChange = function _onChange(val, form_id, key) {
|
|
96
|
-
var _val = _objectSpread({}, _value);
|
|
97
|
-
// 将当前数据map化, 减少循环次数
|
|
98
|
-
var maps = _val[form_id] ? _val[form_id].reduce(function (pre, cur) {
|
|
99
|
-
pre[cur.relation_id] = cur;
|
|
100
|
-
return pre;
|
|
101
|
-
}, {}) : {};
|
|
102
|
-
// 重新赋值, 因为select返回的是数字列表, 需要补充额外的数据
|
|
103
|
-
_val[form_id] = val.map(function (d) {
|
|
104
|
-
var _currentForm$renderLi, _currentForm$renderLi2, _currentForm$renderLi3, _currentForm$renderLi4, _currentForm$renderLi5;
|
|
105
|
-
var _d = maps[d];
|
|
106
|
-
if (_d) {
|
|
107
|
-
if (key === 'like_status') {
|
|
108
|
-
d[key].like_status = val;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
var currentForm = (resourceMaps === null || resourceMaps === void 0 ? void 0 : resourceMaps[form_id]) || {};
|
|
112
|
-
return (
|
|
113
|
-
// maps[d] 为真时, 说明是之前已选择, 否则为新增的值,补充数据
|
|
114
|
-
maps[d] || {
|
|
115
|
-
relation_type: ((_currentForm$renderLi = currentForm.renderListMaps[d]) === null || _currentForm$renderLi === void 0 || (_currentForm$renderLi = _currentForm$renderLi.usable) === null || _currentForm$renderLi === void 0 ? void 0 : _currentForm$renderLi.relation_type) || 'form',
|
|
116
|
-
form_id: form_id,
|
|
117
|
-
relation_id: d,
|
|
118
|
-
like_status: 'common',
|
|
119
|
-
children: (_currentForm$renderLi2 = currentForm.renderListMaps) === null || _currentForm$renderLi2 === void 0 || (_currentForm$renderLi2 = _currentForm$renderLi2[d]) === null || _currentForm$renderLi2 === void 0 ? void 0 : _currentForm$renderLi2.children,
|
|
120
|
-
// 新添加的数据补充错误信息
|
|
121
|
-
errors: getErrorList((_currentForm$renderLi3 = currentForm.renderListMaps) === null || _currentForm$renderLi3 === void 0 ? void 0 : _currentForm$renderLi3[d], getCurrentCacheItem()),
|
|
122
|
-
metadata: _objectSpread(_objectSpread({}, (_currentForm$renderLi4 = currentForm.renderListMaps) === null || _currentForm$renderLi4 === void 0 || (_currentForm$renderLi4 = _currentForm$renderLi4[d]) === null || _currentForm$renderLi4 === void 0 ? void 0 : _currentForm$renderLi4.metadata), {}, {
|
|
123
|
-
form_name: currentForm.title,
|
|
124
|
-
resource_name: (_currentForm$renderLi5 = currentForm.renderListMaps[d]) === null || _currentForm$renderLi5 === void 0 ? void 0 : _currentForm$renderLi5.main_field
|
|
125
|
-
})
|
|
126
|
-
}
|
|
127
|
-
);
|
|
128
|
-
});
|
|
129
|
-
setShowError(false);
|
|
130
|
-
onChange === null || onChange === void 0 || onChange(_val);
|
|
131
|
-
};
|
|
132
|
-
var setLikeStatus = function setLikeStatus(val, form_id, key) {
|
|
133
|
-
var _val$form_id;
|
|
134
|
-
var _val = _objectSpread({}, _value);
|
|
135
|
-
if (_val !== null && _val !== void 0 && (_val$form_id = _val[form_id]) !== null && _val$form_id !== void 0 && _val$form_id[0]) {
|
|
136
|
-
_val[form_id][0][key] = val;
|
|
137
|
-
onChange === null || onChange === void 0 || onChange(_val);
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* @title: 渲染下拉框
|
|
143
|
-
* @description:
|
|
144
|
-
* @return {*}
|
|
145
|
-
* @Author: zhiwei.Wang
|
|
146
|
-
* @Date: 2024-01-09 14:02
|
|
147
|
-
*/
|
|
148
|
-
var renderOptions = useCallback(function (array) {
|
|
149
|
-
var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'value';
|
|
150
|
-
var label = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'label';
|
|
151
|
-
var type = arguments.length > 3 ? arguments[3] : undefined;
|
|
152
|
-
return array.map(function (d) {
|
|
153
|
-
var props = {};
|
|
154
|
-
if (type === 'resource') {
|
|
155
|
-
props.labelText = d.labelText;
|
|
156
|
-
}
|
|
157
|
-
return /*#__PURE__*/React.createElement(Select.Option, _extends({
|
|
158
|
-
value: d[value],
|
|
159
|
-
key: d[value]
|
|
160
|
-
}, props, {
|
|
161
|
-
relation_type: d.relation_type
|
|
162
|
-
}), d[label]);
|
|
163
|
-
});
|
|
164
|
-
}, [config === null || config === void 0 ? void 0 : config.resourceErrorIcon]);
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* @title: 检查当前资源最小选择数量
|
|
168
|
-
* @description:
|
|
169
|
-
* @return {*}
|
|
170
|
-
* @Author: zhiwei.Wang
|
|
171
|
-
* @Date: 2024-09-19 21:08
|
|
172
|
-
*/
|
|
173
|
-
var check = function check() {
|
|
174
|
-
var _iterator = _createForOfIteratorHelper(data),
|
|
175
|
-
_step;
|
|
176
|
-
try {
|
|
177
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
178
|
-
var _value$item$form_id;
|
|
179
|
-
var item = _step.value;
|
|
180
|
-
var _length = (_value$item$form_id = _value[item.form_id]) === null || _value$item$form_id === void 0 ? void 0 : _value$item$form_id.length;
|
|
181
|
-
if (item.select_type.min > _length) {
|
|
182
|
-
setShowError(true);
|
|
183
|
-
return false;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
} catch (err) {
|
|
187
|
-
_iterator.e(err);
|
|
188
|
-
} finally {
|
|
189
|
-
_iterator.f();
|
|
190
|
-
}
|
|
191
|
-
return true;
|
|
192
|
-
};
|
|
193
|
-
useImperativeHandle(ref, function () {
|
|
194
|
-
return {
|
|
195
|
-
check: check
|
|
196
|
-
};
|
|
197
|
-
});
|
|
198
|
-
var getIsAutoAllocation = function getIsAutoAllocation(id) {
|
|
199
|
-
return getAutoAllocationStorage(id);
|
|
200
|
-
};
|
|
201
|
-
var renderItem = function renderItem(item, isOrigin) {
|
|
202
|
-
var _cur$2;
|
|
203
|
-
if (!item) return null;
|
|
204
|
-
var disabled = isOrigin || (config === null || config === void 0 ? void 0 : config.disabled);
|
|
205
|
-
var cur = isOrigin ? originValue[item.form_id] : _value[item.form_id];
|
|
206
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Col, {
|
|
207
|
-
flex: "1 0"
|
|
208
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
209
|
-
className: "resource-v2 resource-col"
|
|
210
|
-
}, item.select_type.type === 'multiple' ? null : /*#__PURE__*/React.createElement(Button, {
|
|
211
|
-
className: classNames('resource-col-like-wrap', {
|
|
212
|
-
'resource-col-like-wrap-disabled': disabled
|
|
213
|
-
}, (config === null || config === void 0 ? void 0 : config.size) || 'large'),
|
|
214
|
-
size: config === null || config === void 0 ? void 0 : config.size,
|
|
215
|
-
onClick: function onClick() {
|
|
216
|
-
var _cur$;
|
|
217
|
-
if (disabled) {
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
setLikeStatus((cur === null || cur === void 0 || (_cur$ = cur[0]) === null || _cur$ === void 0 ? void 0 : _cur$.like_status) === 'like' ? 'common' : 'like', item.form_id, 'like_status');
|
|
221
|
-
}
|
|
222
|
-
}, /*#__PURE__*/React.createElement(Like, {
|
|
223
|
-
status: cur === null || cur === void 0 || (_cur$2 = cur[0]) === null || _cur$2 === void 0 ? void 0 : _cur$2.like_status,
|
|
224
|
-
className: "".concat(disabled ? 'like-icon-disabled' : '')
|
|
225
|
-
})), /*#__PURE__*/React.createElement(MaxLengthSelect, {
|
|
226
|
-
className: "resource-col-select",
|
|
227
|
-
size: (config === null || config === void 0 ? void 0 : config.size) || 'large',
|
|
228
|
-
maxLength: item.select_type.max,
|
|
229
|
-
mode: item.select_type.type === 'multiple' ? 'multiple' : undefined,
|
|
230
|
-
onChange: function onChange(e) {
|
|
231
|
-
var val = e;
|
|
232
|
-
if (!isArray(e)) {
|
|
233
|
-
if (e || e === 0) {
|
|
234
|
-
val = [e];
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
_onChange(val, item.form_id, 'value');
|
|
238
|
-
},
|
|
239
|
-
value: cur === null || cur === void 0 ? void 0 : cur.map(function (d) {
|
|
240
|
-
return d.relation_id;
|
|
241
|
-
}),
|
|
242
|
-
showSearch: true,
|
|
243
|
-
filterOption: function filterOption(str, option) {
|
|
244
|
-
return ((option === null || option === void 0 ? void 0 : option.labelText) || '').toLowerCase().includes((str || '').toLowerCase());
|
|
245
|
-
},
|
|
246
|
-
disabled: disabled
|
|
247
|
-
}, renderOptions(item.renderList, 'id', config !== null && config !== void 0 && config.resourceErrorIcon ? 'label' : 'labelText', 'resource')), config !== null && config !== void 0 && config.autoAllocation ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
248
|
-
checked: getIsAutoAllocation(item.form_id),
|
|
249
|
-
onChange: function onChange(e) {
|
|
250
|
-
handleCheckAutoAllocation(item.form_id, e.target.checked);
|
|
251
|
-
}
|
|
252
|
-
}), /*#__PURE__*/React.createElement(Tooltip, {
|
|
253
|
-
title: locales.getText('page.booking.text.resource.check-auto-allocation-tip')
|
|
254
|
-
}, /*#__PURE__*/React.createElement(QuestionCircleOutlined, null))) : null)));
|
|
255
|
-
};
|
|
256
|
-
var renderErrors = function renderErrors(item) {
|
|
257
|
-
var cur = _value[item.form_id];
|
|
258
|
-
var errors = (cur || []).reduce(function (pre, d) {
|
|
259
|
-
return pre.concat((d === null || d === void 0 ? void 0 : d.errors) || []);
|
|
260
|
-
}, []);
|
|
261
|
-
return state.renderType !== 'eventBooking' && (errors || []).map(function (d) {
|
|
262
|
-
return /*#__PURE__*/React.createElement(Alert, {
|
|
263
|
-
key: d.type,
|
|
264
|
-
message: d.label,
|
|
265
|
-
type: "warning",
|
|
266
|
-
showIcon: true,
|
|
267
|
-
style: {
|
|
268
|
-
marginBottom: 12
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
});
|
|
272
|
-
};
|
|
273
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, data.map(function (item) {
|
|
274
|
-
var _cur;
|
|
275
|
-
// 原资源表单信息
|
|
276
|
-
var originItem = originData === null || originData === void 0 ? void 0 : originData.find(function (originDataItem) {
|
|
277
|
-
return originDataItem.form_id === item.form_id;
|
|
278
|
-
});
|
|
279
|
-
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
280
|
-
key: item.form_id
|
|
281
|
-
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
282
|
-
label: item.title,
|
|
283
|
-
required: true,
|
|
284
|
-
labelCol: config === null || config === void 0 ? void 0 : config.labelCol,
|
|
285
|
-
extra: showError && item.select_type.min > ((_cur = cur) === null || _cur === void 0 ? void 0 : _cur.length) ? /*#__PURE__*/React.createElement("span", {
|
|
286
|
-
style: {
|
|
287
|
-
color: '#ff4d4f'
|
|
288
|
-
}
|
|
289
|
-
}, locales.getText('page.booking.text.resource.min-length-error')(item.select_type.min, item.title)) : undefined
|
|
290
|
-
}, /*#__PURE__*/React.createElement(Row, {
|
|
291
|
-
gutter: [16, 16],
|
|
292
|
-
wrap: false
|
|
293
|
-
}, renderItem(originItem, true), !!originItem ? /*#__PURE__*/React.createElement(Col, {
|
|
294
|
-
flex: "none",
|
|
295
|
-
style: {
|
|
296
|
-
display: 'flex',
|
|
297
|
-
alignItems: 'center'
|
|
298
|
-
}
|
|
299
|
-
}, /*#__PURE__*/React.createElement(Iconfont, {
|
|
300
|
-
type: "pisell2-arrow-block-right",
|
|
301
|
-
style: {
|
|
302
|
-
fontSize: 24,
|
|
303
|
-
color: '#1b1b1b'
|
|
304
|
-
}
|
|
305
|
-
})) : null, renderItem(item, false))), renderErrors(item));
|
|
306
|
-
}));
|
|
307
|
-
};
|
|
308
|
-
export default /*#__PURE__*/forwardRef(Resources);
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
.resource-col.resource-v2 {
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
justify-content: center;
|
|
5
|
-
gap: 10px;
|
|
6
|
-
width: 100%;
|
|
7
|
-
overflow: hidden;
|
|
8
|
-
|
|
9
|
-
.resource-col-like-wrap {
|
|
10
|
-
width: 32px;
|
|
11
|
-
height: 32px;
|
|
12
|
-
|
|
13
|
-
&.large {
|
|
14
|
-
width: 40px;
|
|
15
|
-
height: 40px;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
display: flex;
|
|
19
|
-
align-items: center;
|
|
20
|
-
justify-content: center;
|
|
21
|
-
padding: 0;
|
|
22
|
-
flex-shrink: 0;
|
|
23
|
-
|
|
24
|
-
.like-resource {
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.resource-col-like-wrap-disabled,
|
|
29
|
-
.like-icon-disabled {
|
|
30
|
-
opacity: 0.5;
|
|
31
|
-
cursor: not-allowed;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.resource-col-select {
|
|
35
|
-
flex: 1;
|
|
36
|
-
overflow: hidden;
|
|
37
|
-
|
|
38
|
-
.resource-option-label-text {
|
|
39
|
-
display: inline-block;
|
|
40
|
-
overflow: hidden;
|
|
41
|
-
text-overflow: ellipsis;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { State } from '../store';
|
|
2
|
-
import { ModeEnum } from '../const';
|
|
3
|
-
export declare const getStep: (mode?: ModeEnum) => State['steps'];
|
|
4
|
-
declare const _default: (params: any) => State;
|
|
5
|
-
export default _default;
|
|
6
|
-
export declare enum EVisibleButtonType {
|
|
7
|
-
/** 取消按钮 */
|
|
8
|
-
CancelButton = "CancelButton",
|
|
9
|
-
/** 等待按钮 */
|
|
10
|
-
WaitButton = "WaitButton"
|
|
11
|
-
}
|
|
12
|
-
export declare enum LinklyActionStatus {
|
|
13
|
-
/** 空 */
|
|
14
|
-
Empty = "Empty",
|
|
15
|
-
/** 取消 */
|
|
16
|
-
Cancel = "Cancel",
|
|
17
|
-
/** 取消中 */
|
|
18
|
-
CancelWaiting = "CancelWaiting",
|
|
19
|
-
/** 签名 */
|
|
20
|
-
Signature = "Signature",
|
|
21
|
-
/** 签名等待中 */
|
|
22
|
-
SignatureWaiting = "SignatureWaiting"
|
|
23
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["order_id", "name", "symbol", "amount", "mode", "number", "pay", "device", "net", "client"];
|
|
3
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
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; }
|
|
6
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
-
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; }
|
|
9
|
-
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; }
|
|
10
|
-
import { locales } from '@pisell/utils';
|
|
11
|
-
import { ClientEnum, EftposEnum, ModeEnum, PayRouteEnum, StatusEnum } from "../const";
|
|
12
|
-
export var getStep = function getStep() {
|
|
13
|
-
var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ModeEnum.Pay;
|
|
14
|
-
return [{
|
|
15
|
-
key: Date.now(),
|
|
16
|
-
title: locales.getText('page.eftpos-pay.text.loading')(mode),
|
|
17
|
-
// 'Payment in process...',
|
|
18
|
-
text: locales.getText('page.eftpos-pay.text.waiting.processing'),
|
|
19
|
-
// 'Waiting for the processing...',
|
|
20
|
-
warn: '',
|
|
21
|
-
tip: locales.getText('page.eftpos-pay.text.processing'),
|
|
22
|
-
// 'processing...',
|
|
23
|
-
status: StatusEnum.Loading
|
|
24
|
-
}];
|
|
25
|
-
};
|
|
26
|
-
export default (function (params) {
|
|
27
|
-
var _ref = params || {
|
|
28
|
-
mode: ModeEnum.Pay
|
|
29
|
-
},
|
|
30
|
-
order_id = _ref.order_id,
|
|
31
|
-
name = _ref.name,
|
|
32
|
-
symbol = _ref.symbol,
|
|
33
|
-
amount = _ref.amount,
|
|
34
|
-
mode = _ref.mode,
|
|
35
|
-
number = _ref.number,
|
|
36
|
-
pay = _ref.pay,
|
|
37
|
-
device = _ref.device,
|
|
38
|
-
net = _ref.net,
|
|
39
|
-
client = _ref.client,
|
|
40
|
-
other = _objectWithoutProperties(_ref, _excluded);
|
|
41
|
-
console.log('params =>>>>>> ', params);
|
|
42
|
-
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
43
|
-
order_id: order_id,
|
|
44
|
-
name: name,
|
|
45
|
-
symbol: symbol,
|
|
46
|
-
amount: amount,
|
|
47
|
-
mode: mode,
|
|
48
|
-
eftpos: EftposEnum.Linkly,
|
|
49
|
-
key: Date.now(),
|
|
50
|
-
step: 0,
|
|
51
|
-
type: PayRouteEnum.Step,
|
|
52
|
-
title: locales.getText('page.eftpos-pay.text.loading')(mode),
|
|
53
|
-
component: '',
|
|
54
|
-
status: StatusEnum.Loading,
|
|
55
|
-
steps: getStep(mode),
|
|
56
|
-
render: true,
|
|
57
|
-
client: client !== 'undefined' ? client : ClientEnum.Merchant,
|
|
58
|
-
warn: '',
|
|
59
|
-
custom: other || {}
|
|
60
|
-
}, typeof net !== 'undefined' ? {
|
|
61
|
-
net: net
|
|
62
|
-
} : {}), typeof number !== 'undefined' ? {
|
|
63
|
-
number: number
|
|
64
|
-
} : {}), typeof pay !== 'undefined' ? {
|
|
65
|
-
pay: pay
|
|
66
|
-
} : {}), typeof device !== 'undefined' ? {
|
|
67
|
-
device: device
|
|
68
|
-
} : {});
|
|
69
|
-
});
|
|
70
|
-
export var EVisibleButtonType = /*#__PURE__*/function (EVisibleButtonType) {
|
|
71
|
-
EVisibleButtonType["CancelButton"] = "CancelButton";
|
|
72
|
-
EVisibleButtonType["WaitButton"] = "WaitButton";
|
|
73
|
-
return EVisibleButtonType;
|
|
74
|
-
}({});
|
|
75
|
-
export var LinklyActionStatus = /*#__PURE__*/function (LinklyActionStatus) {
|
|
76
|
-
LinklyActionStatus["Empty"] = "Empty";
|
|
77
|
-
LinklyActionStatus["Cancel"] = "Cancel";
|
|
78
|
-
LinklyActionStatus["CancelWaiting"] = "CancelWaiting";
|
|
79
|
-
LinklyActionStatus["Signature"] = "Signature";
|
|
80
|
-
LinklyActionStatus["SignatureWaiting"] = "SignatureWaiting";
|
|
81
|
-
return LinklyActionStatus;
|
|
82
|
-
}({});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 支付或退款
|
|
3
|
-
* @param failAction 失败回调
|
|
4
|
-
*/
|
|
5
|
-
export declare const useLinklyPayOrRefund: (handleCheck: () => boolean) => {
|
|
6
|
-
action: {
|
|
7
|
-
pay: import("ahooks/lib/useRequest/src/types").Result<any, [data: any]>;
|
|
8
|
-
};
|
|
9
|
-
payOrRefund: (resultQuery: any, handleLinklySuccess: any) => void;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* @title: 取消支付或退款
|
|
13
|
-
* @description: 取消支付或退款调用接口后不管成功还是失败都需要调用支付查询接口
|
|
14
|
-
*/
|
|
15
|
-
export declare const useLinklyCancel: (handleCheck: () => boolean) => {
|
|
16
|
-
action: {
|
|
17
|
-
cancel: import("ahooks/lib/useRequest/src/types").Result<any, [param: any]>;
|
|
18
|
-
};
|
|
19
|
-
linklyCancel: (resultQuery: any) => void;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* @title: 支付或退款签名
|
|
23
|
-
* @description: 支付或退款签名调用接口后不管成功还是失败都需要调用支付查询接口
|
|
24
|
-
*/
|
|
25
|
-
export declare const useLinklySignature: (handleCheck: () => boolean) => {
|
|
26
|
-
action: {
|
|
27
|
-
signature: import("ahooks/lib/useRequest/src/types").Result<any, [param: any]>;
|
|
28
|
-
};
|
|
29
|
-
linklySignature: (status: number, resultQuery: any) => void;
|
|
30
|
-
};
|