hl-core 0.0.10-beta.2 → 0.0.10-beta.21

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 (42) hide show
  1. package/api/base.api.ts +221 -195
  2. package/components/Complex/TextBlock.vue +2 -0
  3. package/components/Dialog/Dialog.vue +7 -1
  4. package/components/Dialog/FamilyDialog.vue +2 -0
  5. package/components/Form/DigitalDocument.vue +52 -0
  6. package/components/Form/DynamicForm.vue +1 -0
  7. package/components/Form/FormData.vue +1 -0
  8. package/components/Form/ManagerAttachment.vue +2 -4
  9. package/components/Input/DynamicInput.vue +2 -0
  10. package/components/Input/FormInput.vue +2 -0
  11. package/components/Input/OtpInput.vue +25 -0
  12. package/components/Input/PanelInput.vue +1 -0
  13. package/components/Input/RoundedInput.vue +2 -0
  14. package/components/Input/RoundedSelect.vue +4 -0
  15. package/components/Input/SwitchInput.vue +2 -0
  16. package/components/Input/TextInput.vue +2 -0
  17. package/components/Layout/Drawer.vue +2 -0
  18. package/components/Pages/Anketa.vue +165 -166
  19. package/components/Pages/Auth.vue +2 -0
  20. package/components/Pages/ContragentForm.vue +1 -0
  21. package/components/Pages/Documents.vue +237 -6
  22. package/components/Pages/MemberForm.vue +204 -56
  23. package/components/Pages/ProductConditions.vue +153 -74
  24. package/components/Panel/PanelHandler.vue +231 -105
  25. package/components/Transitions/Animation.vue +2 -0
  26. package/components/Utilities/Chip.vue +2 -0
  27. package/components/Utilities/JsonViewer.vue +1 -2
  28. package/composables/classes.ts +102 -41
  29. package/composables/fields.ts +6 -4
  30. package/composables/index.ts +220 -7
  31. package/composables/styles.ts +8 -24
  32. package/configs/pwa.ts +1 -7
  33. package/locales/ru.json +11 -4
  34. package/nuxt.config.ts +10 -13
  35. package/package.json +13 -12
  36. package/plugins/head.ts +1 -1
  37. package/store/data.store.ts +235 -357
  38. package/store/member.store.ts +3 -2
  39. package/tsconfig.json +3 -0
  40. package/types/enum.ts +17 -2
  41. package/types/form.ts +71 -75
  42. package/types/index.ts +889 -877
