@pisell/private-materials 6.5.30 → 6.5.32
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 +2 -2
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +10 -10
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +10 -10
- package/es/components/appointmentBooking/components/Voucher/index.js +2 -1
- package/es/components/booking/addons/index.js +25 -17
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/components/TabProduct/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
- package/es/components/booking/components/collapsibleList/utils.d.ts +1 -0
- package/es/components/booking/components/emptyBooking/index.d.ts +1 -0
- package/es/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
- package/es/components/booking/components/footer/amount.d.ts +1 -0
- package/es/components/booking/components/footer/amount.js +529 -79
- package/es/components/booking/components/footer/index.js +15 -3
- package/es/components/booking/components/footer/utils.d.ts +19 -0
- package/es/components/booking/components/footer/utils.js +160 -61
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/es/components/booking/components/reloadResourceModal/index.d.ts +1 -0
- package/es/components/booking/components/voucher/index.js +20 -6
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/forms/single/index.d.ts +1 -0
- package/es/components/booking/forms/table/index.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/es/components/booking/info/date/index.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/notes/index.d.ts +1 -0
- package/es/components/booking/info/service/actions/index.d.ts +1 -0
- package/es/components/booking/info/service/like/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/info/service2/utils.js +1 -0
- package/es/components/booking/info2/service/actions/index.d.ts +1 -0
- package/es/components/booking/info2/service/addService/index.js +2 -3
- package/es/components/booking/info2/service/contactInfoMode/index.d.ts +1 -0
- package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/materiels/contacts/index.d.ts +1 -0
- package/es/components/booking/materiels/duration/index.d.ts +1 -0
- package/es/components/booking/materiels/holder/index.d.ts +1 -0
- package/es/components/booking/materiels/startTime/index.d.ts +1 -0
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
- package/es/components/booking/notes/NoteBlock/index.d.ts +1 -0
- package/es/components/booking/notes/addNote/index.d.ts +1 -0
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/booking/utils.d.ts +1 -0
- package/es/components/booking/utils.js +16 -3
- package/es/components/checkout/PaymentModal.d.ts +7 -5
- package/es/components/checkout/PaymentModal.js +44 -108
- package/es/components/checkout/components/AdditionalModule/index.js +6 -0
- package/es/components/checkout/components/AmountSummary/index.less +4 -5
- package/es/components/checkout/components/SearchAndClientModule/index.d.ts +1 -0
- package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/es/components/checkout/utils/PaymentResultToastUtils.d.ts +0 -1
- package/es/components/eftpos/deviceList/index.d.ts +1 -0
- package/es/components/eftpos/form/index.d.ts +1 -0
- package/es/components/eftpos/group/index.d.ts +1 -0
- package/es/components/eftpos/hooks.d.ts +1 -0
- package/es/components/eftpos/icon/apiKey.d.ts +1 -0
- package/es/components/eftpos/icon/device.d.ts +1 -0
- package/es/components/eftpos/index.d.ts +1 -0
- package/es/components/eftpos/pos.d.ts +1 -0
- package/es/components/eftpos/receipt/index.d.ts +1 -0
- package/es/components/eftposPay/amount.d.ts +2 -1
- package/es/components/eftposPay/app.d.ts +1 -0
- package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -0
- package/es/components/eftposPay/component/fail/index.d.ts +1 -0
- package/es/components/eftposPay/component/fail/network.d.ts +1 -0
- package/es/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/es/components/eftposPay/component/manual/index.d.ts +1 -0
- package/es/components/eftposPay/component/signature/index.d.ts +1 -0
- package/es/components/eftposPay/component/step/index.d.ts +1 -0
- package/es/components/eftposPay/component/step/step.d.ts +1 -0
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +14 -6
- package/es/components/eftposPay/pay.d.ts +1 -0
- package/es/components/eftposPay/payo/config.d.ts +1 -0
- package/es/components/eftposPay/payo/config.js +70 -32
- package/es/components/eftposPay/payo/payment.d.ts +66 -0
- package/es/components/eftposPay/payo/payment.js +579 -0
- package/es/components/eftposPay/store/index.d.ts +4 -4
- package/es/components/eftposPay/tip.d.ts +1 -0
- package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/es/components/eftposPay/utils/log/index.d.ts +110 -0
- package/es/components/eftposPay/utils/log/index.js +371 -0
- package/es/components/eftposPay/windcave/receiptAction.d.ts +1 -0
- package/es/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +2 -1
- package/es/components/login/index.d.ts +1 -0
- package/es/components/pay/toB/components/Cache/index.d.ts +1 -0
- package/es/components/pay/toB/components/CardGroup/index.d.ts +1 -0
- package/es/components/pay/toB/components/Content/Header.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +13 -11
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
- package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +4 -2
- package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.js +2 -0
- package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.less +13 -3
- package/es/components/pay/toC/index.js +7 -4
- package/es/components/pay/toC/locales.d.ts +3 -0
- package/es/components/pay/toC/locales.js +6 -3
- package/es/components/pay/toC/model.d.ts +1 -9
- package/es/components/pay/toC/status.d.ts +1 -0
- package/es/components/pay/toC/status.js +3 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
- package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/es/components/productSelect/components/productGroup/index.d.ts +1 -0
- package/es/components/ruleSetting/ruleBorder/index.d.ts +1 -0
- package/es/components/schedules/calendar/calendarItem.d.ts +1 -0
- package/es/components/schedules/calendar/index.d.ts +1 -0
- package/es/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleList/index.d.ts +1 -0
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
- package/es/components/schedules/products/index.d.ts +1 -0
- package/es/components/schedules/products/list/ProductItem/index.d.ts +1 -0
- package/es/components/schedules/products/list/index.d.ts +1 -0
- package/es/components/schedules/resources/index.d.ts +1 -0
- package/es/components/schedules/resources/list/index.d.ts +1 -0
- package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/es/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
- package/es/components/schedules/schedules/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/es/components/shoppingCart/index.d.ts +1 -0
- package/es/components/subTotal/index.js +1 -1
- package/es/components/systemSettings/registry/components/GroupModal.d.ts +4 -0
- package/es/components/{checkout/PaymentPlugin.js → systemSettings/registry/components/GroupModal.js} +132 -171
- package/es/components/systemSettings/registry/components/ItemModal.d.ts +4 -0
- package/es/components/systemSettings/registry/components/ItemModal.js +547 -0
- package/es/components/systemSettings/registry/components/ModuleList.d.ts +4 -0
- package/es/components/systemSettings/registry/components/ModuleList.js +54 -0
- package/es/components/systemSettings/registry/components/SectionList.d.ts +4 -0
- package/es/components/systemSettings/registry/components/SectionList.js +174 -0
- package/es/components/systemSettings/registry/components/SettingsTable.d.ts +4 -0
- package/es/components/systemSettings/registry/components/SettingsTable.js +765 -0
- package/es/components/systemSettings/registry/components/index.d.ts +4 -0
- package/es/components/systemSettings/registry/components/index.js +4 -0
- package/es/components/systemSettings/registry/index.d.ts +5 -0
- package/es/components/systemSettings/registry/index.js +1059 -0
- package/es/components/systemSettings/registry/index.less +410 -0
- package/es/components/systemSettings/registry/locales.d.ts +272 -0
- package/es/components/systemSettings/registry/locales.js +300 -0
- package/es/components/systemSettings/registry/services.d.ts +77 -0
- package/es/components/systemSettings/registry/services.js +472 -0
- package/es/components/systemSettings/registry/types.d.ts +126 -0
- package/es/components/systemSettings/registry/types.js +1 -0
- package/es/components/systemSettings/registry/utils/typeValidation.d.ts +16 -0
- package/es/components/systemSettings/registry/utils/typeValidation.js +284 -0
- package/es/components/systemSettings/registry/utils/validators.d.ts +8 -0
- package/es/components/systemSettings/registry/utils/validators.js +44 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -0
- package/es/components/ticketBooking/utils/index.d.ts +3 -0
- package/es/components/ticketBooking/utils/index.js +36 -13
- package/es/components/wallet/Detail/index.js +34 -2
- package/es/components/wallet/Detail/index.less +11 -0
- package/es/components/wallet/Detail/locales.d.ts +6 -0
- package/es/components/wallet/Detail/locales.js +14 -2
- package/es/components/wallet/Detail/model.d.ts +1 -13
- package/es/components/wallet/DiscountCard/model.d.ts +1 -14
- package/es/components/wallet/PointCard/model.d.ts +1 -13
- package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/es/components/wallet/Voucher/index.js +11 -10
- package/es/components/wallet/Voucher/model.d.ts +1 -13
- package/es/components/wallet/components/WalletCard.js +5 -1
- package/es/components/wallet/index.js +4 -2
- package/es/components/wallet/model.d.ts +1 -9
- package/es/components/wallet/serve.d.ts +7 -0
- package/es/components/wallet/utils.d.ts +48 -0
- package/es/components/wallet/utils.js +342 -0
- package/es/hooks/usePaymentLogger.d.ts +1 -0
- package/es/index.d.ts +4 -0
- package/es/index.js +5 -1
- package/es/plus/clientName/index.d.ts +1 -0
- package/es/plus/clinetSearch/Add/BirthdayField/index.d.ts +1 -0
- package/es/plus/clinetSearch/Add/GenderField/index.d.ts +1 -0
- package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Cover/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Price/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/index.d.ts +1 -0
- package/es/plus/saasCreateOrganization/components/Header.d.ts +1 -0
- package/es/plus/saasRegister/components/EntryEmail.d.ts +1 -0
- package/es/plus/saasRegister/components/EntryInfo.d.ts +1 -0
- package/es/plus/saasRegister/components/GoLogin.d.ts +1 -0
- package/es/plus/saasRegister/components/Header.d.ts +1 -0
- package/es/plus/saasRegister/components/VerifyError.d.ts +1 -0
- package/es/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
- package/es/plus/walletEditor/components/relationProduct/index.d.ts +1 -0
- package/es/plus/walletPassGallery/components/footerButton/index.js +2 -4
- package/es/plus/walletPassGallery/components/footerButton/index.less +14 -59
- package/es/plus/walletPassGallery/components/passDetail/index.d.ts +1 -0
- package/es/plus/walletPassGallery/components/passDetail/index.js +84 -31
- package/es/plus/walletPassGallery/components/passDetail/index.less +4 -0
- package/es/plus/walletPassGallery/components/recharge/index.js +19 -8
- package/es/plus/walletPassGallery/index.js +7 -3
- package/es/plus/walletPassGallery/serve.d.ts +3 -0
- package/es/plus/walletPassGallery/serve.js +4 -2
- package/es/pro/Login2.0/index.less +15 -8
- package/es/pro/pisellPaymentList/example.d.ts +1 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +35 -30
- package/lib/components/appointmentBooking/components/Voucher/index.js +2 -1
- package/lib/components/booking/addons/index.js +15 -7
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
- package/lib/components/booking/components/collapsibleList/utils.d.ts +1 -0
- package/lib/components/booking/components/emptyBooking/index.d.ts +1 -0
- package/lib/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
- package/lib/components/booking/components/footer/amount.d.ts +1 -0
- package/lib/components/booking/components/footer/amount.js +276 -38
- package/lib/components/booking/components/footer/index.js +15 -3
- package/lib/components/booking/components/footer/utils.d.ts +19 -0
- package/lib/components/booking/components/footer/utils.js +109 -33
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/lib/components/booking/components/reloadResourceModal/index.d.ts +1 -0
- package/lib/components/booking/components/voucher/index.js +21 -7
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/forms/single/index.d.ts +1 -0
- package/lib/components/booking/forms/table/index.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/lib/components/booking/info/date/index.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/notes/index.d.ts +1 -0
- package/lib/components/booking/info/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info/service/like/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.js +1 -0
- package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addService/index.js +1 -2
- package/lib/components/booking/info2/service/contactInfoMode/index.d.ts +1 -0
- package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/materiels/contacts/index.d.ts +1 -0
- package/lib/components/booking/materiels/duration/index.d.ts +1 -0
- package/lib/components/booking/materiels/holder/index.d.ts +1 -0
- package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
- package/lib/components/booking/notes/NoteBlock/index.d.ts +1 -0
- package/lib/components/booking/notes/addNote/index.d.ts +1 -0
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/booking/utils.d.ts +1 -0
- package/lib/components/booking/utils.js +11 -0
- package/lib/components/checkout/PaymentModal.d.ts +7 -5
- package/lib/components/checkout/PaymentModal.js +73 -127
- package/lib/components/checkout/components/AdditionalModule/index.js +6 -0
- package/lib/components/checkout/components/AmountSummary/index.less +4 -5
- package/lib/components/checkout/components/SearchAndClientModule/index.d.ts +1 -0
- package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/lib/components/checkout/utils/PaymentResultToastUtils.d.ts +0 -1
- package/lib/components/eftpos/deviceList/index.d.ts +1 -0
- package/lib/components/eftpos/form/index.d.ts +1 -0
- package/lib/components/eftpos/group/index.d.ts +1 -0
- package/lib/components/eftpos/hooks.d.ts +1 -0
- package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
- package/lib/components/eftpos/icon/device.d.ts +1 -0
- package/lib/components/eftpos/index.d.ts +1 -0
- package/lib/components/eftpos/pos.d.ts +1 -0
- package/lib/components/eftpos/receipt/index.d.ts +1 -0
- package/lib/components/eftposPay/amount.d.ts +2 -1
- package/lib/components/eftposPay/app.d.ts +1 -0
- package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/index.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/network.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/lib/components/eftposPay/component/manual/index.d.ts +1 -0
- package/lib/components/eftposPay/component/signature/index.d.ts +1 -0
- package/lib/components/eftposPay/component/step/index.d.ts +1 -0
- package/lib/components/eftposPay/component/step/step.d.ts +1 -0
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +12 -6
- package/lib/components/eftposPay/pay.d.ts +1 -0
- package/lib/components/eftposPay/payo/config.d.ts +1 -0
- package/lib/components/eftposPay/payo/config.js +98 -73
- package/lib/components/eftposPay/payo/payment.d.ts +66 -0
- package/lib/components/eftposPay/payo/payment.js +357 -0
- package/lib/components/eftposPay/store/index.d.ts +4 -4
- package/lib/components/eftposPay/tip.d.ts +1 -0
- package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/lib/components/eftposPay/utils/log/index.d.ts +110 -0
- package/lib/components/eftposPay/utils/log/index.js +294 -0
- package/lib/components/eftposPay/windcave/receiptAction.d.ts +1 -0
- package/lib/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +3 -0
- package/lib/components/login/index.d.ts +1 -0
- package/lib/components/pay/toB/components/Cache/index.d.ts +1 -0
- package/lib/components/pay/toB/components/CardGroup/index.d.ts +1 -0
- package/lib/components/pay/toB/components/Content/Header.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +13 -11
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
- package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +4 -2
- package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.js +1 -1
- package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.less +13 -3
- package/lib/components/pay/toC/index.js +4 -1
- package/lib/components/pay/toC/locales.d.ts +3 -0
- package/lib/components/pay/toC/locales.js +6 -3
- package/lib/components/pay/toC/model.d.ts +1 -9
- package/lib/components/pay/toC/status.d.ts +1 -0
- package/lib/components/pay/toC/status.js +5 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/lib/components/productSelect/components/productGroup/index.d.ts +1 -0
- package/lib/components/ruleSetting/ruleBorder/index.d.ts +1 -0
- package/lib/components/schedules/calendar/calendarItem.d.ts +1 -0
- package/lib/components/schedules/calendar/index.d.ts +1 -0
- package/lib/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleList/index.d.ts +1 -0
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
- package/lib/components/schedules/products/index.d.ts +1 -0
- package/lib/components/schedules/products/list/ProductItem/index.d.ts +1 -0
- package/lib/components/schedules/products/list/index.d.ts +1 -0
- package/lib/components/schedules/resources/index.d.ts +1 -0
- package/lib/components/schedules/resources/list/index.d.ts +1 -0
- package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/lib/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
- package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
- package/lib/components/schedules/schedules/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/lib/components/shoppingCart/index.d.ts +1 -0
- package/lib/components/subTotal/index.js +1 -1
- package/lib/components/systemSettings/registry/components/GroupModal.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/GroupModal.js +177 -0
- package/lib/components/systemSettings/registry/components/ItemModal.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/ItemModal.js +508 -0
- package/lib/components/systemSettings/registry/components/ModuleList.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/ModuleList.js +71 -0
- package/lib/components/systemSettings/registry/components/SectionList.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/SectionList.js +181 -0
- package/lib/components/systemSettings/registry/components/SettingsTable.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/SettingsTable.js +575 -0
- package/lib/components/systemSettings/registry/components/index.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/index.js +48 -0
- package/lib/components/systemSettings/registry/index.d.ts +5 -0
- package/lib/components/systemSettings/registry/index.js +529 -0
- package/lib/components/systemSettings/registry/index.less +410 -0
- package/lib/components/systemSettings/registry/locales.d.ts +272 -0
- package/lib/components/systemSettings/registry/locales.js +324 -0
- package/lib/components/systemSettings/registry/services.d.ts +77 -0
- package/lib/components/systemSettings/registry/services.js +290 -0
- package/lib/components/systemSettings/registry/types.d.ts +126 -0
- package/lib/components/systemSettings/registry/types.js +17 -0
- package/lib/components/systemSettings/registry/utils/typeValidation.d.ts +16 -0
- package/lib/components/systemSettings/registry/utils/typeValidation.js +228 -0
- package/lib/components/systemSettings/registry/utils/validators.d.ts +8 -0
- package/lib/components/systemSettings/registry/utils/validators.js +54 -0
- package/lib/components/ticketBooking/utils/index.d.ts +3 -0
- package/lib/components/ticketBooking/utils/index.js +20 -6
- package/lib/components/wallet/Detail/index.js +31 -3
- package/lib/components/wallet/Detail/index.less +11 -0
- package/lib/components/wallet/Detail/locales.d.ts +6 -0
- package/lib/components/wallet/Detail/locales.js +14 -2
- package/lib/components/wallet/Detail/model.d.ts +1 -13
- package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
- package/lib/components/wallet/PointCard/model.d.ts +1 -13
- package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/lib/components/wallet/Voucher/index.js +8 -8
- package/lib/components/wallet/Voucher/model.d.ts +1 -13
- package/lib/components/wallet/components/WalletCard.js +4 -0
- package/lib/components/wallet/index.js +2 -2
- package/lib/components/wallet/model.d.ts +1 -9
- package/lib/components/wallet/serve.d.ts +7 -0
- package/lib/components/wallet/utils.d.ts +48 -0
- package/lib/components/wallet/utils.js +287 -0
- package/lib/hooks/usePaymentLogger.d.ts +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +12 -0
- package/lib/plus/clientName/index.d.ts +1 -0
- package/lib/plus/clinetSearch/Add/BirthdayField/index.d.ts +1 -0
- package/lib/plus/clinetSearch/Add/GenderField/index.d.ts +1 -0
- package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Cover/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Price/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/index.d.ts +1 -0
- package/lib/plus/saasCreateOrganization/components/Header.d.ts +1 -0
- package/lib/plus/saasRegister/components/EntryEmail.d.ts +1 -0
- package/lib/plus/saasRegister/components/EntryInfo.d.ts +1 -0
- package/lib/plus/saasRegister/components/GoLogin.d.ts +1 -0
- package/lib/plus/saasRegister/components/Header.d.ts +1 -0
- package/lib/plus/saasRegister/components/VerifyError.d.ts +1 -0
- package/lib/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
- package/lib/plus/walletEditor/components/relationProduct/index.d.ts +1 -0
- package/lib/plus/walletPassGallery/components/footerButton/index.js +2 -2
- package/lib/plus/walletPassGallery/components/footerButton/index.less +14 -59
- package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +1 -0
- package/lib/plus/walletPassGallery/components/passDetail/index.js +54 -15
- package/lib/plus/walletPassGallery/components/passDetail/index.less +4 -0
- package/lib/plus/walletPassGallery/components/recharge/index.js +7 -1
- package/lib/plus/walletPassGallery/index.js +7 -3
- package/lib/plus/walletPassGallery/serve.d.ts +3 -0
- package/lib/plus/walletPassGallery/serve.js +3 -2
- package/lib/pro/Login2.0/index.less +15 -8
- package/lib/pro/pisellPaymentList/example.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +34 -39
- package/lowcode/settings-registry/meta.ts +29 -0
- package/lowcode/wallet-pass-detail/meta.ts +89 -0
- package/package.json +3 -3
- package/es/components/checkout/PaymentPlugin.d.ts +0 -2
- package/lib/components/checkout/PaymentPlugin.d.ts +0 -2
- package/lib/components/checkout/PaymentPlugin.js +0 -181
|
@@ -0,0 +1,1059 @@
|
|
|
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
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; }
|
|
7
|
+
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; }
|
|
8
|
+
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; }
|
|
9
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
10
|
+
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); }
|
|
11
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
12
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
13
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
14
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
|
+
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."); }
|
|
16
|
+
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); }
|
|
17
|
+
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; }
|
|
18
|
+
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; } }
|
|
19
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
+
import React, { useState, useEffect, useCallback, useRef } from 'react';
|
|
21
|
+
import { message } from 'antd';
|
|
22
|
+
import { Button } from '@pisell/materials';
|
|
23
|
+
import { PlusOutlined } from '@ant-design/icons';
|
|
24
|
+
import { locales } from '@pisell/utils';
|
|
25
|
+
import useEngineContext from "../../../hooks/useEngineContext";
|
|
26
|
+
import { SectionList, SettingsTable, GroupModal, ItemModal } from "./components";
|
|
27
|
+
import { createGroup, updateGroup, deleteGroup, sortGroups, getSectionList, getGroupList, createItem, updateItem, deleteItem, sortItems } from "./services";
|
|
28
|
+
import { validateDefaultValue, parseDefaultValue } from "./utils/typeValidation";
|
|
29
|
+
import localeTexts from "./locales";
|
|
30
|
+
import "./index.less";
|
|
31
|
+
|
|
32
|
+
// 注释掉这里的初始化,使用 useEffect 中的初始化
|
|
33
|
+
// locales.init(localeTexts, localStorage.getItem('umi_locale') || 'en');
|
|
34
|
+
|
|
35
|
+
var Registry = function Registry(_ref) {
|
|
36
|
+
var _context$engine2;
|
|
37
|
+
var className = _ref.className,
|
|
38
|
+
style = _ref.style,
|
|
39
|
+
_ref$sections = _ref.sections,
|
|
40
|
+
sections = _ref$sections === void 0 ? [] : _ref$sections,
|
|
41
|
+
selectedSectionId = _ref.selectedSectionId,
|
|
42
|
+
onSectionSelect = _ref.onSectionSelect,
|
|
43
|
+
onDataChange = _ref.onDataChange;
|
|
44
|
+
var context = useEngineContext();
|
|
45
|
+
var request = context.appHelper.utils.request;
|
|
46
|
+
var _useState = useState(sections),
|
|
47
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
48
|
+
localSections = _useState2[0],
|
|
49
|
+
setLocalSections = _useState2[1];
|
|
50
|
+
var _useState3 = useState(selectedSectionId || (sections.length > 0 ? sections[0].id : 0)),
|
|
51
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
52
|
+
currentSectionId = _useState4[0],
|
|
53
|
+
setCurrentSectionId = _useState4[1];
|
|
54
|
+
|
|
55
|
+
// 分页相关状态
|
|
56
|
+
var _useState5 = useState(false),
|
|
57
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
58
|
+
loading = _useState6[0],
|
|
59
|
+
setLoading = _useState6[1];
|
|
60
|
+
var _useState7 = useState(true),
|
|
61
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
62
|
+
hasMore = _useState8[0],
|
|
63
|
+
setHasMore = _useState8[1];
|
|
64
|
+
var _useState9 = useState(1),
|
|
65
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
66
|
+
currentPage = _useState10[0],
|
|
67
|
+
setCurrentPage = _useState10[1];
|
|
68
|
+
var _useState11 = useState(20),
|
|
69
|
+
_useState12 = _slicedToArray(_useState11, 1),
|
|
70
|
+
pageSize = _useState12[0];
|
|
71
|
+
var _useState13 = useState(true),
|
|
72
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
73
|
+
isInitialLoad = _useState14[0],
|
|
74
|
+
setIsInitialLoad = _useState14[1];
|
|
75
|
+
|
|
76
|
+
// 组数据状态
|
|
77
|
+
var _useState15 = useState([]),
|
|
78
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
79
|
+
groupList = _useState16[0],
|
|
80
|
+
setGroupList = _useState16[1];
|
|
81
|
+
var _useState17 = useState(false),
|
|
82
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
83
|
+
groupLoading = _useState18[0],
|
|
84
|
+
setGroupLoading = _useState18[1];
|
|
85
|
+
|
|
86
|
+
// 使用 ref 存储最新的回调函数和上次加载的section code,避免依赖项问题
|
|
87
|
+
var onDataChangeRef = useRef(onDataChange);
|
|
88
|
+
var lastLoadedSectionCodeRef = useRef('');
|
|
89
|
+
onDataChangeRef.current = onDataChange;
|
|
90
|
+
|
|
91
|
+
// 模态框状态
|
|
92
|
+
var _useState19 = useState(false),
|
|
93
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
94
|
+
groupModalOpen = _useState20[0],
|
|
95
|
+
setGroupModalOpen = _useState20[1];
|
|
96
|
+
var _useState21 = useState(false),
|
|
97
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
98
|
+
itemModalOpen = _useState22[0],
|
|
99
|
+
setItemModalOpen = _useState22[1];
|
|
100
|
+
var _useState23 = useState('add'),
|
|
101
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
102
|
+
modalType = _useState24[0],
|
|
103
|
+
setModalType = _useState24[1];
|
|
104
|
+
var _useState25 = useState(),
|
|
105
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
106
|
+
editingGroup = _useState26[0],
|
|
107
|
+
setEditingGroup = _useState26[1];
|
|
108
|
+
var _useState27 = useState(),
|
|
109
|
+
_useState28 = _slicedToArray(_useState27, 2),
|
|
110
|
+
editingItem = _useState28[0],
|
|
111
|
+
setEditingItem = _useState28[1];
|
|
112
|
+
var _useState29 = useState(0),
|
|
113
|
+
_useState30 = _slicedToArray(_useState29, 2),
|
|
114
|
+
targetGroupId = _useState30[0],
|
|
115
|
+
setTargetGroupId = _useState30[1];
|
|
116
|
+
|
|
117
|
+
// 创建组
|
|
118
|
+
var handleCreateGroup = /*#__PURE__*/function () {
|
|
119
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
|
120
|
+
var response, _currentSection;
|
|
121
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
122
|
+
while (1) switch (_context.prev = _context.next) {
|
|
123
|
+
case 0:
|
|
124
|
+
_context.prev = 0;
|
|
125
|
+
_context.next = 3;
|
|
126
|
+
return createGroup(request, params);
|
|
127
|
+
case 3:
|
|
128
|
+
response = _context.sent;
|
|
129
|
+
if (!currentSectionId) {
|
|
130
|
+
_context.next = 9;
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
_currentSection = localSections.find(function (s) {
|
|
134
|
+
return s.id === currentSectionId;
|
|
135
|
+
});
|
|
136
|
+
if (!_currentSection) {
|
|
137
|
+
_context.next = 9;
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
_context.next = 9;
|
|
141
|
+
return loadGroupData(_currentSection.code, true);
|
|
142
|
+
case 9:
|
|
143
|
+
message.success(locales.getText('registry.message.save.success'));
|
|
144
|
+
return _context.abrupt("return", response);
|
|
145
|
+
case 13:
|
|
146
|
+
_context.prev = 13;
|
|
147
|
+
_context.t0 = _context["catch"](0);
|
|
148
|
+
message.error(locales.getText('registry.message.create.group.error'));
|
|
149
|
+
throw _context.t0;
|
|
150
|
+
case 17:
|
|
151
|
+
case "end":
|
|
152
|
+
return _context.stop();
|
|
153
|
+
}
|
|
154
|
+
}, _callee, null, [[0, 13]]);
|
|
155
|
+
}));
|
|
156
|
+
return function handleCreateGroup(_x) {
|
|
157
|
+
return _ref2.apply(this, arguments);
|
|
158
|
+
};
|
|
159
|
+
}();
|
|
160
|
+
|
|
161
|
+
// 更新组
|
|
162
|
+
var handleUpdateGroup = /*#__PURE__*/function () {
|
|
163
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
164
|
+
var response, _currentSection2;
|
|
165
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
166
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
167
|
+
case 0:
|
|
168
|
+
_context2.prev = 0;
|
|
169
|
+
_context2.next = 3;
|
|
170
|
+
return updateGroup(request, params);
|
|
171
|
+
case 3:
|
|
172
|
+
response = _context2.sent;
|
|
173
|
+
if (!currentSectionId) {
|
|
174
|
+
_context2.next = 9;
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
_currentSection2 = localSections.find(function (s) {
|
|
178
|
+
return s.id === currentSectionId;
|
|
179
|
+
});
|
|
180
|
+
if (!_currentSection2) {
|
|
181
|
+
_context2.next = 9;
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
_context2.next = 9;
|
|
185
|
+
return loadGroupData(_currentSection2.code, true);
|
|
186
|
+
case 9:
|
|
187
|
+
message.success(locales.getText('registry.message.save.success'));
|
|
188
|
+
return _context2.abrupt("return", response);
|
|
189
|
+
case 13:
|
|
190
|
+
_context2.prev = 13;
|
|
191
|
+
_context2.t0 = _context2["catch"](0);
|
|
192
|
+
throw _context2.t0;
|
|
193
|
+
case 16:
|
|
194
|
+
case "end":
|
|
195
|
+
return _context2.stop();
|
|
196
|
+
}
|
|
197
|
+
}, _callee2, null, [[0, 13]]);
|
|
198
|
+
}));
|
|
199
|
+
return function handleUpdateGroup(_x2) {
|
|
200
|
+
return _ref3.apply(this, arguments);
|
|
201
|
+
};
|
|
202
|
+
}();
|
|
203
|
+
|
|
204
|
+
// 删除组
|
|
205
|
+
var handleDeleteGroup = /*#__PURE__*/function () {
|
|
206
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params) {
|
|
207
|
+
var response, _currentSection3;
|
|
208
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
209
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
210
|
+
case 0:
|
|
211
|
+
_context3.prev = 0;
|
|
212
|
+
_context3.next = 3;
|
|
213
|
+
return deleteGroup(request, params);
|
|
214
|
+
case 3:
|
|
215
|
+
response = _context3.sent;
|
|
216
|
+
if (!currentSectionId) {
|
|
217
|
+
_context3.next = 9;
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
_currentSection3 = localSections.find(function (s) {
|
|
221
|
+
return s.id === currentSectionId;
|
|
222
|
+
});
|
|
223
|
+
if (!_currentSection3) {
|
|
224
|
+
_context3.next = 9;
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
_context3.next = 9;
|
|
228
|
+
return loadGroupData(_currentSection3.code, true);
|
|
229
|
+
case 9:
|
|
230
|
+
message.success(locales.getText('registry.message.delete.success'));
|
|
231
|
+
return _context3.abrupt("return", response);
|
|
232
|
+
case 13:
|
|
233
|
+
_context3.prev = 13;
|
|
234
|
+
_context3.t0 = _context3["catch"](0);
|
|
235
|
+
throw _context3.t0;
|
|
236
|
+
case 16:
|
|
237
|
+
case "end":
|
|
238
|
+
return _context3.stop();
|
|
239
|
+
}
|
|
240
|
+
}, _callee3, null, [[0, 13]]);
|
|
241
|
+
}));
|
|
242
|
+
return function handleDeleteGroup(_x3) {
|
|
243
|
+
return _ref4.apply(this, arguments);
|
|
244
|
+
};
|
|
245
|
+
}();
|
|
246
|
+
|
|
247
|
+
// 创建设置项
|
|
248
|
+
var handleCreateItem = /*#__PURE__*/function () {
|
|
249
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(params) {
|
|
250
|
+
var response, _currentSection4;
|
|
251
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
252
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
253
|
+
case 0:
|
|
254
|
+
_context4.prev = 0;
|
|
255
|
+
_context4.next = 3;
|
|
256
|
+
return createItem(request, params);
|
|
257
|
+
case 3:
|
|
258
|
+
response = _context4.sent;
|
|
259
|
+
if (!currentSectionId) {
|
|
260
|
+
_context4.next = 9;
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
_currentSection4 = localSections.find(function (s) {
|
|
264
|
+
return s.id === currentSectionId;
|
|
265
|
+
});
|
|
266
|
+
if (!_currentSection4) {
|
|
267
|
+
_context4.next = 9;
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
270
|
+
_context4.next = 9;
|
|
271
|
+
return loadGroupData(_currentSection4.code, true);
|
|
272
|
+
case 9:
|
|
273
|
+
message.success(locales.getText('registry.message.save.success'));
|
|
274
|
+
return _context4.abrupt("return", response);
|
|
275
|
+
case 13:
|
|
276
|
+
_context4.prev = 13;
|
|
277
|
+
_context4.t0 = _context4["catch"](0);
|
|
278
|
+
throw _context4.t0;
|
|
279
|
+
case 16:
|
|
280
|
+
case "end":
|
|
281
|
+
return _context4.stop();
|
|
282
|
+
}
|
|
283
|
+
}, _callee4, null, [[0, 13]]);
|
|
284
|
+
}));
|
|
285
|
+
return function handleCreateItem(_x4) {
|
|
286
|
+
return _ref5.apply(this, arguments);
|
|
287
|
+
};
|
|
288
|
+
}();
|
|
289
|
+
|
|
290
|
+
// 更新设置项
|
|
291
|
+
var handleUpdateItem = /*#__PURE__*/function () {
|
|
292
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(params) {
|
|
293
|
+
var response, _currentSection5;
|
|
294
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
295
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
296
|
+
case 0:
|
|
297
|
+
_context5.prev = 0;
|
|
298
|
+
_context5.next = 3;
|
|
299
|
+
return updateItem(request, params);
|
|
300
|
+
case 3:
|
|
301
|
+
response = _context5.sent;
|
|
302
|
+
if (!currentSectionId) {
|
|
303
|
+
_context5.next = 9;
|
|
304
|
+
break;
|
|
305
|
+
}
|
|
306
|
+
_currentSection5 = localSections.find(function (s) {
|
|
307
|
+
return s.id === currentSectionId;
|
|
308
|
+
});
|
|
309
|
+
if (!_currentSection5) {
|
|
310
|
+
_context5.next = 9;
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
_context5.next = 9;
|
|
314
|
+
return loadGroupData(_currentSection5.code, true);
|
|
315
|
+
case 9:
|
|
316
|
+
message.success(locales.getText('registry.message.save.success'));
|
|
317
|
+
return _context5.abrupt("return", response);
|
|
318
|
+
case 13:
|
|
319
|
+
_context5.prev = 13;
|
|
320
|
+
_context5.t0 = _context5["catch"](0);
|
|
321
|
+
throw _context5.t0;
|
|
322
|
+
case 16:
|
|
323
|
+
case "end":
|
|
324
|
+
return _context5.stop();
|
|
325
|
+
}
|
|
326
|
+
}, _callee5, null, [[0, 13]]);
|
|
327
|
+
}));
|
|
328
|
+
return function handleUpdateItem(_x5) {
|
|
329
|
+
return _ref6.apply(this, arguments);
|
|
330
|
+
};
|
|
331
|
+
}();
|
|
332
|
+
|
|
333
|
+
// 删除设置项
|
|
334
|
+
var handleDeleteItem = /*#__PURE__*/function () {
|
|
335
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
|
|
336
|
+
var response, _currentSection6;
|
|
337
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
338
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
339
|
+
case 0:
|
|
340
|
+
_context6.prev = 0;
|
|
341
|
+
_context6.next = 3;
|
|
342
|
+
return deleteItem(request, params);
|
|
343
|
+
case 3:
|
|
344
|
+
response = _context6.sent;
|
|
345
|
+
if (!currentSectionId) {
|
|
346
|
+
_context6.next = 9;
|
|
347
|
+
break;
|
|
348
|
+
}
|
|
349
|
+
_currentSection6 = localSections.find(function (s) {
|
|
350
|
+
return s.id === currentSectionId;
|
|
351
|
+
});
|
|
352
|
+
if (!_currentSection6) {
|
|
353
|
+
_context6.next = 9;
|
|
354
|
+
break;
|
|
355
|
+
}
|
|
356
|
+
_context6.next = 9;
|
|
357
|
+
return loadGroupData(_currentSection6.code, true);
|
|
358
|
+
case 9:
|
|
359
|
+
message.success(locales.getText('registry.message.delete.success'));
|
|
360
|
+
return _context6.abrupt("return", response);
|
|
361
|
+
case 13:
|
|
362
|
+
_context6.prev = 13;
|
|
363
|
+
_context6.t0 = _context6["catch"](0);
|
|
364
|
+
console.error('Failed to delete item:', _context6.t0);
|
|
365
|
+
// message.error(locales.getText('registry.message.delete.item.error'));
|
|
366
|
+
throw _context6.t0;
|
|
367
|
+
case 17:
|
|
368
|
+
case "end":
|
|
369
|
+
return _context6.stop();
|
|
370
|
+
}
|
|
371
|
+
}, _callee6, null, [[0, 13]]);
|
|
372
|
+
}));
|
|
373
|
+
return function handleDeleteItem(_x6) {
|
|
374
|
+
return _ref7.apply(this, arguments);
|
|
375
|
+
};
|
|
376
|
+
}();
|
|
377
|
+
|
|
378
|
+
// 组排序
|
|
379
|
+
var handleGroupReorder = /*#__PURE__*/function () {
|
|
380
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(groupIds) {
|
|
381
|
+
var _currentSection7, reorderedGroups, _currentSection8;
|
|
382
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
383
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
384
|
+
case 0:
|
|
385
|
+
_context7.prev = 0;
|
|
386
|
+
// 获取当前section的code
|
|
387
|
+
_currentSection7 = localSections.find(function (s) {
|
|
388
|
+
return s.id === currentSectionId;
|
|
389
|
+
});
|
|
390
|
+
if (_currentSection7) {
|
|
391
|
+
_context7.next = 4;
|
|
392
|
+
break;
|
|
393
|
+
}
|
|
394
|
+
throw new Error('Current section not found');
|
|
395
|
+
case 4:
|
|
396
|
+
_context7.next = 6;
|
|
397
|
+
return sortGroups(request, {
|
|
398
|
+
section_code: _currentSection7.code,
|
|
399
|
+
group_ids: groupIds
|
|
400
|
+
});
|
|
401
|
+
case 6:
|
|
402
|
+
// API调用成功后,更新本地状态
|
|
403
|
+
reorderedGroups = groupIds.map(function (id) {
|
|
404
|
+
var group = groupList.find(function (g) {
|
|
405
|
+
return g.id === id;
|
|
406
|
+
});
|
|
407
|
+
return group ? _objectSpread({}, group) : null;
|
|
408
|
+
}).filter(Boolean);
|
|
409
|
+
setGroupList(reorderedGroups);
|
|
410
|
+
message.success(locales.getText('registry.message.reorder.success'));
|
|
411
|
+
_context7.next = 18;
|
|
412
|
+
break;
|
|
413
|
+
case 11:
|
|
414
|
+
_context7.prev = 11;
|
|
415
|
+
_context7.t0 = _context7["catch"](0);
|
|
416
|
+
console.error('Failed to reorder groups:', _context7.t0);
|
|
417
|
+
// message.error(locales.getText('registry.message.reorder.error'));
|
|
418
|
+
|
|
419
|
+
// 如果API调用失败,重新加载组数据以恢复原始状态
|
|
420
|
+
_currentSection8 = localSections.find(function (s) {
|
|
421
|
+
return s.id === currentSectionId;
|
|
422
|
+
});
|
|
423
|
+
if (!_currentSection8) {
|
|
424
|
+
_context7.next = 18;
|
|
425
|
+
break;
|
|
426
|
+
}
|
|
427
|
+
_context7.next = 18;
|
|
428
|
+
return loadGroupData(_currentSection8.code, true);
|
|
429
|
+
case 18:
|
|
430
|
+
case "end":
|
|
431
|
+
return _context7.stop();
|
|
432
|
+
}
|
|
433
|
+
}, _callee7, null, [[0, 11]]);
|
|
434
|
+
}));
|
|
435
|
+
return function handleGroupReorder(_x7) {
|
|
436
|
+
return _ref8.apply(this, arguments);
|
|
437
|
+
};
|
|
438
|
+
}();
|
|
439
|
+
|
|
440
|
+
// 设置项移动
|
|
441
|
+
var handleItemMove = /*#__PURE__*/function () {
|
|
442
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(itemId, targetGroupId, newOrder) {
|
|
443
|
+
var targetGroup, targetGroupItems, existingIndex, _targetGroupItems$spl, _targetGroupItems$spl2, movedItem, allItems, _movedItem, sortedItemIds, _currentSection9, _currentSection10;
|
|
444
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
445
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
446
|
+
case 0:
|
|
447
|
+
_context8.prev = 0;
|
|
448
|
+
// 找到目标组
|
|
449
|
+
targetGroup = groupList.find(function (g) {
|
|
450
|
+
return g.id === targetGroupId;
|
|
451
|
+
});
|
|
452
|
+
if (targetGroup) {
|
|
453
|
+
_context8.next = 4;
|
|
454
|
+
break;
|
|
455
|
+
}
|
|
456
|
+
throw new Error('Target group not found');
|
|
457
|
+
case 4:
|
|
458
|
+
// 获取目标组的所有设置项ID,并在指定位置插入当前移动的项
|
|
459
|
+
targetGroupItems = _toConsumableArray(targetGroup.items); // 如果是跨组移动,需要先移除原来的项,然后在新位置插入
|
|
460
|
+
existingIndex = targetGroupItems.findIndex(function (item) {
|
|
461
|
+
return item.id === itemId;
|
|
462
|
+
});
|
|
463
|
+
if (existingIndex !== -1) {
|
|
464
|
+
// 同组内移动
|
|
465
|
+
_targetGroupItems$spl = targetGroupItems.splice(existingIndex, 1), _targetGroupItems$spl2 = _slicedToArray(_targetGroupItems$spl, 1), movedItem = _targetGroupItems$spl2[0];
|
|
466
|
+
targetGroupItems.splice(newOrder, 0, movedItem);
|
|
467
|
+
} else {
|
|
468
|
+
// 跨组移动,需要找到原来的项
|
|
469
|
+
allItems = groupList.reduce(function (acc, g) {
|
|
470
|
+
return [].concat(_toConsumableArray(acc), _toConsumableArray(g.items));
|
|
471
|
+
}, []);
|
|
472
|
+
_movedItem = allItems.find(function (item) {
|
|
473
|
+
return item.id === itemId;
|
|
474
|
+
});
|
|
475
|
+
if (_movedItem) {
|
|
476
|
+
targetGroupItems.splice(newOrder, 0, _movedItem);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
// 构建排序后的item_ids数组
|
|
481
|
+
sortedItemIds = targetGroupItems.map(function (item) {
|
|
482
|
+
return item.id;
|
|
483
|
+
}); // 调用排序API
|
|
484
|
+
_context8.next = 10;
|
|
485
|
+
return sortItems(request, {
|
|
486
|
+
id: itemId,
|
|
487
|
+
group_id: targetGroupId.toString(),
|
|
488
|
+
item_ids: sortedItemIds
|
|
489
|
+
});
|
|
490
|
+
case 10:
|
|
491
|
+
// API调用成功后,重新加载组数据以获取最新状态
|
|
492
|
+
_currentSection9 = localSections.find(function (s) {
|
|
493
|
+
return s.id === currentSectionId;
|
|
494
|
+
});
|
|
495
|
+
if (!_currentSection9) {
|
|
496
|
+
_context8.next = 14;
|
|
497
|
+
break;
|
|
498
|
+
}
|
|
499
|
+
_context8.next = 14;
|
|
500
|
+
return loadGroupData(_currentSection9.code, true);
|
|
501
|
+
case 14:
|
|
502
|
+
message.success(locales.getText('registry.message.move.success'));
|
|
503
|
+
_context8.next = 24;
|
|
504
|
+
break;
|
|
505
|
+
case 17:
|
|
506
|
+
_context8.prev = 17;
|
|
507
|
+
_context8.t0 = _context8["catch"](0);
|
|
508
|
+
console.error('Failed to move item:', _context8.t0);
|
|
509
|
+
// message.error(locales.getText('registry.message.move.error'));
|
|
510
|
+
|
|
511
|
+
// 如果API调用失败,重新加载组数据以恢复原始状态
|
|
512
|
+
_currentSection10 = localSections.find(function (s) {
|
|
513
|
+
return s.id === currentSectionId;
|
|
514
|
+
});
|
|
515
|
+
if (!_currentSection10) {
|
|
516
|
+
_context8.next = 24;
|
|
517
|
+
break;
|
|
518
|
+
}
|
|
519
|
+
_context8.next = 24;
|
|
520
|
+
return loadGroupData(_currentSection10.code, true);
|
|
521
|
+
case 24:
|
|
522
|
+
case "end":
|
|
523
|
+
return _context8.stop();
|
|
524
|
+
}
|
|
525
|
+
}, _callee8, null, [[0, 17]]);
|
|
526
|
+
}));
|
|
527
|
+
return function handleItemMove(_x8, _x9, _x10) {
|
|
528
|
+
return _ref9.apply(this, arguments);
|
|
529
|
+
};
|
|
530
|
+
}();
|
|
531
|
+
|
|
532
|
+
// 加载组数据
|
|
533
|
+
var loadGroupData = useCallback( /*#__PURE__*/function () {
|
|
534
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(sectionCode) {
|
|
535
|
+
var forceRefresh,
|
|
536
|
+
response,
|
|
537
|
+
newGroups,
|
|
538
|
+
_args9 = arguments;
|
|
539
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
540
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
541
|
+
case 0:
|
|
542
|
+
forceRefresh = _args9.length > 1 && _args9[1] !== undefined ? _args9[1] : false;
|
|
543
|
+
if (!(groupLoading || !forceRefresh && lastLoadedSectionCodeRef.current === sectionCode)) {
|
|
544
|
+
_context9.next = 3;
|
|
545
|
+
break;
|
|
546
|
+
}
|
|
547
|
+
return _context9.abrupt("return");
|
|
548
|
+
case 3:
|
|
549
|
+
lastLoadedSectionCodeRef.current = sectionCode;
|
|
550
|
+
setGroupLoading(true);
|
|
551
|
+
_context9.prev = 5;
|
|
552
|
+
_context9.next = 8;
|
|
553
|
+
return getGroupList(request, {
|
|
554
|
+
page: 1,
|
|
555
|
+
pageSize: 100,
|
|
556
|
+
// 获取所有组数据
|
|
557
|
+
filter: {
|
|
558
|
+
section_code: sectionCode
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
case 8:
|
|
562
|
+
response = _context9.sent;
|
|
563
|
+
newGroups = response.data || [];
|
|
564
|
+
setGroupList(newGroups);
|
|
565
|
+
_context9.next = 17;
|
|
566
|
+
break;
|
|
567
|
+
case 13:
|
|
568
|
+
_context9.prev = 13;
|
|
569
|
+
_context9.t0 = _context9["catch"](5);
|
|
570
|
+
console.error('Failed to load group data:', _context9.t0);
|
|
571
|
+
// message.error(locales.getText('registry.message.load.failed'));
|
|
572
|
+
setGroupList([]);
|
|
573
|
+
case 17:
|
|
574
|
+
_context9.prev = 17;
|
|
575
|
+
setGroupLoading(false);
|
|
576
|
+
return _context9.finish(17);
|
|
577
|
+
case 20:
|
|
578
|
+
case "end":
|
|
579
|
+
return _context9.stop();
|
|
580
|
+
}
|
|
581
|
+
}, _callee9, null, [[5, 13, 17, 20]]);
|
|
582
|
+
}));
|
|
583
|
+
return function (_x11) {
|
|
584
|
+
return _ref10.apply(this, arguments);
|
|
585
|
+
};
|
|
586
|
+
}(), []); // 移除所有依赖项,使用ref来避免无限循环
|
|
587
|
+
|
|
588
|
+
// 加载区块数据
|
|
589
|
+
var loadSectionData = useCallback( /*#__PURE__*/function () {
|
|
590
|
+
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(page) {
|
|
591
|
+
var isLoadMore,
|
|
592
|
+
response,
|
|
593
|
+
newSections,
|
|
594
|
+
totalPage,
|
|
595
|
+
_onDataChangeRef$curr2,
|
|
596
|
+
_args10 = arguments;
|
|
597
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
598
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
599
|
+
case 0:
|
|
600
|
+
isLoadMore = _args10.length > 1 && _args10[1] !== undefined ? _args10[1] : false;
|
|
601
|
+
if (!loading) {
|
|
602
|
+
_context10.next = 3;
|
|
603
|
+
break;
|
|
604
|
+
}
|
|
605
|
+
return _context10.abrupt("return");
|
|
606
|
+
case 3:
|
|
607
|
+
setLoading(true);
|
|
608
|
+
_context10.prev = 4;
|
|
609
|
+
_context10.next = 7;
|
|
610
|
+
return getSectionList(request, {
|
|
611
|
+
page: page,
|
|
612
|
+
pageSize: pageSize,
|
|
613
|
+
filter: {}
|
|
614
|
+
});
|
|
615
|
+
case 7:
|
|
616
|
+
response = _context10.sent;
|
|
617
|
+
newSections = response.data || [];
|
|
618
|
+
if (isLoadMore) {
|
|
619
|
+
// 加载更多时追加数据
|
|
620
|
+
setLocalSections(function (prev) {
|
|
621
|
+
return [].concat(_toConsumableArray(prev), _toConsumableArray(newSections));
|
|
622
|
+
});
|
|
623
|
+
} else {
|
|
624
|
+
// 初始加载时替换数据
|
|
625
|
+
setLocalSections(newSections);
|
|
626
|
+
// 如果当前没有选中的section或currentSectionId为null/0,设置为第一个section
|
|
627
|
+
if (newSections.length > 0 && (!currentSectionId || currentSectionId === 0)) {
|
|
628
|
+
setCurrentSectionId(newSections[0].id);
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
// 判断是否还有更多数据 - 使用新的 meta 信息
|
|
633
|
+
totalPage = response.meta.totalPage;
|
|
634
|
+
setHasMore(page < totalPage);
|
|
635
|
+
if (isLoadMore) {
|
|
636
|
+
setLocalSections(function (prev) {
|
|
637
|
+
var _onDataChangeRef$curr;
|
|
638
|
+
var updatedSections = [].concat(_toConsumableArray(prev), _toConsumableArray(newSections));
|
|
639
|
+
(_onDataChangeRef$curr = onDataChangeRef.current) === null || _onDataChangeRef$curr === void 0 || _onDataChangeRef$curr.call(onDataChangeRef, updatedSections);
|
|
640
|
+
return updatedSections;
|
|
641
|
+
});
|
|
642
|
+
} else {
|
|
643
|
+
(_onDataChangeRef$curr2 = onDataChangeRef.current) === null || _onDataChangeRef$curr2 === void 0 || _onDataChangeRef$curr2.call(onDataChangeRef, newSections);
|
|
644
|
+
}
|
|
645
|
+
_context10.next = 18;
|
|
646
|
+
break;
|
|
647
|
+
case 15:
|
|
648
|
+
_context10.prev = 15;
|
|
649
|
+
_context10.t0 = _context10["catch"](4);
|
|
650
|
+
console.error('Failed to load section data:', _context10.t0);
|
|
651
|
+
// message.error(locales.getText('registry.message.load.failed'));
|
|
652
|
+
case 18:
|
|
653
|
+
_context10.prev = 18;
|
|
654
|
+
setLoading(false);
|
|
655
|
+
return _context10.finish(18);
|
|
656
|
+
case 21:
|
|
657
|
+
case "end":
|
|
658
|
+
return _context10.stop();
|
|
659
|
+
}
|
|
660
|
+
}, _callee10, null, [[4, 15, 18, 21]]);
|
|
661
|
+
}));
|
|
662
|
+
return function (_x12) {
|
|
663
|
+
return _ref11.apply(this, arguments);
|
|
664
|
+
};
|
|
665
|
+
}(), [loading, pageSize, currentSectionId]); // 移除 onDataChange 依赖
|
|
666
|
+
|
|
667
|
+
// 加载更多数据
|
|
668
|
+
var handleLoadMore = useCallback(function () {
|
|
669
|
+
if (!hasMore || loading) return;
|
|
670
|
+
var nextPage = currentPage + 1;
|
|
671
|
+
setCurrentPage(nextPage);
|
|
672
|
+
loadSectionData(nextPage, true);
|
|
673
|
+
}, [hasMore, loading, currentPage]); // 移除 loadSectionData 依赖
|
|
674
|
+
|
|
675
|
+
// 初始化多语言
|
|
676
|
+
useEffect(function () {
|
|
677
|
+
var _context$engine;
|
|
678
|
+
var currentLocale = (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || localStorage.getItem('umi_locale') || 'zh-CN';
|
|
679
|
+
locales.init(localeTexts, currentLocale);
|
|
680
|
+
}, [context === null || context === void 0 || (_context$engine2 = context.engine) === null || _context$engine2 === void 0 || (_context$engine2 = _context$engine2.props) === null || _context$engine2 === void 0 ? void 0 : _context$engine2.locale]);
|
|
681
|
+
|
|
682
|
+
// 初始加载数据
|
|
683
|
+
useEffect(function () {
|
|
684
|
+
if (isInitialLoad) {
|
|
685
|
+
setIsInitialLoad(false);
|
|
686
|
+
loadSectionData(1, false);
|
|
687
|
+
}
|
|
688
|
+
}, [isInitialLoad]); // 移除 loadSectionData 依赖,避免无限循环
|
|
689
|
+
|
|
690
|
+
// 同步外部区块数据(仅在不是初始加载时且有外部数据时)
|
|
691
|
+
useEffect(function () {
|
|
692
|
+
if (!isInitialLoad && sections && sections.length > 0) {
|
|
693
|
+
setLocalSections(sections);
|
|
694
|
+
}
|
|
695
|
+
}, [sections, isInitialLoad]);
|
|
696
|
+
|
|
697
|
+
// 同步外部选中区块
|
|
698
|
+
useEffect(function () {
|
|
699
|
+
if (selectedSectionId) {
|
|
700
|
+
setCurrentSectionId(selectedSectionId);
|
|
701
|
+
}
|
|
702
|
+
}, [selectedSectionId]);
|
|
703
|
+
|
|
704
|
+
// 当currentSectionId改变时加载对应的组数据
|
|
705
|
+
useEffect(function () {
|
|
706
|
+
if (currentSectionId && localSections.length > 0) {
|
|
707
|
+
var selectedSection = localSections.find(function (section) {
|
|
708
|
+
return section.id === currentSectionId;
|
|
709
|
+
});
|
|
710
|
+
if (selectedSection) {
|
|
711
|
+
// 重置上次加载的section code,确保新section能够加载
|
|
712
|
+
lastLoadedSectionCodeRef.current = '';
|
|
713
|
+
loadGroupData(selectedSection.code);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
}, [currentSectionId, localSections]); // loadGroupData现在是稳定的,不需要作为依赖项
|
|
717
|
+
|
|
718
|
+
// 处理区块选择
|
|
719
|
+
var handleSectionSelect = function handleSectionSelect(sectionId) {
|
|
720
|
+
setCurrentSectionId(sectionId);
|
|
721
|
+
onSectionSelect === null || onSectionSelect === void 0 || onSectionSelect(sectionId);
|
|
722
|
+
// 移除这里的loadGroupData调用,因为useEffect会自动处理
|
|
723
|
+
};
|
|
724
|
+
|
|
725
|
+
// 处理数据变更
|
|
726
|
+
var handleDataChange = function handleDataChange(updatedSection) {
|
|
727
|
+
var newSections = localSections.map(function (section) {
|
|
728
|
+
return section.id === updatedSection.id ? updatedSection : section;
|
|
729
|
+
});
|
|
730
|
+
setLocalSections(newSections);
|
|
731
|
+
onDataChange === null || onDataChange === void 0 || onDataChange(newSections);
|
|
732
|
+
};
|
|
733
|
+
|
|
734
|
+
// 获取当前选中的区块
|
|
735
|
+
var currentSection = localSections.find(function (section) {
|
|
736
|
+
return section.id === currentSectionId;
|
|
737
|
+
});
|
|
738
|
+
|
|
739
|
+
// 检查代码是否已存在
|
|
740
|
+
var isCodeExists = function isCodeExists(code, excludeId) {
|
|
741
|
+
if (!currentSection || !currentSection.groups) return false;
|
|
742
|
+
return currentSection.groups.some(function (group) {
|
|
743
|
+
return group.code === code && group.id !== excludeId;
|
|
744
|
+
});
|
|
745
|
+
};
|
|
746
|
+
|
|
747
|
+
// 检查键是否已存在
|
|
748
|
+
var isKeyExists = function isKeyExists(key, excludeId) {
|
|
749
|
+
if (!currentSection || !currentSection.groups) return false;
|
|
750
|
+
return currentSection.groups.some(function (group) {
|
|
751
|
+
return group.items && group.items.some(function (item) {
|
|
752
|
+
return item.key === key && item.id !== excludeId;
|
|
753
|
+
});
|
|
754
|
+
});
|
|
755
|
+
};
|
|
756
|
+
|
|
757
|
+
// 处理添加组
|
|
758
|
+
var handleAddGroup = function handleAddGroup() {
|
|
759
|
+
setModalType('add');
|
|
760
|
+
setEditingGroup(undefined);
|
|
761
|
+
setGroupModalOpen(true);
|
|
762
|
+
};
|
|
763
|
+
|
|
764
|
+
// 处理编辑组
|
|
765
|
+
var handleEditGroup = function handleEditGroup(group) {
|
|
766
|
+
setModalType('edit');
|
|
767
|
+
setEditingGroup(group);
|
|
768
|
+
console.log('group', group);
|
|
769
|
+
setGroupModalOpen(true);
|
|
770
|
+
};
|
|
771
|
+
|
|
772
|
+
// 处理添加设置项
|
|
773
|
+
var handleAddItem = function handleAddItem(groupId) {
|
|
774
|
+
setModalType('add');
|
|
775
|
+
setEditingItem(undefined);
|
|
776
|
+
setTargetGroupId(groupId);
|
|
777
|
+
setItemModalOpen(true);
|
|
778
|
+
};
|
|
779
|
+
|
|
780
|
+
// 处理编辑设置项
|
|
781
|
+
var handleEditItem = function handleEditItem(item) {
|
|
782
|
+
setModalType('edit');
|
|
783
|
+
setEditingItem(item);
|
|
784
|
+
setTargetGroupId(item.groupId || item.group_id || 0);
|
|
785
|
+
setItemModalOpen(true);
|
|
786
|
+
};
|
|
787
|
+
|
|
788
|
+
// 处理组表单提交
|
|
789
|
+
var handleGroupSubmit = /*#__PURE__*/function () {
|
|
790
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(formData) {
|
|
791
|
+
var maxSort, newSort;
|
|
792
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
793
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
794
|
+
case 0:
|
|
795
|
+
if (currentSection) {
|
|
796
|
+
_context11.next = 2;
|
|
797
|
+
break;
|
|
798
|
+
}
|
|
799
|
+
return _context11.abrupt("return");
|
|
800
|
+
case 2:
|
|
801
|
+
if (!isCodeExists(formData.code, editingGroup === null || editingGroup === void 0 ? void 0 : editingGroup.id)) {
|
|
802
|
+
_context11.next = 4;
|
|
803
|
+
break;
|
|
804
|
+
}
|
|
805
|
+
return _context11.abrupt("return");
|
|
806
|
+
case 4:
|
|
807
|
+
_context11.prev = 4;
|
|
808
|
+
if (!(modalType === 'add')) {
|
|
809
|
+
_context11.next = 12;
|
|
810
|
+
break;
|
|
811
|
+
}
|
|
812
|
+
// 计算新组的sort值:最后一个组的sort值+1
|
|
813
|
+
maxSort = groupList.length > 0 ? Math.max.apply(Math, _toConsumableArray(groupList.map(function (group) {
|
|
814
|
+
return group.sort || 0;
|
|
815
|
+
}))) : 0;
|
|
816
|
+
newSort = maxSort + 1; // 创建新组 - 使用 API 调用
|
|
817
|
+
_context11.next = 10;
|
|
818
|
+
return handleCreateGroup({
|
|
819
|
+
section_code: currentSection.code,
|
|
820
|
+
code: formData.code,
|
|
821
|
+
title: formData.title,
|
|
822
|
+
sort: newSort
|
|
823
|
+
});
|
|
824
|
+
case 10:
|
|
825
|
+
_context11.next = 17;
|
|
826
|
+
break;
|
|
827
|
+
case 12:
|
|
828
|
+
if (editingGroup !== null && editingGroup !== void 0 && editingGroup.id) {
|
|
829
|
+
_context11.next = 15;
|
|
830
|
+
break;
|
|
831
|
+
}
|
|
832
|
+
console.error('No editing group ID found');
|
|
833
|
+
return _context11.abrupt("return");
|
|
834
|
+
case 15:
|
|
835
|
+
_context11.next = 17;
|
|
836
|
+
return handleUpdateGroup({
|
|
837
|
+
id: editingGroup.id,
|
|
838
|
+
code: formData.code,
|
|
839
|
+
title: formData.title
|
|
840
|
+
});
|
|
841
|
+
case 17:
|
|
842
|
+
// 只有在保存成功后才关闭模态框
|
|
843
|
+
setGroupModalOpen(false);
|
|
844
|
+
_context11.next = 23;
|
|
845
|
+
break;
|
|
846
|
+
case 20:
|
|
847
|
+
_context11.prev = 20;
|
|
848
|
+
_context11.t0 = _context11["catch"](4);
|
|
849
|
+
console.error('Failed to submit group form:', _context11.t0);
|
|
850
|
+
// 错误消息已在 handleCreateGroup 中处理
|
|
851
|
+
// 保存失败时不关闭模态框
|
|
852
|
+
case 23:
|
|
853
|
+
case "end":
|
|
854
|
+
return _context11.stop();
|
|
855
|
+
}
|
|
856
|
+
}, _callee11, null, [[4, 20]]);
|
|
857
|
+
}));
|
|
858
|
+
return function handleGroupSubmit(_x13) {
|
|
859
|
+
return _ref12.apply(this, arguments);
|
|
860
|
+
};
|
|
861
|
+
}();
|
|
862
|
+
|
|
863
|
+
// 处理设置项表单提交
|
|
864
|
+
var handleItemSubmit = /*#__PURE__*/function () {
|
|
865
|
+
var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(formData) {
|
|
866
|
+
var processedDefaultValue, validation, targetGroup, maxSort, newSort;
|
|
867
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
868
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
869
|
+
case 0:
|
|
870
|
+
if (currentSection) {
|
|
871
|
+
_context12.next = 2;
|
|
872
|
+
break;
|
|
873
|
+
}
|
|
874
|
+
return _context12.abrupt("return");
|
|
875
|
+
case 2:
|
|
876
|
+
if (!isKeyExists(formData.key, editingItem === null || editingItem === void 0 ? void 0 : editingItem.id)) {
|
|
877
|
+
_context12.next = 4;
|
|
878
|
+
break;
|
|
879
|
+
}
|
|
880
|
+
return _context12.abrupt("return");
|
|
881
|
+
case 4:
|
|
882
|
+
// 验证和解析默认值
|
|
883
|
+
processedDefaultValue = formData.default;
|
|
884
|
+
if (!(formData.default !== undefined && formData.default !== null && formData.default !== '')) {
|
|
885
|
+
_context12.next = 13;
|
|
886
|
+
break;
|
|
887
|
+
}
|
|
888
|
+
validation = validateDefaultValue(formData.fieldType, formData.default);
|
|
889
|
+
if (validation.isValid) {
|
|
890
|
+
_context12.next = 10;
|
|
891
|
+
break;
|
|
892
|
+
}
|
|
893
|
+
message.error("\u9ED8\u8BA4\u503C\u9A8C\u8BC1\u5931\u8D25: ".concat(validation.error));
|
|
894
|
+
return _context12.abrupt("return");
|
|
895
|
+
case 10:
|
|
896
|
+
// 解析默认值为对应的类型
|
|
897
|
+
processedDefaultValue = parseDefaultValue(formData.fieldType, formData.default);
|
|
898
|
+
_context12.next = 14;
|
|
899
|
+
break;
|
|
900
|
+
case 13:
|
|
901
|
+
processedDefaultValue = null;
|
|
902
|
+
case 14:
|
|
903
|
+
_context12.prev = 14;
|
|
904
|
+
if (!(modalType === 'add')) {
|
|
905
|
+
_context12.next = 23;
|
|
906
|
+
break;
|
|
907
|
+
}
|
|
908
|
+
// 计算新设置项的sort值:目标组内最后一个item的sort值+1
|
|
909
|
+
targetGroup = groupList.find(function (group) {
|
|
910
|
+
return group.id === targetGroupId;
|
|
911
|
+
});
|
|
912
|
+
maxSort = targetGroup && targetGroup.items && targetGroup.items.length > 0 ? Math.max.apply(Math, _toConsumableArray(targetGroup.items.map(function (item) {
|
|
913
|
+
return item.sort || 0;
|
|
914
|
+
}))) : 0;
|
|
915
|
+
newSort = maxSort + 1; // 创建新设置项 - 使用 API 调用
|
|
916
|
+
_context12.next = 21;
|
|
917
|
+
return handleCreateItem({
|
|
918
|
+
section_code: currentSection.code,
|
|
919
|
+
group_id: targetGroupId,
|
|
920
|
+
code: formData.key,
|
|
921
|
+
title: formData.name,
|
|
922
|
+
description: formData.description,
|
|
923
|
+
type: formData.fieldType,
|
|
924
|
+
interface: formData.interfaceType,
|
|
925
|
+
default: processedDefaultValue,
|
|
926
|
+
scopes: formData.scopes,
|
|
927
|
+
schema: formData.uiSchema ? function () {
|
|
928
|
+
try {
|
|
929
|
+
return JSON.parse(formData.uiSchema);
|
|
930
|
+
} catch (e) {
|
|
931
|
+
console.warn('Invalid JSON in uiSchema:', e);
|
|
932
|
+
return formData.uiSchema;
|
|
933
|
+
}
|
|
934
|
+
}() : undefined,
|
|
935
|
+
sort: newSort
|
|
936
|
+
});
|
|
937
|
+
case 21:
|
|
938
|
+
_context12.next = 28;
|
|
939
|
+
break;
|
|
940
|
+
case 23:
|
|
941
|
+
if (editingItem !== null && editingItem !== void 0 && editingItem.id) {
|
|
942
|
+
_context12.next = 26;
|
|
943
|
+
break;
|
|
944
|
+
}
|
|
945
|
+
console.error('No editing item ID found');
|
|
946
|
+
return _context12.abrupt("return");
|
|
947
|
+
case 26:
|
|
948
|
+
_context12.next = 28;
|
|
949
|
+
return handleUpdateItem({
|
|
950
|
+
id: editingItem.id,
|
|
951
|
+
section_code: currentSection.code,
|
|
952
|
+
group_id: targetGroupId,
|
|
953
|
+
code: formData.key,
|
|
954
|
+
title: formData.name,
|
|
955
|
+
description: formData.description,
|
|
956
|
+
type: formData.fieldType,
|
|
957
|
+
interface: formData.interfaceType,
|
|
958
|
+
default: processedDefaultValue,
|
|
959
|
+
scopes: formData.scopes,
|
|
960
|
+
schema: formData.uiSchema ? function () {
|
|
961
|
+
try {
|
|
962
|
+
return JSON.parse(formData.uiSchema);
|
|
963
|
+
} catch (e) {
|
|
964
|
+
console.warn('Invalid JSON in uiSchema:', e);
|
|
965
|
+
return formData.uiSchema;
|
|
966
|
+
}
|
|
967
|
+
}() : undefined,
|
|
968
|
+
sort: editingItem.sort
|
|
969
|
+
});
|
|
970
|
+
case 28:
|
|
971
|
+
// 只有在保存成功后才关闭模态框
|
|
972
|
+
setItemModalOpen(false);
|
|
973
|
+
_context12.next = 34;
|
|
974
|
+
break;
|
|
975
|
+
case 31:
|
|
976
|
+
_context12.prev = 31;
|
|
977
|
+
_context12.t0 = _context12["catch"](14);
|
|
978
|
+
console.error('Failed to submit item form:', _context12.t0);
|
|
979
|
+
// 错误消息已在 handleCreateItem/handleUpdateItem 中处理
|
|
980
|
+
// 保存失败时不关闭模态框
|
|
981
|
+
case 34:
|
|
982
|
+
case "end":
|
|
983
|
+
return _context12.stop();
|
|
984
|
+
}
|
|
985
|
+
}, _callee12, null, [[14, 31]]);
|
|
986
|
+
}));
|
|
987
|
+
return function handleItemSubmit(_x14) {
|
|
988
|
+
return _ref13.apply(this, arguments);
|
|
989
|
+
};
|
|
990
|
+
}();
|
|
991
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
992
|
+
className: "pisell-settings-registry ".concat(className || ''),
|
|
993
|
+
style: style
|
|
994
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
995
|
+
className: "pisell-settings-registry-sidebar"
|
|
996
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
997
|
+
className: "pisell-settings-registry-sidebar-header"
|
|
998
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
999
|
+
className: "pisell-settings-registry-sidebar-title"
|
|
1000
|
+
}, locales.getText('registry.sections.title'))), /*#__PURE__*/React.createElement(SectionList, {
|
|
1001
|
+
sections: localSections,
|
|
1002
|
+
selectedSectionId: currentSectionId,
|
|
1003
|
+
onSectionSelect: handleSectionSelect,
|
|
1004
|
+
loading: loading,
|
|
1005
|
+
hasMore: hasMore,
|
|
1006
|
+
onLoadMore: handleLoadMore
|
|
1007
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
1008
|
+
className: "pisell-settings-registry-content"
|
|
1009
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1010
|
+
className: "pisell-settings-registry-content-header"
|
|
1011
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1012
|
+
className: "pisell-settings-registry-content-title"
|
|
1013
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1014
|
+
className: "pisell-settings-registry-content-main-title"
|
|
1015
|
+
}, locales.getText('registry.title'))), /*#__PURE__*/React.createElement(Button, {
|
|
1016
|
+
type: "primary",
|
|
1017
|
+
icon: /*#__PURE__*/React.createElement(PlusOutlined, null),
|
|
1018
|
+
onClick: handleAddGroup,
|
|
1019
|
+
disabled: !currentSection
|
|
1020
|
+
}, locales.getText('registry.action.add.group'))), /*#__PURE__*/React.createElement(SettingsTable, {
|
|
1021
|
+
section: currentSection,
|
|
1022
|
+
groupList: groupList,
|
|
1023
|
+
groupLoading: groupLoading,
|
|
1024
|
+
onDataChange: handleDataChange,
|
|
1025
|
+
onEditGroup: handleEditGroup,
|
|
1026
|
+
onDeleteGroup: function onDeleteGroup(groupId) {
|
|
1027
|
+
return handleDeleteGroup({
|
|
1028
|
+
id: groupId
|
|
1029
|
+
});
|
|
1030
|
+
},
|
|
1031
|
+
onAddItem: handleAddItem,
|
|
1032
|
+
onEditItem: handleEditItem,
|
|
1033
|
+
onDeleteItem: function onDeleteItem(itemId) {
|
|
1034
|
+
return handleDeleteItem({
|
|
1035
|
+
id: itemId
|
|
1036
|
+
});
|
|
1037
|
+
},
|
|
1038
|
+
onGroupReorder: handleGroupReorder,
|
|
1039
|
+
onItemMove: handleItemMove
|
|
1040
|
+
})), /*#__PURE__*/React.createElement(GroupModal, {
|
|
1041
|
+
open: groupModalOpen,
|
|
1042
|
+
type: modalType,
|
|
1043
|
+
data: editingGroup,
|
|
1044
|
+
onOk: handleGroupSubmit,
|
|
1045
|
+
onCancel: function onCancel() {
|
|
1046
|
+
return setGroupModalOpen(false);
|
|
1047
|
+
}
|
|
1048
|
+
}), /*#__PURE__*/React.createElement(ItemModal, {
|
|
1049
|
+
open: itemModalOpen,
|
|
1050
|
+
type: modalType,
|
|
1051
|
+
data: editingItem,
|
|
1052
|
+
section: currentSection,
|
|
1053
|
+
onOk: handleItemSubmit,
|
|
1054
|
+
onCancel: function onCancel() {
|
|
1055
|
+
return setItemModalOpen(false);
|
|
1056
|
+
}
|
|
1057
|
+
}));
|
|
1058
|
+
};
|
|
1059
|
+
export default Registry;
|