@pisell/private-materials 6.1.1 → 6.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +4 -4
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/es/businessModel/SalesModel/Sales/index.js +37 -4
- package/es/businessModel/SalesModel/index.d.ts +0 -1
- package/es/components/Sales/Resource/index.js +2 -2
- package/es/components/Sales/Resource/serve.d.ts +7 -0
- package/es/components/Sales/Resource/serve.js +10 -0
- package/es/components/booking/components/TabProduct/index.d.ts +0 -1
- package/es/components/booking/components/customSelect/index.js +1 -0
- package/es/components/booking/components/footer/utils.d.ts +1 -0
- package/es/components/booking/components/footer/utils.js +47 -18
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/es/components/booking/editBookingModal/index.d.ts +5 -0
- package/es/components/booking/editBookingModal/index.js +386 -0
- package/es/components/booking/editBookingModal/index.less +8 -0
- package/es/components/booking/editBookingModal/locales.d.ts +21 -0
- package/es/components/booking/editBookingModal/locales.js +20 -0
- package/es/components/booking/editBookingModal/mock.d.ts +807 -0
- package/es/components/booking/editBookingModal/mock.js +2993 -0
- package/es/components/booking/editBookingModal/serve.d.ts +51 -0
- package/es/components/booking/editBookingModal/serve.js +288 -0
- package/es/components/booking/editBookingModal/type.d.ts +12 -0
- package/es/components/booking/editBookingModal/type.js +1 -0
- package/es/components/booking/editBookingModal/utils.d.ts +12 -0
- package/es/components/booking/editBookingModal/utils.js +157 -0
- package/es/components/booking/forms/table/index.d.ts +0 -1
- package/es/components/booking/hooks/useClearCart.js +11 -8
- package/es/components/booking/info/client/index.js +3 -2
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.js +24 -10
- package/es/components/booking/info/model.js +5 -0
- package/es/components/booking/info/service/Lists.js +38 -26
- package/es/components/booking/info/service/editService/index.js +3 -0
- package/es/components/booking/info/service/like/index.d.ts +0 -1
- package/es/components/booking/info/service/serviceList/index.js +2 -0
- package/es/components/booking/info/service/serviceManager/index.js +3 -1
- package/es/components/booking/info/service2/Lists.d.ts +0 -1
- package/es/components/booking/info/service2/Lists.js +1 -0
- package/es/components/booking/info/service2/utils.js +26 -25
- package/es/components/booking/info2/service/addService/index.js +1 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +10 -0
- package/es/components/booking/info2/service/addService/utils.js +54 -17
- package/es/components/booking/info2/service/addTimeModal/index.js +3 -0
- package/es/components/booking/info2/service/editService/Resources/index.js +27 -8
- package/es/components/booking/info2/service/editService/Resources/index.less +6 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +7 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +26 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/index.d.ts +10 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/index.js +308 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/index.less +44 -0
- package/es/components/booking/info2/service/editService/index.js +261 -167
- package/es/components/booking/info2/service/index.js +19 -15
- package/es/components/booking/info2/service/serviceList/index.js +2 -0
- package/es/components/booking/info2/utilsByBooking.js +9 -0
- package/es/components/booking/locales.d.ts +3 -0
- package/es/components/booking/locales.js +3 -0
- package/es/components/booking/materiels/duration/index.js +9 -2
- package/es/components/booking/materiels/holder/index.d.ts +0 -1
- package/es/components/booking/materiels/startTime/index.d.ts +0 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftpos/deviceList/index.d.ts +0 -1
- package/es/components/eftpos/form/index.d.ts +0 -1
- package/es/components/eftpos/group/index.d.ts +0 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftpos/icon/apiKey.d.ts +0 -1
- package/es/components/eftpos/icon/device.d.ts +0 -1
- package/es/components/eftpos/receipt/index.d.ts +0 -1
- package/es/components/eftpos/surcharge/index.d.ts +0 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/es/components/eftposPay/component/step/index.d.ts +0 -1
- package/es/components/eftposPay/component/step/step.d.ts +0 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/payo/config.js +30 -3
- package/es/components/eftposPay/store/index.d.ts +6 -6
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Event/index.js +13 -4
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/index.js +19 -3
- package/es/components/eventBooking/index.js +21 -7
- package/es/components/eventBooking/locales.js +3 -3
- package/es/components/index.d.ts +3 -1
- package/es/components/index.js +3 -1
- package/es/components/pay/toB/components/Content/index.js +35 -52
- package/es/components/pay/toB/store/hooks.js +13 -4
- package/es/components/pay/toB/store/provider.js +1 -0
- package/es/components/pay/toB/types/storeTypes.d.ts +2 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
- package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/es/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/es/components/schedules/products/index.d.ts +0 -1
- package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Cart/Product.js +48 -41
- package/es/components/shoppingCart/components/Cart/index.js +21 -18
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/es/components/stepController/components/Content/index.d.ts +7 -0
- package/es/components/stepController/components/Content/index.js +9 -0
- package/es/components/stepController/components/Content/index.less +8 -0
- package/es/components/stepController/components/Footer/index.d.ts +8 -0
- package/es/components/stepController/components/Footer/index.js +15 -0
- package/es/components/stepController/components/Footer/index.less +39 -0
- package/es/components/stepController/components/Header/index.d.ts +20 -0
- package/es/components/stepController/components/Header/index.js +97 -0
- package/es/components/stepController/components/Header/index.less +21 -0
- package/es/components/stepController/index.d.ts +5 -0
- package/es/components/stepController/index.js +64 -0
- package/es/components/stepController/index.less +11 -0
- package/es/components/stepController/locales.d.ts +27 -0
- package/es/components/stepController/locales.js +32 -0
- package/es/components/stepController/types.d.ts +23 -0
- package/es/components/stepController/types.js +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +3 -2
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/es/components/ticketBooking/components/menuBar/index.d.ts +0 -1
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/es/components/ticketBooking/components/ticketBooking/index.js +137 -137
- package/es/components/ticketBooking/utils/index.js +2 -1
- package/es/hooks/useWindowSize.d.ts +5 -0
- package/es/hooks/useWindowSize.js +26 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/lib/businessModel/SalesModel/Sales/index.js +22 -8
- package/lib/businessModel/SalesModel/index.d.ts +0 -1
- package/lib/components/Sales/Resource/index.js +1 -1
- package/lib/components/Sales/Resource/serve.d.ts +7 -0
- package/lib/components/Sales/Resource/serve.js +9 -2
- package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
- package/lib/components/booking/components/customSelect/index.js +1 -0
- package/lib/components/booking/components/footer/utils.d.ts +1 -0
- package/lib/components/booking/components/footer/utils.js +27 -7
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/lib/components/booking/editBookingModal/index.d.ts +5 -0
- package/lib/components/booking/editBookingModal/index.js +363 -0
- package/lib/components/booking/editBookingModal/index.less +8 -0
- package/lib/components/booking/editBookingModal/locales.d.ts +21 -0
- package/lib/components/booking/editBookingModal/locales.js +44 -0
- package/lib/components/booking/editBookingModal/mock.d.ts +807 -0
- package/lib/components/booking/editBookingModal/mock.js +3314 -0
- package/lib/components/booking/editBookingModal/serve.d.ts +51 -0
- package/lib/components/booking/editBookingModal/serve.js +178 -0
- package/lib/components/booking/editBookingModal/type.d.ts +12 -0
- package/lib/components/booking/editBookingModal/type.js +17 -0
- package/lib/components/booking/editBookingModal/utils.d.ts +12 -0
- package/lib/components/booking/editBookingModal/utils.js +158 -0
- package/lib/components/booking/forms/table/index.d.ts +0 -1
- package/lib/components/booking/hooks/useClearCart.js +16 -13
- package/lib/components/booking/info/client/index.js +7 -6
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.js +16 -10
- package/lib/components/booking/info/model.js +3 -0
- package/lib/components/booking/info/service/Lists.js +37 -23
- package/lib/components/booking/info/service/editService/index.js +3 -0
- package/lib/components/booking/info/service/like/index.d.ts +0 -1
- package/lib/components/booking/info/service/serviceList/index.js +2 -0
- package/lib/components/booking/info/service/serviceManager/index.js +2 -0
- package/lib/components/booking/info/service2/Lists.d.ts +0 -1
- package/lib/components/booking/info/service2/Lists.js +1 -0
- package/lib/components/booking/info/service2/utils.js +22 -21
- package/lib/components/booking/info2/service/addService/index.js +1 -0
- package/lib/components/booking/info2/service/addService/utils.d.ts +10 -0
- package/lib/components/booking/info2/service/addService/utils.js +36 -7
- package/lib/components/booking/info2/service/addTimeModal/index.js +3 -0
- package/lib/components/booking/info2/service/editService/Resources/index.js +56 -10
- package/lib/components/booking/info2/service/editService/Resources/index.less +6 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +7 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +53 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/index.d.ts +10 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/index.js +311 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/index.less +44 -0
- package/lib/components/booking/info2/service/editService/index.js +164 -79
- package/lib/components/booking/info2/service/index.js +13 -9
- package/lib/components/booking/info2/service/serviceList/index.js +2 -0
- package/lib/components/booking/info2/utilsByBooking.js +6 -0
- package/lib/components/booking/locales.d.ts +3 -0
- package/lib/components/booking/locales.js +3 -0
- package/lib/components/booking/materiels/duration/index.js +7 -2
- package/lib/components/booking/materiels/holder/index.d.ts +0 -1
- package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftpos/deviceList/index.d.ts +0 -1
- package/lib/components/eftpos/form/index.d.ts +0 -1
- package/lib/components/eftpos/group/index.d.ts +0 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
- package/lib/components/eftpos/icon/device.d.ts +0 -1
- package/lib/components/eftpos/receipt/index.d.ts +0 -1
- package/lib/components/eftpos/surcharge/index.d.ts +0 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/lib/components/eftposPay/component/step/index.d.ts +0 -1
- package/lib/components/eftposPay/component/step/step.d.ts +0 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/payo/config.js +22 -2
- package/lib/components/eftposPay/store/index.d.ts +6 -6
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Event/index.js +10 -3
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/index.js +9 -3
- package/lib/components/eventBooking/index.js +11 -7
- package/lib/components/eventBooking/locales.js +3 -3
- package/lib/components/index.d.ts +3 -1
- package/lib/components/index.js +6 -0
- package/lib/components/pay/toB/components/Content/index.js +5 -5
- package/lib/components/pay/toB/store/hooks.js +8 -1
- package/lib/components/pay/toB/store/provider.js +1 -0
- package/lib/components/pay/toB/types/storeTypes.d.ts +2 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/lib/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/lib/components/schedules/products/index.d.ts +0 -1
- package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Cart/Product.js +31 -21
- package/lib/components/shoppingCart/components/Cart/index.js +18 -15
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/lib/components/stepController/components/Content/index.d.ts +7 -0
- package/lib/components/stepController/components/Content/index.js +40 -0
- package/lib/components/stepController/components/Content/index.less +8 -0
- package/lib/components/stepController/components/Footer/index.d.ts +8 -0
- package/lib/components/stepController/components/Footer/index.js +49 -0
- package/lib/components/stepController/components/Footer/index.less +39 -0
- package/lib/components/stepController/components/Header/index.d.ts +20 -0
- package/lib/components/stepController/components/Header/index.js +104 -0
- package/lib/components/stepController/components/Header/index.less +21 -0
- package/lib/components/stepController/index.d.ts +5 -0
- package/lib/components/stepController/index.js +89 -0
- package/lib/components/stepController/index.less +11 -0
- package/lib/components/stepController/locales.d.ts +27 -0
- package/lib/components/stepController/locales.js +50 -0
- package/lib/components/stepController/types.d.ts +23 -0
- package/lib/components/stepController/types.js +17 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +2 -2
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/menuBar/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.js +143 -138
- package/lib/components/ticketBooking/utils/index.js +2 -1
- package/lib/hooks/useWindowSize.d.ts +5 -0
- package/lib/hooks/useWindowSize.js +51 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -0
- package/lowcode/edit-booking-modal/meta.ts +53 -0
- package/lowcode/step-controller/meta.ts +88 -0
- package/package.json +2 -2
@@ -4,10 +4,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
4
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
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
6
6
|
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); }
|
7
|
+
import { useMemoizedFn } from "ahooks";
|
7
8
|
import { useEffect, useMemo, useRef } from "react";
|
8
9
|
import useHolderConfig from "./useHolderConfig";
|
9
10
|
import { isOpenAddTime } from "../utils";
|
10
11
|
import useGetHolderList from "./useGetHolderList";
|
12
|
+
import { getProductExtend } from "../../info2/service/addService/utils";
|
11
13
|
var useInfoHolder = function useInfoHolder(state, dispatch) {
|
12
14
|
var _state$client, _state$bookingConfig2;
|
13
15
|
var detailRef = useRef();
|
@@ -28,29 +30,41 @@ var useInfoHolder = function useInfoHolder(state, dispatch) {
|
|
28
30
|
};
|
29
31
|
}, [state === null || state === void 0 || (_state$bookingConfig2 = state.bookingConfig) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.config) === null || _state$bookingConfig2 === void 0 ? void 0 : _state$bookingConfig2.information_tab]);
|
30
32
|
var showAddTimeModal = useMemo(function () {
|
31
|
-
return isOpenAddTime(state);
|
33
|
+
return isOpenAddTime(state) && !state.isBookingTicket2;
|
32
34
|
}, [state, appointment_card.quick_time]);
|
33
|
-
var handleEdit = function
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
35
|
+
var handleEdit = useMemoizedFn(function (cacheItem, type) {
|
36
|
+
var _detailRef$current, _detailRef$current$in;
|
37
|
+
// console.timeEnd('handleChange');
|
38
|
+
console.time('handleEdit');
|
39
|
+
console.log(performance.now() - window.pp1, '打开商品4');
|
40
|
+
(_detailRef$current = detailRef.current) === null || _detailRef$current === void 0 || (_detailRef$current$in = _detailRef$current.init) === null || _detailRef$current$in === void 0 || _detailRef$current$in.call(_detailRef$current, cacheItem, false, type === 'edit_product');
|
41
|
+
// setTimeout(() => {
|
42
|
+
// console.log(performance.now() - window.pp1, '打开商品5');
|
43
|
+
// console.timeEnd('handleEdit')
|
44
|
+
// detailRef.current?.init?.(cacheItem, false, type === 'edit_product');
|
45
|
+
// }, );
|
46
|
+
});
|
39
47
|
var dispatchService = function dispatchService(type, payload) {
|
40
48
|
dispatch({
|
41
49
|
type: type,
|
42
50
|
payload: _objectSpread({}, payload)
|
43
51
|
});
|
44
52
|
};
|
45
|
-
var handleAction = function
|
53
|
+
var handleAction = useMemoizedFn(function (dataSource) {
|
54
|
+
var cacheItem = getProductExtend({
|
55
|
+
cacheItem: _objectSpread(_objectSpread({}, dataSource._origin), {}, {
|
56
|
+
new: 0
|
57
|
+
}),
|
58
|
+
state: state
|
59
|
+
});
|
46
60
|
dispatch({
|
47
61
|
type: "setService",
|
48
62
|
payload: {
|
49
63
|
addTimeModal: true,
|
50
|
-
cacheItem:
|
64
|
+
cacheItem: cacheItem
|
51
65
|
}
|
52
66
|
});
|
53
|
-
};
|
67
|
+
});
|
54
68
|
return {
|
55
69
|
detailRef: detailRef,
|
56
70
|
handleEdit: handleEdit,
|
@@ -67,6 +67,11 @@ var _miniRedux = miniRedux({
|
|
67
67
|
},
|
68
68
|
setActiveCartId: function setActiveCartId(state, payload) {
|
69
69
|
state.setGlobalState(payload);
|
70
|
+
},
|
71
|
+
setAddons: function setAddons(state, payload) {
|
72
|
+
state.setGlobalState({
|
73
|
+
addons: _objectSpread(_objectSpread({}, state.addons), payload)
|
74
|
+
});
|
70
75
|
}
|
71
76
|
},
|
72
77
|
reducers: {
|
@@ -14,7 +14,7 @@ import { useMemoizedFn } from 'ahooks';
|
|
14
14
|
import { getProductExtend } from "../../info2/service/addService/utils";
|
15
15
|
import useAddHolder from "../hooks/useAddHolder";
|
16
16
|
var Lists = function Lists(_ref) {
|
17
|
-
var _state$
|
17
|
+
var _state$service2;
|
18
18
|
var onEdit = _ref.onEdit,
|
19
19
|
onChange = _ref.onChange,
|
20
20
|
onAction = _ref.onAction,
|
@@ -36,6 +36,8 @@ var Lists = function Lists(_ref) {
|
|
36
36
|
* @Date: 2024-11-29 16:35
|
37
37
|
*/
|
38
38
|
var handleChange = useMemoizedFn(function (currentItem, type, other) {
|
39
|
+
console.time('handleChange');
|
40
|
+
console.log(window.pp1 = performance.now(), '打开商品');
|
39
41
|
if (state.disabledEdit || state.disableEventBookingEdit) {
|
40
42
|
return;
|
41
43
|
}
|
@@ -55,14 +57,14 @@ var Lists = function Lists(_ref) {
|
|
55
57
|
state: state
|
56
58
|
});
|
57
59
|
}
|
60
|
+
openBookingEditModal();
|
58
61
|
onChange({
|
59
62
|
editModal: true,
|
60
63
|
cacheItem: cacheItem
|
61
64
|
});
|
62
|
-
return onEdit === null || onEdit === void 0 ? void 0 : onEdit(
|
63
|
-
new: 0
|
64
|
-
}), type);
|
65
|
+
return onEdit === null || onEdit === void 0 ? void 0 : onEdit(cacheItem, type);
|
65
66
|
}
|
67
|
+
closeBookingEditModal();
|
66
68
|
var params = {
|
67
69
|
editModal: false,
|
68
70
|
value: products,
|
@@ -95,27 +97,37 @@ var Lists = function Lists(_ref) {
|
|
95
97
|
isShowEditProduct: !state.isBookingCreatePage
|
96
98
|
};
|
97
99
|
}, [state === null || state === void 0 ? void 0 : state.bookingId, state === null || state === void 0 ? void 0 : state.disabledEdit, isShowChangeHolder, state.isBookingCreatePage]);
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
100
|
+
var products = useMemo(function () {
|
101
|
+
var _state$service;
|
102
|
+
console.time('products');
|
103
|
+
var p = formatProducts((state === null || state === void 0 || (_state$service = state.service) === null || _state$service === void 0 ? void 0 : _state$service.value) || [], state, false, true, isParallelResource);
|
104
|
+
console.timeEnd('products');
|
105
|
+
return p;
|
106
|
+
}, [state === null || state === void 0 || (_state$service2 = state.service) === null || _state$service2 === void 0 ? void 0 : _state$service2.value]);
|
107
|
+
return useMemo(function () {
|
108
|
+
console.log('render List');
|
109
|
+
return /*#__PURE__*/React.createElement(CartContext.Provider, {
|
110
|
+
value: {
|
111
|
+
state: state
|
112
|
+
}
|
113
|
+
}, /*#__PURE__*/React.createElement(ShoppingCart, {
|
114
|
+
isParallelResource: isParallelResource,
|
115
|
+
onAction: onAction,
|
116
|
+
onChange: handleChange,
|
117
|
+
isOpenGroup: false,
|
118
|
+
isHideClearCart: true,
|
119
|
+
onAddProduct: function onAddProduct() {
|
120
|
+
return onChange({
|
121
|
+
addModal: true
|
122
|
+
});
|
123
|
+
}
|
124
|
+
// onActiveKey={handleActiveKey}
|
125
|
+
// collapseParams={CollapseParams}
|
126
|
+
,
|
127
|
+
productParams: _objectSpread(_objectSpread({}, productParams), {}, {
|
128
|
+
products: products
|
129
|
+
})
|
130
|
+
}));
|
131
|
+
}, [products, state, productParams]);
|
120
132
|
};
|
121
133
|
export default Lists;
|
@@ -269,6 +269,7 @@ var Info = function Info(_, ref) {
|
|
269
269
|
return d._id !== _id;
|
270
270
|
});
|
271
271
|
}
|
272
|
+
closeBookingEditModal();
|
272
273
|
dispatch({
|
273
274
|
type: 'setService',
|
274
275
|
payload: {
|
@@ -785,6 +786,7 @@ var Info = function Info(_, ref) {
|
|
785
786
|
if (state.channelDisabledEdit) {
|
786
787
|
return;
|
787
788
|
}
|
789
|
+
openBookingEditModal();
|
788
790
|
dispatch({
|
789
791
|
type: 'setService',
|
790
792
|
payload: {
|
@@ -972,6 +974,7 @@ var Info = function Info(_, ref) {
|
|
972
974
|
open: state.service.editModal && !((_state$service$cacheI8 = state.service.cacheItem) !== null && _state$service$cacheI8 !== void 0 && _state$service$cacheI8.autoClose),
|
973
975
|
title: isDayBookingMode ? locales.getText('pisell2.text.edit-select-service') : locales.getText('pisell2.text.edit-service'),
|
974
976
|
onClose: function onClose() {
|
977
|
+
closeBookingEditModal();
|
975
978
|
dispatch({
|
976
979
|
type: 'setService',
|
977
980
|
payload: {
|
@@ -33,6 +33,7 @@ var ServiceList = function ServiceList(_ref) {
|
|
33
33
|
if (state.disabledEdit || state.disableEventBookingEdit) {
|
34
34
|
return;
|
35
35
|
}
|
36
|
+
openBookingEditModal();
|
36
37
|
dispatch({
|
37
38
|
type: 'setService',
|
38
39
|
payload: {
|
@@ -54,6 +55,7 @@ var ServiceList = function ServiceList(_ref) {
|
|
54
55
|
_list = _list.filter(function (d) {
|
55
56
|
return d._id !== item._id;
|
56
57
|
});
|
58
|
+
closeBookingEditModal();
|
57
59
|
dispatch({
|
58
60
|
type: 'setService',
|
59
61
|
payload: {
|
@@ -242,6 +242,7 @@ export var useService = function useService(_ref) {
|
|
242
242
|
}
|
243
243
|
}
|
244
244
|
deleteCacheParams();
|
245
|
+
closeBookingEditModal();
|
245
246
|
dispatch({
|
246
247
|
type: 'setService',
|
247
248
|
payload: {
|
@@ -253,7 +254,7 @@ export var useService = function useService(_ref) {
|
|
253
254
|
changeService: false
|
254
255
|
}
|
255
256
|
});
|
256
|
-
case
|
257
|
+
case 8:
|
257
258
|
case "end":
|
258
259
|
return _context4.stop();
|
259
260
|
}
|
@@ -265,6 +266,7 @@ export var useService = function useService(_ref) {
|
|
265
266
|
}();
|
266
267
|
var goEditPanel = function goEditPanel(_ref11) {
|
267
268
|
var booking = _ref11.booking;
|
269
|
+
openBookingEditModal();
|
268
270
|
dispatch({
|
269
271
|
type: 'setService',
|
270
272
|
payload: {
|
@@ -451,12 +451,13 @@ var formatBundle = function formatBundle(bundle) {
|
|
451
451
|
var formatOptions = function formatOptions(options) {
|
452
452
|
if (!(options !== null && options !== void 0 && options.length)) return [];
|
453
453
|
return options.map(function (item) {
|
454
|
+
var price = Number((item === null || item === void 0 ? void 0 : item.price) || (item === null || item === void 0 ? void 0 : item.add_price));
|
454
455
|
return {
|
455
456
|
id: item === null || item === void 0 ? void 0 : item.id,
|
456
457
|
name: item === null || item === void 0 ? void 0 : item.name,
|
457
458
|
num: item === null || item === void 0 ? void 0 : item.num,
|
458
|
-
price:
|
459
|
-
total:
|
459
|
+
price: price,
|
460
|
+
total: price,
|
460
461
|
origin_total: item === null || item === void 0 ? void 0 : item.original_price
|
461
462
|
};
|
462
463
|
});
|
@@ -495,7 +496,8 @@ var getAllErrorList = function getAllErrorList(item) {
|
|
495
496
|
var _ref4 = item._data || {},
|
496
497
|
resourceMaps = _ref4.resourceMaps;
|
497
498
|
var _ref5 = item._extend || {},
|
498
|
-
resource = _ref5.resource
|
499
|
+
_ref5$resource = _ref5.resource,
|
500
|
+
resource = _ref5$resource === void 0 ? {} : _ref5$resource;
|
499
501
|
var errorList = [];
|
500
502
|
Object.entries(resource).forEach(function (_ref6) {
|
501
503
|
var _ref7 = _slicedToArray(_ref6, 2),
|
@@ -515,7 +517,7 @@ var mapListItems = function mapListItems(items) {
|
|
515
517
|
return {
|
516
518
|
id: item.id || item.form_record_id,
|
517
519
|
label: item.labelText,
|
518
|
-
isError: !item.usable
|
520
|
+
isError: !item.usable || item.unbound
|
519
521
|
};
|
520
522
|
});
|
521
523
|
};
|
@@ -689,29 +691,28 @@ export var formatProducts = function formatProducts(lists, state) {
|
|
689
691
|
_origin: item
|
690
692
|
});
|
691
693
|
};
|
692
|
-
|
693
|
-
// 将商品分为组商品和非组商品
|
694
|
-
lists.forEach(function (item) {
|
695
|
-
var _item$_extend28;
|
696
|
-
if (!(item !== null && item !== void 0 && (_item$_extend28 = item._extend) !== null && _item$_extend28 !== void 0 && _item$_extend28.groupId)) {
|
697
|
-
normalList.push(formItem(item));
|
698
|
-
} else {
|
699
|
-
groupList.push(item);
|
700
|
-
}
|
701
|
-
});
|
702
|
-
|
703
|
-
// 根据item._extend.groupId 进行分组
|
704
|
-
var groups = groupList.reduce(function (prev, item) {
|
705
|
-
var _item$_extend29;
|
706
|
-
var groupId = item === null || item === void 0 || (_item$_extend29 = item._extend) === null || _item$_extend29 === void 0 ? void 0 : _item$_extend29.groupId;
|
707
|
-
if (!prev[groupId]) {
|
708
|
-
prev[groupId] = [];
|
709
|
-
}
|
710
|
-
prev[groupId].push(item);
|
711
|
-
return prev;
|
712
|
-
}, {});
|
713
694
|
console.log(normalList, 'normalList');
|
714
695
|
if (isRenderGroup) {
|
696
|
+
// 将商品分为组商品和非组商品
|
697
|
+
lists.forEach(function (item) {
|
698
|
+
var _item$_extend28;
|
699
|
+
if (!(item !== null && item !== void 0 && (_item$_extend28 = item._extend) !== null && _item$_extend28 !== void 0 && _item$_extend28.groupId)) {
|
700
|
+
normalList.push(formItem(item));
|
701
|
+
} else {
|
702
|
+
groupList.push(item);
|
703
|
+
}
|
704
|
+
});
|
705
|
+
|
706
|
+
// 根据item._extend.groupId 进行分组
|
707
|
+
var groups = groupList.reduce(function (prev, item) {
|
708
|
+
var _item$_extend29;
|
709
|
+
var groupId = item === null || item === void 0 || (_item$_extend29 = item._extend) === null || _item$_extend29 === void 0 ? void 0 : _item$_extend29.groupId;
|
710
|
+
if (!prev[groupId]) {
|
711
|
+
prev[groupId] = [];
|
712
|
+
}
|
713
|
+
prev[groupId].push(item);
|
714
|
+
return prev;
|
715
|
+
}, {});
|
715
716
|
return Object.values(groups).map(function (d) {
|
716
717
|
return formItem(concatBookings(d));
|
717
718
|
}).concat(normalList);
|
@@ -69,6 +69,16 @@ export declare const setDefaultResource: ({ cacheItem, resources }: any) => any;
|
|
69
69
|
* @Date: 2024-09-19 20:26
|
70
70
|
*/
|
71
71
|
export declare const setDefaultCapacitys: ({ capacitys, cacheItem }: any) => any;
|
72
|
+
/**
|
73
|
+
* @title: 将商品内关联的资源id还原成数据
|
74
|
+
* @description:
|
75
|
+
* @param {any} resourcesOriginMap
|
76
|
+
* @param {any} cacheItem
|
77
|
+
* @return {*}
|
78
|
+
* @Author: zhiwei.Wang
|
79
|
+
* @Date: 2024-09-19 20:23
|
80
|
+
*/
|
81
|
+
export declare const getResourceByIds: (resourcesOriginMap: any, cacheItem: any, extraParams?: any) => any[];
|
72
82
|
/**
|
73
83
|
* @title: 预生成服务的 extend
|
74
84
|
* @description:
|
@@ -128,7 +128,8 @@ export var getTimeObj = function getTimeObj(_ref4) {
|
|
128
128
|
cacheItem: cacheItem,
|
129
129
|
useStartTime: useStartTime,
|
130
130
|
currentResource: currentResource,
|
131
|
-
|
131
|
+
// 没有使用该参数
|
132
|
+
// state,
|
132
133
|
durationProps: durationProps
|
133
134
|
});
|
134
135
|
var obj = sliceDayIntoFiveMinutes((_state$bookingConfig2 = state.bookingConfig) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.config) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.basic) === null || _state$bookingConfig2 === void 0 ? void 0 : _state$bookingConfig2.service_time, locales.locale);
|
@@ -179,14 +180,23 @@ export var formatResources = function formatResources(_ref5) {
|
|
179
180
|
var _item = cloneDeep(item);
|
180
181
|
_item.renderList = _item.renderList.map(function (d) {
|
181
182
|
var res = formatResource(d, _cacheItem, function (newData) {
|
183
|
+
var unbound = !item.optional_resource.includes(newData.id) && !item.default_resource.includes(newData.id) && newData.id !== 0;
|
182
184
|
return /*#__PURE__*/React.createElement("div", {
|
183
185
|
className: "resource-option"
|
184
186
|
}, /*#__PURE__*/React.createElement("div", {
|
185
187
|
className: "like-wrap"
|
186
|
-
}),
|
188
|
+
}), /*#__PURE__*/React.createElement("span", {
|
189
|
+
className: "resource-option-label-text"
|
190
|
+
}, newData.labelText), (!newData.usable || unbound) && /*#__PURE__*/React.createElement(AlertTriangle, {
|
187
191
|
className: "resource-option-alert-icon"
|
188
192
|
}));
|
189
193
|
});
|
194
|
+
// 平行资源日历拖拽需求
|
195
|
+
// 当拖入为绑定的资源中时,为了展示,会临时创建目标资源对应的resourceItem
|
196
|
+
// 但是在 item.optional_resource 中并不包含目标资源id
|
197
|
+
if (!item.optional_resource.includes(d.id) && !item.default_resource.includes(d.id) && d.id !== 0) {
|
198
|
+
res.unbound = true;
|
199
|
+
}
|
190
200
|
renderListMaps[res.id] = res;
|
191
201
|
return res;
|
192
202
|
}).sort(function (a, b) {
|
@@ -277,7 +287,9 @@ export var setDefaultResource = function setDefaultResource(_ref6) {
|
|
277
287
|
defaultOriginalResource = renderList;
|
278
288
|
}
|
279
289
|
var defaultResource = defaultOriginalResource.map(function (d) {
|
280
|
-
return
|
290
|
+
return {
|
291
|
+
// ...d,
|
292
|
+
children: d.children,
|
281
293
|
relation_type: d.relation_type,
|
282
294
|
form_id: item.form_id,
|
283
295
|
relation_id: d.id,
|
@@ -288,7 +300,7 @@ export var setDefaultResource = function setDefaultResource(_ref6) {
|
|
288
300
|
form_name: item.title,
|
289
301
|
resource_name: d.main_field
|
290
302
|
}
|
291
|
-
}
|
303
|
+
};
|
292
304
|
});
|
293
305
|
obj[item.form_id] = defaultResource;
|
294
306
|
};
|
@@ -356,10 +368,12 @@ export var setDefaultCapacitys = function setDefaultCapacitys(_ref7) {
|
|
356
368
|
* @Author: zhiwei.Wang
|
357
369
|
* @Date: 2024-09-19 20:23
|
358
370
|
*/
|
359
|
-
var getResourceByIds = function getResourceByIds(resourcesOriginMap, cacheItem) {
|
371
|
+
export var getResourceByIds = function getResourceByIds(resourcesOriginMap, cacheItem, extraParams) {
|
360
372
|
var _cacheItem$product_re;
|
361
373
|
var _resources = _toConsumableArray((cacheItem === null || cacheItem === void 0 || (_cacheItem$product_re = cacheItem.product_resource) === null || _cacheItem$product_re === void 0 ? void 0 : _cacheItem$product_re.resources) || []);
|
362
|
-
|
374
|
+
var _ref8 = extraParams || {},
|
375
|
+
_ref8$extraResources = _ref8.extraResources,
|
376
|
+
extraResources = _ref8$extraResources === void 0 ? [] : _ref8$extraResources;
|
363
377
|
// 过滤出开启的资源
|
364
378
|
_resources = _resources.filter(function (d) {
|
365
379
|
return d.status == 1;
|
@@ -371,6 +385,14 @@ var getResourceByIds = function getResourceByIds(resourcesOriginMap, cacheItem)
|
|
371
385
|
var item = _step2.value;
|
372
386
|
var form_id = item.id;
|
373
387
|
|
388
|
+
// 将未绑定的资源,也放入 SelectOption 列表,避免出现仅展示id的情况
|
389
|
+
var extraResourceIds = extraResources.filter(function (_extraItem) {
|
390
|
+
return _extraItem.form_id === form_id && !item.optional_resource.includes(_extraItem.id) && !item.default_resource.includes(_extraItem.id);
|
391
|
+
}).map(function (_extraItem) {
|
392
|
+
return _extraItem.id;
|
393
|
+
});
|
394
|
+
extraResourceIds = Array.from(new Set(extraResourceIds));
|
395
|
+
|
374
396
|
// 去重
|
375
397
|
item.optional_resource = (item.optional_resource || []).filter(function (d) {
|
376
398
|
return item.default_resource.indexOf(d) == -1;
|
@@ -380,7 +402,10 @@ var getResourceByIds = function getResourceByIds(resourcesOriginMap, cacheItem)
|
|
380
402
|
if (resourcesOriginMap[d].combined_resource && resourcesOriginMap[d].combined_resource.status === 1) {
|
381
403
|
resourcesOriginMap[d].combined_resource.resource_ids.forEach(function (id) {
|
382
404
|
if (resourcesOriginMap[id]) {
|
383
|
-
|
405
|
+
var _resourcesOriginMap$i, _resourcesOriginMap$i2;
|
406
|
+
combiningResources.push(_objectSpread(_objectSpread({}, resourcesOriginMap[id]), {}, {
|
407
|
+
relation_id: ((_resourcesOriginMap$i = resourcesOriginMap[id]) === null || _resourcesOriginMap$i === void 0 ? void 0 : _resourcesOriginMap$i.relation_id) || ((_resourcesOriginMap$i2 = resourcesOriginMap[id]) === null || _resourcesOriginMap$i2 === void 0 ? void 0 : _resourcesOriginMap$i2.id)
|
408
|
+
}));
|
384
409
|
}
|
385
410
|
});
|
386
411
|
}
|
@@ -393,7 +418,7 @@ var getResourceByIds = function getResourceByIds(resourcesOriginMap, cacheItem)
|
|
393
418
|
};
|
394
419
|
|
395
420
|
// 可选项
|
396
|
-
var optional_resource = item.optional_resource.map(function (d) {
|
421
|
+
var optional_resource = [].concat(_toConsumableArray(item.optional_resource), _toConsumableArray(extraResourceIds)).map(function (d) {
|
397
422
|
if (!resourcesOriginMap[d]) {
|
398
423
|
return null;
|
399
424
|
}
|
@@ -454,10 +479,10 @@ var getIsAutoClose = function getIsAutoClose(cacheItem) {
|
|
454
479
|
}
|
455
480
|
}
|
456
481
|
}
|
457
|
-
return Object.entries(cacheItem._extend.resource).every(function (
|
458
|
-
var
|
459
|
-
key =
|
460
|
-
value =
|
482
|
+
return Object.entries(cacheItem._extend.resource).every(function (_ref9) {
|
483
|
+
var _ref10 = _slicedToArray(_ref9, 2),
|
484
|
+
key = _ref10[0],
|
485
|
+
value = _ref10[1];
|
461
486
|
return getAutoAllocationStorage(key) && (value === null || value === void 0 ? void 0 : value.length);
|
462
487
|
});
|
463
488
|
};
|
@@ -470,10 +495,10 @@ var getIsAutoClose = function getIsAutoClose(cacheItem) {
|
|
470
495
|
* @Author: zhiwei.Wang
|
471
496
|
* @Date: 2024-06-01 13:25
|
472
497
|
*/
|
473
|
-
export var getProductExtend = function getProductExtend(
|
474
|
-
var cacheItem =
|
475
|
-
state =
|
476
|
-
isDisabledTime =
|
498
|
+
export var getProductExtend = function getProductExtend(_ref11) {
|
499
|
+
var cacheItem = _ref11.cacheItem,
|
500
|
+
state = _ref11.state,
|
501
|
+
isDisabledTime = _ref11.isDisabledTime;
|
477
502
|
// 有endDate 说明是在编辑已经保存过的商品, 没有则是编辑还没保存过的商品
|
478
503
|
var isNew = cacheItem.new || !cacheItem._extend.endDate;
|
479
504
|
var _cacheItem = _objectSpread({}, cacheItem);
|
@@ -570,7 +595,19 @@ export var getProductExtend = function getProductExtend(_ref10) {
|
|
570
595
|
_cacheItem._data.capacitys = cacheItem.capacity;
|
571
596
|
}
|
572
597
|
if (!_cacheItem._data.resourcesOrigin) {
|
573
|
-
|
598
|
+
var extraResources = [];
|
599
|
+
// 日历中可以将预约拖入未绑定的资源中,需要兼容未绑定资源的 selectOption展示
|
600
|
+
if (Array.isArray(_cacheItem._extend.event_resources)) {
|
601
|
+
_cacheItem._extend.event_resources.forEach(function (_item) {
|
602
|
+
extraResources.push({
|
603
|
+
form_id: _item.form_id,
|
604
|
+
id: _item.relation_id
|
605
|
+
});
|
606
|
+
});
|
607
|
+
}
|
608
|
+
_cacheItem._data.resourcesOrigin = getResourceByIds(resourcesOriginMap, cacheItem, {
|
609
|
+
extraResources: extraResources
|
610
|
+
});
|
574
611
|
}
|
575
612
|
if (!_cacheItem._data.resources) {
|
576
613
|
// 资源
|
@@ -69,6 +69,7 @@ var AddTimeModal = function AddTimeModal() {
|
|
69
69
|
_useState10 = _slicedToArray(_useState9, 2),
|
70
70
|
renderList = _useState10[0],
|
71
71
|
setRenderList = _useState10[1];
|
72
|
+
console.log(renderList, 'renderListrenderList');
|
72
73
|
var context = useEngineContext();
|
73
74
|
var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
|
74
75
|
interaction = _context$appHelper$ut.interaction;
|
@@ -147,6 +148,7 @@ var AddTimeModal = function AddTimeModal() {
|
|
147
148
|
}
|
148
149
|
return arr.filter(Boolean);
|
149
150
|
}, [(_state$service = state.service) === null || _state$service === void 0 || (_state$service = _state$service.cacheItem) === null || _state$service === void 0 || (_state$service = _state$service._extend) === null || _state$service === void 0 ? void 0 : _state$service.resource]);
|
151
|
+
console.log(currentResource, 'currentResource');
|
150
152
|
var getTimeUsableStatus = function getTimeUsableStatus(time) {
|
151
153
|
var _state$service$cacheI3;
|
152
154
|
if (!((_state$service$cacheI3 = state.service.cacheItem) !== null && _state$service$cacheI3 !== void 0 && _state$service$cacheI3._extend) || !currentResource.length) {
|
@@ -265,6 +267,7 @@ var AddTimeModal = function AddTimeModal() {
|
|
265
267
|
case 3:
|
266
268
|
newList = _context2.sent;
|
267
269
|
list = newList.map(function (d) {
|
270
|
+
debugger;
|
268
271
|
// 是否可用
|
269
272
|
var isUsable = isUsableProduct(d.add_time, state.service.cacheItem);
|
270
273
|
return _objectSpread(_objectSpread({}, d), {}, {
|
@@ -22,14 +22,22 @@ import { getErrorList } from "../../../utilsByBooking";
|
|
22
22
|
import { isArray } from 'lodash';
|
23
23
|
import { getAutoAllocationStorage, setAutoAllocationStorage } from "../utils";
|
24
24
|
import { useUpdate } from 'ahooks';
|
25
|
-
import { QuestionCircleOutlined } from
|
25
|
+
import { QuestionCircleOutlined } from '@ant-design/icons';
|
26
26
|
var Resources = function Resources(_ref, ref) {
|
27
27
|
var _cacheItem$_data2, _cacheItem$_data4;
|
28
28
|
var state = _ref.state,
|
29
29
|
cacheItem = _ref.cacheItem,
|
30
30
|
getCurrentCacheItem = _ref.getCurrentCacheItem,
|
31
31
|
onChange = _ref.onChange,
|
32
|
-
value = _ref.value
|
32
|
+
value = _ref.value,
|
33
|
+
_ref$config = _ref.config,
|
34
|
+
config = _ref$config === void 0 ? {
|
35
|
+
// 是否显示自动分配
|
36
|
+
autoAllocation: true,
|
37
|
+
// 是否显示资源错误图标
|
38
|
+
resourceErrorIcon: true,
|
39
|
+
disabled: false
|
40
|
+
} : _ref$config;
|
33
41
|
var _useState = useState(false),
|
34
42
|
_useState2 = _slicedToArray(_useState, 2),
|
35
43
|
showError = _useState2[0],
|
@@ -144,7 +152,7 @@ var Resources = function Resources(_ref, ref) {
|
|
144
152
|
relation_type: d.relation_type
|
145
153
|
}), d[label]);
|
146
154
|
});
|
147
|
-
}, []);
|
155
|
+
}, [config === null || config === void 0 ? void 0 : config.resourceErrorIcon]);
|
148
156
|
|
149
157
|
/**
|
150
158
|
* @title: 检查当前资源最小选择数量
|
@@ -181,9 +189,14 @@ var Resources = function Resources(_ref, ref) {
|
|
181
189
|
var getIsAutoAllocation = function getIsAutoAllocation(id) {
|
182
190
|
return getAutoAllocationStorage(id);
|
183
191
|
};
|
192
|
+
console.log('resourcesss');
|
193
|
+
|
194
|
+
/* todo: 此处value变化渲染三次 */
|
195
|
+
|
184
196
|
return /*#__PURE__*/React.createElement(React.Fragment, null, data.map(function (item) {
|
185
197
|
var _cur$2;
|
186
198
|
var cur = _value[item.form_id];
|
199
|
+
console.log(cur, 'curcur');
|
187
200
|
var errors = (cur || []).reduce(function (pre, d) {
|
188
201
|
return pre.concat((d === null || d === void 0 ? void 0 : d.errors) || []);
|
189
202
|
}, []);
|
@@ -193,6 +206,7 @@ var Resources = function Resources(_ref, ref) {
|
|
193
206
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
194
207
|
label: item.title,
|
195
208
|
required: true,
|
209
|
+
labelCol: config === null || config === void 0 ? void 0 : config.labelCol,
|
196
210
|
extra: showError && item.select_type.min > (cur === null || cur === void 0 ? void 0 : cur.length) ? /*#__PURE__*/React.createElement("span", {
|
197
211
|
style: {
|
198
212
|
color: '#ff4d4f'
|
@@ -201,13 +215,17 @@ var Resources = function Resources(_ref, ref) {
|
|
201
215
|
}, /*#__PURE__*/React.createElement("div", {
|
202
216
|
className: "resource-col"
|
203
217
|
}, item.select_type.type === 'multiple' ? null : /*#__PURE__*/React.createElement(Button, {
|
204
|
-
className: "resource-col-like-wrap",
|
218
|
+
className: "resource-col-like-wrap ".concat(config !== null && config !== void 0 && config.disabled ? 'resource-col-like-wrap-disabled' : ''),
|
205
219
|
onClick: function onClick() {
|
206
220
|
var _cur$;
|
221
|
+
if (config !== null && config !== void 0 && config.disabled) {
|
222
|
+
return;
|
223
|
+
}
|
207
224
|
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');
|
208
225
|
}
|
209
226
|
}, /*#__PURE__*/React.createElement(Like, {
|
210
|
-
status: cur === null || cur === void 0 || (_cur$2 = cur[0]) === null || _cur$2 === void 0 ? void 0 : _cur$2.like_status
|
227
|
+
status: cur === null || cur === void 0 || (_cur$2 = cur[0]) === null || _cur$2 === void 0 ? void 0 : _cur$2.like_status,
|
228
|
+
className: "".concat(config !== null && config !== void 0 && config.disabled ? 'like-icon-disabled' : '')
|
211
229
|
})), /*#__PURE__*/React.createElement(MaxLengthSelect, {
|
212
230
|
className: "resource-col-select",
|
213
231
|
size: "large",
|
@@ -228,15 +246,16 @@ var Resources = function Resources(_ref, ref) {
|
|
228
246
|
showSearch: true,
|
229
247
|
filterOption: function filterOption(str, option) {
|
230
248
|
return ((option === null || option === void 0 ? void 0 : option.labelText) || '').toLowerCase().includes((str || '').toLowerCase());
|
231
|
-
}
|
232
|
-
|
249
|
+
},
|
250
|
+
disabled: config === null || config === void 0 ? void 0 : config.disabled
|
251
|
+
}, 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, {
|
233
252
|
checked: getIsAutoAllocation(item.form_id),
|
234
253
|
onChange: function onChange(e) {
|
235
254
|
handleCheckAutoAllocation(item.form_id, e.target.checked);
|
236
255
|
}
|
237
256
|
}), /*#__PURE__*/React.createElement(Tooltip, {
|
238
257
|
title: locales.getText('page.booking.text.resource.check-auto-allocation-tip')
|
239
|
-
}, /*#__PURE__*/React.createElement(QuestionCircleOutlined, null)))), state.renderType !== 'eventBooking' && (errors || []).map(function (d) {
|
258
|
+
}, /*#__PURE__*/React.createElement(QuestionCircleOutlined, null))) : null)), state.renderType !== 'eventBooking' && (errors || []).map(function (d) {
|
240
259
|
return /*#__PURE__*/React.createElement(Alert, {
|
241
260
|
key: d.type,
|
242
261
|
message: d.label,
|