@coopenomics/desktop 2.2.9 → 2025.4.29
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/CHANGELOG.md +11 -0
- package/Dockerfile +12 -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 +6 -5
- package/quasar.config.cjs +5 -12
- 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/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 +1 -2
- package/src/desktops/index.ts +0 -6
- package/src/entities/Account/api/index.ts +11 -2
- package/src/entities/Account/model/index.ts +1 -1
- package/src/entities/Account/model/store.ts +15 -5
- package/src/entities/Account/types/index.ts +9 -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 +5 -6
- 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/features/Account/UpdateAccount/api/index.ts +14 -0
- package/src/features/Account/UpdateAccount/index.ts +1 -0
- package/src/features/Account/UpdateAccount/model/index.ts +16 -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 -104
- 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 +3 -5
- package/src/features/Request/CreateParentOffer/ui/ImageUploaderWithPreview/ImageUploaderWithPreview.vue +4 -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 +4 -5
- package/src/features/Union/AddCooperative/ui/AddCooperativeForm.vue +5 -6
- package/src/features/User/AddUser/ui/AddUserDialog/AddUserDialog.vue +7 -4
- package/src/features/User/LoginUser/model/index.ts +3 -3
- package/src/features/User/LoginUser/ui/LoginForm/LoginForm.vue +0 -6
- package/src/features/User/Logout/model/index.ts +5 -3
- package/src/features/Wallet/DepositToWallet/ui/DepositButton/DepositButton.vue +8 -7
- package/src/features/Wallet/WithdrawFromWallet/ui/withdrawButton.vue +6 -7
- 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} +10 -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/{ListOfBranches/ui/ListOfBranchesPage.vue → MemberBranchList/ui/MemberBranchListPage.vue} +2 -4
- 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 +35 -20
- 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 +2 -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 +4 -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 +4 -5
- package/src/shared/api/client.ts +3 -4
- package/src/shared/api/eosio.ts +1 -2
- package/src/shared/api/utils.ts +1 -3
- package/src/shared/config/index.ts +0 -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/composables/useEditableData.ts +1 -1
- 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/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/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 +171 -0
- package/src/shared/ui/EditableEntrepreneurCard/index.ts +1 -0
- package/src/{widgets/IndividualCard/ui/IndividualCard.vue → shared/ui/EditableIndividualCard/EditableIndividualCard.vue} +101 -68
- package/src/shared/ui/EditableIndividualCard/index.ts +1 -0
- package/src/shared/ui/EditableOrganizationCard/EditableOrganizationCard.vue +225 -0
- package/src/shared/ui/EditableOrganizationCard/index.ts +1 -0
- 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/UserDataForm/OrganizationDataForm/OrganizationDataForm.vue +1 -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 +87 -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 +1 -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/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 -45
- 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 -328
- 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 -103
- 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/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/{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
@@ -0,0 +1,25 @@
|
|
1
|
+
import type { Router } from 'vue-router'
|
2
|
+
import { useDesktopStore } from 'src/entities/Desktop/model'
|
3
|
+
|
4
|
+
export async function useInitExtensionsProcess(router: Router) {
|
5
|
+
const store = useDesktopStore()
|
6
|
+
// Загружаем все модули расширений
|
7
|
+
const modules = import.meta.glob('../../../extensions/**/install.{ts,js}')
|
8
|
+
|
9
|
+
for (const path in modules) {
|
10
|
+
const mod = await modules[path]()
|
11
|
+
if (mod?.default) {
|
12
|
+
// Ожидаем, что расширение возвращает объект { workspace, routes }
|
13
|
+
const result = await mod.default()
|
14
|
+
if (result?.workspace && result?.routes?.length) {
|
15
|
+
// Записываем маршруты в соответствующий workspace
|
16
|
+
store.setRoutes(result.workspace, result.routes)
|
17
|
+
// Регистрируем маршруты в router, добавляя их в базовый родительский маршрут (например, "base")
|
18
|
+
const baseRoute = router.getRoutes().find(r => r.name === 'base')
|
19
|
+
if (baseRoute) {
|
20
|
+
result.routes.forEach((r: any) => router.addRoute('base', r))
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
// processes/init-wallet/index.ts
|
2
|
+
import { useSessionStore } from 'src/entities/Session'
|
3
|
+
import { useCurrentUserStore } from 'src/entities/User'
|
4
|
+
import { useWalletStore } from 'src/entities/Wallet'
|
5
|
+
import { useSystemStore } from 'src/entities/System/model'
|
6
|
+
import { useAccountStore } from 'src/entities/Account/model'
|
7
|
+
|
8
|
+
export function useInitWalletProcess() {
|
9
|
+
const session = useSessionStore()
|
10
|
+
const user = useCurrentUserStore()
|
11
|
+
const wallet = useWalletStore()
|
12
|
+
const { info } = useSystemStore()
|
13
|
+
const account = useAccountStore()
|
14
|
+
|
15
|
+
const run = async () => {
|
16
|
+
await session.init()
|
17
|
+
|
18
|
+
if (!session.isAuth) return
|
19
|
+
|
20
|
+
try {
|
21
|
+
await account.getAccount(session.username)
|
22
|
+
|
23
|
+
await user.loadProfile(session.username, info.coopname)
|
24
|
+
|
25
|
+
await wallet.loadUserWallet({
|
26
|
+
coopname: info.coopname,
|
27
|
+
username: session.username,
|
28
|
+
})
|
29
|
+
|
30
|
+
session.loadComplete = true
|
31
|
+
} catch (e) {
|
32
|
+
console.error(e)
|
33
|
+
}
|
34
|
+
|
35
|
+
// фоновая проверка каждые 10 сек
|
36
|
+
setTimeout(run, 10_000)
|
37
|
+
}
|
38
|
+
|
39
|
+
return { run }
|
40
|
+
}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { Router } from 'vue-router'
|
2
|
+
import { useSessionStore } from 'src/entities/Session'
|
3
|
+
import { useCurrentUserStore } from 'src/entities/User'
|
4
|
+
import { useDesktopStore } from 'src/entities/Desktop/model'
|
5
|
+
import { useSystemStore } from 'src/entities/System/model'
|
6
|
+
|
7
|
+
function hasAccess(to, userAccount) {
|
8
|
+
if (!to.meta?.roles || to.meta?.roles.length === 0) return true
|
9
|
+
return userAccount && to.meta?.roles.includes(userAccount.role)
|
10
|
+
}
|
11
|
+
|
12
|
+
export function setupNavigationGuard(router: Router) {
|
13
|
+
const desktops = useDesktopStore()
|
14
|
+
const session = useSessionStore()
|
15
|
+
const currentUser = useCurrentUserStore()
|
16
|
+
const { info } = useSystemStore()
|
17
|
+
|
18
|
+
router.beforeEach(async (to, from, next) => {
|
19
|
+
await desktops.healthCheck()
|
20
|
+
|
21
|
+
// если требуется установка
|
22
|
+
if (desktops.health?.status === 'install' && to.name !== 'install') {
|
23
|
+
next({ name: 'install', params: { coopname: info.coopname } })
|
24
|
+
return
|
25
|
+
}
|
26
|
+
|
27
|
+
// редирект с index
|
28
|
+
if (to.name === 'index') {
|
29
|
+
const homePage =
|
30
|
+
session.isAuth && currentUser.isRegistrationComplete
|
31
|
+
? desktops.currentDesktop?.authorizedHome
|
32
|
+
: desktops.currentDesktop?.nonAuthorizedHome
|
33
|
+
|
34
|
+
next({ name: homePage, params: { coopname: info.coopname } })
|
35
|
+
return
|
36
|
+
}
|
37
|
+
|
38
|
+
// проверка по ролям
|
39
|
+
if (hasAccess(to, currentUser.userAccount)) {
|
40
|
+
next()
|
41
|
+
} else {
|
42
|
+
next({ name: 'permissionDenied' })
|
43
|
+
}
|
44
|
+
})
|
45
|
+
}
|
@@ -0,0 +1,275 @@
|
|
1
|
+
import { Cooperative, SovietContract } from 'cooptypes'
|
2
|
+
import { useGenerateFreeDecision } from 'src/features/FreeDecision/GenerateDecision'
|
3
|
+
import { useGenerateParticipantApplicationDecision } from 'src/features/Decision/ParticipantApplication'
|
4
|
+
import { useGenerateSovietDecisionOnAnnualMeet } from 'src/features/Meet/GenerateSovietDecision/model'
|
5
|
+
import { useSystemStore } from 'src/entities/System/model'
|
6
|
+
import { useSessionStore } from 'src/entities/Session'
|
7
|
+
import { useGlobalStore } from 'src/shared/store'
|
8
|
+
import { useVoteForDecision } from 'src/features/Decision/VoteForDecision'
|
9
|
+
import { useVoteAgainstDecision } from 'src/features/Decision/VoteAgainstDecision'
|
10
|
+
import { computed } from 'vue'
|
11
|
+
import { useAgendaStore } from 'src/entities/Agenda/model'
|
12
|
+
import type { IAgenda } from 'src/entities/Agenda/model'
|
13
|
+
|
14
|
+
/**
|
15
|
+
* Процесс обработки решений
|
16
|
+
* Координирует работу различных фич для генерации и обработки решений различных типов
|
17
|
+
*/
|
18
|
+
export function useDecisionProcessor() {
|
19
|
+
const { info } = useSystemStore()
|
20
|
+
const session = useSessionStore()
|
21
|
+
const agendaStore = useAgendaStore()
|
22
|
+
|
23
|
+
// Данные повестки и состояние загрузки
|
24
|
+
const decisions = computed(() => agendaStore.agenda)
|
25
|
+
const loading = computed(() => agendaStore.loading)
|
26
|
+
|
27
|
+
/**
|
28
|
+
* Форматирует заголовок вопроса
|
29
|
+
*/
|
30
|
+
function formatDecisionTitle(title: string, user: any) {
|
31
|
+
let result = 'Вопрос на голосование'
|
32
|
+
|
33
|
+
if (user.first_name) {
|
34
|
+
result = `${title} от ${user.last_name} ${user.first_name} ${user.middle_name}`
|
35
|
+
} else {
|
36
|
+
result = `${title} от ${user.short_name}`
|
37
|
+
}
|
38
|
+
|
39
|
+
return result
|
40
|
+
}
|
41
|
+
|
42
|
+
/**
|
43
|
+
* Получает заголовок документа из агрегата
|
44
|
+
*/
|
45
|
+
function getDocumentTitle(row: IAgenda) {
|
46
|
+
// Используем только агрегаты документов
|
47
|
+
if (row.documents?.statement?.documentAggregate?.rawDocument?.full_title) {
|
48
|
+
return row.documents.statement.documentAggregate.rawDocument.full_title
|
49
|
+
}
|
50
|
+
|
51
|
+
if (row.documents?.decision?.documentAggregate?.rawDocument?.full_title) {
|
52
|
+
return row.documents.decision.documentAggregate.rawDocument.full_title
|
53
|
+
}
|
54
|
+
|
55
|
+
// Поддержка исходного формата для таблицы
|
56
|
+
if (row.table?.statement?.meta && typeof row.table.statement.meta === 'string') {
|
57
|
+
try {
|
58
|
+
const meta = JSON.parse(row.table.statement.meta)
|
59
|
+
if (meta.title) return meta.title
|
60
|
+
} catch (e) {
|
61
|
+
// Игнорируем ошибку парсинга JSON
|
62
|
+
}
|
63
|
+
}
|
64
|
+
|
65
|
+
return 'Вопрос без заголовка'
|
66
|
+
}
|
67
|
+
|
68
|
+
/**
|
69
|
+
* Загружает список вопросов на повестке
|
70
|
+
*/
|
71
|
+
async function loadDecisions(coopname: string, hidden = false) {
|
72
|
+
try {
|
73
|
+
const result = await agendaStore.loadAgenda({ coopname }, hidden)
|
74
|
+
return result
|
75
|
+
} catch (error) {
|
76
|
+
throw error
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
/**
|
81
|
+
* Получает хеш документа из агрегата
|
82
|
+
*/
|
83
|
+
function getDocumentHash(row: IAgenda) {
|
84
|
+
// Используем только агрегаты документов
|
85
|
+
if (row.documents?.statement?.documentAggregate?.rawDocument?.hash) {
|
86
|
+
return row.documents.statement.documentAggregate.rawDocument.hash
|
87
|
+
}
|
88
|
+
|
89
|
+
if (row.documents?.decision?.documentAggregate?.rawDocument?.hash) {
|
90
|
+
return row.documents.decision.documentAggregate.rawDocument.hash
|
91
|
+
}
|
92
|
+
|
93
|
+
// Поддержка исходного формата для таблицы
|
94
|
+
if (row.table?.statement?.hash) {
|
95
|
+
return row.table.statement.hash
|
96
|
+
}
|
97
|
+
|
98
|
+
return null
|
99
|
+
}
|
100
|
+
|
101
|
+
/**
|
102
|
+
* Генерирует документ решения в зависимости от его типа
|
103
|
+
*/
|
104
|
+
async function generateDecisionDocument(row: IAgenda) {
|
105
|
+
if (!row.table?.id || !row.table?.username || !row.table?.type) {
|
106
|
+
throw new Error('Некорректные данные решения')
|
107
|
+
}
|
108
|
+
|
109
|
+
const decision_id = Number(row.table.id)
|
110
|
+
const username = row.table.username
|
111
|
+
const type = row.table.type
|
112
|
+
const registry_id = Cooperative.Document.decisionsRegistry[type]
|
113
|
+
|
114
|
+
// Генерация документа в зависимости от типа решения
|
115
|
+
let document
|
116
|
+
|
117
|
+
if (registry_id === Cooperative.Registry.FreeDecision.registry_id) {
|
118
|
+
const unparsedDocumentMeta = row.table.statement.meta == '' ? '{}' : row.table.statement.meta
|
119
|
+
const parsedDocumentMeta = JSON.parse(unparsedDocumentMeta) as Cooperative.Registry.FreeDecision.Action
|
120
|
+
const project_id = parsedDocumentMeta.project_id
|
121
|
+
|
122
|
+
const { generateFreeDecision } = useGenerateFreeDecision()
|
123
|
+
document = await generateFreeDecision({
|
124
|
+
username: username,
|
125
|
+
decision_id: decision_id,
|
126
|
+
project_id: project_id
|
127
|
+
})
|
128
|
+
}
|
129
|
+
else if (registry_id === Cooperative.Registry.DecisionOfParticipantApplication.registry_id) {
|
130
|
+
const { generateParticipantApplicationDecision } = useGenerateParticipantApplicationDecision()
|
131
|
+
document = await generateParticipantApplicationDecision({
|
132
|
+
username: username,
|
133
|
+
decision_id: decision_id
|
134
|
+
})
|
135
|
+
}
|
136
|
+
else if (registry_id === Cooperative.Registry.AnnualGeneralMeetingSovietDecision.registry_id) {
|
137
|
+
const { generateSovietDecisionOnAnnualMeet } = useGenerateSovietDecisionOnAnnualMeet()
|
138
|
+
document = await generateSovietDecisionOnAnnualMeet({
|
139
|
+
username: username,
|
140
|
+
})
|
141
|
+
}
|
142
|
+
else {
|
143
|
+
throw new Error('Неизвестный тип решения')
|
144
|
+
}
|
145
|
+
|
146
|
+
if (!document) {
|
147
|
+
throw new Error('Ошибка при генерации документа решения')
|
148
|
+
}
|
149
|
+
|
150
|
+
return document
|
151
|
+
}
|
152
|
+
|
153
|
+
/**
|
154
|
+
* Авторизует и выполняет решение
|
155
|
+
*/
|
156
|
+
async function authorizeAndExecuteDecision(row: IAgenda) {
|
157
|
+
if (!row.table?.id) {
|
158
|
+
throw new Error('Некорректные данные решения')
|
159
|
+
}
|
160
|
+
|
161
|
+
const decision_id = Number(row.table.id)
|
162
|
+
|
163
|
+
// Генерируем документ решения
|
164
|
+
const document = await generateDecisionDocument(row)
|
165
|
+
|
166
|
+
// Подписываем документ
|
167
|
+
const signed_hash_of_document = useGlobalStore().signDigest(document.hash)
|
168
|
+
const chainDocument: Cooperative.Document.IChainDocument = {
|
169
|
+
hash: document.hash,
|
170
|
+
meta: JSON.stringify(document.meta),
|
171
|
+
signature: signed_hash_of_document.signature,
|
172
|
+
public_key: signed_hash_of_document.public_key,
|
173
|
+
}
|
174
|
+
|
175
|
+
// Подготавливаем данные для транзакций
|
176
|
+
const authorizeData: SovietContract.Actions.Decisions.Authorize.IAuthorize = {
|
177
|
+
coopname: info.coopname,
|
178
|
+
chairman: session.username,
|
179
|
+
decision_id,
|
180
|
+
document: chainDocument,
|
181
|
+
}
|
182
|
+
|
183
|
+
const execData: SovietContract.Actions.Decisions.Exec.IExec = {
|
184
|
+
executer: session.username,
|
185
|
+
coopname: info.coopname,
|
186
|
+
decision_id: decision_id,
|
187
|
+
}
|
188
|
+
|
189
|
+
// Выполняем транзакции
|
190
|
+
await useGlobalStore().transact([
|
191
|
+
{
|
192
|
+
account: SovietContract.contractName.production,
|
193
|
+
name: SovietContract.Actions.Decisions.Authorize.actionName,
|
194
|
+
authorization: [
|
195
|
+
{
|
196
|
+
actor: session.username,
|
197
|
+
permission: 'active',
|
198
|
+
},
|
199
|
+
],
|
200
|
+
data: authorizeData,
|
201
|
+
},
|
202
|
+
{
|
203
|
+
account: SovietContract.contractName.production,
|
204
|
+
name: SovietContract.Actions.Decisions.Exec.actionName,
|
205
|
+
authorization: [
|
206
|
+
{
|
207
|
+
actor: session.username,
|
208
|
+
permission: 'active',
|
209
|
+
},
|
210
|
+
],
|
211
|
+
data: execData,
|
212
|
+
},
|
213
|
+
])
|
214
|
+
|
215
|
+
return true
|
216
|
+
}
|
217
|
+
|
218
|
+
/**
|
219
|
+
* Голосовать "за" решение
|
220
|
+
*/
|
221
|
+
async function voteForDecision(decision_id: number) {
|
222
|
+
const { voteForDecision: vote } = useVoteForDecision()
|
223
|
+
await vote(decision_id)
|
224
|
+
return true
|
225
|
+
}
|
226
|
+
|
227
|
+
/**
|
228
|
+
* Голосовать "против" решения
|
229
|
+
*/
|
230
|
+
async function voteAgainstDecision(decision_id: number) {
|
231
|
+
await useVoteAgainstDecision().voteAgainstDecision({
|
232
|
+
coopname: info.coopname,
|
233
|
+
member: session.username,
|
234
|
+
decision_id,
|
235
|
+
})
|
236
|
+
return true
|
237
|
+
}
|
238
|
+
|
239
|
+
/**
|
240
|
+
* Проверяет, проголосовал ли текущий пользователь "за" решение
|
241
|
+
*/
|
242
|
+
function isVotedFor(decision: SovietContract.Tables.Decisions.IDecision) {
|
243
|
+
return decision.votes_for.includes(session.username)
|
244
|
+
}
|
245
|
+
|
246
|
+
/**
|
247
|
+
* Проверяет, проголосовал ли текущий пользователь "против" решения
|
248
|
+
*/
|
249
|
+
function isVotedAgainst(decision: SovietContract.Tables.Decisions.IDecision) {
|
250
|
+
return decision.votes_against.includes(session.username)
|
251
|
+
}
|
252
|
+
|
253
|
+
/**
|
254
|
+
* Проверяет, проголосовал ли текущий пользователь за решение каким-либо образом
|
255
|
+
*/
|
256
|
+
function isVotedAny(decision: SovietContract.Tables.Decisions.IDecision) {
|
257
|
+
return isVotedAgainst(decision) || isVotedFor(decision)
|
258
|
+
}
|
259
|
+
|
260
|
+
return {
|
261
|
+
decisions,
|
262
|
+
loading,
|
263
|
+
loadDecisions,
|
264
|
+
generateDecisionDocument,
|
265
|
+
authorizeAndExecuteDecision,
|
266
|
+
voteForDecision,
|
267
|
+
voteAgainstDecision,
|
268
|
+
isVotedFor,
|
269
|
+
isVotedAgainst,
|
270
|
+
isVotedAny,
|
271
|
+
formatDecisionTitle,
|
272
|
+
getDocumentTitle,
|
273
|
+
getDocumentHash
|
274
|
+
}
|
275
|
+
}
|
@@ -0,0 +1,80 @@
|
|
1
|
+
import { computed, ref } from 'vue'
|
2
|
+
import { useSelectBranch } from 'src/features/Branch/SelectBranch'
|
3
|
+
import { useSystemStore } from 'src/entities/System/model'
|
4
|
+
import { useSessionStore } from 'src/entities/Session'
|
5
|
+
import { useBranchStore } from 'src/entities/Branch/model'
|
6
|
+
import { DigitalDocument } from 'src/shared/lib/document'
|
7
|
+
import { SuccessAlert, FailAlert } from 'src/shared/api'
|
8
|
+
import { Cooperative } from 'cooptypes'
|
9
|
+
|
10
|
+
export function useSelectBranchProcess() {
|
11
|
+
const title = ref('Выберите кооперативный участок')
|
12
|
+
const step = ref(1)
|
13
|
+
const isSubmitting = ref(false)
|
14
|
+
const isLoading = ref(false)
|
15
|
+
const selectedBranch = ref('')
|
16
|
+
const document = ref()
|
17
|
+
|
18
|
+
const digitalDocument = new DigitalDocument()
|
19
|
+
|
20
|
+
const system = useSystemStore()
|
21
|
+
const session = useSessionStore()
|
22
|
+
const branchStore = useBranchStore()
|
23
|
+
const { selectBranch } = useSelectBranch()
|
24
|
+
|
25
|
+
const branches = computed(() => branchStore.publicBranches)
|
26
|
+
|
27
|
+
if (session.isAuth) {
|
28
|
+
branchStore.loadPublicBranches({ coopname: system.info.coopname })
|
29
|
+
}
|
30
|
+
|
31
|
+
const next = async () => {
|
32
|
+
isLoading.value = true
|
33
|
+
document.value = await digitalDocument.generate<Cooperative.Registry.SelectBranchStatement.Action>({
|
34
|
+
registry_id: Cooperative.Registry.SelectBranchStatement.registry_id,
|
35
|
+
coopname: system.info.coopname,
|
36
|
+
username: session.username,
|
37
|
+
braname: selectedBranch.value,
|
38
|
+
})
|
39
|
+
isLoading.value = false
|
40
|
+
step.value++
|
41
|
+
}
|
42
|
+
|
43
|
+
const back = () => {
|
44
|
+
step.value--
|
45
|
+
}
|
46
|
+
|
47
|
+
const sign = async () => {
|
48
|
+
try {
|
49
|
+
isSubmitting.value = true
|
50
|
+
const doc = await digitalDocument.sign()
|
51
|
+
|
52
|
+
await selectBranch({
|
53
|
+
braname: selectedBranch.value,
|
54
|
+
coopname: system.info.coopname,
|
55
|
+
document: doc,
|
56
|
+
username: session.username,
|
57
|
+
})
|
58
|
+
|
59
|
+
useSelectBranch().isVisible.value = false
|
60
|
+
SuccessAlert('Кооперативный участок выбран')
|
61
|
+
} catch (e: any) {
|
62
|
+
FailAlert(e)
|
63
|
+
} finally {
|
64
|
+
isSubmitting.value = false
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
return {
|
69
|
+
title,
|
70
|
+
step,
|
71
|
+
selectedBranch,
|
72
|
+
branches,
|
73
|
+
document,
|
74
|
+
isSubmitting,
|
75
|
+
isLoading,
|
76
|
+
next,
|
77
|
+
back,
|
78
|
+
sign,
|
79
|
+
}
|
80
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { watch } from 'vue'
|
2
|
+
import { useAccountStore } from 'src/entities/Account/model'
|
3
|
+
import { useSessionStore } from 'src/entities/Session'
|
4
|
+
import { useSystemStore } from 'src/entities/System/model'
|
5
|
+
import { useSelectBranch } from 'src/features/Branch/SelectBranch/model'
|
6
|
+
|
7
|
+
export function useBranchOverlayProcess() {
|
8
|
+
const session = useSessionStore()
|
9
|
+
const system = useSystemStore()
|
10
|
+
const account = useAccountStore()
|
11
|
+
const { isVisible } = useSelectBranch()
|
12
|
+
|
13
|
+
const checkConditions = () => {
|
14
|
+
const branched = system.info?.cooperator_account?.is_branched
|
15
|
+
const participant = account?.account?.participant_account
|
16
|
+
const noBraname = participant?.braname === ''
|
17
|
+
|
18
|
+
// показываем оверлей выбора КУ, если
|
19
|
+
// пользователь - авторизован,
|
20
|
+
// кооператив - в мажоритарном режиме (branched),
|
21
|
+
// пользователь - это пайщик,
|
22
|
+
// и у пользователя не выбран КУ
|
23
|
+
isVisible.value = !!(
|
24
|
+
session.isAuth &&
|
25
|
+
branched &&
|
26
|
+
participant &&
|
27
|
+
noBraname
|
28
|
+
)
|
29
|
+
}
|
30
|
+
|
31
|
+
checkConditions()
|
32
|
+
|
33
|
+
watch(
|
34
|
+
[() => session.isAuth, () => system.info, () => account.account],
|
35
|
+
checkConditions,
|
36
|
+
{ deep: true }
|
37
|
+
)
|
38
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
// processes/watch-desktop-health/index.ts
|
2
|
+
import { watch } from 'vue'
|
3
|
+
import { QSpinnerGears, useQuasar } from 'quasar'
|
4
|
+
import { useDesktopStore } from 'src/entities/Desktop/model'
|
5
|
+
|
6
|
+
export function useDesktopHealthWatcherProcess() {
|
7
|
+
const $q = useQuasar()
|
8
|
+
const desktop = useDesktopStore()
|
9
|
+
|
10
|
+
const enableLoading = () => {
|
11
|
+
$q.loading.show({
|
12
|
+
spinner: QSpinnerGears,
|
13
|
+
message: 'Техническое обслуживание..',
|
14
|
+
spinnerSize: 50,
|
15
|
+
})
|
16
|
+
}
|
17
|
+
|
18
|
+
const disableLoading = () => {
|
19
|
+
$q.loading.hide()
|
20
|
+
}
|
21
|
+
|
22
|
+
const check = () => {
|
23
|
+
if (desktop.online === false) {
|
24
|
+
enableLoading()
|
25
|
+
} else {
|
26
|
+
disableLoading()
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
check()
|
31
|
+
|
32
|
+
watch(() => desktop.online, check)
|
33
|
+
}
|
package/src/shared/api/alerts.ts
CHANGED
@@ -11,7 +11,8 @@ export function SuccessAlert(message: string): void {
|
|
11
11
|
})
|
12
12
|
}
|
13
13
|
|
14
|
-
export function FailAlert(
|
14
|
+
export function FailAlert(error: any): void{
|
15
|
+
const message = extractGraphQLErrorMessages(error)
|
15
16
|
Notify.create({
|
16
17
|
message,
|
17
18
|
type: 'negative',
|
@@ -20,8 +21,3 @@ export function FailAlert(message: string): void {
|
|
20
21
|
]
|
21
22
|
})
|
22
23
|
}
|
23
|
-
|
24
|
-
export function failAlert(error: any): void{
|
25
|
-
const message = extractGraphQLErrorMessages(error)
|
26
|
-
FailAlert(message)
|
27
|
-
}
|
package/src/shared/api/axios.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
import axios from 'axios';
|
2
|
-
import { BACKEND_URL } from '../config';
|
3
2
|
import { useGlobalStore } from '../store';
|
4
3
|
|
5
4
|
export async function sendGET(
|
@@ -14,7 +13,7 @@ export async function sendGET(
|
|
14
13
|
// if (!tokens || !tokens.access || !tokens.access.token)
|
15
14
|
// throw new Error('Ошибка авторизации: токен доступа не найден');
|
16
15
|
|
17
|
-
const response = await axios.get(BACKEND_URL + url, {
|
16
|
+
const response = await axios.get(process.env.BACKEND_URL + url, {
|
18
17
|
params,
|
19
18
|
headers: {
|
20
19
|
Authorization: `Bearer ${tokens?.access?.token}`,
|
@@ -22,7 +21,7 @@ export async function sendGET(
|
|
22
21
|
});
|
23
22
|
return response.data;
|
24
23
|
} else {
|
25
|
-
const response = await axios.get(BACKEND_URL + url, {
|
24
|
+
const response = await axios.get(process.env.BACKEND_URL + url, {
|
26
25
|
params,
|
27
26
|
});
|
28
27
|
return response.data;
|
@@ -50,14 +49,14 @@ export async function sendPOST(
|
|
50
49
|
// if (!tokens || !tokens.access || !tokens.access.token)
|
51
50
|
// throw new Error('Ошибка авторизации: токен доступа не найден');
|
52
51
|
|
53
|
-
const response = await axios.post(BACKEND_URL + url, data, {
|
52
|
+
const response = await axios.post(process.env.BACKEND_URL + url, data, {
|
54
53
|
headers: {
|
55
54
|
Authorization: `Bearer ${tokens?.access?.token}`,
|
56
55
|
},
|
57
56
|
});
|
58
57
|
return response.data;
|
59
58
|
} else {
|
60
|
-
const response = await axios.post(BACKEND_URL + url, data);
|
59
|
+
const response = await axios.post(process.env.BACKEND_URL + url, data);
|
61
60
|
return response.data;
|
62
61
|
}
|
63
62
|
} catch (e: any) {
|
package/src/shared/api/client.ts
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
import { Client } from '@coopenomics/sdk'
|
2
|
-
import { BACKEND_URL, CHAIN_ID, CHAIN_URL } from '../config'
|
3
2
|
|
4
3
|
// Создаем и экспортируем экземпляр API-клиента
|
5
4
|
export const client = Client.create({
|
6
|
-
api_url: BACKEND_URL + '/v1/graphql',
|
5
|
+
api_url: process.env.BACKEND_URL + '/v1/graphql',
|
7
6
|
headers: {
|
8
7
|
'Content-Type': 'application/json',
|
9
8
|
},
|
10
|
-
chain_url: CHAIN_URL,
|
11
|
-
chain_id: CHAIN_ID,
|
9
|
+
chain_url: process.env.CHAIN_URL as string,
|
10
|
+
chain_id: process.env.CHAIN_ID as string,
|
12
11
|
})
|
13
12
|
|
package/src/shared/api/eosio.ts
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
import { TransactResult } from '@wharfkit/session';
|
2
2
|
import { APIClient, PrivateKey } from '@wharfkit/antelope';
|
3
3
|
import { ContractKit } from '@wharfkit/contract';
|
4
|
-
import { CHAIN_URL } from '../config/Env';
|
5
4
|
import { useGlobalStore } from '../store';
|
6
5
|
import { Account } from '@wharfkit/account'
|
7
6
|
|
8
7
|
export const readBlockchain = new APIClient({
|
9
|
-
url: CHAIN_URL,
|
8
|
+
url: process.env.CHAIN_URL,
|
10
9
|
});
|
11
10
|
|
12
11
|
export const contractKit = new ContractKit({
|
package/src/shared/api/utils.ts
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
import type { Mutations } from '@coopenomics/sdk'
|
2
|
+
|
3
|
+
export type AgendaPoint = Mutations.Meet.CreateAnnualGeneralMeet.IInput['data']['agenda'][number]
|
4
|
+
|
5
|
+
export function useAgendaPoints(points: AgendaPoint[]) {
|
6
|
+
const addAgendaPoint = () => {
|
7
|
+
points.push({
|
8
|
+
title: '',
|
9
|
+
context: '',
|
10
|
+
decision: ''
|
11
|
+
})
|
12
|
+
}
|
13
|
+
|
14
|
+
const removeAgendaPoint = (index: number) => {
|
15
|
+
if (points.length > 1) {
|
16
|
+
points.splice(index, 1)
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
return {
|
21
|
+
addAgendaPoint,
|
22
|
+
removeAgendaPoint
|
23
|
+
}
|
24
|
+
}
|