@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 @@
|
|
1
|
+
export {default as ConnectionAgreementPage} from './ConnectionAgreementPage.vue'
|
@@ -1,8 +1,141 @@
|
|
1
1
|
<template lang="pug">
|
2
|
-
div
|
3
|
-
|
4
|
-
|
2
|
+
div
|
3
|
+
q-table(
|
4
|
+
v-if="coops"
|
5
|
+
ref="tableRef" v-model:expanded="expanded"
|
6
|
+
flat
|
7
|
+
:rows="coops"
|
8
|
+
:columns="columns"
|
9
|
+
:table-colspan="9"
|
10
|
+
row-key="username"
|
11
|
+
:pagination="pagination"
|
12
|
+
virtual-scroll
|
13
|
+
:virtual-scroll-item-size="48"
|
14
|
+
:rows-per-page-options="[10]"
|
15
|
+
:loading="onLoading"
|
16
|
+
:no-data-label="'Нет кооперативов'"
|
17
|
+
).full-height
|
18
|
+
template(#top)
|
5
19
|
|
6
|
-
|
7
|
-
|
8
|
-
|
20
|
+
|
21
|
+
template(#header="props")
|
22
|
+
|
23
|
+
q-tr(:props="props")
|
24
|
+
q-th(auto-width)
|
25
|
+
|
26
|
+
q-th(
|
27
|
+
v-for="col in props.cols"
|
28
|
+
:key="col.name"
|
29
|
+
:props="props"
|
30
|
+
) {{ col.label }}
|
31
|
+
|
32
|
+
template(#body="props")
|
33
|
+
q-tr(:key="`m_${props.row.username}`" :props="props")
|
34
|
+
q-td(auto-width)
|
35
|
+
q-btn(size="sm" color="primary" round dense :icon="props.expand ? 'remove' : 'add'" @click="props.expand = !props.expand")
|
36
|
+
q-td {{ props.row.username }}
|
37
|
+
q-td {{ props.row.announce }}
|
38
|
+
|
39
|
+
q-td
|
40
|
+
q-badge(v-if="props.row.status === 'active'" color="teal") активен
|
41
|
+
q-badge(v-if="props.row.status === 'pending'" color="orange") на рассмотрении
|
42
|
+
q-badge(v-if="props.row.status === 'blocked'" color="red") заблокирован
|
43
|
+
|
44
|
+
q-td {{ moment(props.row.created_at).format('DD.MM.YY HH:mm:ss') }}
|
45
|
+
|
46
|
+
q-td
|
47
|
+
q-btn-dropdown( label="действия" flat size="sm")
|
48
|
+
q-list
|
49
|
+
q-item(v-if="props.row.status !== 'active'" clickable v-close-popup @click="activate(props.row.username)")
|
50
|
+
q-item-section
|
51
|
+
q-item-label Активировать
|
52
|
+
q-item(v-if="props.row.status !== 'blocked'" clickable v-close-popup @click="block(props.row.username)")
|
53
|
+
q-item-section
|
54
|
+
q-item-label Заблокировать
|
55
|
+
//- q-item(clickable v-close-popup @click="deleteCoop(props.row.username)")
|
56
|
+
//- q-item-section
|
57
|
+
//- q-item-label Удалить
|
58
|
+
|
59
|
+
q-tr(v-show="props.expand" :key="`e_${props.row.username}`" :props="props" class="q-virtual-scroll--with-prev")
|
60
|
+
q-td(colspan="100%")
|
61
|
+
slot(:expand="props.expand" :receiver="props.row.username")
|
62
|
+
ListOfDocumentsWidget(
|
63
|
+
:username="props.row.username"
|
64
|
+
:filter="{data: getDataFilter(props.row.document.hash)}"
|
65
|
+
:expand="true"
|
66
|
+
:documentType="'newsubmitted'"
|
67
|
+
)
|
68
|
+
|
69
|
+
</template>
|
70
|
+
<script setup lang="ts">
|
71
|
+
import { useLoadCooperatives } from 'src/features/Union/LoadCooperatives';
|
72
|
+
const {loadCooperatives} = useLoadCooperatives()
|
73
|
+
import { useUnionStore } from 'src/entities/Union/model';
|
74
|
+
import { computed, ref } from 'vue';
|
75
|
+
import moment from 'moment-with-locales-es6'
|
76
|
+
import { useActivateCooperative } from 'src/features/Union/ActivateCooperative';
|
77
|
+
import { FailAlert, SuccessAlert } from 'src/shared/api/alerts';
|
78
|
+
import { useBlockCooperative } from 'src/features/Union/BlockCooperative';
|
79
|
+
const union = useUnionStore()
|
80
|
+
|
81
|
+
import { ListOfDocumentsWidget } from 'src/widgets/Cooperative/Documents/ListOfDocuments';
|
82
|
+
const getDataFilter = (hash: string) => {
|
83
|
+
return {
|
84
|
+
document: {
|
85
|
+
hash: hash.toUpperCase()
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
const coops = computed(() => union.coops)
|
91
|
+
|
92
|
+
loadCooperatives()
|
93
|
+
|
94
|
+
const activate = async (coopname: string) => {
|
95
|
+
const {activateCooperative} = useActivateCooperative()
|
96
|
+
|
97
|
+
try {
|
98
|
+
await activateCooperative(coopname)
|
99
|
+
loadCooperatives()
|
100
|
+
SuccessAlert('Кооператив активирован')
|
101
|
+
} catch(e: any) {
|
102
|
+
FailAlert(e.message)
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
const block = async (coopname: string) => {
|
107
|
+
const {blockCooperative} = useBlockCooperative()
|
108
|
+
|
109
|
+
try {
|
110
|
+
await blockCooperative(coopname)
|
111
|
+
loadCooperatives()
|
112
|
+
SuccessAlert('Кооператив заблокирован')
|
113
|
+
} catch(e: any) {
|
114
|
+
FailAlert(e.message)
|
115
|
+
}
|
116
|
+
}
|
117
|
+
|
118
|
+
|
119
|
+
const onLoading = ref(false)
|
120
|
+
|
121
|
+
const columns = [
|
122
|
+
{ name: 'username', align: 'left', label: 'Аккаунт', field: 'username', sortable: true },
|
123
|
+
{ name: 'announce', align: 'left', label: 'Сайт', field: 'announce', sortable: false },
|
124
|
+
|
125
|
+
{ name: 'status', align: 'left', label: 'Статус', field: 'status', sortable: true },
|
126
|
+
{
|
127
|
+
name: 'created_at',
|
128
|
+
align: 'left',
|
129
|
+
label: 'Дата заявки',
|
130
|
+
field: 'created_at',
|
131
|
+
sortable: true,
|
132
|
+
},
|
133
|
+
{ name: 'actions', align: 'center', label: '', field: 'actions', sortable: false },
|
134
|
+
] as any
|
135
|
+
|
136
|
+
const expanded = ref([])
|
137
|
+
const tableRef = ref(null)
|
138
|
+
const pagination = ref({ rowsPerPage: 0 })
|
139
|
+
|
140
|
+
|
141
|
+
</script>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<template lang="pug">
|
2
|
+
q-page.padding
|
3
|
+
ListOfDocumentsWidget(
|
4
|
+
:username="username"
|
5
|
+
:filter="{}"
|
6
|
+
:showFilter="false"
|
7
|
+
:initialDocumentType="typeForToggle"
|
8
|
+
)
|
9
|
+
</template>
|
10
|
+
|
11
|
+
<script setup lang="ts">
|
12
|
+
import { ref, computed } from 'vue'
|
13
|
+
import { useSessionStore } from 'src/entities/Session'
|
14
|
+
import { ListOfDocumentsWidget } from 'src/widgets/Cooperative/Documents/ListOfDocuments/ui'
|
15
|
+
import type { DocumentType } from 'src/entities/Document/model/types'
|
16
|
+
|
17
|
+
// Получаем системную информацию
|
18
|
+
const session = useSessionStore()
|
19
|
+
const username = computed(() => session.username)
|
20
|
+
|
21
|
+
// Переменная для отслеживания типа в интерфейсе
|
22
|
+
const typeForToggle = ref<DocumentType>('newsubmitted')
|
23
|
+
</script>
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as UserDocumentsPage } from './UserDocumentsPage.vue'
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<template lang="pug">
|
2
|
+
ListOfPaymentsWidget(:username="username" :hideActions="true")
|
3
|
+
</template>
|
4
|
+
|
5
|
+
<script lang="ts" setup>
|
6
|
+
import { ListOfPaymentsWidget } from 'src/widgets/Cooperative/Payments';
|
7
|
+
import { useSessionStore } from 'src/entities/Session';
|
8
|
+
|
9
|
+
const session = useSessionStore();
|
10
|
+
const username = session.username;
|
11
|
+
</script>
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as UserPaymentsPage } from './UserPayments.vue'
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './ui'
|
@@ -0,0 +1,114 @@
|
|
1
|
+
<template lang="pug">
|
2
|
+
div.q-pa-md
|
3
|
+
div.row
|
4
|
+
div.col-md-12.col-xs-12
|
5
|
+
q-card(flat class="card-container q-pa-md")
|
6
|
+
div.row
|
7
|
+
div.col-12.col-md-3.flex.justify-center.align-start
|
8
|
+
AutoAvatar(class="profile-avatar" :username="currentUser.userAccount?.username || 'user'")
|
9
|
+
|
10
|
+
div.col-12.col-md-9
|
11
|
+
div.row
|
12
|
+
div.col-12.info-card
|
13
|
+
div.row.q-mb-md
|
14
|
+
div.col-12
|
15
|
+
div.text-h4.q-mb-xs
|
16
|
+
span(v-if="isIP").q-mr-sm ИП
|
17
|
+
| {{displayName}}
|
18
|
+
q-badge(color="primary" class="user-role") {{role}}
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
CopyableInput(
|
23
|
+
label="Имя аккаунта"
|
24
|
+
standout="bg-teal text-white"
|
25
|
+
dense
|
26
|
+
:model-value="currentUser.userAccount?.username || ''"
|
27
|
+
input-class="q-mt-md"
|
28
|
+
).q-mb-md
|
29
|
+
|
30
|
+
EditableIndividualCard(
|
31
|
+
v-if="userType === 'individual' && individualProfile"
|
32
|
+
:participantData="individualProfile"
|
33
|
+
:readonly="true"
|
34
|
+
)
|
35
|
+
EditableEntrepreneurCard(
|
36
|
+
v-if="userType === 'entrepreneur' && entrepreneurProfile"
|
37
|
+
:participantData="entrepreneurProfile"
|
38
|
+
:readonly="true"
|
39
|
+
)
|
40
|
+
EditableOrganizationCard(
|
41
|
+
v-if="userType === 'organization' && organizationProfile"
|
42
|
+
:participantData="organizationProfile"
|
43
|
+
:readonly="true"
|
44
|
+
)
|
45
|
+
</template>
|
46
|
+
|
47
|
+
<script lang="ts" setup>
|
48
|
+
import { AutoAvatar } from 'src/shared/ui/AutoAvatar';
|
49
|
+
import { useCurrentUserStore } from 'src/entities/User';
|
50
|
+
import type { IEntrepreneurData, IIndividualData, IOrganizationData } from 'src/shared/lib/types/user/IUserData';
|
51
|
+
import { computed } from 'vue';
|
52
|
+
import { EditableIndividualCard } from 'src/shared/ui/EditableIndividualCard';
|
53
|
+
import { EditableEntrepreneurCard } from 'src/shared/ui/EditableEntrepreneurCard';
|
54
|
+
import { EditableOrganizationCard } from 'src/shared/ui/EditableOrganizationCard';
|
55
|
+
import { useDisplayName } from 'src/shared/lib/composables/useDisplayName';
|
56
|
+
import { CopyableInput } from 'src/shared/ui/CopyableInput';
|
57
|
+
import 'src/shared/ui/CardStyles/index.scss';
|
58
|
+
|
59
|
+
const currentUser = useCurrentUserStore();
|
60
|
+
|
61
|
+
const userType = computed(() => currentUser.userAccount?.type);
|
62
|
+
|
63
|
+
const userProfile = computed(() => {
|
64
|
+
return currentUser.userAccount?.private_data as IEntrepreneurData | IIndividualData | IOrganizationData | null;
|
65
|
+
});
|
66
|
+
|
67
|
+
const individualProfile = computed(() => {
|
68
|
+
if (userType.value === 'individual') {
|
69
|
+
return userProfile.value as IIndividualData;
|
70
|
+
}
|
71
|
+
return null;
|
72
|
+
});
|
73
|
+
|
74
|
+
const entrepreneurProfile = computed(() => {
|
75
|
+
if (userType.value === 'entrepreneur') {
|
76
|
+
return userProfile.value as IEntrepreneurData;
|
77
|
+
}
|
78
|
+
return null;
|
79
|
+
});
|
80
|
+
|
81
|
+
const organizationProfile = computed(() => {
|
82
|
+
if (userType.value === 'organization') {
|
83
|
+
return userProfile.value as IOrganizationData;
|
84
|
+
}
|
85
|
+
return null;
|
86
|
+
});
|
87
|
+
|
88
|
+
const { displayName, isIP } = useDisplayName(userProfile.value);
|
89
|
+
|
90
|
+
const role = computed(() => {
|
91
|
+
if (currentUser.userAccount?.role === 'user')
|
92
|
+
return 'Пайщик';
|
93
|
+
else if (currentUser.userAccount?.role === 'member')
|
94
|
+
return 'Член совета';
|
95
|
+
else if (currentUser.userAccount?.role === 'chairman')
|
96
|
+
return 'Председатель совета';
|
97
|
+
else return '';
|
98
|
+
});
|
99
|
+
|
100
|
+
</script>
|
101
|
+
|
102
|
+
<style lang="scss" scoped>
|
103
|
+
.profile-avatar {
|
104
|
+
width: 180px;
|
105
|
+
height: 180px;
|
106
|
+
border-radius: 50%;
|
107
|
+
object-fit: cover;
|
108
|
+
}
|
109
|
+
|
110
|
+
.user-role {
|
111
|
+
font-size: 14px;
|
112
|
+
padding: 4px 8px;
|
113
|
+
}
|
114
|
+
</style>
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as ProfilePage } from './ProfilePage.vue';
|
@@ -1 +1 @@
|
|
1
|
-
export {default as UserSettingsPage} from './UserSettingsPage.vue'
|
1
|
+
export { default as UserSettingsPage } from './UserSettingsPage.vue'
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './ui';
|
@@ -0,0 +1,72 @@
|
|
1
|
+
<template lang="pug">
|
2
|
+
div.q-pa-md
|
3
|
+
div.row
|
4
|
+
div.col-md-12.col-xs-12
|
5
|
+
q-card(flat class="card-container q-pa-md")
|
6
|
+
div.row.items-center.q-mb-md
|
7
|
+
div.col-12
|
8
|
+
div.text-h4.q-mb-xs Кошелёк
|
9
|
+
q-badge(color="primary" class="user-role") {{ role }}
|
10
|
+
|
11
|
+
div.row.q-mb-md
|
12
|
+
div.col-12
|
13
|
+
div.info-card
|
14
|
+
div.card-title Неснижаемый остаток
|
15
|
+
div.card-label Заблокировано
|
16
|
+
div.card-value {{ currentUser.participantAccount?.minimum_amount || '0' }}
|
17
|
+
|
18
|
+
div.row
|
19
|
+
div.col-12
|
20
|
+
div.text-h6.q-mb-sm Целевые Программы
|
21
|
+
|
22
|
+
div.row
|
23
|
+
div.col-6.q-pr-sm
|
24
|
+
DepositButton.full-width.card-action-btn
|
25
|
+
div.col-6.q-pl-sm
|
26
|
+
WithdrawButton.full-width.card-action-btn
|
27
|
+
|
28
|
+
div.row.q-mb-md
|
29
|
+
div.col-12
|
30
|
+
div
|
31
|
+
div.info-card.hover(v-for="program_wallet of walletStore.program_wallets" :key="program_wallet.id")
|
32
|
+
div.card-title {{ program_wallet.program_details.title }}
|
33
|
+
div.row
|
34
|
+
div.col-6
|
35
|
+
div.card-label Доступно
|
36
|
+
div.card-value {{program_wallet.available || '0'}}
|
37
|
+
div.col-6
|
38
|
+
div.card-label Заблокировано
|
39
|
+
div.card-value {{program_wallet.blocked || '0'}}
|
40
|
+
|
41
|
+
</template>
|
42
|
+
|
43
|
+
<script lang="ts" setup>
|
44
|
+
import { DepositButton } from 'src/features/Wallet/DepositToWallet';
|
45
|
+
import { WithdrawButton } from 'src/features/Wallet/WithdrawFromWallet';
|
46
|
+
import { useWalletStore } from 'src/entities/Wallet';
|
47
|
+
import { useCurrentUserStore } from 'src/entities/User';
|
48
|
+
import { computed } from 'vue';
|
49
|
+
import 'src/shared/ui/CardStyles/index.scss';
|
50
|
+
|
51
|
+
const walletStore = useWalletStore();
|
52
|
+
const currentUser = useCurrentUserStore();
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
const role = computed(() => {
|
57
|
+
if (currentUser.userAccount?.role === 'user')
|
58
|
+
return 'Пайщик';
|
59
|
+
else if (currentUser.userAccount?.role === 'member')
|
60
|
+
return 'Член совета';
|
61
|
+
else if (currentUser.userAccount?.role === 'chairman')
|
62
|
+
return 'Председатель совета';
|
63
|
+
else return '';
|
64
|
+
});
|
65
|
+
</script>
|
66
|
+
|
67
|
+
<style lang="scss" scoped>
|
68
|
+
.user-role {
|
69
|
+
font-size: 14px;
|
70
|
+
padding: 4px 8px;
|
71
|
+
}
|
72
|
+
</style>
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as WalletPage } from './WalletPage.vue';
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { useDesktopStore } from 'src/entities/Desktop/model'
|
2
|
+
import { useSystemStore } from 'src/entities/System/model'
|
3
|
+
import { useInitWalletProcess } from 'src/processes/init-wallet'
|
4
|
+
import type { Router } from 'vue-router'
|
5
|
+
import { useBranchOverlayProcess } from '../watch-branch-overlay'
|
6
|
+
import { setupNavigationGuard } from '../navigation-guard-setup'
|
7
|
+
import { useInitExtensionsProcess } from 'src/processes/init-installed-extensions'
|
8
|
+
|
9
|
+
export async function useInitAppProcess(router: Router) {
|
10
|
+
const system = useSystemStore()
|
11
|
+
await system.loadSystemInfo()
|
12
|
+
|
13
|
+
const desktops = useDesktopStore()
|
14
|
+
await desktops.healthCheck()
|
15
|
+
await desktops.loadDesktop()
|
16
|
+
|
17
|
+
// Выбираем активный рабочий стол (например, participant)
|
18
|
+
desktops.selectWorkspace('participant')
|
19
|
+
|
20
|
+
useBranchOverlayProcess()
|
21
|
+
await useInitWalletProcess().run()
|
22
|
+
|
23
|
+
// Регистрируем маршруты рабочего стола
|
24
|
+
desktops.registerWorkspaceMenus(router)
|
25
|
+
setupNavigationGuard(router)
|
26
|
+
|
27
|
+
await useInitExtensionsProcess(router)
|
28
|
+
}
|
@@ -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
|
+
}
|