@@ -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: {
@@ -154,19 +155,16 @@ export default defineComponent({
154
155
  return isReadonly.value;
155
156
  });
156
157
  const isSaleChanellShown = computed(() => {
157
- if (dataStore.isGons) return dataStore.isServiceManager();
158
158
  return true;
159
159
  });
160
160
  const isRegionShown = computed(() => {
161
- if (dataStore.isGons) return dataStore.isServiceManager() || dataStore.isAgent();
162
161
  return true;
163
162
  });
164
163
  const isManagerShown = computed(() => {
165
- if (dataStore.isGons) return dataStore.isServiceManager();
166
164
  return true;
167
165
  });
168
166
  const isAgentShown = computed(() => {
169
- if (dataStore.isGons || dataStore.isPension) return dataStore.isServiceManager();
167
+ if (dataStore.isPension) return dataStore.isServiceManager();
170
168
  return true;
171
169
  });
172
170
  const openPanel = async (currentDict: ManagerAttachmentFiels, title: string) => {
@@ -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: {
@@ -1,181 +1,179 @@
1
1
  <template>
2
- <base-fade-transition>
3
- <section v-if="firstQuestionList && firstQuestionList.length && (isFirstPanelOnRight ? true : !firstPanel) && !secondPanel" class="flex flex-col shrink grow max-h-[90vh]">
4
- <base-form-section v-if="$dataStore.isUnderwriter()" class="mx-[10px]">
5
- <base-rounded-select v-model="filterType" class="w-[200px]" :items="filterItems" :label="$dataStore.t('labels.filter')" hide-details />
6
- </base-form-section>
7
- <section :class="[$styles.blueBgLight, $styles.rounded]" class="mx-[10px] my-[14px] p-4 flex flex-col gap-4">
8
- <base-form-toggle
9
- v-model="answerToAll"
10
- :title="$dataStore.t('questionnaireType.answerAllNo')"
11
- :disabled="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
12
- :has-border="false"
13
- @clicked="handleToggler"
2
+ <section v-if="firstQuestionList && firstQuestionList.length && (isFirstPanelOnRight ? true : !firstPanel) && !secondPanel" class="flex flex-col shrink grow max-h-[85svh]">
3
+ <base-form-section v-if="$dataStore.isUnderwriter()" class="mx-[10px]">
4
+ <base-rounded-select v-model="filterType" class="w-[200px]" :items="filterItems" :label="$dataStore.t('labels.filter')" hide-details />
5
+ </base-form-section>
6
+ <section :class="[$styles.blueBgLight, $styles.rounded]" class="mx-[10px] my-[14px] p-4 flex flex-col gap-4">
7
+ <base-form-toggle
8
+ v-model="answerToAll"
9
+ :title="$dataStore.t('questionnaireType.answerAllNo')"
10
+ :disabled="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
11
+ :has-border="false"
12
+ @clicked="handleToggler"
13
+ />
14
+ </section>
15
+ <v-form ref="vForm" class="grow shrink overflow-y-scroll" @submit="submitForm">
16
+ <section
17
+ v-if="firstQuestionList.filter(i => i.first.definedAnswers === 'N').length"
18
+ :class="[$styles.blueBgLight, $styles.rounded]"
19
+ class="mx-[10px] p-4 flex flex-col gap-4"
20
+ >
21
+ <base-form-input
22
+ v-for="(question, index) in firstQuestionList.filter(i => i.first.definedAnswers === 'N')"
23
+ :key="index"
24
+ v-model="question.first.answerText"
25
+ :label="question.first.name"
26
+ :maska="$maska.threeDigit"
27
+ :readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
28
+ :rules="$rules.required"
14
29
  />
15
30
  </section>
16
- <v-form ref="vForm" class="grow shrink overflow-y-scroll" @submit="submitForm">
17
- <section
18
- v-if="firstQuestionList.filter(i => i.first.definedAnswers === 'N').length"
19
- :class="[$styles.blueBgLight, $styles.rounded]"
20
- class="mx-[10px] p-4 flex flex-col gap-4"
21
- >
22
- <base-form-input
23
- v-for="(question, index) in firstQuestionList.filter(i => i.first.definedAnswers === 'N')"
24
- :key="index"
25
- v-model="question.first.answerText"
26
- :label="question.first.name"
27
- :maska="$maska.threeDigit"
28
- :readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
29
- :rules="$rules.required"
30
- />
31
- </section>
32
- <section
33
- v-if="firstQuestions.filter(i => i.first.definedAnswers === 'Y').length"
34
- :class="[$styles.blueBgLight, $styles.rounded]"
35
- class="mx-[10px] mt-[14px] p-4 flex flex-col gap-4"
36
- >
37
- <base-form-text-section
38
- v-for="(question, index) in firstQuestions.filter(i => i.first.definedAnswers === 'Y')"
39
- :key="index"
40
- :class="[currentQuestion?.first.id === question.first.id && $dataStore.rightPanel.open ? $styles.greenBorder : '']"
41
- >
42
- <base-animation>
43
- <div
44
- v-if="question.first.answerName === 'Да' && question.second"
45
- :class="[$styles.greenBg, $styles.whiteText, $styles.textSimple]"
46
- class="rounded-t-lg pl-6 py-1 cursor-pointer"
47
- @click="openFirstPanel(question)"
48
- >
49
- {{ $dataStore.t('questionnaireType.pleaseAnswer', { text: question.second.length }) }}
50
- </div>
51
- </base-animation>
52
- <span :class="[$styles.textTitle]" class="border-b-[1px] border-b-[#F3F6FC] p-6 flex items-center justify-between">
53
- {{ question.first.name }}
54
- <base-animation>
55
- <i
56
- v-if="question.first.answerName === 'Да' && question.second && question.second.length"
57
- class="mdi mdi-chevron-right text-2xl cursor-pointer"
58
- @click="openFirstPanel(question)"
59
- ></i>
60
- </base-animation>
61
- </span>
62
- <div class="flex items-center justify-start gap-5 px-4 pt-4" :class="[$styles.textSimple]">
63
- <v-radio-group
64
- v-model="question.first.answerName"
65
- class="anketa-radio"
66
- :true-icon="`mdi-radiobox-marked ${$styles.greenText}`"
67
- false-icon="mdi-radiobox-blank text-[#636363]"
68
- :rules="$rules.required"
69
- :readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
70
- inline
71
- >
72
- <v-radio label="Да" value="Да" />
73
- <v-radio label="Нет" value="Нет" />
74
- </v-radio-group>
75
- </div>
76
- </base-form-text-section>
77
- </section>
78
- <section
79
- v-if="firstQuestions.filter(i => i.first.definedAnswers === 'D').length"
80
- :class="[$styles.blueBgLight, $styles.rounded]"
81
- class="mx-[10px] mt-[14px] p-4 flex flex-col gap-4"
31
+ <section
32
+ v-if="firstQuestions.filter(i => i.first.definedAnswers === 'Y').length"
33
+ :class="[$styles.blueBgLight, $styles.rounded]"
34
+ class="mx-[10px] mt-[14px] p-4 flex flex-col gap-4"
35
+ >
36
+ <base-form-text-section
37
+ v-for="(question, index) in firstQuestions.filter(i => i.first.definedAnswers === 'Y')"
38
+ :key="index"
39
+ :class="[currentQuestion?.first.id === question.first.id && $dataStore.rightPanel.open ? $styles.greenBorder : '']"
82
40
  >
83
- <base-form-text-section
84
- v-for="(question, index) in firstQuestions.filter(i => i.first.definedAnswers === 'D')"
85
- :key="index"
86
- :class="[currentQuestion?.first.id === question.first.id && $dataStore.rightPanel.open ? $styles.greenBorder : '']"
87
- >
88
- <span :class="[$styles.textTitle]" class="border-b-[1px] border-b-[#F3F6FC] p-6 flex items-center justify-between"> {{ question.first.name }} </span>
89
- <div class="flex items-center justify-start gap-5 px-4 pt-4" :class="[$styles.textSimple]">
90
- <v-radio-group
91
- v-model="question.first.answerName"
92
- class="anketa-radio"
93
- :true-icon="`mdi-radiobox-marked ${$styles.greenText}`"
94
- false-icon="mdi-radiobox-blank text-[#636363]"
95
- :rules="$rules.required"
96
- :readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
97
- inline
98
- >
99
- <v-radio label="Да" value="Да" />
100
- <v-radio label="Нет" value="Нет" />
101
- </v-radio-group>
41
+ <base-animation>
42
+ <div
43
+ v-if="question.first.answerName === 'Да' && question.second"
44
+ :class="[$styles.greenBg, $styles.whiteText, $styles.textSimple]"
45
+ class="rounded-t-lg pl-6 py-1 cursor-pointer"
46
+ @click="openFirstPanel(question)"
47
+ >
48
+ {{ $dataStore.t('questionnaireType.pleaseAnswer', { text: question.second.length }) }}
102
49
  </div>
50
+ </base-animation>
51
+ <span :class="[$styles.textTitle]" class="border-b-[1px] border-b-[#F3F6FC] p-6 flex items-center justify-between">
52
+ {{ question.first.name }}
103
53
  <base-animation>
104
- <div v-if="question.first.answerName === 'Да'" :class="[$styles.whiteText, $styles.textSimple]">
105
- <base-form-input
106
- v-model="question.first.answerText"
107
- :label="$dataStore.t('labels.inDetails')"
108
- :readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
109
- :rules="$rules.required"
110
- />
111
- </div>
54
+ <i
55
+ v-if="question.first.answerName === 'Да' && question.second && question.second.length"
56
+ class="mdi mdi-chevron-right text-2xl cursor-pointer"
57
+ @click="openFirstPanel(question)"
58
+ ></i>
112
59
  </base-animation>
113
- </base-form-text-section>
114
- </section>
115
- </v-form>
116
- <div class="px-[14px]">
117
- <base-btn
118
- class="my-[14px] self-center"
119
- :loading="isButtonLoading"
120
- :disabled="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
121
- @click="submitForm"
122
- :text="$dataStore.t('buttons.save')"
123
- />
124
- </div>
125
- </section>
126
- <base-btn
127
- v-if="currentQuestion && currentQuestion.second && currentQuestion.second.length && isFirstPanelOnRight ? false : firstPanel"
128
- class="!absolute z-10 self-center w-[96%] bottom-0"
129
- :text="$dataStore.t('buttons.save')"
130
- @click="submitSecondaryForm"
131
- />
132
- <section
133
- ref="firstPanelSection"
134
- v-if="currentQuestion && currentQuestion.second && isFirstPanelOnRight ? false : firstPanel"
135
- class="flex flex-col px-[10px] pb-[14px]"
136
- :class="[$styles.scrollPage]"
137
- >
138
- <v-form
139
- v-if="currentQuestion"
60
+ </span>
61
+ <div class="flex items-center justify-start gap-5 px-4 pt-4" :class="[$styles.textSimple]">
62
+ <v-radio-group
63
+ v-model="question.first.answerName"
64
+ class="anketa-radio"
65
+ :true-icon="`mdi-radiobox-marked ${$styles.greenText}`"
66
+ false-icon="mdi-radiobox-blank text-[#636363]"
67
+ :rules="$rules.required"
68
+ :readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
69
+ inline
70
+ >
71
+ <v-radio label="Да" value="Да" />
72
+ <v-radio label="Нет" value="Нет" />
73
+ </v-radio-group>
74
+ </div>
75
+ </base-form-text-section>
76
+ </section>
77
+ <section
78
+ v-if="firstQuestions.filter(i => i.first.definedAnswers === 'D').length"
140
79
  :class="[$styles.blueBgLight, $styles.rounded]"
141
80
  class="mx-[10px] mt-[14px] p-4 flex flex-col gap-4"
142
- ref="vSecondaryForm"
143
- @submit="submitSecondaryForm"
144
81
  >
145
- <base-form-text-section v-for="question in currentQuestion.second" :title="question.name" :key="question.name">
146
- <div v-if="question.definedAnswers === 'N'">
147
- <base-form-input
148
- v-if="question.answerType === 'T' || question.answerType === 'N'"
149
- v-model="question.answerText"
150
- class="border-t-[1px] border-t-[#F3F6FC]"
151
- :placeholder="$dataStore.t('labels.inputText')"
152
- :readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
153
- :rules="isSecondRequired ? $rules.required : []"
154
- />
155
- <base-form-input
156
- v-if="question.answerType === 'D'"
157
- v-model="question.answerText"
158
- class="border-t-[1px] border-t-[#F3F6FC]"
159
- :placeholder="$dataStore.t('form.date')"
82
+ <base-form-text-section
83
+ v-for="(question, index) in firstQuestions.filter(i => i.first.definedAnswers === 'D')"
84
+ :key="index"
85
+ :class="[currentQuestion?.first.id === question.first.id && $dataStore.rightPanel.open ? $styles.greenBorder : '']"
86
+ >
87
+ <span :class="[$styles.textTitle]" class="border-b-[1px] border-b-[#F3F6FC] p-6 flex items-center justify-between"> {{ question.first.name }} </span>
88
+ <div class="flex items-center justify-start gap-5 px-4 pt-4" :class="[$styles.textSimple]">
89
+ <v-radio-group
90
+ v-model="question.first.answerName"
91
+ class="anketa-radio"
92
+ :true-icon="`mdi-radiobox-marked ${$styles.greenText}`"
93
+ false-icon="mdi-radiobox-blank text-[#636363]"
94
+ :rules="$rules.required"
160
95
  :readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
161
- :rules="isSecondRequired ? $rules.date : []"
162
- :maska="$maska.date"
163
- append-inner-icon="mdi mdi-calendar-blank-outline"
164
- />
96
+ inline
97
+ >
98
+ <v-radio label="Да" value="Да" />
99
+ <v-radio label="Нет" value="Нет" />
100
+ </v-radio-group>
165
101
  </div>
166
- <base-panel-input
167
- v-else
168
- :class="[$styles.textTitle, $styles.greenText]"
169
- :value="question.answerName ? question.answerName : 'Выбрать вариант ответа'"
170
- :readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
171
- :clearable="false"
172
- :error-messages="isSecondRequired ? (question.answerName ? [] : ['Выбрать вариант ответа']) : []"
173
- @click="openSecondPanel(question)"
174
- ></base-panel-input>
102
+ <base-animation>
103
+ <div v-if="question.first.answerName === 'Да'" :class="[$styles.whiteText, $styles.textSimple]">
104
+ <base-form-input
105
+ v-model="question.first.answerText"
106
+ :label="$dataStore.t('labels.inDetails')"
107
+ :readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
108
+ :rules="$rules.required"
109
+ />
110
+ </div>
111
+ </base-animation>
175
112
  </base-form-text-section>
176
- </v-form>
177
- </section>
178
- </base-fade-transition>
113
+ </section>
114
+ </v-form>
115
+ <div class="px-[14px]">
116
+ <base-btn
117
+ class="my-[14px] self-center"
118
+ :loading="isButtonLoading"
119
+ :disabled="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
120
+ @click="submitForm"
121
+ :text="$dataStore.t('buttons.save')"
122
+ />
123
+ </div>
124
+ </section>
125
+ <base-btn
126
+ v-if="currentQuestion && currentQuestion.second && currentQuestion.second.length && isFirstPanelOnRight ? false : firstPanel"
127
+ class="!absolute z-10 self-center w-[96%] bottom-0"
128
+ :text="$dataStore.t('buttons.save')"
129
+ @click="submitSecondaryForm"
130
+ />
131
+ <section
132
+ ref="firstPanelSection"
133
+ v-if="currentQuestion && currentQuestion.second && isFirstPanelOnRight ? false : firstPanel"
134
+ class="flex flex-col px-[10px] pb-[14px]"
135
+ :class="[$styles.scrollPage]"
136
+ >
137
+ <v-form
138
+ v-if="currentQuestion"
139
+ :class="[$styles.blueBgLight, $styles.rounded]"
140
+ class="mx-[10px] mt-[14px] p-4 flex flex-col gap-4"
141
+ ref="vSecondaryForm"
142
+ @submit="submitSecondaryForm"
143
+ >
144
+ <base-form-text-section v-for="question in currentQuestion.second" :title="question.name" :key="question.name">
145
+ <div v-if="question.definedAnswers === 'N'">
146
+ <base-form-input
147
+ v-if="question.answerType === 'T' || question.answerType === 'N'"
148
+ v-model="question.answerText"
149
+ class="border-t-[1px] border-t-[#F3F6FC]"
150
+ :placeholder="$dataStore.t('labels.inputText')"
151
+ :readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
152
+ :rules="isSecondRequired ? $rules.required : []"
153
+ />
154
+ <base-form-input
155
+ v-if="question.answerType === 'D'"
156
+ v-model="question.answerText"
157
+ class="border-t-[1px] border-t-[#F3F6FC]"
158
+ :placeholder="$dataStore.t('form.date')"
159
+ :readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
160
+ :rules="isSecondRequired ? $rules.date : []"
161
+ :maska="$maska.date"
162
+ append-inner-icon="mdi mdi-calendar-blank-outline"
163
+ />
164
+ </div>
165
+ <base-panel-input
166
+ v-else
167
+ :class="[$styles.textTitle, $styles.greenText]"
168
+ :value="question.answerName ? question.answerName : 'Выбрать вариант ответа'"
169
+ :readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
170
+ :clearable="false"
171
+ :error-messages="isSecondRequired ? (question.answerName ? [] : ['Выбрать вариант ответа']) : []"
172
+ @click="openSecondPanel(question)"
173
+ ></base-panel-input>
174
+ </base-form-text-section>
175
+ </v-form>
176
+ </section>
179
177
  <Teleport v-if="secondPanel" to="#right-panel-actions">
180
178
  <div :class="[$styles.scrollPage]" class="flex flex-col items-center">
181
179
  <base-rounded-input v-model="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
@@ -234,11 +232,12 @@
234
232
  </v-form>
235
233
  </div>
236
234
  </Teleport>
237
- <base-scroll-buttons v-if="firstQuestionList && firstQuestionList.length" @up="scrollForm('up')" @down="scrollForm('down')" />
235
+ <base-scroll-buttons v-if="firstQuestionList && firstQuestionList.length" class="bottom-[20%]" @up="scrollForm('up')" @down="scrollForm('down')" />
238
236
  </template>
239
237
 
240
238
  <script lang="ts">
241
239
  import { Value } from '../../composables/classes';
240
+ import type { AnketaBody, AnketaSecond, AnswerName } from '../../types';
242
241
 
243
242
  export default defineComponent({
244
243
  setup() {
@@ -125,6 +125,8 @@
125
125
  </template>
126
126
 
127
127
  <script lang="ts">
128
+ import type { InputTypes } from '../../types';
129
+
128
130
  export default defineComponent({
129
131
  setup() {
130
132
  const route = useRoute();
@@ -289,6 +289,7 @@
289
289
  <script lang="ts">
290
290
  import { StoreMembers } from '../../types/enum';
291
291
  import { Member, Value } from '../../composables/classes';
292
+ import type { ESBDValidationType } from '../../types';
292
293
 
293
294
  export default defineComponent({
294
295
  props: {