hl-core 0.0.7 → 0.0.8-beta.10

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 (70) hide show
  1. package/.prettierrc +2 -1
  2. package/api/index.ts +562 -0
  3. package/api/interceptors.ts +38 -0
  4. package/components/Button/Btn.vue +57 -0
  5. package/components/Button/BtnIcon.vue +47 -0
  6. package/components/Button/ScrollButtons.vue +6 -0
  7. package/components/Button/SortArrow.vue +21 -0
  8. package/components/Complex/Content.vue +5 -0
  9. package/components/Complex/ContentBlock.vue +5 -0
  10. package/components/Complex/Page.vue +43 -0
  11. package/components/Dialog/Dialog.vue +76 -0
  12. package/components/Dialog/FamilyDialog.vue +39 -0
  13. package/components/Form/FormBlock.vue +139 -0
  14. package/components/Form/FormSection.vue +18 -0
  15. package/components/Form/FormTextSection.vue +20 -0
  16. package/components/Form/FormToggle.vue +52 -0
  17. package/components/Form/ManagerAttachment.vue +196 -0
  18. package/components/Form/ProductConditionsBlock.vue +72 -0
  19. package/components/Input/Datepicker.vue +41 -0
  20. package/components/Input/EmptyFormField.vue +5 -0
  21. package/components/Input/FileInput.vue +71 -0
  22. package/components/Input/FormInput.vue +183 -0
  23. package/components/Input/PanelInput.vue +133 -0
  24. package/components/Input/RoundedInput.vue +143 -0
  25. package/components/Layout/Drawer.vue +45 -0
  26. package/components/Layout/Header.vue +48 -0
  27. package/components/Layout/Loader.vue +35 -0
  28. package/components/Layout/SettingsPanel.vue +48 -0
  29. package/components/List/ListEmpty.vue +22 -0
  30. package/components/Menu/MenuNav.vue +108 -0
  31. package/components/Menu/MenuNavItem.vue +37 -0
  32. package/components/Pages/Anketa.vue +341 -0
  33. package/components/Pages/Auth.vue +91 -0
  34. package/components/Pages/Documents.vue +108 -0
  35. package/components/Pages/MemberForm.vue +1229 -0
  36. package/components/Pages/ProductAgreement.vue +18 -0
  37. package/components/Pages/ProductConditions.vue +659 -0
  38. package/components/Panel/PanelHandler.vue +233 -0
  39. package/components/Panel/PanelItem.vue +5 -0
  40. package/components/Panel/PanelSelectItem.vue +20 -0
  41. package/components/Transitions/FadeTransition.vue +5 -0
  42. package/components/Transitions/SlideTransition.vue +5 -0
  43. package/composables/axios.ts +11 -0
  44. package/composables/classes.ts +1179 -0
  45. package/composables/constants.ts +71 -0
  46. package/composables/index.ts +168 -2
  47. package/composables/styles.ts +48 -8
  48. package/configs/i18n.ts +19 -0
  49. package/layouts/clear.vue +3 -0
  50. package/layouts/default.vue +75 -0
  51. package/layouts/full.vue +6 -0
  52. package/locales/en.json +403 -0
  53. package/locales/kz.json +403 -0
  54. package/locales/ru.json +403 -0
  55. package/nuxt.config.ts +39 -5
  56. package/package.json +28 -10
  57. package/pages/500.vue +85 -0
  58. package/plugins/helperFunctionsPlugins.ts +19 -2
  59. package/plugins/storePlugin.ts +5 -7
  60. package/plugins/vuetifyPlugin.ts +15 -0
  61. package/store/data.store.js +2291 -8
  62. package/store/form.store.ts +8 -0
  63. package/store/member.store.ts +381 -0
  64. package/store/rules.js +52 -39
  65. package/tailwind.config.js +10 -0
  66. package/types/index.ts +317 -0
  67. package/app.vue +0 -3
  68. package/components/Button/GreenBtn.vue +0 -33
  69. package/store/app.store.js +0 -12
  70. package/store/messages.ts +0 -310
