hl-core 0.0.7-beta.9 → 0.0.8

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 (52) hide show
  1. package/.prettierrc +2 -1
  2. package/api/index.ts +66 -47
  3. package/api/interceptors.ts +4 -4
  4. package/components/Button/Btn.vue +7 -2
  5. package/components/Button/ScrollButtons.vue +6 -0
  6. package/components/Complex/ContentBlock.vue +5 -0
  7. package/components/{Layout → Dialog}/Dialog.vue +3 -27
  8. package/components/Dialog/FamilyDialog.vue +39 -0
  9. package/components/Form/FormBlock.vue +114 -0
  10. package/components/Form/FormSection.vue +18 -0
  11. package/components/Form/FormTextSection.vue +20 -0
  12. package/components/Form/FormToggle.vue +52 -0
  13. package/components/Form/ProductConditionsBlock.vue +68 -0
  14. package/components/Input/EmptyFormField.vue +5 -0
  15. package/components/Input/FileInput.vue +71 -0
  16. package/components/Input/FormInput.vue +171 -0
  17. package/components/Input/PanelInput.vue +133 -0
  18. package/components/Input/RoundedInput.vue +35 -36
  19. package/components/Layout/Drawer.vue +18 -16
  20. package/components/Layout/Header.vue +4 -18
  21. package/components/Layout/Loader.vue +1 -7
  22. package/components/Layout/SettingsPanel.vue +17 -37
  23. package/components/List/ListEmpty.vue +22 -0
  24. package/components/Menu/MenuNav.vue +22 -20
  25. package/components/Menu/MenuNavItem.vue +6 -6
  26. package/components/Pages/Anketa.vue +333 -0
  27. package/components/Pages/Auth.vue +91 -0
  28. package/components/Pages/Documents.vue +108 -0
  29. package/components/Pages/MemberForm.vue +1138 -0
  30. package/components/Pages/ProductAgreement.vue +18 -0
  31. package/components/Pages/ProductConditions.vue +349 -0
  32. package/components/Panel/PanelItem.vue +2 -4
  33. package/components/Panel/PanelSelectItem.vue +20 -0
  34. package/components/Transitions/FadeTransition.vue +5 -0
  35. package/composables/classes.ts +299 -253
  36. package/composables/constants.ts +14 -7
  37. package/composables/index.ts +55 -60
  38. package/composables/styles.ts +31 -7
  39. package/layouts/default.vue +46 -26
  40. package/layouts/full.vue +2 -12
  41. package/nuxt.config.ts +3 -0
  42. package/package.json +13 -10
  43. package/pages/500.vue +40 -12
  44. package/plugins/helperFunctionsPlugins.ts +6 -2
  45. package/plugins/storePlugin.ts +6 -5
  46. package/store/data.store.js +781 -1880
  47. package/store/member.store.ts +291 -0
  48. package/store/messages.ts +66 -51
  49. package/store/rules.js +26 -28
  50. package/types/index.ts +250 -0
  51. package/composables/models.ts +0 -43
  52. /package/store/{form.store.js → form.store.ts} +0 -0
package/.prettierrc CHANGED
@@ -5,5 +5,6 @@
5
5
  "trailingComma": "all",
6
6
  "bracketSpacing": true,
7
7
  "arrowParens": "avoid",
8
- "endOfLine": "auto"
8
+ "endOfLine": "auto",
9
+ "printWidth": 180
9
10
  }
package/api/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { useAxios } from '@/composables/axios';
2
+ import { Value, IDocument } from '@/composables/classes';
2
3
  import { AxiosRequestConfig } from 'axios';
3
4
 
