@coopenomics/desktop 2.2.5 → 2.2.6
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/CHANGELOG.md +8 -0
- package/extensions/powerup/boot.ts +1 -1
- package/package.json +6 -6
- package/src/app/App.vue +4 -2
- package/src/app/providers/card/store.ts +6 -3
- package/src/boot/branch-selector.ts +0 -2
- package/src/boot/navigation-guards.ts +5 -7
- package/src/components/menu/footerMobileMenu.vue +4 -2
- package/src/components/soviet/staff.vue +9 -7
- package/src/desktops/User/model/index.ts +94 -87
- package/src/entities/Request/api/index.ts +19 -19
- package/src/entities/Request/model/stores.ts +1 -0
- package/src/entities/User/model/entity.ts +1 -0
- package/src/features/Agreementer/GenerateAgreement/ui/AgreementReader.vue +4 -2
- package/src/features/Agreementer/SignAgreementDialog/model/index.ts +4 -3
- package/src/features/Agreementer/SignAgreementDialog/ui/SignAgreementDialog.vue +4 -2
- package/src/features/Branch/CreateBranch/model/index.ts +4 -3
- package/src/features/Branch/EditBranch/model/index.ts +3 -2
- package/src/features/Decision/AuthorizeAndExecDecision/model/index.ts +6 -6
- package/src/features/Decision/VoteForDecision/model/index.ts +4 -2
- package/src/features/Installer/ui/RequestKeyForm/RequestKeyForm.vue +4 -2
- package/src/features/PaymentMethod/AddPaymentMethod/model/index.ts +4 -6
- package/src/features/PaymentMethod/DeletePaymentMethod/model/index.ts +3 -2
- package/src/features/Request/AcceptRequest/api/index.ts +20 -21
- package/src/features/Request/CancelRequest/api/index.ts +13 -17
- package/src/features/Request/CompleteOnRequest/api/index.ts +13 -17
- package/src/features/Request/ConfirmRecieveOnRequest/api/index.ts +17 -21
- package/src/features/Request/ConfirmSupplyOnRequest/api/index.ts +17 -21
- package/src/features/Request/CreateChildOrder/api/index.ts +27 -30
- package/src/features/Request/CreateParentOffer/api/index.ts +4 -14
- package/src/features/Request/CreateParentOffer/ui/CreateParentOfferForm/CreateParentOfferForm.vue +5 -2
- package/src/features/Request/DeclineRequest/api/index.ts +14 -18
- package/src/features/Request/DeliverOnRequest/api/index.ts +13 -17
- package/src/features/Request/DisputeOnRequest/api/index.ts +3 -7
- package/src/features/Request/ModerateRequest/api/index.ts +14 -18
- package/src/features/Request/ModerateRequest/ui/ModerateRequestButton.vue +4 -3
- package/src/features/Request/ProhibitRequest/api/index.ts +14 -18
- package/src/features/Request/PublishRequest/api/index.ts +13 -17
- package/src/features/Request/RecieveOnRequest/api/index.ts +17 -21
- package/src/features/Request/SupplyOnRequest/api/index.ts +3 -3
- package/src/features/Request/UnpublishRequest/api/index.ts +14 -17
- package/src/features/Request/UpdateRequest/api/index.ts +0 -4
- package/src/features/User/AddUser/ui/AddUserDialog/AddUserDialog.vue +4 -2
- package/src/features/User/CreateUser/model/index.ts +10 -8
- package/src/features/User/LoginUser/ui/LoginForm/LoginForm.vue +4 -2
- package/src/features/Wallet/DepositToWallet/ui/DepositButton/DepositButton.vue +4 -2
- package/src/pages/Cooperative/ListOfBranches/ui/ListOfBranchesPage.vue +4 -2
- package/src/pages/Documentor/ListOfDocuments/ListOfDocumentsPage.vue +4 -2
- package/src/pages/Marketplace/CreateParentOffer/ui/CreateParentOfferPage.vue +3 -3
- package/src/pages/Marketplace/MainPage/ui/MainPage.vue +13 -13
- package/src/pages/Marketplace/Moderation/ui/ModerationPage.vue +7 -3
- package/src/pages/Marketplace/OfferPage/ui/OfferPage.vue +4 -2
- package/src/pages/Registrator/SignUp/PayInitial.vue +4 -2
- package/src/pages/Registrator/SignUp/ReadStatement.vue +7 -1
- package/src/pages/Registrator/SignUp/SelectBranch.vue +4 -2
- package/src/pages/Registrator/SignUp/SignUp.vue +7 -7
- package/src/pages/Registrator/SignUp/WaitingRegistration.vue +4 -2
- package/src/pages/Union/Connection/ConnectionPage.vue +1 -1
- package/src/pages/_layouts/default.vue +3 -2
- package/src/shared/store/index.ts +16 -18
- package/src/shared/ui/BaseDocument/BaseDocument.vue +1 -3
- package/src/shared/ui/Providers/Bank/Bank.vue +54 -2
- package/src/widgets/Agreementer/RequireAgreements/ui/RequireAgreements.vue +5 -3
- package/src/widgets/Cooperative/Agenda/ListOfQuestions/ui/ListOfQuestions.vue +11 -3
- package/src/widgets/Cooperative/Contacts/ui/ChangeContacts.vue +5 -3
- package/src/widgets/Cooperative/Contributions/ui/ChangeContributions.vue +6 -4
- package/src/widgets/Cooperative/Funds/ui/AccumulationFunds.vue +8 -7
- package/src/widgets/Cooperative/Funds/ui/AddAccumulationFund.vue +5 -3
- package/src/widgets/Cooperative/Funds/ui/AddExpenseFund.vue +5 -3
- package/src/widgets/Cooperative/Funds/ui/ExpenseFunds.vue +8 -7
- package/src/widgets/Cooperative/Members/ui/Members.vue +4 -2
- package/src/widgets/Desktop/SecondLevelMenu/SecondLevelMenu.vue +4 -2
- package/src/widgets/Desktop/SecondLevelMenuList/SecondLevelMenuList.vue +61 -62
- package/src/widgets/Desktop/WorkspaceMenu/WorkspaceMenu.vue +5 -3
- package/src/widgets/Request/CreateChildOrderCard/CreateChildOrderCard.vue +5 -3
- package/src/widgets/Request/SupplyOrderRequestCard/ui/Steps/FirstStep.vue +3 -3
- package/src/widgets/User/PaymentMethods/ui/PaymentMethods.vue +4 -2
- package/src/shared/api/wif.ts +0 -9
@@ -1,37 +1,41 @@
|
|
1
1
|
<template lang="pug">
|
2
|
-
q-list(
|
3
|
-
|
4
|
-
|
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
|
18
|
-
|
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 {
|
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 {
|
32
|
+
import { useSystemStore } from 'src/entities/System/model';
|
29
33
|
|
30
|
-
const desktop = useDesktopStore()
|
31
|
-
const
|
32
|
-
const
|
33
|
-
const
|
34
|
-
const
|
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
|
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
|
-
|
58
|
+
return {
|
55
59
|
isCoop,
|
56
60
|
userRole,
|
57
61
|
userAccount: user.userAccount,
|
58
|
-
coopname:
|
59
|
-
// любые другие свойства, которые нужно использовать в условиях
|
62
|
+
coopname: info.coopname,
|
60
63
|
};
|
64
|
+
});
|
61
65
|
|
62
|
-
|
63
|
-
(route)
|
64
|
-
|
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:
|
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
|
-
|
95
|
-
|
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 {
|
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:
|
50
|
-
else router.push({ name: route.name, params: { 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
|
-
|
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:
|
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="
|
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(
|
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(
|
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"
|
@@ -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 {
|
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:
|
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;
|
package/src/shared/api/wif.ts
DELETED
@@ -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
|
-
}
|