@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
@@ -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,6 +1,6 @@
|
|
1
1
|
import axios from 'axios';
|
2
|
-
import { BACKEND_URL } from '../config';
|
3
2
|
import { useGlobalStore } from '../store';
|
3
|
+
import { env } from 'src/shared/config';
|
4
4
|
|
5
5
|
export async function sendGET(
|
6
6
|
url: string,
|
@@ -14,7 +14,7 @@ export async function sendGET(
|
|
14
14
|
// if (!tokens || !tokens.access || !tokens.access.token)
|
15
15
|
// throw new Error('Ошибка авторизации: токен доступа не найден');
|
16
16
|
|
17
|
-
const response = await axios.get(BACKEND_URL + url, {
|
17
|
+
const response = await axios.get(env.BACKEND_URL + url, {
|
18
18
|
params,
|
19
19
|
headers: {
|
20
20
|
Authorization: `Bearer ${tokens?.access?.token}`,
|
@@ -22,7 +22,7 @@ export async function sendGET(
|
|
22
22
|
});
|
23
23
|
return response.data;
|
24
24
|
} else {
|
25
|
-
const response = await axios.get(BACKEND_URL + url, {
|
25
|
+
const response = await axios.get(env.BACKEND_URL + url, {
|
26
26
|
params,
|
27
27
|
});
|
28
28
|
return response.data;
|
@@ -50,14 +50,14 @@ export async function sendPOST(
|
|
50
50
|
// if (!tokens || !tokens.access || !tokens.access.token)
|
51
51
|
// throw new Error('Ошибка авторизации: токен доступа не найден');
|
52
52
|
|
53
|
-
const response = await axios.post(BACKEND_URL + url, data, {
|
53
|
+
const response = await axios.post(env.BACKEND_URL + url, data, {
|
54
54
|
headers: {
|
55
55
|
Authorization: `Bearer ${tokens?.access?.token}`,
|
56
56
|
},
|
57
57
|
});
|
58
58
|
return response.data;
|
59
59
|
} else {
|
60
|
-
const response = await axios.post(BACKEND_URL + url, data);
|
60
|
+
const response = await axios.post(env.BACKEND_URL + url, data);
|
61
61
|
return response.data;
|
62
62
|
}
|
63
63
|
} catch (e: any) {
|
package/src/shared/api/client.ts
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
import { Client } from '@coopenomics/sdk'
|
2
|
-
import {
|
2
|
+
import { env } from 'src/shared/config'
|
3
3
|
|
4
4
|
// Создаем и экспортируем экземпляр API-клиента
|
5
5
|
export const client = Client.create({
|
6
|
-
api_url: BACKEND_URL + '/v1/graphql',
|
6
|
+
api_url: env.BACKEND_URL + '/v1/graphql',
|
7
7
|
headers: {
|
8
8
|
'Content-Type': 'application/json',
|
9
9
|
},
|
10
|
-
chain_url: CHAIN_URL,
|
11
|
-
chain_id: CHAIN_ID,
|
10
|
+
chain_url: env.CHAIN_URL as string,
|
11
|
+
chain_id: env.CHAIN_ID as string,
|
12
12
|
})
|
13
13
|
|
package/src/shared/api/eosio.ts
CHANGED
@@ -1,12 +1,12 @@
|
|
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'
|
6
|
+
import { env } from 'src/shared/config';
|
7
7
|
|
8
8
|
export const readBlockchain = new APIClient({
|
9
|
-
url: CHAIN_URL,
|
9
|
+
url: env.CHAIN_URL,
|
10
10
|
});
|
11
11
|
|
12
12
|
export const contractKit = new ContractKit({
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import { openDB } from 'idb';
|
2
|
+
import { env } from '../config';
|
2
3
|
|
3
4
|
async function openIndexedDB(dbName: string, storeName: string) {
|
5
|
+
|
4
6
|
if (!process.env.CLIENT) {
|
5
7
|
return;
|
6
8
|
}
|
@@ -21,6 +23,7 @@ export async function getFromIndexedDB(dbName: string, storeName: string, key: s
|
|
21
23
|
return;
|
22
24
|
}
|
23
25
|
|
26
|
+
|
24
27
|
const db = await openIndexedDB(dbName, storeName);
|
25
28
|
if (db) {
|
26
29
|
return db.get(storeName, key);
|
package/src/shared/api/utils.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
import {
|
1
|
+
import { env } from 'src/shared/config';
|
2
2
|
|
3
3
|
export function constructImageSrc(name: string): string {
|
4
4
|
if (name.startsWith('https://')) {
|
5
5
|
return name;
|
6
6
|
} else {
|
7
|
-
return STORAGE_URL + name;
|
7
|
+
return env.STORAGE_URL + name;
|
8
8
|
}
|
9
9
|
}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
// Типы для переменных окружения
|
2
|
+
export interface EnvVars {
|
3
|
+
NODE_ENV?: string;
|
4
|
+
BACKEND_URL?: string;
|
5
|
+
CHAIN_URL?: string;
|
6
|
+
CHAIN_ID?: string;
|
7
|
+
CURRENCY?: string;
|
8
|
+
COOP_SHORT_NAME?: string;
|
9
|
+
SITE_DESCRIPTION?: string;
|
10
|
+
SITE_IMAGE?: string;
|
11
|
+
STORAGE_URL?: string;
|
12
|
+
UPLOAD_URL?: string;
|
13
|
+
CLIENT?: boolean;
|
14
|
+
SERVER?: boolean;
|
15
|
+
VUE_ROUTER_MODE?: string;
|
16
|
+
VUE_ROUTER_BASE?: string;
|
17
|
+
[key: string]: string | boolean | undefined;
|
18
|
+
}
|
19
|
+
|
20
|
+
// Расширяем глобальный Window чтобы TypeScript понимал window.__ENV__
|
21
|
+
declare global {
|
22
|
+
interface Window {
|
23
|
+
__ENV__?: EnvVars;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
/**
|
28
|
+
* Определение переменных окружения для разных сред
|
29
|
+
* - На сервере (SSR): берем напрямую из process.env
|
30
|
+
* - На клиенте (SSR): используем window.__ENV__, инжектированные с сервера
|
31
|
+
* - В SPA режиме: переменные заменяются при сборке
|
32
|
+
*/
|
33
|
+
function getEnv(): EnvVars {
|
34
|
+
// SSR сервер или SPA сборка
|
35
|
+
|
36
|
+
if (typeof process !== 'undefined' && process.env) {
|
37
|
+
// Для SSR сервера - берем реальные переменные
|
38
|
+
// Для SPA - эти значения заменятся при сборке
|
39
|
+
return {
|
40
|
+
NODE_ENV: process.env.NODE_ENV,
|
41
|
+
BACKEND_URL: process.env.BACKEND_URL,
|
42
|
+
CHAIN_URL: process.env.CHAIN_URL,
|
43
|
+
CHAIN_ID: process.env.CHAIN_ID,
|
44
|
+
CURRENCY: process.env.CURRENCY,
|
45
|
+
COOP_SHORT_NAME: process.env.COOP_SHORT_NAME,
|
46
|
+
SITE_DESCRIPTION: process.env.SITE_DESCRIPTION,
|
47
|
+
SITE_IMAGE: process.env.SITE_IMAGE,
|
48
|
+
STORAGE_URL: process.env.STORAGE_URL,
|
49
|
+
UPLOAD_URL: process.env.UPLOAD_URL,
|
50
|
+
CLIENT: process.env.CLIENT as unknown as boolean,
|
51
|
+
SERVER: process.env.SERVER as unknown as boolean,
|
52
|
+
VUE_ROUTER_MODE: process.env.VUE_ROUTER_MODE,
|
53
|
+
VUE_ROUTER_BASE: process.env.VUE_ROUTER_BASE
|
54
|
+
};
|
55
|
+
}
|
56
|
+
|
57
|
+
// SSR клиент - берем из window.__ENV__
|
58
|
+
if (typeof window !== 'undefined' && window.__ENV__) {
|
59
|
+
return window.__ENV__;
|
60
|
+
}
|
61
|
+
|
62
|
+
// Запасной вариант, если ничего не сработало
|
63
|
+
console.warn('Не удалось получить переменные окружения!');
|
64
|
+
return {};
|
65
|
+
}
|
66
|
+
|
67
|
+
// Экспортируем переменные окружения
|
68
|
+
export const env: EnvVars = getEnv();
|
@@ -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
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { computed } from 'vue'
|
2
|
+
import { useWindowSize as vueWindowSize } from 'vue-window-size'
|
3
|
+
|
4
|
+
export const useWindowSize = () => {
|
5
|
+
const { width } = vueWindowSize()
|
6
|
+
|
7
|
+
const isMobile = computed(() => width.value < 768)
|
8
|
+
|
9
|
+
return {
|
10
|
+
width,
|
11
|
+
isMobile
|
12
|
+
}
|
13
|
+
}
|