hl-core 0.0.10-beta.3 → 0.0.10-beta.30

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 (50) hide show
  1. package/api/base.api.ts +259 -190
  2. package/api/interceptors.ts +3 -5
  3. package/components/Complex/TextBlock.vue +2 -0
  4. package/components/Dialog/Dialog.vue +7 -1
  5. package/components/Dialog/FamilyDialog.vue +2 -0
  6. package/components/Form/DigitalDocument.vue +52 -0
  7. package/components/Form/DynamicForm.vue +1 -0
  8. package/components/Form/FormData.vue +1 -0
  9. package/components/Form/ManagerAttachment.vue +18 -8
  10. package/components/Form/ProductConditionsBlock.vue +12 -6
  11. package/components/Input/DynamicInput.vue +2 -0
  12. package/components/Input/FormInput.vue +2 -0
  13. package/components/Input/OtpInput.vue +25 -0
  14. package/components/Input/PanelInput.vue +1 -0
  15. package/components/Input/RoundedInput.vue +2 -0
  16. package/components/Input/RoundedSelect.vue +4 -0
  17. package/components/Input/SwitchInput.vue +2 -0
  18. package/components/Input/TextInput.vue +2 -0
  19. package/components/Layout/Drawer.vue +2 -0
  20. package/components/Pages/Anketa.vue +166 -167
  21. package/components/Pages/Auth.vue +2 -0
  22. package/components/Pages/ContragentForm.vue +2 -1
  23. package/components/Pages/Documents.vue +244 -6
  24. package/components/Pages/MemberForm.vue +276 -96
  25. package/components/Pages/ProductConditions.vue +275 -96
  26. package/components/Panel/PanelHandler.vue +236 -108
  27. package/components/Transitions/Animation.vue +2 -0
  28. package/components/Utilities/Chip.vue +3 -1
  29. package/components/Utilities/JsonViewer.vue +1 -2
  30. package/composables/classes.ts +117 -42
  31. package/composables/constants.ts +33 -0
  32. package/composables/fields.ts +6 -4
  33. package/composables/index.ts +243 -7
  34. package/composables/styles.ts +8 -24
  35. package/configs/pwa.ts +1 -7
  36. package/layouts/clear.vue +1 -1
  37. package/layouts/default.vue +1 -1
  38. package/layouts/full.vue +1 -1
  39. package/locales/ru.json +34 -10
  40. package/nuxt.config.ts +10 -13
  41. package/package.json +13 -12
  42. package/plugins/head.ts +2 -1
  43. package/store/data.store.ts +380 -389
  44. package/store/member.store.ts +3 -2
  45. package/store/rules.ts +19 -0
  46. package/tsconfig.json +3 -0
  47. package/types/enum.ts +19 -2
  48. package/types/env.d.ts +2 -2
  49. package/types/form.ts +71 -74
  50. package/types/index.ts +916 -873
@@ -65,14 +65,12 @@ export default function (axios: AxiosInstance) {
65
65
  dataStore.sendToParent(constants.postActions.Error401, 401);
66
66
  }
67
67
  }
68
- if (error.response.status >= 500) {
69
- if (router.currentRoute.value.name !== 'Auth') {
70
- dataStore.showToaster('error', error.stack ?? dataStore.t('toaster.error'), 5000);
71
- }
72
- }
73
68
  if (error.response.status === 403 && error.response.config.url) {
74
69
  dataStore.showToaster('error', `Нет доступа на запрос: ${error.response.config.url.substring(error.response.config.url.lastIndexOf('/') + 1)}`, 5000);
75
70
  }
71
+ if (error.response.status === 413) {
72
+ dataStore.showToaster('error', dataStore.t('error.exceedUploadLimitFile'), 5000);
73
+ }
76
74
  }
77
75
  }
78
76
  return Promise.reject(error);
@@ -6,6 +6,8 @@
6
6
  </template>
7
7
 
8
8
  <script setup lang="ts">
