@coopenomics/desktop 2.2.6-alpha.0 → 2.2.7

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.
Files changed (88) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/extensions/powerup/boot.ts +1 -1
  3. package/package.json +6 -6
  4. package/src/app/App.vue +4 -2
  5. package/src/app/providers/card/store.ts +6 -3
  6. package/src/boot/branch-selector.ts +0 -2
  7. package/src/boot/init-stores.ts +5 -3
  8. package/src/boot/navigation-guards.ts +5 -7
  9. package/src/components/menu/footerMobileMenu.vue +4 -2
  10. package/src/components/soviet/staff.vue +9 -7
  11. package/src/desktops/User/model/index.ts +89 -87
  12. package/src/entities/Request/api/index.ts +19 -19
  13. package/src/entities/Request/model/stores.ts +1 -0
  14. package/src/entities/System/model/store.ts +1 -1
  15. package/src/entities/User/model/entity.ts +1 -0
  16. package/src/features/Agreementer/GenerateAgreement/ui/AgreementReader.vue +4 -2
  17. package/src/features/Agreementer/SignAgreementDialog/model/index.ts +4 -3
  18. package/src/features/Agreementer/SignAgreementDialog/ui/SignAgreementDialog.vue +4 -2
  19. package/src/features/Branch/CreateBranch/model/index.ts +4 -3
  20. package/src/features/Branch/EditBranch/model/index.ts +3 -2
  21. package/src/features/Branch/SelectBranch/model/index.ts +1 -1
  22. package/src/features/Branch/SelectBranch/ui/SelectBranchOverlay.vue +5 -7
  23. package/src/features/Decision/AuthorizeAndExecDecision/model/index.ts +6 -6
  24. package/src/features/Decision/VoteForDecision/model/index.ts +4 -2
  25. package/src/features/Installer/ui/RequestKeyForm/RequestKeyForm.vue +4 -2
  26. package/src/features/PaymentMethod/AddPaymentMethod/model/index.ts +4 -6
  27. package/src/features/PaymentMethod/DeletePaymentMethod/model/index.ts +3 -2
  28. package/src/features/Request/AcceptRequest/api/index.ts +20 -21
  29. package/src/features/Request/CancelRequest/api/index.ts +13 -17
  30. package/src/features/Request/CompleteOnRequest/api/index.ts +13 -17
  31. package/src/features/Request/ConfirmRecieveOnRequest/api/index.ts +17 -21
  32. package/src/features/Request/ConfirmSupplyOnRequest/api/index.ts +17 -21
  33. package/src/features/Request/CreateChildOrder/api/index.ts +73 -51
  34. package/src/features/Request/CreateChildOrder/model/index.ts +46 -0
  35. package/src/features/Request/CreateChildOrder/model/types.ts +1 -1
  36. package/src/features/Request/CreateChildOrder/ui/CreateChildOrderButton/CreateChildOrderButton.vue +28 -4
  37. package/src/features/Request/CreateParentOffer/api/index.ts +5 -15
  38. package/src/features/Request/CreateParentOffer/model/types.ts +2 -2
  39. package/src/features/Request/CreateParentOffer/ui/CreateParentOfferForm/CreateParentOfferForm.vue +8 -5
  40. package/src/features/Request/DeclineRequest/api/index.ts +14 -18
  41. package/src/features/Request/DeliverOnRequest/api/index.ts +13 -17
  42. package/src/features/Request/DisputeOnRequest/api/index.ts +3 -7
  43. package/src/features/Request/ModerateRequest/api/index.ts +14 -18
  44. package/src/features/Request/ModerateRequest/ui/ModerateRequestButton.vue +4 -3
  45. package/src/features/Request/ProhibitRequest/api/index.ts +14 -18
  46. package/src/features/Request/PublishRequest/api/index.ts +13 -17
  47. package/src/features/Request/RecieveOnRequest/api/index.ts +17 -21
  48. package/src/features/Request/SupplyOnRequest/api/index.ts +4 -4
  49. package/src/features/Request/UnpublishRequest/api/index.ts +14 -17
  50. package/src/features/Request/UpdateRequest/api/index.ts +2 -6
  51. package/src/features/User/AddUser/ui/AddUserDialog/AddUserDialog.vue +4 -2
  52. package/src/features/User/CreateUser/model/index.ts +10 -8
  53. package/src/features/User/LoginUser/ui/LoginForm/LoginForm.vue +4 -2
  54. package/src/features/Wallet/DepositToWallet/ui/DepositButton/DepositButton.vue +4 -2
  55. package/src/pages/Cooperative/ListOfBranches/ui/ListOfBranchesPage.vue +4 -2
  56. package/src/pages/Documentor/ListOfDocuments/ListOfDocumentsPage.vue +4 -2
  57. package/src/pages/Marketplace/CreateParentOffer/ui/CreateParentOfferPage.vue +3 -3
  58. package/src/pages/Marketplace/MainPage/ui/MainPage.vue +13 -13
  59. package/src/pages/Marketplace/Moderation/ui/ModerationPage.vue +7 -3
  60. package/src/pages/Marketplace/OfferPage/ui/OfferPage.vue +4 -2
  61. package/src/pages/Registrator/SignUp/PayInitial.vue +4 -2
  62. package/src/pages/Registrator/SignUp/ReadStatement.vue +7 -1
  63. package/src/pages/Registrator/SignUp/SelectBranch.vue +5 -3
  64. package/src/pages/Registrator/SignUp/SignUp.vue +7 -7
  65. package/src/pages/Registrator/SignUp/WaitingRegistration.vue +4 -2
  66. package/src/pages/Union/Connection/ConnectionPage.vue +1 -1
  67. package/src/pages/_layouts/default.vue +3 -2
  68. package/src/shared/store/index.ts +16 -18
  69. package/src/shared/ui/BaseDocument/BaseDocument.vue +1 -3
  70. package/src/shared/ui/Providers/Bank/Bank.vue +54 -2
  71. package/src/shared/ui/UserDataForm/OrganizationDataForm/OrganizationDataForm.vue +1 -1
  72. package/src/widgets/Agreementer/RequireAgreements/ui/RequireAgreements.vue +5 -3
  73. package/src/widgets/Cooperative/Agenda/ListOfQuestions/ui/ListOfQuestions.vue +11 -3
  74. package/src/widgets/Cooperative/Contacts/ui/ChangeContacts.vue +5 -3
  75. package/src/widgets/Cooperative/Contributions/ui/ChangeContributions.vue +6 -4
  76. package/src/widgets/Cooperative/Funds/ui/AccumulationFunds.vue +8 -7
  77. package/src/widgets/Cooperative/Funds/ui/AddAccumulationFund.vue +5 -3
  78. package/src/widgets/Cooperative/Funds/ui/AddExpenseFund.vue +5 -3
  79. package/src/widgets/Cooperative/Funds/ui/ExpenseFunds.vue +8 -7
  80. package/src/widgets/Cooperative/Members/ui/Members.vue +4 -2
  81. package/src/widgets/Desktop/SecondLevelMenu/SecondLevelMenu.vue +4 -2
  82. package/src/widgets/Desktop/SecondLevelMenuList/SecondLevelMenuList.vue +61 -62
  83. package/src/widgets/Desktop/WorkspaceMenu/WorkspaceMenu.vue +5 -3
  84. package/src/widgets/Request/CreateChildOrderCard/CreateChildOrderCard.vue +5 -3
  85. package/src/widgets/Request/SupplyOrderRequestCard/ui/Steps/FirstStep.vue +3 -3
  86. package/src/widgets/User/CoopCard/ui/CoopCard.vue +5 -1
  87. package/src/widgets/User/PaymentMethods/ui/PaymentMethods.vue +4 -2
  88. package/src/shared/api/wif.ts +0 -9
