@coopenomics/desktop 2025.6.19 → 2025.6.24
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/package.json +7 -7
- package/src/entities/Branch/api/index.ts +1 -2
- package/src/entities/Branch/model/types.ts +2 -1
- package/src/features/Branch/CreateBranch/ui/CreateBranchButton.vue +85 -33
- package/src/features/Branch/DeleteBranch/api/index.ts +15 -0
- package/src/features/Branch/DeleteBranch/index.ts +1 -0
- package/src/features/Branch/DeleteBranch/model/index.ts +44 -0
- package/src/features/Branch/DeleteBranch/ui/DeleteBranchButton.vue +56 -0
- package/src/features/Cooperative/UpdateBoard/index.ts +1 -0
- package/src/features/Cooperative/UpdateBoard/ui/AddMemberDialog.vue +59 -0
- package/src/features/Cooperative/UpdateBoard/ui/index.ts +1 -0
- package/src/features/Meet/CreateMeet/ui/CreateMeetForm.vue +138 -94
- package/src/features/Meet/RestartMeet/ui/RestartMeetForm.vue +135 -73
- package/src/pages/Cooperative/MemberBranchList/ui/MemberBranchListPage.vue +3 -0
- package/src/processes/navigation-guard-setup/index.ts +31 -31
- package/src/shared/ui/UserSearchSelector/UserSearchSelector.vue +328 -0
- package/src/shared/ui/UserSearchSelector/composables/useUserSearch.ts +70 -0
- package/src/shared/ui/UserSearchSelector/index.ts +3 -0
- package/src/shared/ui/UserSearchSelector/model/types.ts +17 -0
- package/src/shared/ui/index.ts +1 -0
- package/src/widgets/Cooperative/Members/ui/Members.vue +167 -135
@@ -1,39 +1,39 @@
|
|
1
1
|
<template lang="pug">
|
2
2
|
div
|
3
|
-
div(v-if=
|
4
|
-
q-card(v-if=
|
5
|
-
q-table(
|
6
|
-
ref=
|
7
|
-
|
8
|
-
|
9
|
-
:
|
10
|
-
:
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
:
|
16
|
-
|
17
|
-
|
3
|
+
div(v-if='members')
|
4
|
+
q-card(v-if='members.length > 0', flat)
|
5
|
+
q-table.full-height(
|
6
|
+
ref='tableRef',
|
7
|
+
flat,
|
8
|
+
bordered,
|
9
|
+
:rows='members',
|
10
|
+
:columns='columns',
|
11
|
+
:table-colspan='9',
|
12
|
+
row-key='username',
|
13
|
+
:pagination='pagination',
|
14
|
+
virtual-scroll,
|
15
|
+
:virtual-scroll-item-size='48',
|
16
|
+
:rows-per-page-options='[10]'
|
17
|
+
)
|
18
18
|
template(#top)
|
19
|
-
q-btn(
|
20
|
-
|
19
|
+
q-btn(
|
20
|
+
icon='add',
|
21
|
+
@click='showAdd = true',
|
22
|
+
color='primary',
|
23
|
+
size='sm'
|
24
|
+
) добавить участника
|
21
25
|
|
22
|
-
template(#header=
|
23
|
-
q-tr(:props=
|
24
|
-
q-th(
|
25
|
-
v-for="col in props.cols"
|
26
|
-
:key="col.name"
|
27
|
-
:props="props"
|
28
|
-
) {{ col.label }}
|
26
|
+
template(#header='props')
|
27
|
+
q-tr(:props='props')
|
28
|
+
q-th(v-for='col in props.cols', :key='col.name', :props='props') {{ col.label }}
|
29
29
|
|
30
30
|
q-th(auto-width)
|
31
31
|
|
32
|
-
template(#body=
|
33
|
-
q-tr(:key=
|
32
|
+
template(#body='props')
|
33
|
+
q-tr(:key='`m_${props.row.username}`', :props='props')
|
34
34
|
q-td
|
35
|
-
q-badge(v-if=
|
36
|
-
q-badge(v-if=
|
35
|
+
q-badge(v-if='props.row.position === "chairman"') Председатель совета
|
36
|
+
q-badge(v-if='props.row.position === "member"') Член совета
|
37
37
|
|
38
38
|
q-td {{ props.row.username }}
|
39
39
|
q-td {{ props.row.last_name }}
|
@@ -44,123 +44,120 @@ div
|
|
44
44
|
q-td {{ props.row.email }}
|
45
45
|
|
46
46
|
q-td(auto-width)
|
47
|
-
q-btn(
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
span Добавить члена совета
|
55
|
-
q-space
|
56
|
-
q-btn(v-close-popup dense flat icon="close")
|
57
|
-
q-tooltip Close
|
47
|
+
q-btn(
|
48
|
+
size='sm',
|
49
|
+
color='red',
|
50
|
+
dense,
|
51
|
+
@click='removeMember(props.row.username)',
|
52
|
+
:loading='showLoading'
|
53
|
+
) удалить
|
58
54
|
|
59
|
-
|
60
|
-
|
61
|
-
p Внимание! Вы собираетесь добавить участника в совет кооператива. Введите идентификатор аккаунта для добавления:
|
62
|
-
div.q-pa-md
|
63
|
-
q-input(v-model="persona.username" label="Идентификатор имени аккаунта" standout="bg-teal text-white")
|
64
|
-
//- q-input(v-model="persona.position_title" label="Позиция")
|
65
|
-
div
|
66
|
-
q-btn(flat @click="showAdd = false") Отменить
|
67
|
-
q-btn(color="primary" @click="addMember" :loading="showLoading") Добавить
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
</template>
|
55
|
+
AddMemberDialog(v-model='showAdd', :loading='showLoading', @add='addMember')
|
56
|
+
</template>
|
72
57
|
|
73
58
|
<script setup lang="ts">
|
74
59
|
import { computed, ref } from 'vue';
|
75
60
|
import { Notify } from 'quasar';
|
76
|
-
import { readBlockchain } from 'src/shared/api'
|
61
|
+
import { readBlockchain } from 'src/shared/api';
|
77
62
|
import { useSessionStore } from 'src/entities/Session';
|
78
|
-
import {
|
63
|
+
import {
|
64
|
+
useUpdateBoard,
|
65
|
+
AddMemberDialog,
|
66
|
+
} from 'src/features/Cooperative/UpdateBoard';
|
79
67
|
import { useSystemStore } from 'src/entities/System/model';
|
80
|
-
const { info } = useSystemStore()
|
68
|
+
const { info } = useSystemStore();
|
81
69
|
|
82
70
|
import { useCooperativeStore } from 'src/entities/Cooperative';
|
83
71
|
import { sleep } from 'src/shared/api/sleep';
|
84
72
|
|
85
|
-
const coop = useCooperativeStore()
|
86
|
-
|
87
|
-
const showAdd = ref(false)
|
73
|
+
const coop = useCooperativeStore();
|
88
74
|
|
89
|
-
const
|
75
|
+
const showAdd = ref(false);
|
90
76
|
|
91
|
-
const
|
92
|
-
username: '',
|
93
|
-
position_title: 'Член совета',
|
94
|
-
})
|
77
|
+
const members = computed(() => coop.privateCooperativeData?.members || []);
|
95
78
|
|
96
79
|
const loadMembers = async () => {
|
97
|
-
coop.loadPrivateCooperativeData()
|
98
|
-
}
|
80
|
+
coop.loadPrivateCooperativeData();
|
81
|
+
};
|
99
82
|
|
100
|
-
const showLoading = ref(false)
|
83
|
+
const showLoading = ref(false);
|
101
84
|
|
102
|
-
loadMembers()
|
85
|
+
loadMembers();
|
103
86
|
|
104
|
-
const addMember = async () => {
|
105
|
-
const verified = await verify(
|
87
|
+
const addMember = async (username: string) => {
|
88
|
+
const verified = await verify(username);
|
106
89
|
|
107
90
|
if (!verified) {
|
108
91
|
Notify.create({
|
109
92
|
message: 'Имя аккаунта на найдено',
|
110
93
|
type: 'negative',
|
111
|
-
})
|
94
|
+
});
|
112
95
|
|
113
|
-
return
|
96
|
+
return;
|
114
97
|
}
|
115
98
|
|
116
|
-
let members_for_send = members.value.map(
|
117
|
-
|
118
|
-
username:
|
119
|
-
position_title:
|
120
|
-
position:
|
121
|
-
is_voting:
|
122
|
-
}
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
99
|
+
let members_for_send = members.value.map(
|
100
|
+
(el: {
|
101
|
+
username: any;
|
102
|
+
position_title: any;
|
103
|
+
position: any;
|
104
|
+
is_voting: any;
|
105
|
+
}) => {
|
106
|
+
return {
|
107
|
+
username: el.username,
|
108
|
+
position_title: el.position_title,
|
109
|
+
position: el.position,
|
110
|
+
is_voting: el.is_voting,
|
111
|
+
};
|
112
|
+
},
|
113
|
+
);
|
114
|
+
|
115
|
+
members_for_send.push({
|
116
|
+
username: username,
|
117
|
+
position_title: 'Член совета',
|
118
|
+
position: 'member',
|
119
|
+
is_voting: true,
|
120
|
+
});
|
121
|
+
|
122
|
+
showLoading.value = true;
|
128
123
|
|
129
124
|
try {
|
130
|
-
await updateBoard(members_for_send)
|
131
|
-
} catch (e: any) {
|
125
|
+
await updateBoard(members_for_send);
|
126
|
+
} catch (e: any) {}
|
132
127
|
|
133
|
-
|
134
|
-
|
135
|
-
showLoading.value = false
|
136
|
-
showAdd.value = false
|
128
|
+
showLoading.value = false;
|
129
|
+
showAdd.value = false;
|
137
130
|
};
|
138
131
|
|
139
132
|
const removeMember = async (username: string) => {
|
140
|
-
let members_for_send = members.value.map(
|
141
|
-
|
142
|
-
username:
|
143
|
-
position_title:
|
144
|
-
position:
|
145
|
-
is_voting:
|
146
|
-
}
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
133
|
+
let members_for_send = members.value.map(
|
134
|
+
(el: {
|
135
|
+
username: any;
|
136
|
+
position_title: any;
|
137
|
+
position: any;
|
138
|
+
is_voting: any;
|
139
|
+
}) => {
|
140
|
+
return {
|
141
|
+
username: el.username,
|
142
|
+
position_title: el.position_title,
|
143
|
+
position: el.position,
|
144
|
+
is_voting: el.is_voting,
|
145
|
+
};
|
146
|
+
},
|
147
|
+
);
|
148
|
+
|
149
|
+
members_for_send = members_for_send.filter(
|
150
|
+
(el: { username: string }) => el.username != username,
|
151
|
+
);
|
152
|
+
showLoading.value = true;
|
151
153
|
|
152
154
|
try {
|
153
|
-
await updateBoard(members_for_send)
|
154
|
-
} catch (e: any) {
|
155
|
-
|
156
|
-
}
|
157
|
-
showLoading.value = false
|
158
|
-
|
159
|
-
|
155
|
+
await updateBoard(members_for_send);
|
156
|
+
} catch (e: any) {}
|
157
|
+
showLoading.value = false;
|
160
158
|
};
|
161
159
|
|
162
160
|
const verify = async (username: string) => {
|
163
|
-
|
164
161
|
try {
|
165
162
|
await readBlockchain.v1.chain.get_account(username);
|
166
163
|
return true;
|
@@ -169,10 +166,9 @@ const verify = async (username: string) => {
|
|
169
166
|
}
|
170
167
|
};
|
171
168
|
|
172
|
-
|
173
169
|
const updateBoard = async (new_members: any) => {
|
174
170
|
try {
|
175
|
-
const coop = useUpdateBoard()
|
171
|
+
const coop = useUpdateBoard();
|
176
172
|
|
177
173
|
await coop.updateBoard({
|
178
174
|
coopname: info.coopname,
|
@@ -180,43 +176,79 @@ const updateBoard = async (new_members: any) => {
|
|
180
176
|
board_id: 0,
|
181
177
|
members: new_members,
|
182
178
|
name: 'Совет',
|
183
|
-
description: 'Совет кооператива'
|
184
|
-
})
|
179
|
+
description: 'Совет кооператива',
|
180
|
+
});
|
185
181
|
|
186
|
-
await sleep(3000)
|
182
|
+
await sleep(3000);
|
187
183
|
|
188
184
|
Notify.create({
|
189
185
|
message: 'Совет обновлен',
|
190
186
|
type: 'positive',
|
191
|
-
})
|
192
|
-
|
193
|
-
loadMembers()
|
194
|
-
|
187
|
+
});
|
195
188
|
|
189
|
+
loadMembers();
|
196
190
|
} catch (e: any) {
|
197
|
-
loadMembers()
|
191
|
+
loadMembers();
|
198
192
|
Notify.create({
|
199
193
|
message: e.message,
|
200
194
|
type: 'negative',
|
201
|
-
})
|
195
|
+
});
|
202
196
|
}
|
203
|
-
}
|
204
|
-
|
205
|
-
|
206
|
-
|
197
|
+
};
|
207
198
|
|
208
199
|
const columns = [
|
209
|
-
{
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
200
|
+
{
|
201
|
+
name: 'position',
|
202
|
+
align: 'left',
|
203
|
+
label: 'Позиция',
|
204
|
+
field: 'position',
|
205
|
+
sortable: true,
|
206
|
+
},
|
207
|
+
{
|
208
|
+
name: 'username',
|
209
|
+
align: 'left',
|
210
|
+
label: 'Аккаунт',
|
211
|
+
field: 'username',
|
212
|
+
sortable: true,
|
213
|
+
},
|
214
|
+
{
|
215
|
+
name: 'last_name',
|
216
|
+
align: 'left',
|
217
|
+
label: 'Фамилия',
|
218
|
+
field: 'last_name',
|
219
|
+
sortable: true,
|
220
|
+
},
|
221
|
+
{
|
222
|
+
name: 'first_name',
|
223
|
+
align: 'left',
|
224
|
+
label: 'Имя',
|
225
|
+
field: 'first_name',
|
226
|
+
sortable: true,
|
227
|
+
},
|
228
|
+
{
|
229
|
+
name: 'middle_name',
|
230
|
+
align: 'left',
|
231
|
+
label: 'Отчество',
|
232
|
+
field: 'middle_name',
|
233
|
+
sortable: true,
|
234
|
+
},
|
214
235
|
// { name: 'middle_name', align: 'left', label: 'Отчество', field: 'middle_name', sortable: true },
|
215
|
-
{
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
236
|
+
{
|
237
|
+
name: 'phone',
|
238
|
+
align: 'left',
|
239
|
+
label: 'Телефон',
|
240
|
+
field: 'phone',
|
241
|
+
sortable: false,
|
242
|
+
},
|
243
|
+
{
|
244
|
+
name: 'email',
|
245
|
+
align: 'left',
|
246
|
+
label: 'Е-почта',
|
247
|
+
field: 'email',
|
248
|
+
sortable: false,
|
249
|
+
},
|
250
|
+
] as any;
|
251
|
+
|
252
|
+
const tableRef = ref(null);
|
253
|
+
const pagination = ref({ rowsPerPage: 10 });
|
222
254
|
</script>
|