@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,117 @@
|
|
1
|
+
import { computed, type Ref } from 'vue'
|
2
|
+
import type { IMeet } from 'src/entities/Meet'
|
3
|
+
import { useMeetStore } from 'src/entities/Meet'
|
4
|
+
import { useSessionStore } from 'src/entities/Session'
|
5
|
+
import { FailAlert, SuccessAlert } from 'src/shared/api'
|
6
|
+
import { voteOnMeet, type IVoteOnMeetInput } from 'src/features/Meet/VoteOnMeet'
|
7
|
+
import { generateBallot } from 'src/features/Meet/GenerateBallot'
|
8
|
+
import { useSignDocument } from 'src/shared/lib/document'
|
9
|
+
import moment from 'moment-with-locales-es6'
|
10
|
+
|
11
|
+
moment.locale('ru')
|
12
|
+
|
13
|
+
export const useMeetDetailsVoting = (
|
14
|
+
meet: IMeet,
|
15
|
+
coopname: string,
|
16
|
+
meetHash: string,
|
17
|
+
votes: Ref<Record<number, 'for' | 'against' | 'abstained'>>,
|
18
|
+
isVoting: Ref<boolean>
|
19
|
+
) => {
|
20
|
+
const meetStore = useMeetStore()
|
21
|
+
const sessionStore = useSessionStore()
|
22
|
+
const { signDocument } = useSignDocument()
|
23
|
+
|
24
|
+
const meetAgendaItems = computed(() => {
|
25
|
+
if (!meet) return []
|
26
|
+
return meet.processing?.questions || []
|
27
|
+
})
|
28
|
+
|
29
|
+
const canVote = computed(() => {
|
30
|
+
if (!meet?.processing?.meet) return false
|
31
|
+
|
32
|
+
const isAuthorized = meet.processing.meet.status === 'authorized'
|
33
|
+
|
34
|
+
const now = moment()
|
35
|
+
const openAt = moment(meet.processing.meet.open_at)
|
36
|
+
const closeAt = moment(meet.processing.meet.close_at)
|
37
|
+
|
38
|
+
const isWithinTimeframe = now.isAfter(openAt) && now.isBefore(closeAt)
|
39
|
+
|
40
|
+
return isAuthorized && isWithinTimeframe
|
41
|
+
})
|
42
|
+
|
43
|
+
const allVotesSelected = computed(() => {
|
44
|
+
if (!meetAgendaItems.value.length) return false
|
45
|
+
return meetAgendaItems.value.every((_, index) => votes.value[index] !== undefined)
|
46
|
+
})
|
47
|
+
|
48
|
+
const isVotingNotStarted = computed(() => {
|
49
|
+
if (!meet?.processing?.meet?.open_at) return false
|
50
|
+
const now = moment()
|
51
|
+
const openAt = moment(meet.processing.meet.open_at)
|
52
|
+
return now.isBefore(openAt)
|
53
|
+
})
|
54
|
+
|
55
|
+
const isVotingEnded = computed(() => {
|
56
|
+
if (!meet?.processing?.meet?.close_at) return false
|
57
|
+
const now = moment()
|
58
|
+
const closeAt = moment(meet.processing.meet.close_at)
|
59
|
+
return now.isAfter(closeAt)
|
60
|
+
})
|
61
|
+
|
62
|
+
const formattedOpenDate = computed(() => {
|
63
|
+
if (!meet?.processing?.meet?.open_at) return ''
|
64
|
+
return moment(meet.processing.meet.open_at).format('DD.MM.YYYY HH:mm')
|
65
|
+
})
|
66
|
+
|
67
|
+
const formattedCloseDate = computed(() => {
|
68
|
+
if (!meet?.processing?.meet?.close_at) return ''
|
69
|
+
return moment(meet.processing.meet.close_at).format('DD.MM.YYYY HH:mm')
|
70
|
+
})
|
71
|
+
|
72
|
+
const submitVote = async () => {
|
73
|
+
if (!meet || !allVotesSelected.value || !canVote.value) return
|
74
|
+
|
75
|
+
isVoting.value = true
|
76
|
+
try {
|
77
|
+
const votesData = meetAgendaItems.value.map((item, index) => ({
|
78
|
+
question_id: item.id,
|
79
|
+
vote: votes.value[index]
|
80
|
+
}))
|
81
|
+
|
82
|
+
const generatedBallot = await generateBallot({
|
83
|
+
coopname,
|
84
|
+
username: sessionStore.username,
|
85
|
+
})
|
86
|
+
|
87
|
+
const signedBallot = await signDocument(generatedBallot)
|
88
|
+
|
89
|
+
const vote: IVoteOnMeetInput = {
|
90
|
+
coopname,
|
91
|
+
hash: meetHash,
|
92
|
+
ballot: signedBallot,
|
93
|
+
username: sessionStore.username,
|
94
|
+
votes: votesData
|
95
|
+
}
|
96
|
+
|
97
|
+
await voteOnMeet(vote)
|
98
|
+
SuccessAlert('Ваш голос успешно отправлен')
|
99
|
+
await meetStore.loadMeet({ coopname, hash: meetHash })
|
100
|
+
} catch (error: any) {
|
101
|
+
FailAlert(error)
|
102
|
+
} finally {
|
103
|
+
isVoting.value = false
|
104
|
+
}
|
105
|
+
}
|
106
|
+
|
107
|
+
return {
|
108
|
+
canVote,
|
109
|
+
meetAgendaItems,
|
110
|
+
allVotesSelected,
|
111
|
+
isVotingNotStarted,
|
112
|
+
isVotingEnded,
|
113
|
+
formattedOpenDate,
|
114
|
+
formattedCloseDate,
|
115
|
+
submitVote
|
116
|
+
}
|
117
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<template lang="pug">
|
2
|
+
div.row.q-pa-md
|
3
|
+
div.col-12
|
4
|
+
q-card(flat)
|
5
|
+
q-card-section
|
6
|
+
div.text-h6 Информация о собрании
|
7
|
+
div.q-mt-sm
|
8
|
+
div.row
|
9
|
+
div.col-2.text-weight-bold Статус:
|
10
|
+
div.col {{ meet.processing?.meet?.status }}
|
11
|
+
|
12
|
+
div.row
|
13
|
+
div.col-2.text-weight-bold Инициатор:
|
14
|
+
div.col {{ meet.processing?.meet?.initiator }}
|
15
|
+
div.row
|
16
|
+
div.col-2.text-weight-bold Председатель:
|
17
|
+
div.col {{ meet.processing?.meet?.presider }}
|
18
|
+
div.row
|
19
|
+
div.col-2.text-weight-bold Секретарь:
|
20
|
+
div.col {{ meet.processing?.meet?.secretary }}
|
21
|
+
div.row
|
22
|
+
div.col-2.text-weight-bold Кворум:
|
23
|
+
div.col {{ meet.processing?.meet?.quorum_percent }}%
|
24
|
+
div.row
|
25
|
+
div.col-2.text-weight-bold Текущий кворум:
|
26
|
+
div.col {{ meet.processing?.meet?.current_quorum_percent }}%
|
27
|
+
div.row
|
28
|
+
div.col-2.text-weight-bold Кворум достигнут:
|
29
|
+
div.col {{ meet.processing?.meet?.quorum_passed ? 'Да' : 'Нет' }}
|
30
|
+
</template>
|
31
|
+
|
32
|
+
<script setup lang="ts">
|
33
|
+
import type { IMeet } from 'src/entities/Meet'
|
34
|
+
|
35
|
+
defineProps<{
|
36
|
+
meet: IMeet
|
37
|
+
}>()
|
38
|
+
</script>
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as MeetInfoCard } from './MeetInfoCard.vue'
|
@@ -0,0 +1,118 @@
|
|
1
|
+
<template lang="pug">
|
2
|
+
|
3
|
+
q-table(
|
4
|
+
ref="tableRef"
|
5
|
+
flat
|
6
|
+
:grid="isMobile"
|
7
|
+
:rows="meets"
|
8
|
+
:columns="columns"
|
9
|
+
:pagination="pagination"
|
10
|
+
virtual-scroll
|
11
|
+
:virtual-scroll-item-size="48"
|
12
|
+
:rows-per-page-options="[10]"
|
13
|
+
:loading='loading'
|
14
|
+
:no-data-label="'Собрания не найдены'"
|
15
|
+
).full-height
|
16
|
+
template(#header="props")
|
17
|
+
q-tr(:props="props")
|
18
|
+
q-th(
|
19
|
+
v-for="col in props.cols"
|
20
|
+
:key="col.name"
|
21
|
+
:props="props"
|
22
|
+
) {{ col.label }}
|
23
|
+
|
24
|
+
template(#body="props")
|
25
|
+
q-tr(:key="`m_${props.row?.hash}`" :props="props")
|
26
|
+
q-td {{ props.row.hash.substring(0, 10) }}
|
27
|
+
q-td {{ props.row.processing?.meet?.type }}
|
28
|
+
q-td {{ props.row.processing?.meet?.status }}
|
29
|
+
q-td {{ formatDate(props.row.processing?.meet?.open_at) }}
|
30
|
+
q-td {{ formatDate(props.row.processing?.meet?.close_at) }}
|
31
|
+
q-td
|
32
|
+
q-btn(
|
33
|
+
v-if="canVote(props.row)"
|
34
|
+
size="sm"
|
35
|
+
color="primary"
|
36
|
+
icon="fa-solid fa-check-to-slot"
|
37
|
+
flat
|
38
|
+
@click="() => $emit('vote', props.row)"
|
39
|
+
) Голосовать
|
40
|
+
q-btn(
|
41
|
+
v-if="canVote(props.row)"
|
42
|
+
size="sm"
|
43
|
+
color="secondary"
|
44
|
+
icon="fa-solid fa-eye"
|
45
|
+
flat
|
46
|
+
@click="() => $emit('view', props.row)"
|
47
|
+
) Участвовать
|
48
|
+
q-btn(
|
49
|
+
size="sm"
|
50
|
+
color="accent"
|
51
|
+
icon="fa-solid fa-arrow-right"
|
52
|
+
flat
|
53
|
+
@click="navigateToMeetDetails(props.row)"
|
54
|
+
) Подробнее
|
55
|
+
</template>
|
56
|
+
|
57
|
+
<script setup lang="ts">
|
58
|
+
import { ref } from 'vue'
|
59
|
+
import { date } from 'quasar'
|
60
|
+
import type { IMeet } from 'src/entities/Meet'
|
61
|
+
import type { QTableColumn } from 'quasar'
|
62
|
+
import { useRouter } from 'vue-router'
|
63
|
+
import { useWindowSize } from 'src/shared/hooks'
|
64
|
+
import { useDesktopStore } from 'src/entities/Desktop/model'
|
65
|
+
|
66
|
+
defineProps<{
|
67
|
+
meets: IMeet[],
|
68
|
+
loading: boolean
|
69
|
+
}>()
|
70
|
+
|
71
|
+
defineEmits<{
|
72
|
+
(e: 'vote', meet: IMeet): void
|
73
|
+
(e: 'view', meet: IMeet): void
|
74
|
+
}>()
|
75
|
+
|
76
|
+
const router = useRouter()
|
77
|
+
const { isMobile } = useWindowSize()
|
78
|
+
const desktop = useDesktopStore()
|
79
|
+
|
80
|
+
// Колонки для таблицы
|
81
|
+
const columns: QTableColumn<IMeet>[] = [
|
82
|
+
{ name: 'hash', align: 'left', label: 'ID', field: (row: IMeet) => row.hash, sortable: true },
|
83
|
+
{ name: 'type', align: 'left', label: 'Тип', field: (row: IMeet) => row.processing?.meet?.type, sortable: true },
|
84
|
+
{ name: 'status', align: 'left', label: 'Статус', field: (row: IMeet) => row.processing?.meet?.status, sortable: true },
|
85
|
+
{ name: 'open_at', align: 'left', label: 'Дата открытия', field: (row: IMeet) => row.processing?.meet?.open_at, sortable: true },
|
86
|
+
{ name: 'close_at', align: 'left', label: 'Дата закрытия', field: (row: IMeet) => row.processing?.meet?.close_at, sortable: true },
|
87
|
+
{ name: 'actions', align: 'left', label: 'Действия', field: () => '', sortable: false },
|
88
|
+
]
|
89
|
+
|
90
|
+
const tableRef = ref(null)
|
91
|
+
const pagination = ref({ rowsPerPage: 10 })
|
92
|
+
|
93
|
+
// Форматирование даты
|
94
|
+
const formatDate = (dateString: string) => {
|
95
|
+
if (!dateString) return '';
|
96
|
+
return date.formatDate(dateString, 'DD.MM.YYYY HH:mm')
|
97
|
+
}
|
98
|
+
|
99
|
+
const canVote = (meet: IMeet) => {
|
100
|
+
return meet.processing?.meet?.status === 'open'
|
101
|
+
}
|
102
|
+
|
103
|
+
// Определение текущего воркспейса и подходящего маршрута для деталей собрания
|
104
|
+
const navigateToMeetDetails = (meet: IMeet) => {
|
105
|
+
const currentWorkspace = desktop.activeWorkspaceName
|
106
|
+
const isSoviet = currentWorkspace === 'soviet'
|
107
|
+
|
108
|
+
const routeName = isSoviet ? 'meet-details' : 'user-meet-details'
|
109
|
+
|
110
|
+
router.push({
|
111
|
+
name: routeName,
|
112
|
+
params: {
|
113
|
+
hash: meet.hash,
|
114
|
+
coopname: router.currentRoute.value.params.coopname
|
115
|
+
}
|
116
|
+
})
|
117
|
+
}
|
118
|
+
</script>
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as MeetsTable } from './MeetsTable.vue'
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './ui'
|
@@ -0,0 +1,89 @@
|
|
1
|
+
<template lang="pug">
|
2
|
+
div.q-pa-xs.col-xs-12.col-sm-6.col-md-4.col-lg-3.q-mt-md
|
3
|
+
q-card.full-height
|
4
|
+
q-card-section
|
5
|
+
div.text-h6 {{ getName(participant) }}
|
6
|
+
q-separator.q-my-md
|
7
|
+
div
|
8
|
+
div.text-caption Е-почта:
|
9
|
+
div.text-subtitle1.q-mb-xs {{ participant.provider_account?.email || 'Не указана' }}
|
10
|
+
div.text-caption Аккаунт:
|
11
|
+
div.text-subtitle1.q-mb-xs {{ participant.username }}
|
12
|
+
div.text-caption Зарегистрирован:
|
13
|
+
div.text-subtitle1 {{ formatDate(participant.blockchain_account?.created) }}
|
14
|
+
q-card-actions(align="right")
|
15
|
+
q-btn(
|
16
|
+
color="primary"
|
17
|
+
:icon="isExpanded ? 'remove' : 'add'"
|
18
|
+
label="Подробнее"
|
19
|
+
@click="toggleExpand"
|
20
|
+
)
|
21
|
+
q-slide-transition
|
22
|
+
div.q-pa-md(v-if="isExpanded")
|
23
|
+
q-separator
|
24
|
+
ParticipantDetails(
|
25
|
+
:participant="participant"
|
26
|
+
:tab-name="currentTab"
|
27
|
+
@update="onUpdate"
|
28
|
+
)
|
29
|
+
</template>
|
30
|
+
|
31
|
+
<script setup lang="ts">
|
32
|
+
import { ref, computed } from 'vue'
|
33
|
+
import moment from 'moment-with-locales-es6'
|
34
|
+
import ParticipantDetails from './ParticipantDetails.vue'
|
35
|
+
import {
|
36
|
+
AccountTypes,
|
37
|
+
type IAccount,
|
38
|
+
type IIndividualData,
|
39
|
+
type IOrganizationData,
|
40
|
+
type IEntrepreneurData
|
41
|
+
} from 'src/entities/Account/types'
|
42
|
+
|
43
|
+
// Props
|
44
|
+
const props = defineProps<{
|
45
|
+
participant: IAccount
|
46
|
+
expanded: Map<string, boolean>
|
47
|
+
}>()
|
48
|
+
|
49
|
+
// Emits
|
50
|
+
const emit = defineEmits<{
|
51
|
+
(e: 'toggle-expand', id: string): void
|
52
|
+
(e: 'update', account: IAccount, newData: IIndividualData | IOrganizationData | IEntrepreneurData): void
|
53
|
+
}>()
|
54
|
+
|
55
|
+
// Локальное состояние
|
56
|
+
const currentTab = ref('info')
|
57
|
+
|
58
|
+
// Computed
|
59
|
+
const isExpanded = computed(() => props.expanded.get(props.participant.username))
|
60
|
+
|
61
|
+
// Функция для получения имени участника
|
62
|
+
const getName = (account: IAccount) => {
|
63
|
+
const d = account.private_account
|
64
|
+
if (!d) return ''
|
65
|
+
switch (d.type) {
|
66
|
+
case AccountTypes.Individual:
|
67
|
+
return `${d.individual_data?.last_name} ${d.individual_data?.first_name} ${d.individual_data?.middle_name}`
|
68
|
+
case AccountTypes.Entrepreneur:
|
69
|
+
return `ИП ${d.entrepreneur_data?.last_name} ${d.entrepreneur_data?.first_name} ${d.entrepreneur_data?.middle_name}`
|
70
|
+
case AccountTypes.Organization:
|
71
|
+
return d.organization_data?.short_name
|
72
|
+
default:
|
73
|
+
return ''
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
77
|
+
// Форматирование даты
|
78
|
+
const formatDate = (date?: string) =>
|
79
|
+
date ? moment(date).format('DD.MM.YY HH:mm:ss') : ''
|
80
|
+
|
81
|
+
// События
|
82
|
+
const toggleExpand = () => {
|
83
|
+
emit('toggle-expand', props.participant.username)
|
84
|
+
}
|
85
|
+
|
86
|
+
const onUpdate = (newData: IIndividualData | IOrganizationData | IEntrepreneurData) => {
|
87
|
+
emit('update', props.participant, newData)
|
88
|
+
}
|
89
|
+
</script>
|
@@ -0,0 +1,79 @@
|
|
1
|
+
<template lang="pug">
|
2
|
+
div
|
3
|
+
q-tabs.compact-tabs(
|
4
|
+
v-model="currentTab"
|
5
|
+
align="justify"
|
6
|
+
stretch
|
7
|
+
dense
|
8
|
+
indicator-color="black"
|
9
|
+
)
|
10
|
+
q-tab(name="info" label="Данные" class="bg-primary text-white compact-tab")
|
11
|
+
q-tab(name="document" label="Документы" class="bg-primary text-white compact-tab")
|
12
|
+
|
13
|
+
q-tab-panels.q-mt-sm.tab-panels-card(v-model="currentTab" animated)
|
14
|
+
q-tab-panel.q-pa-none(name="info")
|
15
|
+
component(:is="useComponent(participant)" :participantData="usePrivateData(participant)" @update="onUpdate")
|
16
|
+
|
17
|
+
q-tab-panel.q-pa-none(name="document")
|
18
|
+
ListOfDocumentsWidget(:username="participant.username" :filter="{}")
|
19
|
+
</template>
|
20
|
+
|
21
|
+
<script setup lang="ts">
|
22
|
+
import { ref, watch } from 'vue'
|
23
|
+
import { EditableEntrepreneurCard } from 'src/shared/ui/EditableEntrepreneurCard'
|
24
|
+
import { EditableIndividualCard } from 'src/shared/ui/EditableIndividualCard'
|
25
|
+
import { EditableOrganizationCard } from 'src/shared/ui/EditableOrganizationCard'
|
26
|
+
import { ListOfDocumentsWidget } from 'src/widgets/Cooperative/Documents/ListOfDocuments'
|
27
|
+
import 'src/shared/ui/TabStyles/index.scss'
|
28
|
+
import {
|
29
|
+
AccountTypes,
|
30
|
+
type IAccount,
|
31
|
+
type IIndividualData,
|
32
|
+
type IOrganizationData,
|
33
|
+
type IEntrepreneurData
|
34
|
+
} from 'src/entities/Account/types'
|
35
|
+
|
36
|
+
// Props
|
37
|
+
const props = defineProps<{
|
38
|
+
participant: IAccount
|
39
|
+
tabName?: string
|
40
|
+
}>()
|
41
|
+
|
42
|
+
// Emits
|
43
|
+
const emit = defineEmits<{
|
44
|
+
(e: 'update', newData: IIndividualData | IOrganizationData | IEntrepreneurData): void
|
45
|
+
}>()
|
46
|
+
|
47
|
+
// Локальное состояние
|
48
|
+
const currentTab = ref(props.tabName || 'info')
|
49
|
+
|
50
|
+
// Отслеживание изменения tabName в props
|
51
|
+
watch(() => props.tabName, (newVal) => {
|
52
|
+
if (newVal) {
|
53
|
+
currentTab.value = newVal
|
54
|
+
}
|
55
|
+
})
|
56
|
+
|
57
|
+
// Компонент для редактирования данных
|
58
|
+
const useComponent = (account: IAccount) => {
|
59
|
+
switch (account.private_account?.type) {
|
60
|
+
case AccountTypes.Individual: return EditableIndividualCard
|
61
|
+
case AccountTypes.Entrepreneur: return EditableEntrepreneurCard
|
62
|
+
case AccountTypes.Organization: return EditableOrganizationCard
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
// Получение данных участника
|
67
|
+
const usePrivateData = (account: IAccount) => {
|
68
|
+
switch (account.private_account?.type) {
|
69
|
+
case AccountTypes.Individual: return account.private_account.individual_data
|
70
|
+
case AccountTypes.Entrepreneur: return account.private_account.entrepreneur_data
|
71
|
+
case AccountTypes.Organization: return account.private_account.organization_data
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
// События
|
76
|
+
const onUpdate = (newData: IIndividualData | IOrganizationData | IEntrepreneurData) => {
|
77
|
+
emit('update', newData)
|
78
|
+
}
|
79
|
+
</script>
|
@@ -0,0 +1,129 @@
|
|
1
|
+
<template lang="pug">
|
2
|
+
q-table(
|
3
|
+
flat
|
4
|
+
:grid="isMobile"
|
5
|
+
:rows="accounts"
|
6
|
+
:columns="columns"
|
7
|
+
row-key="username"
|
8
|
+
:pagination="pagination"
|
9
|
+
virtual-scroll
|
10
|
+
:virtual-scroll-item-size="48"
|
11
|
+
:rows-per-page-options="[10]"
|
12
|
+
:loading="loading"
|
13
|
+
:no-data-label="'У кооператива нет пайщиков'"
|
14
|
+
).full-height
|
15
|
+
template(#top)
|
16
|
+
slot(name="top")
|
17
|
+
|
18
|
+
template(#header="props")
|
19
|
+
q-tr(:props="props")
|
20
|
+
q-th(auto-width)
|
21
|
+
q-th(v-for="col in props.cols" :key="col.name" :props="props") {{ col.label }}
|
22
|
+
|
23
|
+
template(#body="props")
|
24
|
+
q-tr(:key="`m_${props.row.username}`" :props="props")
|
25
|
+
q-td(auto-width)
|
26
|
+
q-btn(
|
27
|
+
size="sm"
|
28
|
+
color="primary"
|
29
|
+
round
|
30
|
+
dense
|
31
|
+
:icon="expanded.get(props.row.username) ? 'remove' : 'add'"
|
32
|
+
@click="onToggleExpand(props.row.username)"
|
33
|
+
)
|
34
|
+
q-td(style="max-width: 150px; word-wrap: break-word; white-space: normal;") {{ getName(props.row) }}
|
35
|
+
q-td {{ props.row.provider_account?.email }}
|
36
|
+
q-td {{ props.row.username }}
|
37
|
+
q-td {{ formatDate(props.row.blockchain_account?.created) }}
|
38
|
+
q-tr(
|
39
|
+
v-if="expanded.get(props.row.username)"
|
40
|
+
:key="`e_${props.row.username}`"
|
41
|
+
:props="props"
|
42
|
+
class="q-virtual-scroll--with-prev"
|
43
|
+
)
|
44
|
+
q-td(colspan="100%")
|
45
|
+
ParticipantDetails(
|
46
|
+
:participant="props.row"
|
47
|
+
:tab-name="currentTab[props.row.username]"
|
48
|
+
@update="newData => onUpdate(props.row, newData)"
|
49
|
+
)
|
50
|
+
|
51
|
+
template(#item="props")
|
52
|
+
ParticipantCard(
|
53
|
+
:participant="props.row"
|
54
|
+
:expanded="expanded"
|
55
|
+
@toggle-expand="onToggleExpand"
|
56
|
+
@update="onUpdate"
|
57
|
+
)
|
58
|
+
</template>
|
59
|
+
|
60
|
+
<script setup lang="ts">
|
61
|
+
import { ref, reactive } from 'vue'
|
62
|
+
import { useWindowSize } from 'src/shared/hooks'
|
63
|
+
import moment from 'moment-with-locales-es6'
|
64
|
+
import { ParticipantCard, ParticipantDetails } from '.'
|
65
|
+
import {
|
66
|
+
AccountTypes,
|
67
|
+
type IAccount,
|
68
|
+
type IIndividualData,
|
69
|
+
type IOrganizationData,
|
70
|
+
type IEntrepreneurData
|
71
|
+
} from 'src/entities/Account/types'
|
72
|
+
|
73
|
+
// Props
|
74
|
+
defineProps<{
|
75
|
+
accounts: IAccount[]
|
76
|
+
loading: boolean
|
77
|
+
}>()
|
78
|
+
|
79
|
+
// Emits
|
80
|
+
const emit = defineEmits<{
|
81
|
+
(e: 'toggle-expand', id: string): void
|
82
|
+
(e: 'update', account: IAccount, newData: IIndividualData | IOrganizationData | IEntrepreneurData): void
|
83
|
+
}>()
|
84
|
+
|
85
|
+
// Локальное состояние
|
86
|
+
const expanded = reactive(new Map<string, boolean>())
|
87
|
+
const currentTab = reactive<Record<string, string>>({})
|
88
|
+
const pagination = ref({ rowsPerPage: 10 })
|
89
|
+
const { isMobile } = useWindowSize()
|
90
|
+
|
91
|
+
// Колонки таблицы
|
92
|
+
const columns: any[] = [
|
93
|
+
{ name: 'name', align: 'left', label: 'ФИО / Наименование', field: 'name', sortable: true },
|
94
|
+
{ name: 'email', align: 'left', label: 'Е-почта', field: 'email', sortable: true },
|
95
|
+
{ name: 'username', align: 'left', label: 'Аккаунт', field: 'username', sortable: true },
|
96
|
+
{ name: 'created_at', align: 'left', label: 'Зарегистрирован', field: 'created_at', sortable: true },
|
97
|
+
]
|
98
|
+
|
99
|
+
// Функция для получения имени участника
|
100
|
+
const getName = (account: IAccount) => {
|
101
|
+
const d = account.private_account
|
102
|
+
if (!d) return ''
|
103
|
+
switch (d.type) {
|
104
|
+
case AccountTypes.Individual:
|
105
|
+
return `${d.individual_data?.last_name} ${d.individual_data?.first_name} ${d.individual_data?.middle_name}`
|
106
|
+
case AccountTypes.Entrepreneur:
|
107
|
+
return `ИП ${d.entrepreneur_data?.last_name} ${d.entrepreneur_data?.first_name} ${d.entrepreneur_data?.middle_name}`
|
108
|
+
case AccountTypes.Organization:
|
109
|
+
return d.organization_data?.short_name
|
110
|
+
default:
|
111
|
+
return ''
|
112
|
+
}
|
113
|
+
}
|
114
|
+
|
115
|
+
// Форматирование даты
|
116
|
+
const formatDate = (date?: string) =>
|
117
|
+
date ? moment(date).format('DD.MM.YY HH:mm:ss') : ''
|
118
|
+
|
119
|
+
// События
|
120
|
+
const onToggleExpand = (id: string) => {
|
121
|
+
expanded.set(id, !expanded.get(id))
|
122
|
+
if (!currentTab[id]) currentTab[id] = 'info'
|
123
|
+
emit('toggle-expand', id)
|
124
|
+
}
|
125
|
+
|
126
|
+
const onUpdate = (account: IAccount, newData: IIndividualData | IOrganizationData | IEntrepreneurData) => {
|
127
|
+
emit('update', account, newData)
|
128
|
+
}
|
129
|
+
</script>
|