9
+ import type { Utils } from '../../types';
10
+
9
11
  defineProps({
10
12
  text: {
11
13
  type: String,
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <v-dialog class="base-dialog" :model-value="Boolean(modelValue)" @update:modelValue="$emit('update:modelValue', $event)" :persistent="true">
2
+ <v-dialog class="base-dialog" :model-value="Boolean(modelValue)" @update:modelValue="$emit('update:modelValue', $event)" :persistent="persistent">
3
3
  <v-card class="self-center w-full sm:w-4/4 md:w-2/3 lg:w-[35%] xl:w-[500px] rounded-lg !p-[36px]">
4
4
  <div class="flex sm:flex-row flex-col place-items-center sm:place-items-start">
5
5
  <div class="h-20 w-20 place-items-start pt-1">
@@ -35,6 +35,8 @@
35
35
  </v-dialog>
36
36
  </template>
37
37
  <script lang="ts">
38
+ import type { Utils } from '../../types';
39
+
38
40
  export default defineComponent({
39
41
  name: 'BaseDialog',
40
42
  props: {
@@ -42,6 +44,10 @@ export default defineComponent({
42
44
  type: Boolean as PropType<boolean | null>,
43
45
  default: false,
44
46
  },
47
+ persistent: {
48
+ type: Boolean as PropType<boolean>,
49
+ default: true,
50
+ },
45
51
  title: {
46
52
  type: String,
47
53
  default() {
@@ -25,6 +25,8 @@
25
25
  </template>
26
26
 
27
27
  <script lang="ts">
28
+ import type { Api } from '../../types';
29
+
28
30
  export default defineComponent({
29
31
  props: {
30
32
  selected: {
@@ -0,0 +1,52 @@
1
+ <template>
2
+ <section v-if="member && member.iin" class="mb-2">
3
+ <base-form-section :title="`${title} ${number === 0 ? '' : number}`" class="mx-[10px] mt-[14px] d-flex">
4
+ <base-form-input v-model="member.iin" :label="$dataStore.t('form.iin')" :readonly="true" />
5
+ <base-form-input v-model.trim="member.longName" :label="$dataStore.t('labels.userFullName')" :readonly="true" />
6
+ <base-panel-input
7
+ v-if="!!member.digitalDocument"
8
+ v-model="member.digitalDocument.fileName"
9
+ label="Цифровой документ"
10
+ :readonly="disabled"
11
+ :clearable="!disabled"
12
+ append-inner-icon="mdi mdi-chevron-right"
13
+ @click="$emit('openPanel', member.digitalDocument)"
14
+ />
15
+ <base-content-block
16
+ v-if="!disabled && !member.digitalDocument"
17
+ class="d-flex align-center justify-between !py-3.5 !pr-5"
18
+ :class="[$styles.whiteBg]"
19
+ @click="$emit('openDigitalDocPanel', member.iin)"
20
+ >
21
+ <p :class="[$styles.greyText]">Получить цифровой документ</p>
22
+ <div class="cursor-pointer">
23
+ <i class="mdi mdi-file-document text-xl" :class="[$styles.blueText]"></i>
24
+ </div>
25
+ </base-content-block>
26
+ </base-form-section>
27
+ </section>
28
+ </template>
29
+
30
+ <script setup lang="ts">
31
+ import type { Base } from '../../types';
32
+
33
+ defineEmits(['openDigitalDocPanel', 'openPanel']);
34
+ defineProps({
35
+ title: {
36
+ type: String,
37
+ default: '',
38
+ },
39
+ member: {
40
+ type: Object as PropType<Base.Document.Digital>,
41
+ default: null,
42
+ },
43
+ number: {
44
+ type: Number,
45
+ default: 0,
46
+ },
47
+ disabled: {
48
+ type: Boolean,
49
+ default: false,
50
+ },
51
+ });
52
+ </script>
@@ -24,6 +24,7 @@
24
24
 
25
25
  <script lang="ts">
26
26
  import { Value } from '#imports';
27
+ import type { DynamicForm, FetchFunctions, InputType } from '../../types/form';
27
28
 
28
29
  export default defineComponent({
29
30
  props: {
@@ -61,6 +61,7 @@
61
61
  <script lang="ts">
62
62
  import { type ComputedRefWithControl } from '@vueuse/core';
63
63
  import { FormBlock } from '../../composables/fields';
64
+ import type { Utils } from '../../types';
64
65
 
65
66
  export default defineComponent({
66
67
  props: {
@@ -106,6 +106,7 @@
106
106
  <script lang="ts">
107
107
  import { Value } from '../../composables/classes';
108
108
  import { watchDebounced } from '@vueuse/core';
109
+ import type { AgentData } from '../../types';
109
110
 
110
111
  export default defineComponent({
111
112
  props: {
@@ -138,35 +139,44 @@ export default defineComponent({
138
139
  (route.params.taskId !== '0' && (!dataStore.isProcessEditable(formStore.applicationData.statusCode) || !dataStore.isTask())),
139
140
  );
140
141
  const isSaleChanellReadonly = computed(() => {
141
- if (dataStore.isGons) return isReadonly.value && dataStore.isServiceManager();
142
+ if (!isReadonly.value) {
143
+ if (dataStore.isGons) return !dataStore.isServiceManager();
144
+ }
142
145
  return isReadonly.value;
143
146
  });
144
147
  const isRegionReadonly = computed(() => {
145
- if (dataStore.isGons) return isReadonly.value && (dataStore.isServiceManager() || dataStore.isAgent());
148
+ if (!isReadonly.value) {
149
+ if (dataStore.isGons) return !dataStore.isServiceManager() && !dataStore.isAgent();
150
+ }
146
151
  return isReadonly.value;
147
152
  });
148
153
  const isManagerReadonly = computed(() => {
149
- if (dataStore.isGons) return isReadonly.value && dataStore.isServiceManager();
154
+ if (!isReadonly.value) {
155
+ if (dataStore.isGons) return !dataStore.isServiceManager();
156
+ }
150
157
  return isReadonly.value;
151
158
  });
152
159
  const isAgentReadonly = computed(() => {
153
- if (dataStore.isGons || dataStore.isPension) return isReadonly.value && dataStore.isServiceManager();
160
+ if (!isReadonly.value) {
161
+ if (dataStore.isGons) return !dataStore.isServiceManager();
162
+ if (dataStore.isPension) return !dataStore.isManager();
163
+ }
154
164
  return isReadonly.value;
155
165
  });
156
166
  const isSaleChanellShown = computed(() => {
157
- if (dataStore.isGons) return dataStore.isServiceManager();
167
+ if (dataStore.isGons) return !dataStore.isAgent();
158
168
  return true;
159
169
  });
160
170
  const isRegionShown = computed(() => {
161
- if (dataStore.isGons) return dataStore.isServiceManager() || dataStore.isAgent();
162
171
  return true;
163
172
  });
164
173
  const isManagerShown = computed(() => {
165
- if (dataStore.isGons) return dataStore.isServiceManager();
174
+ if (dataStore.isGons) return !dataStore.isAgent();
166
175
  return true;
167
176
  });
168
177
  const isAgentShown = computed(() => {
169
- if (dataStore.isGons || dataStore.isPension) return dataStore.isServiceManager();
178
+ if (dataStore.isGons) return !dataStore.isAgent();
179
+ if (dataStore.isPension) return dataStore.isServiceManager();
170
180
  return true;
171
181
  });
172
182
  const openPanel = async (currentDict: ManagerAttachmentFiels, title: string) => {
@@ -75,12 +75,18 @@ export default defineComponent({
75
75
  const dataStore = useDataStore();
76
76
  const formStore = useFormStore();
77
77
 
78
- const amount = computed(() =>
79
- formStore.productConditionsForm && formStore.productConditionsForm.requestedSumInsured ? formStore.productConditionsForm.requestedSumInsured : null,
80
- );
81
- const premium = computed(() =>
82
- formStore.productConditionsForm && formStore.productConditionsForm.insurancePremiumPerMonth ? formStore.productConditionsForm.insurancePremiumPerMonth : null,
83
- );
78
+ const amount = computed(() => {
79
+ if (dataStore.isGons && formStore.productConditionsForm && formStore.productConditionsForm.currency.code === 'USD') {
80
+ return formStore.productConditionsForm.requestedSumInsuredInDollar;
81
+ }
82
+ return formStore.productConditionsForm && formStore.productConditionsForm.requestedSumInsured ? formStore.productConditionsForm.requestedSumInsured : null;
83
+ });
84
+ const premium = computed(() => {
85
+ if (dataStore.isGons && formStore.productConditionsForm && formStore.productConditionsForm.currency.code === 'USD') {
86
+ return formStore.productConditionsForm.insurancePremiumPerMonthInDollar;
87
+ }
88
+ return formStore.productConditionsForm && formStore.productConditionsForm.insurancePremiumPerMonth ? formStore.productConditionsForm.insurancePremiumPerMonth : null;
89
+ });
84
90
  const policyNumber = computed(() => (formStore.applicationData && formStore.applicationData.policyAppDto ? formStore.applicationData.policyAppDto.policyNumber : null));
85
91
  const contractDate = computed(() =>
86
92
  formStore.applicationData && formStore.applicationData.policyAppDto && formStore.applicationData.policyAppDto.contractDate
@@ -12,6 +12,8 @@
12
12
  </template>
13
13
 
14
14
  <script lang="ts">
15
+ import type { InputType } from '../../types/form';
16
+
15
17
  export default defineComponent({
16
18
  props: {
17
19
  fields: {
@@ -49,6 +49,8 @@
49
49
  </template>
50
50
 
51
51
  <script lang="ts">
52
+ import type { InputTypes, InputVariants } from '../../types';
53
+
52
54
  export default defineComponent({
53
55
  name: 'BaseFormInput',
54
56
  props: {
@@ -0,0 +1,25 @@
1
+ <template>
2
+ <v-otp-input v-model="modelValue" class="base-otp-input" base-color="#A0B3D8" color="#FFF" />
3
+ </template>
4
+
5
+ <script setup lang="ts">
6
+ const modelValue = defineModel<string>();
7
+ </script>
8
+
9
+ <style>
10
+ .base-otp-input .v-otp-input__field {
11
+ font-size: 16px;
12
+ }
13
+ .base-otp-input .v-field {
14
+ width: 50px;
15
+ height: 60px;
16
+ border-radius: 8px;
17
+ }
18
+ .base-otp-input .v-otp-input__content {
19
+ gap: 24px;
20
+ }
21
+ .base-otp-input .v-otp-input__divider {
22
+ margin: 0 4px;
23
+ color: #b8b8b8;
24
+ }
25
+ </style>
@@ -39,6 +39,7 @@
39
39
 
40
40
  <script lang="ts">
41
41
  import { Value } from '../../composables/classes';
42
+ import type { InputTypes, InputVariants } from '../../types';
42
43
 
43
44
  export default defineComponent({
44
45
  name: 'BasePanelInput',
@@ -34,6 +34,8 @@
34
34
  </template>
35
35
 
36
36
  <script lang="ts">
37
+ import type { InputTypes, InputVariants } from '../../types';
38
+
37
39
  export default defineComponent({
38
40
  name: 'BaseRoundedInput',
39
41
  props: {
@@ -35,6 +35,8 @@
35
35
  </template>
36
36
 
37
37
  <script lang="ts">
38
+ import type { InputVariants } from '../../types';
39
+
38
40
  export default defineComponent({
39
41
  name: 'BaseRoundedSelect',
40
42
  props: {
@@ -148,6 +150,8 @@ export default defineComponent({
148
150
  border: 1px solid #dadada;
149
151
  box-shadow: none;
150
152
  font-size: 14px;
153
+ padding-top: 6px;
154
+ padding-bottom: 4px;
151
155
  }
152
156
  .rounded-select .v-field--error {
153
157
  border-color: #ff5449;
@@ -5,6 +5,8 @@
5
5
  </template>
6
6
 
7
7
  <script lang="ts">
8
+ import type { SwitchInput } from '../../types/form';
9
+
8
10
  export default defineComponent({
9
11
  name: 'asSwitchInput',
10
12
  props: {
@@ -16,6 +16,8 @@
16
16
  </template>
17
17
 
18
18
  <script lang="ts">
19
+ import type { InputType } from '../../types/form';
20
+
19
21
  const iconsList: { [key: string]: string } = {
20
22
  arrowRight: 'mdi-chevron-right',
21
23
  search: 'mdi-magnify',
@@ -26,6 +26,8 @@
26
26
  </template>
27
27
 
28
28
  <script lang="ts">
29
+ import type { PanelTypes } from '../../types';
30
+
29
31
  export default defineComponent({
30
32
  name: 'BasePanel',
31
33
  props: {