@@ -0,0 +1,91 @@
1
+ <template>
2
+ <section class="flex flex-col justify-evenly">
3
+ <img draggable="false" class="w-2/3 lg:w-[25vw] self-center" src="~/assets/auth-logo.svg" />
4
+ <v-form ref="vForm" class="w-2/3 lg:w-[35vw] self-center">
5
+ <base-rounded-input
6
+ class="mb-1"
7
+ v-model="login"
8
+ :rules="$rules.required"
9
+ :loading="authLoading"
10
+ :placeholder="$t('buttons.userLogin')"
11
+ type="text"
12
+ @submitted="submitAuthForm"
13
+ ></base-rounded-input>
14
+ <base-rounded-input
15
+ class="mb-1"
16
+ v-model="password"
17
+ :rules="$rules.required"
18
+ :loading="authLoading"
19
+ :placeholder="$t('buttons.password')"
20
+ type="password"
21
+ @submitted="submitAuthForm"
22
+ ></base-rounded-input>
23
+ <base-btn :text="$t('buttons.login')" :disabled="authLoading" :btn="$libStyles.greenBtn" @click="submitAuthForm"></base-btn>
24
+ </v-form>
25
+ </section>
26
+ </template>
27
+
28
+ <script lang="ts">
29
+ export default defineComponent({
30
+ setup() {
31
+ const route = useRoute();
32
+ const router = useRouter();
33
+ const dataStore = useDataStore();
34
+
35
+ const vForm = ref<any>(null);
36
+
37
+ const credentials = {
38
+ production: { login: '', password: '' },
39
+ test: { login: '', password: '' },
40
+ development: { login: 'manager', password: 'asdqwe123' },
41
+ vercel: { login: '', password: 'asdqwe123' },
42
+ };
43
+
44
+ const useEnv = {
45
+ envMode: import.meta.env.VITE_MODE,
46
+ isDev: import.meta.env.VITE_MODE === 'development',
47
+ isTest: import.meta.env.VITE_MODE === 'test',
48
+ isVercel: import.meta.env.VITE_MODE === 'vercel',
49
+ isProduction: import.meta.env.VITE_MODE === 'production',
50
+ };
51
+
52
+ const login = ref<string>(credentials[useEnv.envMode as keyof typeof credentials].login);
53
+ const password = ref<string>(credentials[useEnv.envMode as keyof typeof credentials].password);
54
+
55
+ const numAttempts = ref(0);
56
+
57
+ const authLoading = ref(false);
58
+
59
+ onMounted(() => {
60
+ if (route.query && route.query.error) {
61
+ const authError = route.query.error;
62
+ if (authError === '401') {
63
+ dataStore.showToaster('error', dataStore.t('toaster.tokenExpire'), 3000);
64
+ }
65
+ }
66
+ });
67
+
68
+ const submitAuthForm = async () => {
69
+ await vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
70
+ if (v.valid) {
71
+ authLoading.value = true;
72
+ await dataStore.loginUser(login.value, password.value, numAttempts.value);
73
+ numAttempts.value++;
74
+ authLoading.value = false;
75
+ if (!!dataStore.user.id) {
76
+ router.push({ name: 'index' });
77
+ }
78
+ }
79
+ });
80
+ };
81
+
82
+ return {
83
+ login,
84
+ password,
85
+ vForm,
86
+ authLoading,
87
+ submitAuthForm,
88
+ };
89
+ },
90
+ });
91
+ </script>
@@ -0,0 +1,108 @@
1
+ <template>
2
+ <section class="w-full px-[10px] pt-[14px] flex flex-col gap-2" :class="[$libStyles.scrollPage]" v-if="formStore.signedDocumentList && formStore.signedDocumentList.length">
3
+ <base-content-block v-for="document of formStore.signedDocumentList" :key="document.id" :class="[$libStyles.textSimple]">
4
+ <h5 class="text-center font-medium mb-4">
5
+ {{ document.fileTypeName }}
6
+ </h5>
7
+ <div :class="[$libStyles.whiteBg, $libStyles.rounded]" class="p-2 h-12 flex items-center relative">
8
+ <span class="ml-2">{{ document.fileName }}</span>
9
+ <i
10
+ class="transition-all cursor-pointer mdi mdi-dots-vertical pl-2 mr-3 border-l-[1px] text-xl absolute right-0"
11
+ :class="[$libStyles.greenTextHover]"
12
+ @click="openPanel(document)"
13
+ ></i>
14
+ </div>
15
+ </base-content-block>
16
+ </section>
17
+ <base-list-empty v-else></base-list-empty>
18
+ <Teleport v-if="$dataStore.panelAction === null" to="#panel-actions">
19
+ <base-fade-transition>
20
+ <div :class="[$libStyles.flexColNav]">
21
+ <base-btn :disabled="documentLoading" :loading="documentLoading" text="Открыть" @click="getFile('view')"></base-btn>
22
+ <base-btn :disabled="documentLoading" :loading="documentLoading" text="Скачать" @click="getFile('download')"></base-btn>
23
+ </div>
24
+ </base-fade-transition>
25
+ </Teleport>
26
+ </template>
27
+
28
+ <script lang="ts">
29
+ import { DocumentItem } from '@/composables/classes';
30
+
31
+ export default defineComponent({
32
+ setup() {
33
+ const dataStore = useDataStore();
34
+ const formStore = useFormStore();
35
+ const currentDocument = ref<DocumentItem>(new DocumentItem());
36
+ const documentLoading = ref<boolean>(false);
37
+
38
+ const currentState = reactive<{ action: string; text: string }>({
39
+ action: '',
40
+ text: '',
41
+ });
42
+ const object_list = computed(() => Object.values(formStore.signedDocumentList));
43
+ const unSignedList = computed(() => document_list.value.filter(doc => doc.signed === false || doc.signed === null));
44
+ const document_list = computed(() =>
45
+ object_list.value.filter(obj => {
46
+ if (obj.fileTypeCode === '19' || obj.fileTypeCode === '5') {
47
+ return obj;
48
+ }
49
+ }),
50
+ );
51
+
52
+ const openPanel = async (document: DocumentItem) => {
53
+ dataStore.panelAction = null;
54
+ dataStore.panel.title = document.fileTypeName!;
55
+ currentDocument.value = document;
56
+ dataStore.panel.open = true;
57
+ };
58
+
59
+ watch(
60
+ () => document_list.value,
61
+ () => {
62
+ if (document_list.value.length > 1 && unSignedList.value.length) {
63
+ currentState.action = 'submit';
64
+ currentState.text = 'Все документы подписаны';
65
+ } else {
66
+ currentState.action = 'upload';
67
+ currentState.text = 'Сохранить';
68
+ }
69
+ },
70
+ {
71
+ immediate: true,
72
+ },
73
+ );
74
+
75
+ const getFile = async (type: FileActions) => {
76
+ if (currentDocument.value) {
77
+ documentLoading.value = true;
78
+ const fileExtension = currentDocument.value.fileName!.match(/\.([0-9a-z]+)(?:[\?#]|$)/i)![1];
79
+ await dataStore.getFile(currentDocument.value, type, fileExtension);
80
+ documentLoading.value = false;
81
+ }
82
+ };
83
+
84
+ const onInit = async () => {
85
+ await dataStore.getDicFileTypeList();
86
+ await dataStore.getSignedDocList(formStore.applicationData.processInstanceId);
87
+ };
88
+
89
+ onInit();
90
+
91
+ onUnmounted(() => {
92
+ dataStore.panel.open = false;
93
+ dataStore.panelAction = null;
94
+ });
95
+
96
+ return {
97
+ // State
98
+ formStore,
99
+ documentLoading,
100
+ DocumentItem,
101
+
102
+ // Functions
103
+ openPanel,
104
+ getFile,
105
+ };
106
+ },
107
+ });
108
+ </script>