@coopenomics/desktop 2.2.10 → 2025.5.2
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/.env-example +6 -1
- package/.env-testnet +8 -0
- package/Dockerfile +12 -0
- package/alias-resolver.js +35 -0
- package/extensions/market/install.ts +78 -0
- package/extensions/market-admin/install.ts +42 -0
- package/extensions/participant/install.ts +125 -0
- package/extensions/powerup/install.ts +20 -0
- package/extensions/soviet/install.ts +83 -0
- package/package.json +14 -7
- package/quasar.config.cjs +28 -15
- package/src/app/App.vue +44 -73
- package/src/app/layouts/default.vue +40 -0
- package/src/app/layouts/useDefaultLayoutLogic.ts +59 -0
- package/src/app/providers/router.ts +4 -3
- package/src/app/providers/routes/index.ts +19 -34
- package/src/app/styles/style.css +4 -0
- package/src/boot/init.ts +6 -0
- package/src/boot/sentry.ts +14 -14
- package/src/desktops/index.ts +0 -6
- package/src/entities/Account/model/index.ts +1 -1
- package/src/entities/Agenda/api/index.ts +20 -0
- package/src/entities/Agenda/index.ts +2 -0
- package/src/entities/Agenda/model/index.ts +2 -0
- package/src/entities/Agenda/model/store.ts +36 -0
- package/src/entities/Agenda/model/types.ts +4 -0
- package/src/entities/Branch/model/index.ts +1 -1
- package/src/entities/Desktop/api/index.ts +16 -1
- package/src/entities/Desktop/model/store.ts +112 -106
- package/src/entities/Desktop/model/types.ts +14 -1
- package/src/entities/Document/api/index.ts +24 -0
- package/src/entities/Document/index.ts +2 -0
- package/src/entities/Document/model/store.ts +117 -0
- package/src/entities/Document/model/types.ts +18 -0
- package/src/entities/Meet/api/index.ts +58 -0
- package/src/entities/Meet/index.ts +2 -0
- package/src/entities/Meet/model/store.ts +72 -0
- package/src/entities/Meet/types/index.ts +7 -0
- package/src/entities/Payment/api/index.ts +20 -0
- package/src/entities/Payment/model/index.ts +2 -0
- package/src/entities/Payment/model/store.ts +62 -0
- package/src/entities/Payment/model/types.ts +7 -0
- package/src/entities/Session/model/store.ts +4 -4
- package/src/entities/System/model/store.ts +1 -1
- package/src/entities/User/model/stores.ts +3 -1
- package/src/entities/Wallet/api/index.ts +15 -33
- package/src/entities/Wallet/model/stores.ts +3 -23
- package/src/entities/Wallet/model/types.ts +2 -3
- package/src/env.d.ts +2 -0
- package/src/features/Agreementer/SignAgreementDialog/ui/SignAgreementDialog.vue +1 -1
- package/src/features/Branch/SelectBranch/index.ts +2 -0
- package/src/features/Branch/SelectBranch/ui/SelectBranchOverlay.vue +52 -105
- package/src/features/Decision/CreateProject/ui/CreateProjectFreeDecisionButton.vue +1 -1
- package/src/features/Decision/ParticipantApplication/model/index.ts +38 -0
- package/src/features/FreeDecision/CreateProject/model/index.ts +92 -0
- package/src/features/FreeDecision/CreateProject/ui/CreateProjectFreeDecisionButton.vue +51 -0
- package/src/features/FreeDecision/CreateProject/ui/index.ts +1 -0
- package/src/features/FreeDecision/GenerateDecision/index.ts +1 -0
- package/src/features/FreeDecision/GenerateDecision/model/index.ts +36 -0
- package/src/features/FreeDecision/index.ts +2 -0
- package/src/features/Meet/CloseMeetWithDecision/index.ts +1 -0
- package/src/features/Meet/CloseMeetWithDecision/model/index.ts +92 -0
- package/src/features/Meet/CreateMeet/index.ts +2 -0
- package/src/features/Meet/CreateMeet/model/index.ts +65 -0
- package/src/features/Meet/CreateMeet/ui/CreateMeet.vue +34 -0
- package/src/features/Meet/CreateMeet/ui/CreateMeetForm.vue +136 -0
- package/src/features/Meet/CreateMeet/ui/index.ts +2 -0
- package/src/features/Meet/GenerateAgenda/index.ts +1 -0
- package/src/features/Meet/GenerateAgenda/model/index.ts +18 -0
- package/src/features/Meet/GenerateBallot/index.ts +1 -0
- package/src/features/Meet/GenerateBallot/model/index.ts +18 -0
- package/src/features/Meet/GenerateNotification/index.ts +1 -0
- package/src/features/Meet/GenerateNotification/model/index.ts +18 -0
- package/src/features/Meet/GenerateSovietDecision/index.ts +1 -0
- package/src/features/Meet/GenerateSovietDecision/model/index.ts +48 -0
- package/src/features/Meet/MeetDetailsManagement/index.ts +1 -0
- package/src/features/Meet/MeetDetailsManagement/model/index.ts +121 -0
- package/src/features/Meet/RestartMeet/index.ts +2 -0
- package/src/features/Meet/RestartMeet/model/index.ts +54 -0
- package/src/features/Meet/RestartMeet/ui/RestartMeet.vue +46 -0
- package/src/features/Meet/RestartMeet/ui/RestartMeetForm.vue +92 -0
- package/src/features/Meet/RestartMeet/ui/index.ts +2 -0
- package/src/features/Meet/VoteOnMeet/index.ts +1 -0
- package/src/features/Meet/VoteOnMeet/model/index.ts +18 -0
- package/src/features/Payment/SetStatus/api/index.ts +20 -0
- package/src/features/Payment/SetStatus/index.ts +1 -0
- package/src/features/Payment/SetStatus/model/index.ts +30 -0
- package/src/features/{Order → Payment}/SetStatus/ui/SetOrderPaidStatusButton/SetOrderPaidStatusButton.vue +7 -3
- package/src/features/PaymentMethod/AddPaymentMethod/model/index.ts +2 -2
- package/src/features/PaymentMethod/AddPaymentMethod/ui/AddPaymentButton.vue +1 -1
- package/src/features/PaymentMethod/DeletePaymentMethod/model/index.ts +1 -1
- package/src/features/PaymentMethod/DeletePaymentMethod/ui/DeletePaymentMethodButton.vue +3 -1
- package/src/features/Request/CancelRequest/ui/CancelButton.vue +1 -1
- package/src/features/Request/ConfirmRecieveOnRequest/ui/ConfirmRecieveOnRequest.vue +1 -1
- package/src/features/Request/CreateParentOffer/ui/CreateParentOfferForm/CreateParentOfferForm.vue +4 -5
- package/src/features/Request/CreateParentOffer/ui/ImageUploaderWithPreview/ImageUploaderWithPreview.vue +5 -3
- package/src/features/Request/DisputeOnRequest/ui/DisputeOnRequestButton.vue +1 -1
- package/src/features/Request/ModerateRequest/ui/ModerateRequestButton.vue +2 -2
- package/src/features/Request/PublishRequest/ui/PublishRequestButton.vue +1 -1
- package/src/features/Request/RecieveOnRequest/ui/RecieveOnRequestButton.vue +1 -1
- package/src/features/Request/UnpublishRequest/ui/UnpublishRequestButton.vue +1 -1
- package/src/features/Union/AddCooperative/model/index.ts +5 -5
- package/src/features/Union/AddCooperative/ui/AddCooperativeForm.vue +6 -9
- package/src/features/User/AddUser/ui/AddUserDialog/AddUserDialog.vue +4 -4
- package/src/features/User/LoginUser/model/index.ts +3 -7
- package/src/features/User/LoginUser/ui/LoginForm/LoginForm.vue +0 -6
- package/src/features/User/Logout/model/index.ts +2 -1
- package/src/features/Wallet/DepositToWallet/ui/DepositButton/DepositButton.vue +10 -7
- package/src/features/Wallet/WithdrawFromWallet/ui/withdrawButton.vue +7 -6
- package/src/pages/Blank/index.ts +1 -0
- package/src/pages/Contacts/ContactsPage.vue +64 -0
- package/src/{widgets/Cooperative/Contacts → pages/Cooperative/ChangeContacts}/ui/index.ts +0 -1
- package/src/{widgets/Cooperative/Contributions/ui/ChangeContributions.vue → pages/Cooperative/ChangeRegisterPayments/ui/ChangeRegisterPayments.vue} +12 -11
- package/src/pages/Cooperative/ChangeRegisterPayments/ui/index.ts +1 -0
- package/src/pages/Cooperative/ListOfAgenda/index.ts +1 -0
- package/src/pages/Cooperative/ListOfAgenda/ui/ListOfAgendaQuestions.vue +118 -0
- package/src/pages/Cooperative/ListOfAgenda/ui/index.ts +1 -0
- package/src/pages/Cooperative/ListOfDocuments/ListOfDocumentsPage.vue +24 -0
- package/src/pages/Cooperative/ListOfMeets/model/index.ts +1 -0
- package/src/pages/Cooperative/ListOfMeets/model/model.ts +117 -0
- package/src/pages/Cooperative/ListOfMeets/ui/ListOfMeetsPage.vue +90 -0
- package/src/pages/Cooperative/ListOfMeets/ui/index.ts +1 -0
- package/src/pages/Cooperative/ListOfOrders/index.ts +1 -1
- package/src/pages/Cooperative/ListOfOrders/ui/ListOfOrdersPage.vue +0 -4
- package/src/pages/Cooperative/ListOfParticipants/ui/ListOfParticipantsPage.vue +61 -10
- package/src/pages/Cooperative/ListOfParticipants/ui/index.ts +1 -1
- package/src/pages/Cooperative/MeetDetails/ui/MeetDetailsPage.vue +88 -0
- package/src/pages/Cooperative/MeetDetails/ui/index.ts +1 -0
- package/src/pages/Cooperative/MemberBranchList/ui/index.ts +1 -0
- package/src/pages/Cooperative/Payments/index.ts +1 -0
- package/src/pages/Cooperative/Payments/ui/PaymentsPage.vue +7 -0
- package/src/pages/{ExtStore → ExtensionStore}/ExtensionPage/ExtensionPage.vue +51 -24
- package/src/pages/{ExtStore → ExtensionStore}/ExtensionsShowcase/ExtensionsShowcase.vue +2 -2
- package/src/pages/{ExtStore → ExtensionStore}/InstalledExtensions/InstalledExtensions.vue +2 -2
- package/src/pages/Marketplace/OfferPage/ui/OfferPage.vue +1 -1
- package/src/pages/Marketplace/Showcase/ui/ShowcasePage.vue +1 -1
- package/src/pages/Marketplace/SuppliesList/ui/SuppliesListPage.vue +1 -1
- package/src/pages/Marketplace/UserParentOffers/ui/UserParentOffersPage.vue +1 -1
- package/src/pages/Marketplace/UserSuppliesList/ui/UserSuppliesListPage.vue +1 -1
- package/src/pages/PermissionDenied/index.ts +1 -0
- package/src/pages/Registrator/SignUp/EmailInput.vue +4 -3
- package/src/pages/Registrator/SignUp/GenerateAccount.vue +2 -3
- package/src/pages/Registrator/SignUp/PayInitial.vue +1 -1
- package/src/pages/Registrator/SignUp/ReadStatement.vue +2 -2
- package/src/pages/Registrator/SignUp/SelectBranch.vue +2 -2
- package/src/pages/Registrator/SignUp/SignStatement.vue +2 -2
- package/src/pages/Registrator/SignUp/SignUp.vue +5 -12
- package/src/pages/Registrator/SignUp/WaitingRegistration.vue +1 -5
- package/src/pages/Registrator/SignUp/Welcome.vue +6 -3
- package/src/pages/Union/ConnectionAgreement/index.ts +1 -0
- package/src/pages/Union/ListOfCooperatives/ui/UnionPageListOfCooperatives.vue +139 -6
- package/src/pages/User/DocumentsPage/UserDocumentsPage.vue +23 -0
- package/src/pages/User/DocumentsPage/index.ts +1 -0
- package/src/pages/User/PaymentsPage/ui/UserPayments.vue +11 -0
- package/src/pages/User/PaymentsPage/ui/index.ts +1 -0
- package/src/pages/User/ProfilePage/index.ts +1 -0
- package/src/pages/User/ProfilePage/ui/ProfilePage.vue +114 -0
- package/src/pages/User/ProfilePage/ui/index.ts +1 -0
- package/src/pages/User/SettingsPage/ui/index.ts +1 -1
- package/src/pages/User/WalletPage/index.ts +1 -0
- package/src/pages/User/WalletPage/ui/WalletPage.vue +72 -0
- package/src/pages/User/WalletPage/ui/index.ts +1 -0
- package/src/processes/init-app/index.ts +28 -0
- package/src/processes/init-installed-extensions/index.ts +25 -0
- package/src/processes/init-wallet/index.ts +40 -0
- package/src/processes/navigation-guard-setup/index.ts +45 -0
- package/src/processes/process-decisions/index.ts +275 -0
- package/src/processes/select-branch/index.ts +80 -0
- package/src/processes/watch-branch-overlay/index.ts +38 -0
- package/src/processes/watch-desktop-health/index.ts +33 -0
- package/src/shared/api/alerts.ts +2 -6
- package/src/shared/api/axios.ts +5 -5
- package/src/shared/api/client.ts +4 -4
- package/src/shared/api/eosio.ts +2 -2
- package/src/shared/api/indexDB.ts +3 -0
- package/src/shared/api/utils.ts +2 -2
- package/src/shared/config/Environment.ts +68 -0
- package/src/shared/config/index.ts +2 -1
- package/src/shared/hooks/index.ts +2 -0
- package/src/shared/hooks/useAgendaPoints.ts +24 -0
- package/src/shared/hooks/useWindowSize.ts +13 -0
- package/src/shared/lib/composables/useDisplayName.ts +34 -0
- package/src/shared/lib/navigation/index.ts +2 -0
- package/src/shared/lib/navigation/routeUtils.ts +51 -0
- package/src/shared/lib/navigation/useBackButton.ts +63 -0
- package/src/shared/lib/proxy/dicebear-collection.cjs +21 -0
- package/src/shared/lib/proxy/dicebear-core.cjs +20 -0
- package/src/shared/lib/proxy/email-regex.cjs +19 -0
- package/src/shared/lib/utils/dates/validateDateWithinRange.ts +23 -0
- package/src/shared/ui/BaseDocument/BaseDocument.vue +120 -90
- package/src/{components/menu/blockchainStatus.vue → shared/ui/BlockchainStatusBar/BlockchainStatusBar.vue} +1 -0
- package/src/shared/ui/BlockchainStatusBar/index.ts +1 -0
- package/src/shared/ui/CardStyles/index.scss +61 -0
- package/src/shared/ui/ClientOnly/ClientOnly.vue +15 -0
- package/src/shared/ui/ClientOnly/index.ts +1 -0
- package/src/shared/ui/ComplexDocument/ComplexDocument.vue +31 -8
- package/src/shared/ui/CopyableInput/index.ts +1 -0
- package/src/shared/ui/CopyableInput/ui/CopyableInput.vue +62 -0
- package/src/shared/ui/EditableEntrepreneurCard/EditableEntrepreneurCard.vue +9 -8
- package/src/shared/ui/EditableIndividualCard/EditableIndividualCard.vue +10 -10
- package/src/shared/ui/EditableOrganizationCard/EditableOrganizationCard.vue +57 -47
- package/src/shared/ui/Form/Form.vue +3 -1
- package/src/shared/ui/InputStyles/index.scss +29 -0
- package/src/shared/ui/TabStyles/index.scss +53 -0
- package/src/shared/ui/index.ts +1 -0
- package/src/{components/history/AccountEvents.vue → widgets/AccountActions/AccountActionsPage.vue} +2 -2
- package/src/widgets/AccountActions/index.ts +1 -0
- package/src/widgets/BankDetailsCard/ui/BankDetailsCard.vue +2 -2
- package/src/widgets/BranchCard/ui/BranchCard.vue +2 -2
- package/src/widgets/Cooperative/Documents/ListOfDocuments/ui/DocumentCard.vue +48 -0
- package/src/widgets/Cooperative/Documents/ListOfDocuments/ui/DocumentsTable.vue +162 -0
- package/src/widgets/Cooperative/Documents/ListOfDocuments/ui/ListOfDocumentsWidget.vue +77 -120
- package/src/widgets/Cooperative/Documents/ListOfDocuments/ui/index.ts +3 -1
- package/src/widgets/Cooperative/Orders/ListOfOrders/ui/ListOfOrdersWidget.vue +135 -128
- package/src/widgets/Cooperative/Orders/ListOfOrders/ui/OrderCard.vue +74 -0
- package/src/widgets/Cooperative/Orders/ListOfOrders/ui/index.ts +2 -1
- package/src/widgets/Cooperative/Payments/ListOfPayments/ui/ListOfPaymentsWidget.vue +216 -0
- package/src/widgets/Cooperative/Payments/ListOfPayments/ui/PaymentCard.vue +73 -0
- package/src/widgets/Cooperative/Payments/ListOfPayments/ui/index.ts +2 -0
- package/src/widgets/Cooperative/Payments/index.ts +1 -0
- package/src/widgets/Desktop/LeftDrawerMenu/LeftDrawerMenu.vue +3 -2
- package/src/widgets/Desktop/SecondLevelMenuList/SecondLevelMenuList.vue +58 -91
- package/src/widgets/Desktop/WorkspaceMenu/WorkspaceMenu.vue +114 -59
- package/src/widgets/{ExtStore/ExtensionCard → ExtensionCard}/ExtensionCard.vue +12 -7
- package/src/widgets/Header/BackButton/BackButton.vue +25 -0
- package/src/widgets/Header/BackButton/index.ts +1 -0
- package/src/widgets/Header/CommonHeader/CooperativeSettingsHeader.vue +34 -0
- package/src/widgets/Header/CommonHeader/ExtstoreHeader.vue +41 -0
- package/src/widgets/Header/CommonHeader/Header.vue +33 -198
- package/src/widgets/Header/CommonHeader/HeaderStyles.scss +22 -0
- package/src/widgets/Header/CommonHeader/MainHeader.vue +88 -0
- package/src/widgets/Header/CommonHeader/UserSettingsHeader.vue +29 -0
- package/src/widgets/Header/CommonHeader/index.ts +1 -1
- package/src/widgets/Header/SettingsDropdown/SettingsDropdown.vue +0 -6
- package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Base/Base.vue +2 -2
- package/src/widgets/Meets/MeetDetailsActions/MeetDetailsActions.vue +51 -0
- package/src/widgets/Meets/MeetDetailsActions/index.ts +1 -0
- package/src/widgets/Meets/MeetDetailsActions/model.ts +46 -0
- package/src/widgets/Meets/MeetDetailsAgenda/MeetDetailsAgenda.vue +29 -0
- package/src/widgets/Meets/MeetDetailsAgenda/index.ts +1 -0
- package/src/widgets/Meets/MeetDetailsHeader/MeetDetailsHeader.vue +40 -0
- package/src/widgets/Meets/MeetDetailsHeader/index.ts +1 -0
- package/src/widgets/Meets/MeetDetailsVoting/MeetDetailsVoting.vue +77 -0
- package/src/widgets/Meets/MeetDetailsVoting/index.ts +1 -0
- package/src/widgets/Meets/MeetDetailsVoting/model.ts +117 -0
- package/src/widgets/Meets/MeetInfoCard/ui/MeetInfoCard.vue +38 -0
- package/src/widgets/Meets/MeetInfoCard/ui/index.ts +1 -0
- package/src/widgets/Meets/MeetsTable/ui/MeetsTable.vue +118 -0
- package/src/widgets/Meets/MeetsTable/ui/index.ts +1 -0
- package/src/widgets/Participants/index.ts +1 -0
- package/src/widgets/Participants/ui/ParticipantCard.vue +89 -0
- package/src/widgets/Participants/ui/ParticipantDetails.vue +79 -0
- package/src/widgets/Participants/ui/ParticipantsTable.vue +129 -0
- package/src/widgets/Participants/ui/index.ts +4 -0
- package/src/widgets/Questions/index.ts +3 -0
- package/src/widgets/Questions/ui/QuestionCard/QuestionCard.vue +109 -0
- package/src/widgets/Questions/ui/QuestionCard/index.ts +1 -0
- package/src/widgets/Questions/ui/QuestionsTable/QuestionsTable.vue +177 -0
- package/src/widgets/Questions/ui/QuestionsTable/index.ts +1 -0
- package/src/widgets/Questions/ui/VotingButtons/VotingButtons.vue +75 -0
- package/src/widgets/Questions/ui/VotingButtons/index.ts +1 -0
- package/src/widgets/Questions/ui/index.ts +3 -0
- package/src/widgets/RequireAgreements/index.ts +1 -0
- package/src/widgets/User/PaymentMethods/ui/PaymentMethods.vue +81 -85
- package/src-ssr/middlewares/injectEnv.ts +49 -0
- package/tsconfig.json +1 -1
- package/extensions/powerup/boot.ts +0 -17
- package/src/app/providers/card/store.ts +0 -42
- package/src/boot/branch-selector.ts +0 -40
- package/src/boot/init-stores.ts +0 -51
- package/src/boot/navigation-guards.ts +0 -46
- package/src/components/menu/footerMobileMenu.vue +0 -79
- package/src/components/soviet/index.vue +0 -76
- package/src/components/soviet/staff.vue +0 -274
- package/src/desktops/User/index.ts +0 -1
- package/src/desktops/User/model/index.ts +0 -329
- package/src/entities/Menu/model/store.ts +0 -69
- package/src/entities/Menu/model/types.ts +0 -11
- package/src/entities/Menu/ui/index.ts +0 -1
- package/src/entities/Order/api/index.ts +0 -14
- package/src/entities/Order/model/store.ts +0 -87
- package/src/features/Order/SetStatus/api/index.ts +0 -7
- package/src/features/Order/SetStatus/model/index.ts +0 -23
- package/src/pages/Cooperative/Contacts/ui/ContactsPage.vue +0 -7
- package/src/pages/Cooperative/ListOfBranches/ui/index.ts +0 -1
- package/src/pages/Documentor/ListOfDocuments/ListOfDocumentsPage.vue +0 -12
- package/src/pages/Union/Connection/index.ts +0 -1
- package/src/pages/_layouts/blank.vue +0 -24
- package/src/pages/_layouts/default.vue +0 -79
- package/src/types/index.ts +0 -3
- package/src/widgets/Commutator/Commutator.vue +0 -7
- package/src/widgets/Commutator/index.ts +0 -1
- package/src/widgets/Cooperative/Agenda/ListOfQuestions/ui/ListOfQuestions.vue +0 -273
- package/src/widgets/Cooperative/Agenda/ListOfQuestions/ui/index.ts +0 -1
- package/src/widgets/Cooperative/Contacts/ui/Contacts.vue +0 -52
- package/src/widgets/Cooperative/Contributions/ui/index.ts +0 -1
- package/src/widgets/Cooperative/Description/ui/SetDescription.vue +0 -4
- package/src/widgets/Cooperative/Description/ui/index.ts +0 -1
- package/src/widgets/Cooperative/Participants/ListOfParticipants/ui/ListOfParticipantsWidget.vue +0 -186
- package/src/widgets/Cooperative/Participants/ListOfParticipants/ui/index.ts +0 -1
- package/src/widgets/Desktop/SecondLevelMenu/SecondLevelMenu.vue +0 -59
- package/src/widgets/Desktop/SecondLevelMenu/index.ts +0 -1
- package/src/widgets/IndividualCard/ui/IndividualCard.vue +0 -170
- package/src/widgets/IndividualCard/ui/index.ts +0 -1
- package/src/widgets/OrganizationCard/ui/OrganizationCard.vue +0 -44
- package/src/widgets/OrganizationCard/ui/index.ts +0 -1
- package/src/widgets/Union/ListOfCooperatives/ui/UnionListOfCooperatives.vue +0 -136
- package/src/widgets/Union/ListOfCooperatives/ui/index.ts +0 -1
- package/src/entities/{Menu → Document}/model/index.ts +0 -0
- package/src/entities/{Order → Meet}/model/index.ts +0 -0
- package/src/entities/{Order → Payment}/index.ts +0 -0
- package/src/features/{Order/SetStatus → Decision/ParticipantApplication}/index.ts +0 -0
- package/src/{widgets/Request/SupplyOrderRequestCard → features/FreeDecision/CreateProject}/index.ts +0 -0
- package/src/features/{Order → Payment}/SetStatus/ui/SetOrderCompletedStatusButton/SetOrderCompletedStatusButton.vue +0 -0
- package/src/features/{Order → Payment}/SetStatus/ui/SetOrderCompletedStatusButton/index.ts +0 -0
- package/src/features/{Order → Payment}/SetStatus/ui/SetOrderPaidStatusButton/index.ts +0 -0
- package/src/features/{Order → Payment}/SetStatus/ui/SetOrderRefundedStatusButton/SetOrderRefundedStatusButton.vue +0 -0
- package/src/features/{Order → Payment}/SetStatus/ui/SetOrderRefundedStatusButton/index.ts +0 -0
- package/src/pages/{blank/blank.vue → Blank/BlankPage.vue} +0 -0
- package/src/pages/{Cooperative/Contacts/ui → Contacts}/index.ts +0 -0
- package/src/pages/Cooperative/{Contacts → ChangeContacts}/index.ts +0 -0
- package/src/{widgets/Cooperative/Contacts → pages/Cooperative/ChangeContacts}/ui/ChangeContacts.vue +0 -0
- package/src/pages/Cooperative/{ListOfBranches → ChangeRegisterPayments}/index.ts +0 -0
- package/src/pages/{Documentor → Cooperative}/ListOfDocuments/index.ts +0 -0
- package/src/pages/{Installer → Cooperative/ListOfMeets}/index.ts +0 -0
- package/src/{widgets/Cooperative/Agenda/ListOfQuestions → pages/Cooperative/MeetDetails}/index.ts +0 -0
- package/src/{widgets/Cooperative/Contacts → pages/Cooperative/MemberBranchList}/index.ts +0 -0
- package/src/pages/Cooperative/{ListOfBranches/ui/ListOfBranchesPage.vue → MemberBranchList/ui/MemberBranchListPage.vue} +0 -0
- package/src/pages/{ExtStore → ExtensionStore}/BaseRoute/ExtensionStoreBase.vue +0 -0
- package/src/pages/{ExtStore → ExtensionStore}/BaseRoute/index.ts +0 -0
- package/src/pages/{ExtStore → ExtensionStore}/ExtensionPage/index.ts +0 -0
- package/src/pages/{ExtStore → ExtensionStore}/ExtensionsShowcase/index.ts +0 -0
- package/src/pages/{ExtStore → ExtensionStore}/InstalledExtensions/index.ts +0 -0
- package/src/pages/{_layouts/permissionDenied.vue → PermissionDenied/PermissionDenied.vue} +0 -0
- package/src/pages/Union/{Connection/ConnectionPage.vue → ConnectionAgreement/ConnectionAgreementPage.vue} +0 -0
- package/src/{widgets/Cooperative/Contributions → pages/Union/InstallCooperative}/index.ts +0 -0
- package/src/pages/{Installer → Union/InstallCooperative}/ui/InstallCooperativePage.vue +0 -0
- package/src/pages/{Installer → Union/InstallCooperative}/ui/index.ts +0 -0
- package/src/{widgets/Cooperative/Participants/ListOfParticipants → pages/User/PaymentsPage}/index.ts +0 -0
- package/src/{components/history → widgets/AccountActions}/AccountLink.vue +0 -0
- package/src/{components/history → widgets/AccountActions}/ActionCell.vue +0 -0
- package/src/{components/history → widgets/AccountActions}/DataCell.vue +0 -0
- package/src/widgets/{IndividualCard → Cooperative/Payments/ListOfPayments}/index.ts +0 -0
- package/src/widgets/{ExtStore/ExtensionCard → ExtensionCard}/index.ts +0 -0
- package/src/widgets/{Request → Marketplace}/CreateChildOrderCard/CreateChildOrderCard.vue +0 -0
- package/src/widgets/{Request → Marketplace}/CreateChildOrderCard/index.ts +0 -0
- package/src/widgets/{Request → Marketplace}/RequestCard/RequestCard.vue +0 -0
- package/src/widgets/{Request → Marketplace}/RequestCard/index.ts +0 -0
- package/src/{entities/Menu → widgets/Marketplace/SupplyOrderRequestCard}/index.ts +1 -1
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/model/index.ts +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/model/types.ts +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Base/index.ts +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/EightStep.vue +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/FifthStep.vue +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/FirstStep.vue +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/FourthStep.vue +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/SecondStep.vue +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/SeventhStep.vue +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/SixthStep.vue +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/ThirdStep.vue +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/index.ts +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/index.ts +0 -0
- /package/src/widgets/{OrganizationCard → Meets/MeetInfoCard}/index.ts +0 -0
- /package/src/widgets/{Union/ListOfCooperatives → Meets/MeetsTable}/index.ts +0 -0
- /package/src/widgets/{Agreementer/RequireAgreements → RequireAgreements}/ui/RequireAgreements.vue +0 -0
- /package/src/widgets/{Agreementer/RequireAgreements → RequireAgreements}/ui/index.ts +0 -0
@@ -1,131 +1,156 @@
|
|
1
1
|
<template lang="pug">
|
2
2
|
div.row.justify-center
|
3
3
|
div.col-12
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
q-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
:
|
28
|
-
:
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
q-
|
35
|
-
q-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
q-
|
45
|
-
q-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
4
|
+
div.scroll-area(style="height: 90vh; overflow-y: auto;")
|
5
|
+
q-table(
|
6
|
+
v-if="payments && payments.items"
|
7
|
+
ref="tableRef"
|
8
|
+
flat
|
9
|
+
:grid="isMobile"
|
10
|
+
:rows="payments.items"
|
11
|
+
row-key="id"
|
12
|
+
:columns="columns"
|
13
|
+
:table-colspan="9"
|
14
|
+
:loading="onLoading"
|
15
|
+
:no-data-label="'платежи не найдены'"
|
16
|
+
virtual-scroll
|
17
|
+
@virtual-scroll="onScroll"
|
18
|
+
:virtual-scroll-target="'.scroll-area'"
|
19
|
+
:virtual-scroll-item-size="48"
|
20
|
+
:virtual-scroll-sticky-size-start="48"
|
21
|
+
:rows-per-page-options="[0]"
|
22
|
+
:pagination="pagination"
|
23
|
+
class="q-mb-md"
|
24
|
+
)
|
25
|
+
template(#item="props")
|
26
|
+
OrderCard(
|
27
|
+
:order="props.row"
|
28
|
+
:expanded="expanded.get(props.row.id)"
|
29
|
+
:hideActions="hideActions"
|
30
|
+
@toggle-expand="toggleExpand(props.row.id)"
|
31
|
+
)
|
32
|
+
|
33
|
+
template(#header="props")
|
34
|
+
q-tr(:props="props")
|
35
|
+
q-th(auto-width)
|
36
|
+
q-th(
|
37
|
+
v-for="col in props.cols"
|
38
|
+
:key="col.name"
|
39
|
+
:props="props"
|
40
|
+
@click="onSort(col)"
|
41
|
+
) {{ col.label }}
|
42
|
+
|
43
|
+
template(#body="props")
|
44
|
+
q-tr(:key="`m_${props.row.id}`" :props="props")
|
45
|
+
q-td(auto-width)
|
46
|
+
q-btn(
|
47
|
+
size="sm"
|
48
|
+
color="primary"
|
49
|
+
round
|
50
|
+
dense
|
51
|
+
:icon="expanded.get(props.row.id) ? 'remove' : 'add'"
|
52
|
+
@click="toggleExpand(props.row.id)"
|
53
|
+
)
|
54
|
+
q-td {{props.row.id}}
|
55
|
+
q-td {{ props.row.amount }} {{props.row.symbol}}
|
56
|
+
q-td
|
57
|
+
q-badge(v-if="props.row.details.data.includes('registration')") регистрационный
|
58
|
+
q-badge(v-else) паевой
|
59
|
+
|
60
|
+
q-td(style="max-width: 150px; word-wrap: break-word; white-space: normal;") {{props.row.username}}
|
61
|
+
|
62
|
+
|
63
|
+
q-td
|
64
|
+
q-badge(v-if="props.row.status ==='COMPLETED'" color="teal") обработан
|
65
|
+
q-badge(v-if="props.row.status ==='PENDING'" color="orange") ожидание оплаты
|
66
|
+
q-badge(v-if="props.row.status ==='FAILED'" color="red") ошибка
|
67
|
+
q-badge(v-if="props.row.status ==='PAID'" color="orange") оплачен
|
68
|
+
q-badge(v-if="props.row.status ==='REFUNDED'" color="grey") отменён
|
69
|
+
q-badge(v-if="props.row.status ==='EXPIRED'" color="grey") истёк
|
70
|
+
q-td
|
71
|
+
SetOrderPaidStatusButton(
|
72
|
+
v-if="!hideActions && ['EXPIRED', 'PENDING', 'FAILED'].includes(props.row.status)"
|
73
|
+
:id="props.row.id"
|
74
|
+
)
|
75
|
+
span(v-else-if="!hideActions").text-grey нет доступных действий
|
76
|
+
|
77
|
+
q-tr(v-if="expanded.get(props.row.id)" :key="`e_${props.row.id}`" :props="props" class="q-virtual-scroll--with-prev")
|
78
|
+
q-td(colspan="100%")
|
79
|
+
div(v-if="props.row.status=='FAILED'")
|
80
|
+
span Причина ошибки: {{props.row.message ?? 'нет дополнительной информации'}}
|
81
|
+
div(v-else)
|
82
|
+
span нет дополнительной информации
|
63
83
|
</template>
|
64
84
|
<script setup lang="ts">
|
65
85
|
import { onMounted, ref, computed, reactive, nextTick } from 'vue'
|
66
86
|
import { Notify } from 'quasar'
|
67
|
-
import {
|
68
|
-
|
69
|
-
import
|
70
|
-
import {
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
const orderStore = useOrderStore()
|
75
|
-
const orders = computed(() => orderStore.orders)
|
76
|
-
console.log('orders: ', orders.value)
|
87
|
+
import { usePaymentStore } from 'src/entities/Payment/model';
|
88
|
+
import { SetOrderPaidStatusButton } from 'src/features/Payment/SetStatus/ui/SetOrderPaidStatusButton';
|
89
|
+
import OrderCard from './OrderCard.vue';
|
90
|
+
import { useWindowSize } from 'src/shared/hooks';
|
91
|
+
|
92
|
+
const paymentStore = usePaymentStore()
|
93
|
+
const payments = computed(() => paymentStore.payments)
|
77
94
|
const onLoading = ref(false)
|
78
95
|
const nextPage = ref(1)
|
79
96
|
const lastPage = ref(1);
|
80
|
-
|
81
|
-
const dropdowns = reactive({})
|
97
|
+
const { isMobile } = useWindowSize()
|
82
98
|
|
83
99
|
const sortState = reactive({
|
84
100
|
sortBy: '',
|
85
101
|
sortDir: ''
|
86
102
|
})
|
87
103
|
|
88
|
-
const sortedQuery = computed(() => {
|
89
|
-
if (sortState.sortBy && sortState.sortDir)
|
90
|
-
return `${sortState.sortBy}:${sortState.sortDir}`
|
91
|
-
else return ''
|
92
|
-
})
|
93
|
-
|
94
104
|
const onSort = (col) => {
|
95
|
-
|
96
105
|
if (!col.sortable) return
|
97
106
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
}
|
111
|
-
|
112
|
-
const closeDropdown = (id: string) => {
|
113
|
-
dropdowns[id] = false // Закрываем дропдаун для конкретной строки
|
107
|
+
// Меняем направление сортировки, если кликнули на тот же столбец
|
108
|
+
if (sortState.sortBy === col.name) {
|
109
|
+
sortState.sortDir = sortState.sortDir === 'asc' ? 'desc' : 'asc'
|
110
|
+
} else {
|
111
|
+
// Если сортируем новый столбец, сбрасываем на 'asc'
|
112
|
+
sortState.sortBy = col.name
|
113
|
+
sortState.sortDir = 'asc'
|
114
|
+
}
|
115
|
+
paymentStore.clear()
|
116
|
+
nextPage.value = 1
|
117
|
+
lastPage.value = 1
|
118
|
+
loadPayments(1) // Перезагружаем с новыми параметрами сортировки
|
114
119
|
}
|
115
120
|
|
116
121
|
const props = defineProps({
|
117
|
-
|
122
|
+
username: {
|
118
123
|
type: String,
|
119
124
|
required: false,
|
120
125
|
default: null
|
121
126
|
},
|
127
|
+
hideActions: {
|
128
|
+
type: Boolean,
|
129
|
+
default: false
|
130
|
+
}
|
122
131
|
})
|
123
132
|
|
124
|
-
const
|
133
|
+
const loadPayments = async (page = 1) => {
|
125
134
|
try {
|
126
135
|
onLoading.value = true
|
127
|
-
|
128
|
-
|
136
|
+
|
137
|
+
// Данные для фильтрации
|
138
|
+
const data = props.username ? { username: props.username } : undefined;
|
139
|
+
|
140
|
+
// Опции пагинации и сортировки
|
141
|
+
const options = {
|
142
|
+
page,
|
143
|
+
limit: 25,
|
144
|
+
sortBy: sortState.sortBy || undefined,
|
145
|
+
sortOrder: sortState.sortDir ? sortState.sortDir.toUpperCase() as 'ASC' | 'DESC' : 'ASC'
|
146
|
+
};
|
147
|
+
|
148
|
+
await paymentStore.loadPayments(data, options);
|
149
|
+
|
150
|
+
if (payments.value) {
|
151
|
+
lastPage.value = payments.value.totalPages || 1
|
152
|
+
}
|
153
|
+
|
129
154
|
onLoading.value = false
|
130
155
|
} catch (e: any) {
|
131
156
|
onLoading.value = false
|
@@ -139,16 +164,15 @@
|
|
139
164
|
|
140
165
|
// Функция обработки виртуального скролла
|
141
166
|
const onScroll = ({ to, ref }) => {
|
142
|
-
if(
|
143
|
-
|
144
|
-
const lastIndex = orders.value.results.length - 1
|
167
|
+
if(payments.value) {
|
168
|
+
const lastIndex = payments.value.items.length - 1
|
145
169
|
|
146
170
|
if (onLoading.value !== true && nextPage.value < lastPage.value && to === lastIndex) {
|
147
171
|
onLoading.value = true
|
148
172
|
|
149
173
|
setTimeout(() => {
|
150
174
|
nextPage.value++
|
151
|
-
|
175
|
+
loadPayments(nextPage.value) // Загружаем следующую страницу
|
152
176
|
|
153
177
|
nextTick(() => {
|
154
178
|
ref.refresh() // Обновляем виртуальный скролл после загрузки
|
@@ -160,17 +184,18 @@
|
|
160
184
|
}
|
161
185
|
|
162
186
|
onMounted(() => {
|
163
|
-
|
164
|
-
|
187
|
+
paymentStore.clear()
|
188
|
+
loadPayments()
|
165
189
|
})
|
166
190
|
|
167
191
|
|
168
|
-
const columns = [
|
169
|
-
{ name: '
|
170
|
-
{ name: '
|
171
|
-
{ name: 'type', align: 'left', label: 'Тип платежа', field: '
|
172
|
-
{ name: '
|
173
|
-
{ name: 'status', align: 'left', label: 'Статус', field: '', sortable: true },
|
192
|
+
const columns: any[] = [
|
193
|
+
{ name: 'id', align: 'left', label: '№', field: 'id', sortable: true },
|
194
|
+
{ name: 'amount', align: 'left', label: 'Сумма', field: 'amount', sortable: true },
|
195
|
+
{ name: 'type', align: 'left', label: 'Тип платежа', field: '', sortable: false },
|
196
|
+
{ name: 'username', align: 'left', label: 'От кого', field: 'username', sortable: true },
|
197
|
+
{ name: 'status', align: 'left', label: 'Статус', field: 'status', sortable: true },
|
198
|
+
{ name: 'actions', align: 'left', label: '', field: '', sortable: false, hide: props.hideActions },
|
174
199
|
] as any
|
175
200
|
|
176
201
|
const expanded = reactive(new Map()) // Используем Map для отслеживания состояния развертывания каждой записи
|
@@ -184,24 +209,6 @@
|
|
184
209
|
const pagination = ref({ rowsPerPage: 0 })
|
185
210
|
</script>
|
186
211
|
|
187
|
-
<style lang="sass">
|
188
|
-
.my-sticky-dynamic
|
189
|
-
/* height or max-height is important */
|
190
|
-
height: 100vh
|
191
|
-
|
192
|
-
/* this will be the loading indicator */
|
193
|
-
thead tr:last-child th
|
194
|
-
/* height of all previous header rows */
|
195
|
-
top: 48px
|
196
|
-
thead tr:first-child th
|
197
|
-
top: 0
|
198
|
-
|
199
|
-
/* prevent scrolling behind sticky top row on focus */
|
200
|
-
tbody
|
201
|
-
/* height of all previous header rows */
|
202
|
-
scroll-margin-top: 48px
|
203
|
-
|
204
|
-
</style>
|
205
212
|
<style>
|
206
213
|
.q-list--dense > .q-item, .q-item--dense {
|
207
214
|
padding: 0px !important;
|
@@ -0,0 +1,74 @@
|
|
1
|
+
<template lang="pug">
|
2
|
+
div.q-pa-xs.col-xs-12.col-sm-12.col-md-12.q-mt-md
|
3
|
+
q-card(bordered flat)
|
4
|
+
q-card-section.q-py-xs
|
5
|
+
div.text-subtitle2 № {{ order.order_num }}
|
6
|
+
div.text-caption Сумма: {{ order.quantity }}
|
7
|
+
|
8
|
+
q-separator
|
9
|
+
|
10
|
+
q-card-section.q-py-xs
|
11
|
+
div.row.items-center
|
12
|
+
div.col-6 Тип платежа:
|
13
|
+
div.col-6.text-right
|
14
|
+
q-badge(v-if="order.type ==='registration'") регистрационный
|
15
|
+
q-badge(v-if="order.type ==='deposit'") паевой
|
16
|
+
|
17
|
+
div.row.items-center.q-mt-sm
|
18
|
+
div.col-6 От кого:
|
19
|
+
div.col-6.text-right {{ getNameFromUserData(order.user?.private_data) }}
|
20
|
+
|
21
|
+
div.row.items-center.q-mt-sm
|
22
|
+
div.col-6 Статус:
|
23
|
+
div.col-6.text-right
|
24
|
+
q-badge(v-if="order.status ==='completed'" color="teal") обработан
|
25
|
+
q-badge(v-if="order.status ==='pending'" color="orange") ожидание оплаты
|
26
|
+
q-badge(v-if="order.status ==='failed'" color="red") ошибка
|
27
|
+
q-badge(v-if="order.status ==='paid'" color="orange") оплачен
|
28
|
+
q-badge(v-if="order.status ==='refunded'" color="grey") отменён
|
29
|
+
q-badge(v-if="order.status ==='expired'" color="grey") истёк
|
30
|
+
|
31
|
+
q-card-actions(align="right")
|
32
|
+
q-btn(
|
33
|
+
v-if="order.message"
|
34
|
+
size="sm"
|
35
|
+
flat
|
36
|
+
icon="expand_more"
|
37
|
+
@click="$emit('toggle-expand')"
|
38
|
+
)
|
39
|
+
| {{ expanded ? 'Скрыть' : 'Подробнее' }}
|
40
|
+
|
41
|
+
q-btn-dropdown(v-if="!hideActions" size="sm" label="действия" color="primary")
|
42
|
+
q-list(dense)
|
43
|
+
SetOrderPaidStatusButton(:id="order.id" @close="$emit('close-dropdown')")
|
44
|
+
SetOrderRefundedStatusButton(:id="order.id" @close="$emit('close-dropdown')")
|
45
|
+
|
46
|
+
q-slide-transition
|
47
|
+
div(v-show="expanded && order.message")
|
48
|
+
q-separator
|
49
|
+
q-card-section
|
50
|
+
p Причина ошибки: {{order.message}}
|
51
|
+
</template>
|
52
|
+
|
53
|
+
<script setup lang="ts">
|
54
|
+
import { getNameFromUserData } from 'src/shared/lib/utils/getNameFromUserData';
|
55
|
+
import { SetOrderPaidStatusButton } from 'src/features/Payment/SetStatus/ui/SetOrderPaidStatusButton';
|
56
|
+
import { SetOrderRefundedStatusButton } from 'src/features/Payment/SetStatus/ui/SetOrderRefundedStatusButton';
|
57
|
+
|
58
|
+
defineProps({
|
59
|
+
order: {
|
60
|
+
type: Object,
|
61
|
+
required: true
|
62
|
+
},
|
63
|
+
expanded: {
|
64
|
+
type: Boolean,
|
65
|
+
default: false
|
66
|
+
},
|
67
|
+
hideActions: {
|
68
|
+
type: Boolean,
|
69
|
+
default: false
|
70
|
+
}
|
71
|
+
})
|
72
|
+
|
73
|
+
defineEmits(['toggle-expand', 'close-dropdown'])
|
74
|
+
</script>
|
@@ -1 +1,2 @@
|
|
1
|
-
export {default as
|
1
|
+
export { default as OrderCard } from './OrderCard.vue'
|
2
|
+
export { default as ListOfOrdersWidget } from './ListOfOrdersWidget.vue'
|
@@ -0,0 +1,216 @@
|
|
1
|
+
<template lang="pug">
|
2
|
+
div.row.justify-center
|
3
|
+
div.col-12
|
4
|
+
div.scroll-area(style="height: 90vh; overflow-y: auto;")
|
5
|
+
q-table(
|
6
|
+
v-if="payments && payments.items"
|
7
|
+
ref="tableRef"
|
8
|
+
flat
|
9
|
+
:grid="isMobile"
|
10
|
+
:rows="payments.items"
|
11
|
+
row-key="id"
|
12
|
+
:columns="columns"
|
13
|
+
:table-colspan="9"
|
14
|
+
:loading="onLoading"
|
15
|
+
:no-data-label="'платежи не найдены'"
|
16
|
+
virtual-scroll
|
17
|
+
@virtual-scroll="onScroll"
|
18
|
+
:virtual-scroll-target="'.scroll-area'"
|
19
|
+
:virtual-scroll-item-size="48"
|
20
|
+
:virtual-scroll-sticky-size-start="48"
|
21
|
+
:rows-per-page-options="[0]"
|
22
|
+
:pagination="pagination"
|
23
|
+
class="q-mb-md"
|
24
|
+
)
|
25
|
+
template(#item="props")
|
26
|
+
PaymentCard(
|
27
|
+
:payment="props.row"
|
28
|
+
:expanded="expanded.get(props.row.id)"
|
29
|
+
:hideActions="hideActions"
|
30
|
+
@toggle-expand="toggleExpand(props.row.id)"
|
31
|
+
)
|
32
|
+
|
33
|
+
template(#header="props")
|
34
|
+
q-tr(:props="props")
|
35
|
+
q-th(auto-width)
|
36
|
+
q-th(
|
37
|
+
v-for="col in props.cols"
|
38
|
+
:key="col.name"
|
39
|
+
:props="props"
|
40
|
+
@click="onSort(col)"
|
41
|
+
) {{ col.label }}
|
42
|
+
|
43
|
+
template(#body="props")
|
44
|
+
q-tr(:key="`m_${props.row.id}`" :props="props")
|
45
|
+
q-td(auto-width)
|
46
|
+
q-btn(
|
47
|
+
size="sm"
|
48
|
+
color="primary"
|
49
|
+
round
|
50
|
+
dense
|
51
|
+
:icon="expanded.get(props.row.id) ? 'remove' : 'add'"
|
52
|
+
@click="toggleExpand(props.row.id)"
|
53
|
+
)
|
54
|
+
q-td {{props.row.id}}
|
55
|
+
q-td {{ props.row.amount }}
|
56
|
+
q-td
|
57
|
+
q-badge(v-if="props.row.type === 'registration'" color="teal") регистрационный
|
58
|
+
q-badge(v-else color="teal") паевой
|
59
|
+
|
60
|
+
q-td(style="max-width: 150px; word-wrap: break-word; white-space: normal;") {{props.row.username}}
|
61
|
+
|
62
|
+
|
63
|
+
q-td
|
64
|
+
q-badge(v-if="props.row.status ==='COMPLETED'" color="teal") обработан
|
65
|
+
q-badge(v-if="props.row.status ==='PENDING'" color="orange") ожидание оплаты
|
66
|
+
q-badge(v-if="props.row.status ==='FAILED'" color="red") ошибка
|
67
|
+
q-badge(v-if="props.row.status ==='PAID'" color="orange") оплачен
|
68
|
+
q-badge(v-if="props.row.status ==='REFUNDED'" color="grey") отменён
|
69
|
+
q-badge(v-if="props.row.status ==='EXPIRED'" color="grey") истёк
|
70
|
+
q-td
|
71
|
+
SetOrderPaidStatusButton(
|
72
|
+
v-if="!hideActions && ['EXPIRED', 'PENDING', 'FAILED'].includes(props.row.status)"
|
73
|
+
:id="props.row.id"
|
74
|
+
)
|
75
|
+
span(v-else-if="!hideActions").text-grey нет доступных действий
|
76
|
+
|
77
|
+
q-tr(v-if="expanded.get(props.row.id)" :key="`e_${props.row.id}`" :props="props" class="q-virtual-scroll--with-prev")
|
78
|
+
q-td(colspan="100%")
|
79
|
+
div(v-if="props.row.status=='FAILED'")
|
80
|
+
span Причина ошибки: {{props.row.message ?? 'нет дополнительной информации'}}
|
81
|
+
div(v-else)
|
82
|
+
span нет дополнительной информации
|
83
|
+
</template>
|
84
|
+
<script setup lang="ts">
|
85
|
+
import { onMounted, ref, computed, reactive, nextTick } from 'vue'
|
86
|
+
import { Notify } from 'quasar'
|
87
|
+
import { usePaymentStore } from 'src/entities/Payment/model';
|
88
|
+
import { SetOrderPaidStatusButton } from 'src/features/Payment/SetStatus/ui/SetOrderPaidStatusButton';
|
89
|
+
import PaymentCard from './PaymentCard.vue';
|
90
|
+
import { useWindowSize } from 'src/shared/hooks';
|
91
|
+
|
92
|
+
const paymentStore = usePaymentStore()
|
93
|
+
const payments = computed(() => paymentStore.payments)
|
94
|
+
const onLoading = ref(false)
|
95
|
+
const nextPage = ref(1)
|
96
|
+
const lastPage = ref(1);
|
97
|
+
const { isMobile } = useWindowSize()
|
98
|
+
|
99
|
+
const sortState = reactive({
|
100
|
+
sortBy: '',
|
101
|
+
sortDir: ''
|
102
|
+
})
|
103
|
+
|
104
|
+
const onSort = (col) => {
|
105
|
+
if (!col.sortable) return
|
106
|
+
|
107
|
+
// Меняем направление сортировки, если кликнули на тот же столбец
|
108
|
+
if (sortState.sortBy === col.name) {
|
109
|
+
sortState.sortDir = sortState.sortDir === 'asc' ? 'desc' : 'asc'
|
110
|
+
} else {
|
111
|
+
// Если сортируем новый столбец, сбрасываем на 'asc'
|
112
|
+
sortState.sortBy = col.name
|
113
|
+
sortState.sortDir = 'asc'
|
114
|
+
}
|
115
|
+
paymentStore.clear()
|
116
|
+
nextPage.value = 1
|
117
|
+
lastPage.value = 1
|
118
|
+
loadPayments(1) // Перезагружаем с новыми параметрами сортировки
|
119
|
+
}
|
120
|
+
|
121
|
+
const props = defineProps({
|
122
|
+
username: {
|
123
|
+
type: String,
|
124
|
+
required: false,
|
125
|
+
default: null
|
126
|
+
},
|
127
|
+
hideActions: {
|
128
|
+
type: Boolean,
|
129
|
+
default: false
|
130
|
+
}
|
131
|
+
})
|
132
|
+
|
133
|
+
const loadPayments = async (page = 1) => {
|
134
|
+
try {
|
135
|
+
onLoading.value = true
|
136
|
+
|
137
|
+
// Данные для фильтрации
|
138
|
+
const data = props.username ? { username: props.username } : undefined;
|
139
|
+
|
140
|
+
// Опции пагинации и сортировки
|
141
|
+
const options = {
|
142
|
+
page,
|
143
|
+
limit: 25,
|
144
|
+
sortBy: sortState.sortBy || undefined,
|
145
|
+
sortOrder: sortState.sortDir ? sortState.sortDir.toUpperCase() as 'ASC' | 'DESC' : 'ASC'
|
146
|
+
};
|
147
|
+
|
148
|
+
await paymentStore.loadPayments(data, options);
|
149
|
+
|
150
|
+
if (payments.value) {
|
151
|
+
lastPage.value = payments.value.totalPages || 1
|
152
|
+
}
|
153
|
+
|
154
|
+
onLoading.value = false
|
155
|
+
} catch (e: any) {
|
156
|
+
onLoading.value = false
|
157
|
+
console.log(e)
|
158
|
+
Notify.create({
|
159
|
+
message: e.message,
|
160
|
+
type: 'negative',
|
161
|
+
})
|
162
|
+
}
|
163
|
+
}
|
164
|
+
|
165
|
+
// Функция обработки виртуального скролла
|
166
|
+
const onScroll = ({ to, ref }) => {
|
167
|
+
if(payments.value) {
|
168
|
+
const lastIndex = payments.value.items.length - 1
|
169
|
+
|
170
|
+
if (onLoading.value !== true && nextPage.value < lastPage.value && to === lastIndex) {
|
171
|
+
onLoading.value = true
|
172
|
+
|
173
|
+
setTimeout(() => {
|
174
|
+
nextPage.value++
|
175
|
+
loadPayments(nextPage.value) // Загружаем следующую страницу
|
176
|
+
|
177
|
+
nextTick(() => {
|
178
|
+
ref.refresh() // Обновляем виртуальный скролл после загрузки
|
179
|
+
onLoading.value = false
|
180
|
+
})
|
181
|
+
}, 500) // Имитируем задержку загрузки
|
182
|
+
}
|
183
|
+
}
|
184
|
+
}
|
185
|
+
|
186
|
+
onMounted(() => {
|
187
|
+
paymentStore.clear()
|
188
|
+
loadPayments()
|
189
|
+
})
|
190
|
+
|
191
|
+
|
192
|
+
const columns: any[] = [
|
193
|
+
{ name: 'id', align: 'left', label: '№', field: 'id', sortable: true },
|
194
|
+
{ name: 'amount', align: 'left', label: 'Сумма', field: 'amount', sortable: true },
|
195
|
+
{ name: 'type', align: 'left', label: 'Тип платежа', field: '', sortable: false },
|
196
|
+
{ name: 'username', align: 'left', label: 'От кого', field: 'username', sortable: true },
|
197
|
+
{ name: 'status', align: 'left', label: 'Статус', field: 'status', sortable: true },
|
198
|
+
{ name: 'actions', align: 'left', label: '', field: '', sortable: false, hide: props.hideActions },
|
199
|
+
] as any
|
200
|
+
|
201
|
+
const expanded = reactive(new Map()) // Используем Map для отслеживания состояния развертывания каждой записи
|
202
|
+
|
203
|
+
// Функция для переключения состояния развертывания
|
204
|
+
const toggleExpand = (id: any) => {
|
205
|
+
expanded.set(id, !expanded.get(id))
|
206
|
+
}
|
207
|
+
|
208
|
+
const tableRef = ref(null)
|
209
|
+
const pagination = ref({ rowsPerPage: 0 })
|
210
|
+
</script>
|
211
|
+
|
212
|
+
<style>
|
213
|
+
.q-list--dense > .q-item, .q-item--dense {
|
214
|
+
padding: 0px !important;
|
215
|
+
}
|
216
|
+
</style>
|