hl-core 0.0.8-beta.9 → 0.0.9-beta.1
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/api/index.ts +100 -34
- package/api/interceptors.ts +17 -13
- package/components/Button/Btn.vue +1 -1
- package/components/Button/ScrollButtons.vue +2 -2
- package/components/Complex/Page.vue +1 -1
- package/components/Dialog/Dialog.vue +9 -39
- package/components/Dialog/FamilyDialog.vue +7 -4
- package/components/Form/FormBlock.vue +51 -28
- package/components/Form/FormSection.vue +4 -1
- package/components/Form/FormToggle.vue +2 -3
- package/components/Form/ManagerAttachment.vue +21 -20
- package/components/Form/ProductConditionsBlock.vue +60 -10
- package/components/Input/Datepicker.vue +6 -2
- package/components/Input/FileInput.vue +2 -2
- package/components/Input/FormInput.vue +29 -7
- package/components/Input/PanelInput.vue +7 -2
- package/components/Input/RoundedInput.vue +2 -2
- package/components/Input/RoundedSelect.vue +137 -0
- package/components/Layout/Drawer.vue +3 -2
- package/components/Layout/Header.vue +40 -4
- package/components/Layout/Loader.vue +1 -1
- package/components/Layout/SettingsPanel.vue +51 -13
- package/components/Menu/MenuHover.vue +30 -0
- package/components/Menu/MenuNav.vue +29 -13
- package/components/Menu/MenuNavItem.vue +6 -3
- package/components/Pages/Anketa.vue +49 -31
- package/components/Pages/Auth.vue +139 -46
- package/components/Pages/Documents.vue +6 -6
- package/components/Pages/InvoiceInfo.vue +30 -0
- package/components/Pages/MemberForm.vue +503 -343
- package/components/Pages/ProductAgreement.vue +4 -2
- package/components/Pages/ProductConditions.vue +494 -95
- package/components/Panel/PanelHandler.vue +91 -20
- package/components/Panel/PanelSelectItem.vue +1 -1
- package/components/Utilities/Chip.vue +27 -0
- package/components/Utilities/JsonViewer.vue +27 -0
- package/composables/axios.ts +1 -1
- package/composables/classes.ts +165 -81
- package/composables/constants.ts +25 -52
- package/composables/index.ts +80 -2
- package/composables/styles.ts +8 -3
- package/configs/i18n.ts +2 -4
- package/layouts/default.vue +6 -6
- package/locales/kz.json +532 -346
- package/locales/ru.json +210 -22
- package/nuxt.config.ts +1 -1
- package/package.json +38 -12
- package/pages/500.vue +2 -2
- package/pages/Token.vue +51 -0
- package/plugins/helperFunctionsPlugins.ts +2 -1
- package/plugins/vuetifyPlugin.ts +3 -1
- package/store/{data.store.js → data.store.ts} +1116 -752
- package/store/form.store.ts +1 -1
- package/store/member.store.ts +94 -72
- package/store/{rules.js → rules.ts} +54 -26
- package/types/enum.ts +83 -0
- package/types/env.d.ts +10 -0
- package/types/index.ts +197 -7
- package/locales/en.json +0 -399
package/composables/index.ts
CHANGED
|
@@ -3,6 +3,25 @@ import jwt_decode from 'jwt-decode';
|
|
|
3
3
|
import { XMLParser } from 'fast-xml-parser';
|
|
4
4
|
import { AxiosError } from 'axios';
|
|
5
5
|
|
|
6
|
+
export const getBaseCredentials = () => {
|
|
7
|
+
return {
|
|
8
|
+
production: { login: '', password: '' },
|
|
9
|
+
test: { login: '', password: '' },
|
|
10
|
+
development: { login: 'manager', password: 'asdqwe123' },
|
|
11
|
+
vercel: { login: '', password: 'asdqwe123' },
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const useEnv = () => {
|
|
16
|
+
return {
|
|
17
|
+
envMode: import.meta.env.VITE_MODE,
|
|
18
|
+
isDev: import.meta.env.VITE_MODE === 'development',
|
|
19
|
+
isTest: import.meta.env.VITE_MODE === 'test',
|
|
20
|
+
isVercel: import.meta.env.VITE_MODE === 'vercel',
|
|
21
|
+
isProduction: import.meta.env.VITE_MODE === 'production',
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
6
25
|
export class Masks {
|
|
7
26
|
numbers: string = '#*';
|
|
8
27
|
otp: string = '# # # #';
|
|
@@ -141,10 +160,11 @@ export const parseXML = (xml: boolean | string = true, withTag = false, tag: str
|
|
|
141
160
|
};
|
|
142
161
|
|
|
143
162
|
export const ESBDMessage = (ESBDObject: any, initialPoint: any) => {
|
|
163
|
+
return ESBDObject.errorMsg;
|
|
144
164
|
let result;
|
|
145
165
|
if (ESBDObject.errorCode === 2) {
|
|
146
166
|
if (ESBDObject.errorMsg.indexOf('EMSG') === -1) {
|
|
147
|
-
result = '
|
|
167
|
+
result = 'Контрагент не является резидентом РК!';
|
|
148
168
|
} else {
|
|
149
169
|
result = ESBDObject.errorMsg.substring(ESBDObject.errorMsg.indexOf('EMSG') + 6, ESBDObject.errorMsg.lastIndexOf('EWS-100')).replace(initialPoint, '');
|
|
150
170
|
}
|
|
@@ -165,8 +185,66 @@ export const ErrorHandler = (err: unknown, errorText?: string) => {
|
|
|
165
185
|
console.log(err);
|
|
166
186
|
if (err instanceof AxiosError) {
|
|
167
187
|
if ('response' in err && err.response && err.response.data) {
|
|
168
|
-
|
|
188
|
+
if ('status' in err.response && err.response.status === 403) {
|
|
189
|
+
useDataStore().showToaster('error', useDataStore().t('toaster.noPermission'), 10000);
|
|
190
|
+
} else if (err.response.data) {
|
|
191
|
+
useDataStore().showToaster('error', errorText ? errorText : err.response.data, 10000);
|
|
192
|
+
}
|
|
169
193
|
}
|
|
170
194
|
}
|
|
171
195
|
return false;
|
|
172
196
|
};
|
|
197
|
+
|
|
198
|
+
export const setAddressBeneficiary = (whichIndex: number, sameAddress: boolean) => {
|
|
199
|
+
const formStore = useFormStore();
|
|
200
|
+
const dataStore = useDataStore();
|
|
201
|
+
const beneficiary = formStore.beneficiaryForm[Number(whichIndex)];
|
|
202
|
+
const policyholder = formStore.policyholderForm;
|
|
203
|
+
if (sameAddress === true) {
|
|
204
|
+
beneficiary.registrationCity = policyholder.registrationCity;
|
|
205
|
+
beneficiary.registrationCountry = policyholder.registrationCountry;
|
|
206
|
+
beneficiary.birthPlace = policyholder.birthPlace;
|
|
207
|
+
beneficiary.registrationMicroDistrict = policyholder.registrationMicroDistrict;
|
|
208
|
+
beneficiary.registrationNumberApartment = policyholder.registrationNumberApartment;
|
|
209
|
+
beneficiary.registrationNumberApartment = policyholder.registrationNumberApartment;
|
|
210
|
+
beneficiary.registrationNumberHouse = policyholder.registrationNumberHouse;
|
|
211
|
+
beneficiary.registrationProvince = policyholder.registrationProvince;
|
|
212
|
+
beneficiary.registrationQuarter = policyholder.registrationQuarter;
|
|
213
|
+
beneficiary.registrationRegion = policyholder.registrationRegion;
|
|
214
|
+
beneficiary.registrationRegionType = policyholder.registrationRegionType;
|
|
215
|
+
beneficiary.registrationStreet = policyholder.registrationStreet;
|
|
216
|
+
} else {
|
|
217
|
+
if (beneficiary.id === 0) {
|
|
218
|
+
beneficiary.registrationCity = new Value();
|
|
219
|
+
beneficiary.registrationCountry = new Value();
|
|
220
|
+
beneficiary.registrationMicroDistrict = '';
|
|
221
|
+
beneficiary.registrationNumberApartment = '';
|
|
222
|
+
beneficiary.registrationNumberApartment = '';
|
|
223
|
+
beneficiary.registrationNumberHouse = '';
|
|
224
|
+
beneficiary.registrationProvince = new Value();
|
|
225
|
+
beneficiary.registrationQuarter = '';
|
|
226
|
+
beneficiary.registrationRegion = new Value();
|
|
227
|
+
beneficiary.registrationRegionType = new Value();
|
|
228
|
+
beneficiary.registrationStreet = '';
|
|
229
|
+
} else {
|
|
230
|
+
if (beneficiary.response && beneficiary.response.addresses && beneficiary.response.addresses.length) {
|
|
231
|
+
const benAddress = beneficiary.response.addresses;
|
|
232
|
+
const country = dataStore.countries.find(i => (i.nameRu as string).match(new RegExp(benAddress[0].countryName, 'i')));
|
|
233
|
+
const city = dataStore.cities.find(i => i.nameRu === benAddress[0].cityName.replace('г.', ''));
|
|
234
|
+
const province = dataStore.states.find(i => i.ids === benAddress[0].stateCode);
|
|
235
|
+
const localityType = dataStore.localityTypes.find(i => i.nameRu === benAddress[0].cityTypeName);
|
|
236
|
+
const region = dataStore.regions.find(i => i.ids == benAddress[0].regionCode);
|
|
237
|
+
beneficiary.registrationCountry = country ?? new Value();
|
|
238
|
+
beneficiary.registrationCity = city ?? new Value();
|
|
239
|
+
beneficiary.registrationMicroDistrict = beneficiary.response?.addresses[0].microRaion ?? '';
|
|
240
|
+
beneficiary.registrationNumberApartment = beneficiary.response?.addresses[0].apartmentNumber ?? '';
|
|
241
|
+
beneficiary.registrationNumberHouse = beneficiary.response?.addresses[0].blockNumber ?? '';
|
|
242
|
+
beneficiary.registrationProvince = province ?? new Value();
|
|
243
|
+
beneficiary.registrationQuarter = beneficiary.response?.addresses[0].kvartal ?? '';
|
|
244
|
+
beneficiary.registrationRegion = region ?? new Value();
|
|
245
|
+
beneficiary.registrationRegionType = localityType ?? new Value();
|
|
246
|
+
beneficiary.registrationStreet = beneficiary.response?.addresses[0].streetName ?? '';
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
};
|
package/composables/styles.ts
CHANGED
|
@@ -17,9 +17,10 @@ export class Styles {
|
|
|
17
17
|
// Green
|
|
18
18
|
greenBg: string = 'bg-[#009C73]';
|
|
19
19
|
greenBgHover: string = 'hover:bg-[#00a277]';
|
|
20
|
-
greenBgLight: string = 'bg-[#
|
|
21
|
-
greenText: string = 'text-[#009C73]';
|
|
20
|
+
greenBgLight: string = 'bg-[#EAF6EF]';
|
|
21
|
+
greenText: string = '!text-[#009C73]';
|
|
22
22
|
greenTextHover: string = 'hover:text-[#009C73]';
|
|
23
|
+
greenBgLightHover: string = 'hover:bg-[#dbf0e4]';
|
|
23
24
|
|
|
24
25
|
// Yellow
|
|
25
26
|
yellowText: string = 'text-[#FAB31C]';
|
|
@@ -35,8 +36,10 @@ export class Styles {
|
|
|
35
36
|
greyBtnBg: string = 'bg-[#EEE6E6]';
|
|
36
37
|
greyBtnDisabledBg: string = 'bg-[#919191]';
|
|
37
38
|
blueLightBgHover: string = 'hover:bg-[#F3F6FC]';
|
|
39
|
+
greyTextDark: string = 'text-[#9197A1]';
|
|
40
|
+
|
|
38
41
|
// Red
|
|
39
|
-
redText: string = 'text-[#
|
|
42
|
+
redText: string = 'text-[#FD2D39]';
|
|
40
43
|
redBg: string = 'bg-[#FF897D]';
|
|
41
44
|
redBgHover: string = 'hover:bg-[#ff9b91]';
|
|
42
45
|
// Error
|
|
@@ -61,6 +64,7 @@ export class Styles {
|
|
|
61
64
|
yellowBtn: string;
|
|
62
65
|
whiteBtn: string;
|
|
63
66
|
blueLightBtn: string;
|
|
67
|
+
greenLightBtn: string;
|
|
64
68
|
|
|
65
69
|
// Complex
|
|
66
70
|
flexColNav: string;
|
|
@@ -79,6 +83,7 @@ export class Styles {
|
|
|
79
83
|
this.blueBtn = `${this.blueBg} ${this.whiteText} ${this.textTitle} ${this.rounded} w-full ${this.blueBgHover}`;
|
|
80
84
|
this.whiteBtn = ` ${this.blackText} ${this.textTitle} ${this.rounded} w-full ${this.blueLightBgHover}`;
|
|
81
85
|
this.blueLightBtn = `${this.blueBgLight} ${this.greyTextLight} ${this.textTitle} ${this.rounded} w-full ${this.blueBgLightHover}`;
|
|
86
|
+
this.greenLightBtn = `${this.greenBgLight} ${this.greenText} ${this.textTitle} ${this.rounded} w-full ${this.greenBgLightHover}`;
|
|
82
87
|
|
|
83
88
|
// Complex
|
|
84
89
|
this.flexColNav = 'flex flex-col gap-[10px] px-2 pt-[14px]';
|
package/configs/i18n.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { createI18n } from 'vue-i18n';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import kz from '@/locales/kz.json';
|
|
2
|
+
import ru from '../locales/ru.json';
|
|
3
|
+
import kz from '../locales/kz.json';
|
|
5
4
|
|
|
6
5
|
const instance = createI18n({
|
|
7
6
|
legacy: false,
|
|
8
7
|
globalInjection: true,
|
|
9
8
|
locale: 'ru',
|
|
10
9
|
messages: {
|
|
11
|
-
en,
|
|
12
10
|
ru,
|
|
13
11
|
kz,
|
|
14
12
|
},
|
package/layouts/default.vue
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
:title="$dataStore.menu.title ?? 'Страховые продукты'"
|
|
9
9
|
:has-back="$dataStore.menu.hasBack ?? false"
|
|
10
10
|
:back-icon="$dataStore.menu.backIcon ?? 'mdi-arrow-left'"
|
|
11
|
+
:more-icon="$dataStore.menu.moreIcon ?? 'mdi-cog-outline'"
|
|
11
12
|
:has-more="'hasMore' in $route.meta && $route.meta.hasMore ? !!$route.meta.hasMore : false"
|
|
12
|
-
:hide-more-on-lg="true"
|
|
13
13
|
:class="{
|
|
14
14
|
// @ts-ignore
|
|
15
15
|
'!hidden': !$display().lgAndUp.value && !!$dataStore.menu.selectedItem.title,
|
|
@@ -19,17 +19,17 @@
|
|
|
19
19
|
@onLink="onLink"
|
|
20
20
|
>
|
|
21
21
|
<template #end>
|
|
22
|
-
<base-loader v-if="$dataStore.menu.loading" class="self-center m-5 opacity-70"
|
|
22
|
+
<base-loader v-if="$dataStore.menu.loading" class="self-center m-5 opacity-70" />
|
|
23
23
|
</template>
|
|
24
24
|
</base-menu-nav>
|
|
25
|
-
<slot
|
|
26
|
-
<base-settings-panel
|
|
25
|
+
<slot></slot>
|
|
26
|
+
<base-settings-panel />
|
|
27
27
|
</section>
|
|
28
28
|
</div>
|
|
29
29
|
</template>
|
|
30
30
|
|
|
31
31
|
<script setup lang="ts">
|
|
32
|
-
import { MenuItem } from '
|
|
32
|
+
import { MenuItem } from '../composables/classes';
|
|
33
33
|
const dataStore = useDataStore();
|
|
34
34
|
|
|
35
35
|
const openSettings = async () => {
|
|
@@ -38,7 +38,7 @@ const openSettings = async () => {
|
|
|
38
38
|
|
|
39
39
|
const onLink = async (item: MenuItem) => {
|
|
40
40
|
if (dataStore.menu.onLink) await dataStore.menu.onLink(item);
|
|
41
|
-
if (
|
|
41
|
+
if (!dataStore.filters.disabled(item)) dataStore.menu.selectedItem = item;
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
const onBack = async (item: MenuItem) => {
|