4
5
  enum Methods {
@@ -7,20 +8,12 @@ enum Methods {
7
8
  }
8
9
 
9
10
  export class ApiClass {
10
- baseURL: string | undefined;
11
- productUrl: string | undefined;
12
-
13
- constructor(baseURL?: string | undefined, productUrl?: string | undefined) {
14
- this.baseURL = baseURL;
15
- this.productUrl = productUrl;
16
- }
11
+ private readonly baseURL: string = import.meta.env.VITE_BASE_URL as string;
12
+ private readonly productUrl: string = import.meta.env.VITE_PRODUCT_URL as string;
17
13
 
18
14
  private async axiosCall(config: AxiosRequestConfig) {
19
15
  const dataStore = useDataStore();
20
- if (
21
- (dataStore.isEFO && this.baseURL) ||
22
- (!dataStore.isEFO && this.baseURL && this.productUrl)
23
- ) {
16
+ if ((dataStore.isEFO && this.baseURL) || (!dataStore.isEFO && this.baseURL && this.productUrl)) {
24
17
  const { data } = await useAxios(this.baseURL as string).request(config);
25
18
  return data;
26
19
  } else {
@@ -29,11 +22,7 @@ export class ApiClass {
29
22
  }
30
23
  }
31
24
 
32
- async loginUser(data: {
33
- login: string;
34
- password: string;
35
- numAttempt: number;
36
- }) {
25
+ async loginUser(data: { login: string; password: string; numAttempt: number }): Promise<{ refreshToken: string; accessToken: string }> {
37
26
  return this.axiosCall({
38
27
  method: Methods.POST,
39
28
  url: '/identity/api/Account/login',
@@ -41,13 +30,7 @@ export class ApiClass {
41
30
  });
42
31
  }
43
32
 
44
- async getNewAccessToken({
45
- refreshToken,
46
- accessToken,
47
- }: {
48
- refreshToken: string;
49
- accessToken: string;
50
- }) {
33
+ async getNewAccessToken({ refreshToken, accessToken }: { refreshToken: string; accessToken: string }): Promise<{ refreshToken: string; accessToken: string }> {
51
34
  return this.axiosCall({
52
35
  method: Methods.POST,
53
36
  url: '/identity/api/Account/refresh',
@@ -176,6 +159,20 @@ export class ApiClass {
176
159
  });
177
160
  }
178
161
 
162
+ async getQuestionList(surveyType: string, processInstanceId: string, insuredId: number | string): Promise<AnketaFirst> {
163
+ return this.axiosCall({
164
+ method: Methods.GET,
165
+ url: `/Baiterek/api/Application/Anketa/${surveyType}/${processInstanceId}/${insuredId}`,
166
+ });
167
+ }
168
+
169
+ async getQuestionListSecond(surveyType: string, processInstanceId: string, insuredId: number | string): Promise<AnketaSecond[]> {
170
+ return this.axiosCall({
171
+ method: Methods.GET,
172
+ url: `/Baiterek/api/Application/Anketa/${surveyType}/${processInstanceId}/${insuredId}`,
173
+ });
174
+ }
175
+
179
176
  async definedAnswers(filter: string) {
180
177
  return this.axiosCall({
181
178
  method: Methods.GET,
@@ -183,7 +180,7 @@ export class ApiClass {
183
180
  });
184
181
  }
185
182
 
186
- async setSurvey(surveyData: any) {
183
+ async setSurvey(surveyData: AnketaFirst) {
187
184
  return this.axiosCall({
188
185
  method: Methods.POST,
189
186
  data: surveyData,
@@ -191,7 +188,7 @@ export class ApiClass {
191
188
  });
192
189
  }
193
190
 
194
- async getQuestionRefs(id: string | number) {
191
+ async getQuestionRefs(id: string | number): Promise<Value[]> {
195
192
  return this.axiosCall({
196
193
  method: Methods.GET,
197
194
  url: `/Ekk/api/Contragentinsis/DictionaryItems/Questionary?filter=${id}`,
@@ -205,10 +202,7 @@ export class ApiClass {
205
202
  });
206
203
  }
207
204
 
208
- async getAdditionalInsuranceTermsAnswers(
209
- processCode: string | number,
210
- questionId: string,
211
- ) {
205
+ async getAdditionalInsuranceTermsAnswers(processCode: string | number, questionId: string) {
212
206
  return this.axiosCall({
213
207
  method: Methods.GET,
214
208
  url: `/Arm/api/Dictionary/ProcessCoverTypeSum/${processCode}/${questionId}`,
@@ -237,7 +231,7 @@ export class ApiClass {
237
231
  });
238
232
  }
239
233
 
240
- async getFile(id: any) {
234
+ async getFile(id: string) {
241
235
  return await this.axiosCall({
242
236
  method: Methods.GET,
243
237
  url: `/Arm/api/File/DownloadFile/${id}`,
@@ -255,35 +249,35 @@ export class ApiClass {
255
249
  });
256
250
  }
257
251
 
258
- async getContrAgentData(personId: any) {
252
+ async getContrAgentData(personId: string | number) {
259
253
  return this.axiosCall({
260
254
  method: Methods.GET,
261
255
  url: `/Ekk/api/Contragentinsis/Questionaries?PersonId=${personId}`,
262
256
  });
263
257
  }
264
258
 
265
- async getContrAgentContacts(personId: any) {
259
+ async getContrAgentContacts(personId: string | number) {
266
260
  return this.axiosCall({
267
261
  method: Methods.GET,
268
262
  url: `/Ekk/api/Contragentinsis/Contacts?PersonId=${personId}`,
269
263
  });
270
264
  }
271
265
 
272
- async getContrAgentDocuments(personId: any) {
266
+ async getContrAgentDocuments(personId: string | number) {
273
267
  return this.axiosCall({
274
268
  method: Methods.GET,
275
269
  url: `/Ekk/api/Contragentinsis/Documents?PersonId=${personId}`,
276
270
  });
277
271
  }
278
272
 
279
- async getContrAgentAddress(personId: any) {
273
+ async getContrAgentAddress(personId: string | number) {
280
274
  return this.axiosCall({
281
275
  method: Methods.GET,
282
276
  url: `/Ekk/api/Contragentinsis/Address?PersonId=${personId}`,
283
277
  });
284
278
  }
285
279
 
286
- async getTaskList(data: any) {
280
+ async getTaskList(data: any): Promise<{ items: TaskListItem[]; totalItems: number }> {
287
281
  return this.axiosCall({
288
282
  method: Methods.POST,
289
283
  url: `/Arm/api/Bpm/TaskList`,
@@ -291,13 +285,13 @@ export class ApiClass {
291
285
  });
292
286
  }
293
287
 
294
- async getProcessHistory(id: any) {
288
+ async getProcessHistory(id: string): Promise<TaskHistory[]> {
295
289
  return this.axiosCall({
296
290
  url: `/Arm/api/Bpm/GetProcessHistory?processInstanceId=${id}`,
297
291
  });
298
292
  }
299
293
 
300
- async sendSms(data: any) {
294
+ async sendSms(data: { phone: string; template: string; tempFlags: { url: string } }): Promise<void> {
301
295
  return this.axiosCall({
302
296
  baseURL: import.meta.env.VITE_SMS_SERVICE as string,
303
297
  method: Methods.POST,
@@ -306,7 +300,7 @@ export class ApiClass {
306
300
  });
307
301
  }
308
302
 
309
- async getUserGroups() {
303
+ async getUserGroups(): Promise<Item[]> {
310
304
  return this.axiosCall({
311
305
  method: Methods.GET,
312
306
  url: '/Arm/api/Bpm/TaskGroups',
@@ -320,7 +314,7 @@ export class ApiClass {
320
314
  });
321
315
  }
322
316
 
323
- async getOtpStatus(data: any) {
317
+ async getOtpStatus(data: OtpDataType): Promise<boolean> {
324
318
  return this.axiosCall({
325
319
  method: Methods.POST,
326
320
  url: '/Arm/api/Otp/OtpLifeStatus',
@@ -328,7 +322,7 @@ export class ApiClass {
328
322
  });
329
323
  }
330
324
 
331
- async sendOtp(data: any) {
325
+ async sendOtp(data: OtpDataType): Promise<SendOtpResponse> {
332
326
  return this.axiosCall({
333
327
  method: Methods.POST,
334
328
  url: '/Arm/api/Otp/Get',
@@ -336,7 +330,7 @@ export class ApiClass {
336
330
  });
337
331
  }
338
332
 
339
- async checkOtp(data: any) {
333
+ async checkOtp(data: { tokenId: string; phoneNumber: string; code: string }): Promise<SendOtpResponse> {
340
334
  return this.axiosCall({
341
335
  method: Methods.POST,
342
336
  url: '/Arm/api/Otp/Check',
@@ -344,7 +338,7 @@ export class ApiClass {
344
338
  });
345
339
  }
346
340
 
347
- async getProcessList() {
341
+ async getProcessList(): Promise<Item[]> {
348
342
  return this.axiosCall({
349
343
  method: Methods.GET,
350
344
  url: '/Arm/api/Bpm/ProcessList',
@@ -352,7 +346,9 @@ export class ApiClass {
352
346
  });
353
347
  }
354
348
 
355
- async startApplication(data: any) {
349
+ async startApplication(data: StartApplicationType): Promise<{
350
+ processInstanceId: string;
351
+ }> {
356
352
  return this.axiosCall({
357
353
  method: Methods.POST,
358
354
  url: `/${this.productUrl}/api/Application/StartApplication`,
@@ -462,7 +458,7 @@ export class ApiClass {
462
458
  });
463
459
  }
464
460
 
465
- async getSignedDocList(data: any) {
461
+ async getSignedDocList(data: { processInstanceId: string }): Promise<IDocument[]> {
466
462
  return this.axiosCall({
467
463
  method: Methods.POST,
468
464
  url: '/Arm/api/File/List',
@@ -470,6 +466,21 @@ export class ApiClass {
470
466
  });
471
467
  }
472
468
 
469
+ async calculateWithoutApplication(data: RecalculationDataType): Promise<RecalculationResponseType> {
470
+ return this.axiosCall({
471
+ method: Methods.POST,
472
+ url: `/${this.productUrl}/api/Application/Calculate`,
473
+ data: data,
474
+ });
475
+ }
476
+
477
+ async getDefaultCalculationData(): Promise<RecalculationDataType> {
478
+ return this.axiosCall({
479
+ method: Methods.GET,
480
+ url: `/${this.productUrl}/api/Application/DefaultCalculatorValues`,
481
+ });
482
+ }
483
+
473
484
  async reCalculate(data: any) {
474
485
  return this.axiosCall({
475
486
  method: Methods.POST,
@@ -478,7 +489,7 @@ export class ApiClass {
478
489
  });
479
490
  }
480
491
 
481
- async getValidateClientESBD(data: any) {
492
+ async getValidateClientESBD(data: ESBDValidationType): Promise<ESBDResponseType> {
482
493
  return this.axiosCall({
483
494
  method: Methods.POST,
484
495
  url: '/externalservices/api/ExternalServices/GetValidateClientEsbd',
@@ -486,7 +497,7 @@ export class ApiClass {
486
497
  });
487
498
  }
488
499
 
489
- async isClaimTask(taskId: string) {
500
+ async isClaimTask(taskId: string): Promise<boolean> {
490
501
  return this.axiosCall({
491
502
  method: Methods.POST,
492
503
  url: '/Arm/api/Bpm/IsClaimTask',
@@ -502,7 +513,7 @@ export class ApiClass {
502
513
  });
503
514
  }
504
515
 
505
- async getContragentFromGBDFL(data: any) {
516
+ async getContragentFromGBDFL(data: { iin: string; phoneNumber: string }): Promise<GBDFLResponse> {
506
517
  return this.axiosCall({
507
518
  method: Methods.POST,
508
519
  url: '/externalservices/api/ExternalServices/GetGbdflToken',
@@ -510,6 +521,14 @@ export class ApiClass {
510
521
  });
511
522
  }
512
523
 
524
+ async getFamilyInfo(data: { iin: string; phoneNumber: string }): Promise<FamilyInfoGKB> {
525
+ return this.axiosCall({
526
+ method: Methods.POST,
527
+ url: '/externalservices/api/ExternalServices/GetFamilyInfoToken',
528
+ data: data,
529
+ });
530
+ }
531
+
513
532
  async getProcessTariff(code: number | string = 5) {
514
533
  return this.axiosCall({ url: `/arm/api/Dictionary/ProcessTariff/${code}` });
515
534
  }
@@ -19,19 +19,19 @@ export default function (axios: AxiosInstance) {
19
19
  const dataStore = useDataStore();
20
20
  const router = useRouter();
21
21
  if (error.response.status === 401) {
22
+ dataStore.$reset();
23
+ localStorage.clear();
22
24
  if (dataStore.isEFO) {
23
25
  router.push({ name: 'Auth', query: { error: 401 } });
24
26
  } else {
25
27
  dataStore.sendToParent(constants.postActions.Error401, 401);
26
28
  }
27
29
  }
28
- if (error.response.status === 500) {
30
+ if (error.response.status >= 500) {
29
31
  if (router.currentRoute.value.name !== 'Auth') {
30
- router.push({ name: '500', query: { stack: error.stack } });
32
+ dataStore.showToaster('error', error.stack, 5000);
31
33
  }
32
34
  }
33
- dataStore.$reset();
34
- localStorage.clear();
35
35
  return Promise.reject(error);
36
36
  },
37
37
  );
@@ -3,7 +3,7 @@
3
3
  type="button"
4
4
  class="transition-all"
5
5
  @click="$emit('clicked')"
6
- :disabled="disabled"
6
+ :disabled="disabled || loading"
7
7
  :class="[
8
8
  disabled ? 'disabled' : '',
9
9
  classes,
@@ -11,7 +11,8 @@
11
11
  $libStyles[`btnH${$capitalize(size)}` as keyof typeof $libStyles],
12
12
  ]"
13
13
  >
14
- {{ text }}
14
+ <base-loader v-if="loading" :size="24" color="#FFF" bg-color="" :width="2"></base-loader>
15
+ <span v-if="!loading">{{ text }}</span>
15
16
  </button>
16
17
  </template>
17
18
 
@@ -35,6 +36,10 @@ export default defineComponent({
35
36
  type: Boolean,
36
37
  default: false,
37
38
  },
39
+ loading: {
40
+ type: Boolean,
41
+ default: false,
42
+ },
38
43
  btn: {
39
44
  type: String,
40
45
  default: new Styles().blueBtn,
@@ -0,0 +1,6 @@
1
+ <template>
2
+ <div class="absolute bottom-[12%] right-1 flex flex-col gap-4">
3
+ <v-btn style="backdrop-filter: blur(5px)" color="#A0B3D8" variant="outlined" icon="mdi mdi-arrow-up" @click="$emit('up')"></v-btn>
4
+ <v-btn style="backdrop-filter: blur(5px)" color="#A0B3D8" variant="outlined" icon="mdi mdi-arrow-down" @click="$emit('down')"></v-btn>
5
+ </div>
6
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <div class="w-full p-4" :class="[$libStyles.blueBgLight, $libStyles.rounded]">
3
+ <slot></slot>
4
+ </div>
5
+ </template>
@@ -1,8 +1,6 @@
1
1
  <template>
2
2
  <v-dialog v-model="fieldModel">
3
- <v-card
4
- class="self-center w-full sm:w-3/4 md:w-2/3 lg:w-2/4 xl:w-[600px] rounded-lg !p-2"
5
- >
3
+ <v-card class="self-center w-full sm:w-3/4 md:w-2/3 lg:w-2/4 xl:w-[600px] rounded-lg !p-2">
6
4
  <v-card-title>
7
5
  <slot v-if="!title" name="title"></slot>
8
6
  {{ title }}
@@ -11,27 +9,9 @@
11
9
  <slot v-if="!subtitle" name="subtitle"></slot>
12
10
  {{ subtitle }}
13
11
  </v-card-subtitle>
14
- <v-card-text>
15
- <slot v-if="text" name="content"></slot>
16
- {{ text }}
17
- </v-card-text>
18
12
  <v-card-actions class="gap-[16px]">
19
- <base-btn
20
- v-if="actions === 'default'"
21
- class="!w-fit px-6"
22
- size="sm"
23
- :text="$t('confirm.yes')"
24
- :btn="$libStyles.blueBtn"
25
- @click="$emit('yes')"
26
- ></base-btn>
27
- <base-btn
28
- v-if="actions === 'default'"
29
- class="!w-fit px-6"
30
- size="sm"
31
- :text="$t('confirm.no')"
32
- :btn="$libStyles.blueBtn"
33
- @click="$emit('no')"
34
- />
13
+ <base-btn v-if="actions === 'default'" class="!w-fit px-6" size="sm" :text="$t('confirm.yes')" :btn="$libStyles.blueBtn" @click="$emit('yes')"></base-btn>
14
+ <base-btn v-if="actions === 'default'" class="!w-fit px-6" size="sm" :text="$t('confirm.no')" :btn="$libStyles.blueBtn" @click="$emit('no')" />
35
15
  <slot v-if="actions !== 'default'" name="actions"></slot>
36
16
  </v-card-actions>
37
17
  </v-card>
@@ -53,10 +33,6 @@ export default defineComponent({
53
33
  type: String,
54
34
  default: '',
55
35
  },
56
- text: {
57
- type: String,
58
- default: '',
59
- },
60
36
  actions: {
61
37
  type: String,
62
38
  default: 'default',
@@ -0,0 +1,39 @@
1
+ <template>
2
+ <v-list lines="two" v-if="formStore.birthInfos && formStore.birthInfos.length" class="w-full !py-0">
3
+ <v-list-item @click="$emit('reset')" :append-icon="selected && Object.keys(selected).length === 0 ? `mdi-radiobox-marked ${$libStyles.greenText}` : 'mdi-radiobox-blank text-[#636363]'">
4
+ <v-list-item-title :class="[$libStyles.greenText, $libStyles.textTitle]">{{ $t('form.notChosen') }}</v-list-item-title>
5
+ </v-list-item>
6
+ <v-list-item
7
+ v-for="familyMember of formStore.birthInfos"
8
+ :key="familyMember.childIIN"
9
+ @click="$emit('selectFamilyMember', familyMember)"
10
+ :append-icon="familyMember && selected && selected.childIIN === familyMember.childIIN ? `mdi-radiobox-marked ${$libStyles.greenText}` : 'mdi-radiobox-blank text-[#636363]'"
11
+ >
12
+ <v-list-item-title :class="[$libStyles.greenText, $libStyles.textTitle]">{{
13
+ `${familyMember.childSurName} ${familyMember.childName} ${familyMember.childPatronymic ? familyMember.childPatronymic : ''}`
14
+ }}</v-list-item-title>
15
+ <v-list-item-subtitle :class="[$libStyles.textSimple]"
16
+ ><span>{{ `${$t('form.iin')}:` }}</span
17
+ >{{ ` ${$reformatIin(familyMember.childIIN!)}` }}</v-list-item-subtitle
18
+ >
19
+ </v-list-item>
20
+ </v-list>
21
+ <base-list-empty class="w-full" v-else></base-list-empty>
22
+ </template>
23
+
24
+ <script lang="ts">
25
+ export default defineComponent({
26
+ props: {
27
+ selected: {
28
+ type: Object as PropType<BirthInfoGKB>,
29
+ },
30
+ },
31
+ emits: ['selectFamilyMember', 'reset'],
32
+ setup() {
33
+ const formStore = useFormStore();
34
+ return {
35
+ formStore,
36
+ };
37
+ },
38
+ });
39
+ </script>
@@ -0,0 +1,114 @@
1
+ <template>
2
+ <div class="pt-3 rounded-lg border-[1px]" :class="[$libStyles.whiteBg]">
3
+ <div class="ml-5">
4
+ <p :class="[$libStyles.textTitle, $libStyles.greenText]">{{ title }}</p>
5
+ <p v-if="!!subtitle" :class="[$libStyles.greyText, $libStyles.textSimple]">{{ subtitle }}</p>
6
+ </div>
7
+ <div class="ml-5 mt-6 grid grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7 auto-rows-fr items-center">
8
+ <span :class="[$libStyles.textSimple]" class="font-medium">{{ $t('form.fullName') }}</span>
9
+ <span :class="[$libStyles.textSimple]" class="font-medium">{{ $t('form.iin') }}</span>
10
+ <span :class="[$libStyles.textSimple]" class="font-medium hidden lg:block"> {{ $t('form.gender') }}</span>
11
+ <span :class="[$libStyles.textSimple]" class="font-medium"> {{ $t('form.birthDate') }} </span>
12
+ <span :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $t('form.Country') }} </span>
13
+ <span :class="[$libStyles.textSimple]" class="font-medium hidden lg:block"> {{ $t('code') }}</span>
14
+ </div>
15
+ <div v-if="isMultiple" class="ml-5 flex flex-col">
16
+ <div v-for="(each, index) of member" :key="index" class="grid grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7 auto-rows-fr items-center relative">
17
+ <span :class="[getMemberInfo(each).fullName === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(each).fullName }}</span>
18
+ <span :class="[getMemberInfo(each).iin === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(each).iin }}</span>
19
+ <span :class="[getMemberInfo(each).gender === null && $libStyles.emptyBlockCol]" class="hidden lg:block">{{ getMemberInfo(each).gender }} </span>
20
+ <span :class="[getMemberInfo(each).birthDate === null && $libStyles.emptyBlockCol]"> {{ getMemberInfo(each).birthDate }} </span>
21
+ <span :class="[getMemberInfo(each).birthPlace === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).birthPlace }} </span>
22
+ <span :class="[getMemberInfo(each).sectorCode === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).sectorCode }} </span>
23
+ <div
24
+ class="rounded-br-lg transition-all h-[70px] w-[60px] place-self-end cursor-pointer"
25
+ :class="[$libStyles.blueBgLight, $libStyles.blueBgLightHover]"
26
+ @click="$emit('onMore', { whichForm, index })"
27
+ >
28
+ <i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"> </i>
29
+ </div>
30
+ </div>
31
+ </div>
32
+ <div v-else class="ml-5 grid grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7 auto-rows-fr items-center relative">
33
+ <span :class="[getMemberInfo(member).fullName === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(member).fullName }}</span>
34
+ <span :class="[getMemberInfo(member).iin === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(member).iin }}</span>
35
+ <span :class="[getMemberInfo(member).gender === null && $libStyles.emptyBlockCol]" class="hidden lg:block">{{ getMemberInfo(member).gender }} </span>
36
+ <span :class="[getMemberInfo(member).birthDate === null && $libStyles.emptyBlockCol]"> {{ getMemberInfo(member).birthDate }} </span>
37
+ <span :class="[getMemberInfo(member).birthPlace === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(member).birthPlace }} </span>
38
+ <span :class="[getMemberInfo(member).sectorCode === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(member).sectorCode }} </span>
39
+ <div
40
+ class="rounded-br-lg transition-all h-[70px] w-[60px] place-self-end cursor-pointer"
41
+ :class="[$libStyles.blueBgLight, $libStyles.blueBgLightHover]"
42
+ @click="$emit('onMore', { whichForm })"
43
+ >
44
+ <i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"> </i>
45
+ </div>
46
+ </div>
47
+ <div
48
+ v-if="isMultiple && more"
49
+ :class="[$libStyles.blueBg, $libStyles.whiteText, $libStyles.textSimple]"
50
+ class="cursor-pointer rounded-b-lg h-[36px] flex items-center font-medium justify-center"
51
+ @click="memberStore.addMember(whichForm)"
52
+ >
53
+ {{ $t('buttons.add') }}
54
+ </div>
55
+ </div>
56
+ </template>
57
+
58
+ <script lang="ts">
59
+ import { Member } from '@/composables/classes';
60
+
61
+ export default defineComponent({
62
+ props: {
63
+ title: {
64
+ type: String,
65
+ default: '',
66
+ },
67
+ subtitle: {
68
+ type: String,
69
+ default: '',
70
+ },
71
+ whichForm: {
72
+ type: String as PropType<MemberFormTypes>,
73
+ default: '',
74
+ },
75
+ more: {
76
+ type: Boolean,
77
+ default: false,
78
+ },
79
+ },
80
+ emits: ['onMore', 'addMember'],
81
+ setup(props) {
82
+ const dataStore = useDataStore();
83
+ const formStore = useFormStore();
84
+ const memberStore = useMemberStore();
85
+ const multipleMembers = ['insuredForm', 'beneficiaryForm', 'beneficialOwnerForm'];
86
+ const isMultiple = ref(multipleMembers.includes(props.whichForm));
87
+ const member: Member = formStore[props.whichForm as MemberKeys];
88
+
89
+ const getMemberInfo = (memberData: Member) => {
90
+ return {
91
+ fullName: computed(() => (memberData && memberData.getFullNameShorted() ? memberData.getFullNameShorted() : null)).value,
92
+ iin: computed(() => (memberData && memberData.iin ? memberData.iin : null)).value,
93
+ gender: computed(() => (memberData && memberData.gender.nameRu ? (memberData.gender.nameRu as string).charAt(0) : null)).value,
94
+ birthDate: computed(() => (memberData && memberData.birthDate ? memberData.birthDate : null)).value,
95
+ birthPlace: computed(() => (memberData && memberData.birthPlace.nameRu ? (memberData.birthPlace.nameRu as string).substring(0, 3) : null)).value,
96
+ sectorCode: computed(() => (memberData && memberData.economySectorCode.ids ? (memberData.economySectorCode.ids as string).slice(-1) : null)).value,
97
+ };
98
+ };
99
+
100
+ return {
101
+ // State
102
+ formStore,
103
+ memberStore,
104
+ member,
105
+ isMultiple,
106
+
107
+ // Computed
108
+
109
+ // Functions
110
+ getMemberInfo,
111
+ };
112
+ },
113
+ });
114
+ </script>
@@ -0,0 +1,18 @@
1
+ <template>
2
+ <section :class="[$libStyles.blueBgLight, $libStyles.rounded]" class="mt-[14px] p-4 flex flex-col gap-[1px]">
3
+ <h2 :class="[$libStyles.textTitle]" class="font-medium text-center w-full mb-4">{{ title }}</h2>
4
+ <slot></slot>
5
+ </section>
6
+ </template>
7
+
8
+ <script lang="ts">
9
+ export default defineComponent({
10
+ props: {
11
+ title: {
12
+ type: String,
13
+ default: 'Заголовок',
14
+ required: true,
15
+ },
16
+ },
17
+ });
18
+ </script>
@@ -0,0 +1,20 @@
1
+ <template>
2
+ <div class="flex flex-col justify-between rounded-lg" :class="[$libStyles.whiteBg]">
3
+ <span v-if="title" class="p-4" :class="[$libStyles.textTitle]">{{ title }}</span>
4
+ <span v-if="subtitle" class="p-4 text-[#99A3B3] border-t-[1px]" :class="[$libStyles.textSimple]">{{ subtitle }}</span>
5
+ <slot></slot>
6
+ </div>
7
+ </template>
8
+
9
+ <script lang="ts">
10
+ export default defineComponent({
11
+ props: {
12
+ title: {
13
+ type: String,
14
+ },
15
+ subtitle: {
16
+ type: String,
17
+ },
18
+ },
19
+ });
20
+ </script>
@@ -0,0 +1,52 @@
1
+ <template>
2
+ <div
3
+ class="h-[74px] !pl-2 md:!pl-5 flex items-center justify-start gap-4"
4
+ :class="[$libStyles.whiteBg, hasBorder ? 'border-[1px] rounded-lg' : 'border-b-[1px] border-b-[#f3f6fc] rounded']"
5
+ >
6
+ <v-switch
7
+ class="base-toggle"
8
+ :model-value="modelValue"
9
+ @update:modelValue="
10
+ $emit('update:modelValue', $event);
11
+ $emit('clicked');
12
+ "
13
+ color="#009C73"
14
+ hide-details
15
+ :disabled="disabled"
16
+ >
17
+ </v-switch>
18
+ <p :class="[$libStyles.textSimple]">{{ `${title}` }}</p>
19
+ <p class="mr-3" :class="[modelValue ? $libStyles.greenText : '', $libStyles.textSimple]">{{ `${modelValue ? $dataStore.t('confirm.yes') : $dataStore.t('confirm.no')}` }}</p>
20
+ </div>
21
+ </template>
22
+
23
+ <script lang="ts">
24
+ export default defineComponent({
25
+ props: {
26
+ modelValue: {
27
+ type: Boolean,
28
+ default: '',
29
+ },
30
+ title: {
31
+ type: String,
32
+ default: '',
33
+ },
34
+ disabled: {
35
+ type: Boolean,
36
+ default: false,
37
+ },
38
+ hasBorder: {
39
+ type: Boolean,
40
+ default: true,
41
+ },
42
+ },
43
+ emits: ['update:modelValue', 'clicked'],
44
+ });
45
+ </script>
46
+
47
+ <style>
48
+ .v-input.base-toggle {
49
+ width: fit-content;
50
+ flex: unset !important;
51
+ }
52
+ </style>