@@ -16,7 +16,9 @@ import { Cooperative } from 'cooptypes';
16
16
  import { useCooperativeStore } from 'src/entities/Cooperative';
17
17
  import { useUpdateMeta } from 'src/features/User/UpdateMeta';
18
18
  import { FailAlert, SuccessAlert } from 'src/shared/api';
19
- import { COOPNAME } from 'src/shared/config';
19
+ import { useSystemStore } from 'src/entities/System/model';
20
+ const { info } = useSystemStore()
21
+
20
22
  import { ref, watch } from 'vue';
21
23
 
22
24
  const coop = useCooperativeStore()
@@ -31,7 +33,7 @@ watch(() => coop.contacts, (newValue: Cooperative.Model.IContacts | undefined) =
31
33
  }
32
34
  })
33
35
 
34
- coop.loadPublicCooperativeData(COOPNAME)
36
+ coop.loadPublicCooperativeData(info.coopname)
35
37
  coop.loadContacts()
36
38
 
37
39
  const update = async () => {
@@ -40,7 +42,7 @@ const update = async () => {
40
42
 
41
43
  try {
42
44
  await updateMeta(
43
- COOPNAME,
45
+ info.coopname,
44
46
  {
45
47
  phone: phone.value,
46
48
  email: email.value
@@ -4,12 +4,14 @@ import { useCooperativeStore } from 'src/entities/Cooperative';
4
4
  import { useSessionStore } from 'src/entities/Session';
5
5
  import { useUpdateCoop } from 'src/features/Cooperative/UpdateCoop';
6
6
  import { FailAlert, SuccessAlert } from 'src/shared/api';
7
- import { COOPNAME, CURRENCY } from 'src/shared/config';
7
+ import { CURRENCY } from 'src/shared/config';
8
8
  import { formatToAsset } from 'src/shared/lib/utils/formatToAsset';
9
9
  import { ref, watch } from 'vue';
10
+ import { useSystemStore } from 'src/entities/System/model';
11
+ const { info } = useSystemStore()
10
12
 
11
13
  const coop = useCooperativeStore()
12
- coop.loadPublicCooperativeData(COOPNAME)
14
+ coop.loadPublicCooperativeData(info.coopname)
13
15
  coop.loadPrivateCooperativeData()
14
16
 
15
17
  const localCoop = ref({
@@ -25,7 +27,7 @@ const save = async () => {
25
27
  if (coop.publicCooperativeData)
26
28
  try {
27
29
  await updateCoop({
28
- coopname: COOPNAME,
30
+ coopname: info.coopname,
29
31
  username: session.username,
30
32
  initial: formatToAsset(localCoop.value.initial, CURRENCY),
31
33
  minimum: formatToAsset(localCoop.value.minimum, CURRENCY),
@@ -34,7 +36,7 @@ const save = async () => {
34
36
  announce: coop.publicCooperativeData?.announce,
35
37
  description: coop.publicCooperativeData?.description
36
38
  })
37
- await coop.loadPublicCooperativeData(COOPNAME)
39
+ await coop.loadPublicCooperativeData(info.coopname)
38
40
 
39
41
  SuccessAlert('Размеры взносов успешно обновлены')
40
42
  } catch (e: any) {
@@ -2,18 +2,19 @@
2
2
  import { computed, ref } from 'vue';
3
3
  import { FundContract } from 'cooptypes';
4
4
  import { useEditFund } from 'src/features/Fund/EditFund';
5
- import { COOPNAME } from 'src/shared/config';
6
5
  import { useSessionStore } from 'src/entities/Session';
7
6
  import { FailAlert, SuccessAlert } from 'src/shared/api';
8
7
  import { useCooperativeStore } from 'src/entities/Cooperative';
9
8
  import AddAccumulationFund from './AddAccumulationFund.vue'
10
9
  import { useDeleteFund } from 'src/features/Fund/DeleteFund';
10
+ import { useSystemStore } from 'src/entities/System/model';
11
+ const { info } = useSystemStore()
11
12
 
12
13
  const coop = useCooperativeStore()
13
14
 
14
15
  const loadFunds = async () => {
15
16
  try {
16
- await coop.loadFunds(COOPNAME)
17
+ await coop.loadFunds(info.coopname)
17
18
  } catch(e: any){
18
19
  FailAlert(e.message)
19
20
  }
@@ -37,13 +38,13 @@ const delFund = async(fund: FundContract.Tables.AccumulatedFunds.IAccumulatedFun
37
38
  const { deleteFund } = useDeleteFund()
38
39
  try {
39
40
  await deleteFund({
40
- coopname: COOPNAME,
41
+ coopname: info.coopname,
41
42
  username: session.username,
42
43
  type: 'accumulation',
43
44
  fund_id: fund.id
44
45
  })
45
46
 
46
- await coop.loadFunds(COOPNAME)
47
+ await coop.loadFunds(info.coopname)
47
48
  SuccessAlert('Фонд успешно удалён')
48
49
 
49
50
  } catch (e: any){
@@ -59,7 +60,7 @@ const saveFund = async (fund: FundContract.Tables.AccumulatedFunds.IAccumulatedF
59
60
  try {
60
61
 
61
62
  await editFund({
62
- coopname: COOPNAME,
63
+ coopname: info.coopname,
63
64
  username: session.username,
64
65
  type: 'accumulation',
65
66
  fund_id: fund.id,
@@ -69,12 +70,12 @@ const saveFund = async (fund: FundContract.Tables.AccumulatedFunds.IAccumulatedF
69
70
  percent: percent
70
71
  })
71
72
 
72
- await coop.loadFunds(COOPNAME)
73
+ await coop.loadFunds(info.coopname)
73
74
 
74
75
  SuccessAlert('Фонд успешно обновлён')
75
76
  } catch(e: any){
76
77
  FailAlert(e.message)
77
- await coop.loadFunds(COOPNAME)
78
+ await coop.loadFunds(info.coopname)
78
79
  }
79
80
 
80
81
  };
@@ -3,7 +3,9 @@ import { useCooperativeStore } from 'src/entities/Cooperative';
3
3
  import { useSessionStore } from 'src/entities/Session';
4
4
  import { useCreateFund } from 'src/features/Fund/CreateFund';
5
5
  import { FailAlert, SuccessAlert } from 'src/shared/api';
6
- import { COOPNAME } from 'src/shared/config';
6
+ import { useSystemStore } from 'src/entities/System/model';
7
+ const { info } = useSystemStore()
8
+
7
9
  import { ref, watch } from 'vue';
8
10
 
9
11
  const props = defineProps({
@@ -27,7 +29,7 @@ const percent = ref()
27
29
  const addFund = async() => {
28
30
  try{
29
31
  await createFund({
30
- coopname: COOPNAME,
32
+ coopname: info.coopname,
31
33
  username: session.username,
32
34
  type: 'accumulation',
33
35
  contract: '',
@@ -36,7 +38,7 @@ const addFund = async() => {
36
38
  percent: Number(percent.value) * 10000
37
39
  })
38
40
 
39
- await coop.loadFunds(COOPNAME)
41
+ await coop.loadFunds(info.coopname)
40
42
  localShowAdd.value = false
41
43
  name.value = ''
42
44
  description.value = ''
@@ -3,7 +3,9 @@ import { useCooperativeStore } from 'src/entities/Cooperative';
3
3
  import { useSessionStore } from 'src/entities/Session';
4
4
  import { useCreateFund } from 'src/features/Fund/CreateFund';
5
5
  import { FailAlert, SuccessAlert } from 'src/shared/api';
6
- import { COOPNAME } from 'src/shared/config';
6
+ import { useSystemStore } from 'src/entities/System/model';
7
+ const { info } = useSystemStore()
8
+
7
9
  import { ref, watch } from 'vue';
8
10
 
9
11
  const props = defineProps({
@@ -26,7 +28,7 @@ const description = ref('')
26
28
  const addFund = async() => {
27
29
  try{
28
30
  await createFund({
29
- coopname: COOPNAME,
31
+ coopname: info.coopname,
30
32
  username: session.username,
31
33
  type: 'expend',
32
34
  contract: '',
@@ -35,7 +37,7 @@ const addFund = async() => {
35
37
  percent: 0
36
38
  })
37
39
 
38
- await coop.loadFunds(COOPNAME)
40
+ await coop.loadFunds(info.coopname)
39
41
  localShowAdd.value = false
40
42
  name.value = ''
41
43
  description.value = ''
@@ -2,18 +2,19 @@
2
2
  import { computed, ref } from 'vue';
3
3
  import { FundContract } from 'cooptypes';
4
4
  import { useEditFund } from 'src/features/Fund/EditFund';
5
- import { COOPNAME } from 'src/shared/config';
6
5
  import { useSessionStore } from 'src/entities/Session';
7
6
  import { FailAlert, SuccessAlert } from 'src/shared/api';
8
7
  import { useCooperativeStore } from 'src/entities/Cooperative';
9
8
  import AddExpenseFund from './AddExpenseFund.vue'
10
9
  import { useDeleteFund } from 'src/features/Fund/DeleteFund';
10
+ import { useSystemStore } from 'src/entities/System/model';
11
+ const { info } = useSystemStore()
11
12
 
12
13
  const coop = useCooperativeStore()
13
14
 
14
15
  const loadFunds = async () => {
15
16
  try {
16
- await coop.loadFunds(COOPNAME)
17
+ await coop.loadFunds(info.coopname)
17
18
  } catch(e: any){
18
19
  FailAlert(e.message)
19
20
  }
@@ -31,13 +32,13 @@ const delFund = async(fund: FundContract.Tables.AccumulatedFunds.IAccumulatedFun
31
32
  const { deleteFund } = useDeleteFund()
32
33
  try {
33
34
  await deleteFund({
34
- coopname: COOPNAME,
35
+ coopname: info.coopname,
35
36
  username: session.username,
36
37
  type: 'expend',
37
38
  fund_id: fund.id
38
39
  })
39
40
 
40
- await coop.loadFunds(COOPNAME)
41
+ await coop.loadFunds(info.coopname)
41
42
  SuccessAlert('Фонд успешно удалён')
42
43
 
43
44
  } catch (e: any){
@@ -52,7 +53,7 @@ const saveFund = async (fund: FundContract.Tables.AccumulatedFunds.IAccumulatedF
52
53
  try {
53
54
 
54
55
  await editFund({
55
- coopname: COOPNAME,
56
+ coopname: info.coopname,
56
57
  username: session.username,
57
58
  type: 'expend',
58
59
  fund_id: fund.id,
@@ -62,12 +63,12 @@ const saveFund = async (fund: FundContract.Tables.AccumulatedFunds.IAccumulatedF
62
63
  percent: 0
63
64
  })
64
65
 
65
- await coop.loadFunds(COOPNAME)
66
+ await coop.loadFunds(info.coopname)
66
67
 
67
68
  SuccessAlert('Фонд успешно обновлён')
68
69
  } catch(e: any){
69
70
  FailAlert(e.message)
70
- await coop.loadFunds(COOPNAME)
71
+ await coop.loadFunds(info.coopname)
71
72
  }
72
73
 
73
74
  };
@@ -76,7 +76,9 @@ import { Notify } from 'quasar';
76
76
  import { readBlockchain } from 'src/shared/api'
77
77
  import { useSessionStore } from 'src/entities/Session';
78
78
  import { useUpdateBoard } from 'src/features/Cooperative/UpdateBoard';
79
- import { COOPNAME } from 'src/shared/config';
79
+ import { useSystemStore } from 'src/entities/System/model';
80
+ const { info } = useSystemStore()
81
+
80
82
  import { useCooperativeStore } from 'src/entities/Cooperative';
81
83
  import { sleep } from 'src/shared/api/sleep';
82
84
 
@@ -173,7 +175,7 @@ const updateBoard = async (new_members: any) => {
173
175
  const coop = useUpdateBoard()
174
176
 
175
177
  await coop.updateBoard({
176
- coopname: COOPNAME,
178
+ coopname: info.coopname,
177
179
  username: useSessionStore().username,
178
180
  board_id: 0,
179
181
  members: new_members,
@@ -19,7 +19,7 @@ q-tabs(
19
19
  :name="route.meta.title"
20
20
  :label="route.meta.title"
21
21
  :to="{ name: route.name }"
22
- :params="{coopname: COOPNAME}"
22
+ :params="{coopname: info.coopname}"
23
23
  )
24
24
 
25
25
 
@@ -30,7 +30,9 @@ import { ref, watch } from 'vue';
30
30
  import { useRoute } from 'vue-router';
31
31
  import { useDesktopStore } from 'src/entities/Desktop/model';
32
32
  import { type IRoute } from 'src/entities/Desktop/model/types';
33
- import { COOPNAME } from 'src/shared/config';
33
+ import { useSystemStore } from 'src/entities/System/model';
34
+ const { info } = useSystemStore()
35
+
34
36
  const desktop = useDesktopStore()
35
37
  const routes = ref<IRoute[]>([])
36
38
  const route = useRoute()
@@ -1,37 +1,41 @@
1
1
  <template lang="pug">
2
- q-list(
3
- v-if="routes"
4
- class="second-menu"
5
- )
6
-
7
- q-item(
8
- v-for="route in routes"
9
- :key="route.name"
10
- clickable
11
- v-ripple
12
- :active="isActive(route)"
13
- active-class="bg-gradient-dark text-white"
14
- @click="navigate(route)"
2
+ q-list(
3
+ v-if="filteredRoutes"
4
+ class="second-menu"
15
5
  )
16
6
 
17
- q-item-section
18
- q-item-label.no-select {{ route.meta.title }}
7
+ q-item(
8
+ v-for="route in filteredRoutes"
9
+ :key="route.name"
10
+ clickable
11
+ v-ripple
12
+ :active="isActive(route)"
13
+ active-class="bg-gradient-dark text-white"
14
+ @click="navigate(route)"
15
+ )
16
+
17
+ q-item-section
18
+ q-item-label.no-select
19
+ span {{ route.meta.title }}
20
+
21
+ // показываем иконку замка с цветом если требуется роль не user
22
+ q-icon(v-if="route.meta.roles && !route.meta.roles.includes('user') && route.meta.roles.length > 0" name="fa-solid fa-lock-open" :color="context.userRole == 'member' ? 'orange' : 'teal' ")
19
23
 
20
24
  </template>
21
25
 
22
26
  <script lang="ts" setup>
23
27
  import { useCurrentUserStore } from 'src/entities/User';
24
- import { ref, watch } from 'vue';
28
+ import { computed } from 'vue';
25
29
  import { useRoute, useRouter } from 'vue-router';
26
30
  import { useDesktopStore } from 'src/entities/Desktop/model';
27
31
  import { type IRoute } from 'src/entities/Desktop/model/types';
28
- import { COOPNAME } from 'src/shared/config';
32
+ import { useSystemStore } from 'src/entities/System/model';
29
33
 
30
- const desktop = useDesktopStore()
31
- const routes = ref<IRoute[]>([])
32
- const route = useRoute()
33
- const router = useRouter()
34
- const user = useCurrentUserStore()
34
+ const desktop = useDesktopStore();
35
+ const route = useRoute();
36
+ const router = useRouter();
37
+ const user = useCurrentUserStore();
38
+ const { info } = useSystemStore();
35
39
 
36
40
  const evaluateCondition = (condition: string, context: Record<string, any>): boolean => {
37
41
  try {
@@ -43,7 +47,7 @@ q-list(
43
47
  }
44
48
  };
45
49
 
46
- const init = () => {
50
+ const context = computed(() => {
47
51
  const isCoop = user.userAccount?.type === 'organization' &&
48
52
  user.userAccount?.private_data &&
49
53
  'type' in user.userAccount.private_data &&
@@ -51,38 +55,34 @@ q-list(
51
55
 
52
56
  const userRole = user.userAccount?.role || 'user';
53
57
 
54
- const context = {
58
+ return {
55
59
  isCoop,
56
60
  userRole,
57
61
  userAccount: user.userAccount,
58
- coopname: COOPNAME,
59
- // любые другие свойства, которые нужно использовать в условиях
62
+ coopname: info.coopname,
60
63
  };
64
+ });
61
65
 
62
- routes.value = (desktop.getSecondLevel(route) as unknown as IRoute[]).filter(
63
- (route) => {
64
- const rolesMatch = route.meta?.roles?.includes(userRole) || route.meta?.roles?.length === 0;
66
+ const filteredRoutes = computed(() => {
67
+ const secondLevelRoutes = desktop.getSecondLevel(route) as unknown as IRoute[];
68
+ return secondLevelRoutes.filter((route) => {
69
+ const rolesMatch = route.meta?.roles?.includes(context.value.userRole) || route.meta?.roles?.length === 0;
65
70
  const conditionMatch = route.meta?.conditions
66
- ? evaluateCondition(route.meta.conditions, context)
71
+ ? evaluateCondition(route.meta.conditions, context.value)
67
72
  : true; // Если условия нет, пропускаем проверку
68
73
  return rolesMatch && conditionMatch;
69
- }
70
- );
71
- }
74
+ });
75
+ });
72
76
 
73
77
  // Функция проверки активного маршрута
74
78
  const isActive = (routeToCheck: IRoute) => {
75
- return route.name === routeToCheck.name
76
- }
79
+ return route.name === routeToCheck.name;
80
+ };
77
81
 
78
82
  // Функция навигации при клике на элемент
79
83
  const navigate = (routeToNavigate: IRoute) => {
80
- router.push({ name: routeToNavigate.name, params: { coopname: COOPNAME } });
81
- }
82
-
83
- init()
84
-
85
- watch(route, () => init())
84
+ router.push({ name: routeToNavigate.name, params: { coopname: info.coopname } });
85
+ };
86
86
  </script>
87
87
 
88
88
  <style>
@@ -91,26 +91,25 @@ q-list(
91
91
  }
92
92
 
93
93
  .custom-ripple {
94
- position: relative;
95
- overflow: hidden;
96
- }
97
-
98
- .custom-ripple::before {
99
- content: "";
100
- position: absolute;
101
- top: 0;
102
- left: 0;
103
- width: 100%;
104
- height: 100%;
105
- background: rgba(0, 0, 0, 0.1);
106
- transform: scaleX(0);
107
- transform-origin: left;
108
- transition: transform 0.4s ease-out;
109
- z-index: 0;
110
- }
111
-
112
- .custom-ripple:active::before {
113
- transform: scaleX(1);
114
- }
94
+ position: relative;
95
+ overflow: hidden;
96
+ }
115
97
 
98
+ .custom-ripple::before {
99
+ content: "";
100
+ position: absolute;
101
+ top: 0;
102
+ left: 0;
103
+ width: 100%;
104
+ height: 100%;
105
+ background: rgba(0, 0, 0, 0.1);
106
+ transform: scaleX(0);
107
+ transform-origin: left;
108
+ transition: transform 0.4s ease-out;
109
+ z-index: 0;
110
+ }
111
+
112
+ .custom-ripple:active::before {
113
+ transform: scaleX(1);
114
+ }
116
115
  </style>
@@ -20,7 +20,9 @@ div
20
20
  import { computed } from 'vue'
21
21
  import { useRouter, useRoute } from 'vue-router'
22
22
  import { useQuasar } from 'quasar'
23
- import { COOPNAME } from 'src/shared/config'
23
+ import { useSystemStore } from 'src/entities/System/model';
24
+ const { info } = useSystemStore()
25
+
24
26
  import { useCurrentUserStore } from 'src/entities/User'
25
27
  import { type IRoute } from 'src/entities/Desktop/model/types'
26
28
  import { useDesktopStore } from 'src/entities/Desktop/model'
@@ -46,8 +48,8 @@ div
46
48
 
47
49
  const open = (route: IRoute) => {
48
50
  if (route.children)
49
- router.push({ name: route.children[0].name, params: { coopname: COOPNAME } })
50
- else router.push({ name: route.name, params: { coopname: COOPNAME } })
51
+ router.push({ name: route.children[0].name, params: { coopname: info.coopname } })
52
+ else router.push({ name: route.name, params: { coopname: info.coopname } })
51
53
 
52
54
  }
53
55
 
@@ -4,11 +4,13 @@ import { Map } from 'src/shared/ui/Map'
4
4
  import { CreateChildOrderButton } from 'src/features/Request/CreateChildOrder'
5
5
  import type { IRequestData } from 'src/entities/Request'
6
6
  import { useCooperativeStore, type IAddressesData } from 'src/entities/Cooperative'
7
- import { COOPNAME } from 'src/shared/config'
7
+
8
8
  import { useSessionStore } from 'src/entities/Session'
9
9
  const session = useSessionStore()
10
10
  const username = computed(() => session.username)
11
11
  const cooperativeStore = useCooperativeStore()
12
+ import { useSystemStore } from 'src/entities/System/model';
13
+ const { info } = useSystemStore()
12
14
 
13
15
  let units = ref(1)
14
16
  const selectedAddress = ref<IAddressesData>()
@@ -27,7 +29,7 @@ cooperativeStore.addresses.map((el: any) => {
27
29
  )
28
30
 
29
31
  onMounted(async () => {
30
- await cooperativeStore.loadAddresses({ coopname: COOPNAME })
32
+ await cooperativeStore.loadAddresses({ coopname: info.coopname })
31
33
  selectedAddress.value = addresses.value[0]
32
34
  })
33
35
 
@@ -53,5 +55,5 @@ div.q-pl-md.q-pr-md
53
55
 
54
56
  q-input(v-model="units" label="Введите количество единиц")
55
57
 
56
- CreateChildOrderButton(:coopname="COOPNAME" :username="username" :offer="offer" :units="units")
58
+ CreateChildOrderButton(:coopname="info.coopname" :username="username" :offer="offer" :units="units")
57
59
  </template>
@@ -24,10 +24,10 @@ div
24
24
  span Пожалуйста, подтвердите свою готовность совершить поставку.
25
25
 
26
26
  q-stepper-navigation.q-gutter-sm
27
- DeclineButton(v-if="iAmSupplier && isActive" :request-id=Number("request.id") :coopname="request.coopname" :username="username")
27
+ DeclineButton(v-if="iAmSupplier && isActive" :request-id="Number(request.id)" :coopname="request.coopname" :username="username")
28
28
  //- q-btn(v-if="iAmSupplier && isActive" @click="decline") Отклонить
29
- AcceptButton(v-if="iAmSupplier && isActive" :request-id=Number("request.id") :coopname="request.coopname" :username="username")
30
-
29
+ AcceptButton(v-if="iAmSupplier && isActive" :request-id="Number(request.id)" :coopname="request.coopname" :username="username")
30
+ p {{request}}
31
31
  template(v-else)
32
32
  q-step(
33
33
  :name="1"
@@ -8,7 +8,9 @@ div.q-pa-md
8
8
  AutoAvatar(style="width: 60px; border-radius: 50%;" :username="currentUser.username")
9
9
  div.col-12.col-md-9.q-mt-sm.q-mt-md-0
10
10
  q-badge(color="primary" style="font-size: 12px; margin-bottom: 4px;") {{role}}
11
- div.text-h6 {{displayName}}
11
+ div.text-h6
12
+ span(v-if="isIP").q-mr-sm ИП
13
+ | {{displayName}}
12
14
  div.row
13
15
  DepositButton.col-6.border-left-radius-buttons
14
16
  WithdrawButton.col-6.border-right-radius-buttons
@@ -34,6 +36,8 @@ const currentUser = useCurrentUserStore()
34
36
 
35
37
  const userType = computed(() => currentUser.userAccount?.type)
36
38
 
39
+ const isIP = computed(() => currentUser.userAccount?.type === 'entrepreneur')
40
+
37
41
  const role = computed(() => {
38
42
  if (currentUser.userAccount?.role === 'user')
39
43
  return 'Пайщик'
@@ -85,7 +85,9 @@ div(flat bordered).q-pa-md
85
85
 
86
86
  <script lang="ts" setup>
87
87
  import { useWalletStore } from 'src/entities/Wallet';
88
- import { COOPNAME } from 'src/shared/config';
88
+ import { useSystemStore } from 'src/entities/System/model';
89
+ const { info } = useSystemStore()
90
+
89
91
  import { computed } from 'vue';
90
92
  import { AddPaymentMethodButton } from 'src/features/PaymentMethod/AddPaymentMethod';
91
93
  import type { IBankTransferData, ISBPData } from 'src/features/PaymentMethod/AddPaymentMethod/model';
@@ -102,7 +104,7 @@ const wallet = useWalletStore()
102
104
 
103
105
  const username = computed(() => props.username)
104
106
 
105
- wallet.loadUserWalet({ coopname: COOPNAME, username: username.value })
107
+ wallet.loadUserWalet({ coopname: info.coopname, username: username.value })
106
108
 
107
109
  function isSBPData(data: ISBPData | IBankTransferData): data is ISBPData {
108
110
  return (data as ISBPData).phone !== undefined;
@@ -1,9 +0,0 @@
1
- import { LocalStorage } from 'quasar'
2
- import { COOPNAME } from '../config'
3
-
4
- export function getWIF(): string {
5
- const wif = LocalStorage.getItem(`${COOPNAME}:WIF`) as string
6
- if (!wif) throw new Error('Ошибка авторизации: приватный ключ не найден')
7
-
8
- return wif
9
- }