@nixweb/nixloc-ui 0.0.125 → 0.0.128
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/docs/src/component/template/ViewTemplateReportPreview.drawio +210 -0
- package/package.json +79 -77
- package/src/App.vue +13 -13
- package/src/component/forms/Button.vue +170 -169
- package/src/component/forms/CheckboxGroup.vue +72 -63
- package/src/component/forms/CheckboxSimple.vue +46 -27
- package/src/component/forms/Color.vue +38 -38
- package/src/component/forms/DateTime.vue +167 -177
- package/src/component/forms/Dropdown.vue +218 -224
- package/src/component/forms/EditorHtml.vue +126 -123
- package/src/component/forms/FileUpload.vue +185 -189
- package/src/component/forms/ImageUpload.vue +230 -0
- package/src/component/forms/IncrementDecrement.vue +101 -0
- package/src/component/forms/InputDecimal.vue +142 -137
- package/src/component/forms/InputNumber.vue +154 -149
- package/src/component/forms/InputPassword.vue +135 -135
- package/src/component/forms/InputText.vue +162 -157
- package/src/component/forms/Modal.vue +65 -60
- package/src/component/forms/RadioGroup.vue +50 -50
- package/src/component/forms/Select.vue +349 -337
- package/src/component/forms/SelectStatic.vue +127 -120
- package/src/component/forms/Slider.vue +18 -18
- package/src/component/forms/TextArea.vue +126 -126
- package/src/component/layout/Alert.vue +92 -92
- package/src/component/layout/Badge.vue +103 -103
- package/src/component/layout/FixedBar.vue +100 -68
- package/src/component/layout/Header.vue +38 -35
- package/src/component/layout/LoadingFullPage.vue +27 -27
- package/src/component/layout/Menu.vue +210 -214
- package/src/component/layout/Molded.vue +28 -27
- package/src/component/layout/Panel.vue +140 -142
- package/src/component/layout/Popover.vue +126 -126
- package/src/component/layout/ScrollBar.vue +42 -43
- package/src/component/layout/Tab.vue +135 -0
- package/src/component/layout/Tag.vue +3 -3
- package/src/component/layout/Wizard.vue +211 -213
- package/src/component/rental/DisplayPeriodRent.vue +81 -0
- package/src/component/rental/DisplayTotalization.vue +47 -0
- package/src/component/shared/Collapse.vue +131 -131
- package/src/component/shared/Confirmation.vue +2 -2
- package/src/component/shared/DocumentEditor.vue +1 -1
- package/src/component/shared/DocumentPreview.vue +1 -1
- package/src/component/shared/DocumentPublic.vue +34 -0
- package/src/component/shared/ExportExcel.vue +1 -8
- package/src/component/shared/ExportPDF.vue +116 -116
- package/src/component/shared/{HeaderPrint.vue → HeaderReport.vue} +4 -4
- package/src/component/shared/HorizontalFilter.vue +59 -59
- package/src/component/shared/Loading.vue +107 -107
- package/src/component/shared/LoadingMoreButton.vue +23 -23
- package/src/component/shared/Messages.vue +81 -83
- package/src/component/shared/PDFViewer.vue +22 -22
- package/src/component/shared/Pagination.vue +52 -53
- package/src/component/shared/{LegendaParametro.vue → ParameterLegend.vue} +22 -26
- package/src/component/shared/ProgressBar.vue +22 -21
- package/src/component/shared/QueryButton.vue +66 -66
- package/src/component/shared/Report.vue +187 -0
- package/src/component/shared/SaveCancel.vue +26 -5
- package/src/component/shared/Search.vue +154 -154
- package/src/component/shared/SelectOption.vue +146 -0
- package/src/component/shared/Table.vue +163 -243
- package/src/component/shared/TableButton.vue +36 -36
- package/src/component/shared/TableDraggable.vue +127 -0
- package/src/component/shared/TableItem.vue +177 -0
- package/src/component/shared/TableTotalRecords.vue +9 -10
- package/src/component/shared/TableTotalization.vue +47 -47
- package/src/component/shared/Tip.vue +42 -42
- package/src/component/shared/Toast.vue +54 -54
- package/src/component/shared/TotalizationReport.vue +59 -0
- package/src/component/shared/VerticalFilter.vue +97 -145
- package/src/component/shared/query-builder/AddRule.vue +181 -187
- package/src/component/shared/query-builder/ConvertToOdata.js +34 -43
- package/src/component/shared/query-builder/DynamicComponent.vue +21 -16
- package/src/component/shared/query-builder/DynamicComponentList.vue +73 -0
- package/src/component/shared/query-builder/Fields.vue +29 -63
- package/src/component/shared/query-builder/QueryBuilder.vue +69 -69
- package/src/component/shared/query-builder/Rules.vue +2 -14
- package/src/component/shared/query-builder/SelectRule.vue +15 -15
- package/src/component/shared/query-builder/Tags.vue +24 -8
- package/src/component/shared/query-builder/utilities.js +21 -21
- package/src/component/template/{ListViewWithHandlerData.vue → ListViewWithDataHandler.vue} +260 -231
- package/src/component/template/{AddEditReport.vue → ReportCreateUpdate.vue} +40 -22
- package/src/component/template/ViewTemplateConfiguration.vue +64 -69
- package/src/component/template/ViewTemplateDocumentView.vue +22 -25
- package/src/component/template/ViewTemplateReportList.vue +39 -57
- package/src/component/template/ViewTemplateReportPreview.vue +270 -341
- package/src/component/template/ViewTemplateReportPreviewCOPIASEGURANCA.vue +497 -0
- package/src/component/template/ViewTemplateSelectOption.vue +60 -0
- package/src/component/template/ViewTemplateWithSalveCancel.vue +32 -32
- package/src/component/template/ViewTemplateWithTable.vue +56 -49
- package/src/component/template/model/Report.js +2 -2
- package/src/component/value-objects/Address.js +11 -0
- package/src/component/value-objects/{Endereco.vue → Address.vue} +39 -40
- package/src/component/value-objects/{DadosContato.js → Contact.js} +2 -2
- package/src/component/value-objects/{DadosContato.vue → Contact.vue} +24 -17
- package/src/component/value-objects/Person.js +10 -0
- package/src/component/value-objects/{DadosPessoa.vue → Person.vue} +50 -35
- package/src/config/axios.js +9 -9
- package/src/config/dicas.js +14 -14
- package/src/config/router.js +13 -13
- package/src/config/token.js +14 -14
- package/src/main.js +23 -23
- package/src/store/modules/generic.js +512 -488
- package/src/store/modules/report.js +156 -127
- package/src/store/modules/user.js +6 -0
- package/src/store/modules/validation.js +38 -38
- package/src/store/store.js +13 -13
- package/docs/src/component/template/ModeloRelatorioView.drawio +0 -160
- package/src/component/shared/query-builder/ListDynamicComponent.vue +0 -42
- package/src/component/shared/query-builder/Totalization.vue +0 -38
- package/src/component/value-objects/DadosPessoa.js +0 -10
- package/src/component/value-objects/Endereco.js +0 -11
|
@@ -1,337 +1,349 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<label>
|
|
4
|
-
<span class="title">{{ title }}</span>
|
|
5
|
-
<span class="required" v-if="required">*</span>
|
|
6
|
-
<Tip :field="field" :formName="formName" />
|
|
7
|
-
</label>
|
|
8
|
-
<div
|
|
9
|
-
class="select"
|
|
10
|
-
:class="{
|
|
11
|
-
'select-invalid': notifications.length > 0 && formDirty,
|
|
12
|
-
border: showBorder,
|
|
13
|
-
}"
|
|
14
|
-
>
|
|
15
|
-
<multiselect
|
|
16
|
-
@open="onOpen"
|
|
17
|
-
@select="onSelected"
|
|
18
|
-
@search-change="onSearch"
|
|
19
|
-
:options="data"
|
|
20
|
-
v-model.trim="currentValue"
|
|
21
|
-
:custom-label="label"
|
|
22
|
-
placeholder
|
|
23
|
-
:disabled="disabled"
|
|
24
|
-
:showLabels="true"
|
|
25
|
-
:noResult="false"
|
|
26
|
-
:maxHeight="250"
|
|
27
|
-
ref="multiselect"
|
|
28
|
-
selectLabel
|
|
29
|
-
deselectLabel
|
|
30
|
-
selectedLabel
|
|
31
|
-
>
|
|
32
|
-
<div slot="beforeList">
|
|
33
|
-
<vue-loading
|
|
34
|
-
v-if="loading"
|
|
35
|
-
type="bubbles"
|
|
36
|
-
color="#577696"
|
|
37
|
-
:size="{ width: '40px', height: '40px' }"
|
|
38
|
-
></vue-loading>
|
|
39
|
-
<div class="before-list" v-if="!loading">
|
|
40
|
-
<Button
|
|
41
|
-
v-if="
|
|
42
|
-
key="addNewRegister"
|
|
43
|
-
type="primary"
|
|
44
|
-
title="Novo"
|
|
45
|
-
size="small"
|
|
46
|
-
:clicked="addNewRegister"
|
|
47
|
-
/>
|
|
48
|
-
<Button
|
|
49
|
-
key="cleanSelect"
|
|
50
|
-
type="warning"
|
|
51
|
-
classIcon="fas fa-broom"
|
|
52
|
-
size="small"
|
|
53
|
-
:clicked="cleanSelect"
|
|
54
|
-
/>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
<div slot="afterList" v-if="totalRecords > 20 && data.length < totalRecords">
|
|
58
|
-
<div class="after-list text-center">
|
|
59
|
-
<Button
|
|
60
|
-
key="loadingMore"
|
|
61
|
-
type="info"
|
|
62
|
-
title="Carregar mais..."
|
|
63
|
-
classIcon="fas fa-redo-alt"
|
|
64
|
-
size="small"
|
|
65
|
-
:clicked="loadingMore"
|
|
66
|
-
/>
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
<div slot="noOptions">Lista está vazia</div>
|
|
70
|
-
<div slot="noResult">Nenhum registro encontrado</div>
|
|
71
|
-
</multiselect>
|
|
72
|
-
<div v-if="formDirty">
|
|
73
|
-
<div v-for="message in notifications" :key="message">
|
|
74
|
-
<span class="invalid">{{ message }}</span>
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
|
|
79
|
-
<vodal
|
|
80
|
-
v-if="nameNewRegister"
|
|
81
|
-
:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
:
|
|
85
|
-
:
|
|
86
|
-
:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
<
|
|
90
|
-
<
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
</
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
import
|
|
98
|
-
import
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
import
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
},
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
if (
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
},
|
|
171
|
-
|
|
172
|
-
...
|
|
173
|
-
...
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
"
|
|
182
|
-
"
|
|
183
|
-
"
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
response.
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
this.
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
this
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
this.
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
.select
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="margin">
|
|
3
|
+
<label>
|
|
4
|
+
<span class="title">{{ title }}</span>
|
|
5
|
+
<span class="required" v-if="required">*</span>
|
|
6
|
+
<Tip :field="field" :formName="formName" />
|
|
7
|
+
</label>
|
|
8
|
+
<div
|
|
9
|
+
class="select"
|
|
10
|
+
:class="{
|
|
11
|
+
'select-invalid': notifications.length > 0 && formDirty,
|
|
12
|
+
border: showBorder,
|
|
13
|
+
}"
|
|
14
|
+
>
|
|
15
|
+
<multiselect
|
|
16
|
+
@open="onOpen"
|
|
17
|
+
@select="onSelected"
|
|
18
|
+
@search-change="onSearch"
|
|
19
|
+
:options="data"
|
|
20
|
+
v-model.trim="currentValue"
|
|
21
|
+
:custom-label="label"
|
|
22
|
+
placeholder
|
|
23
|
+
:disabled="disabled"
|
|
24
|
+
:showLabels="true"
|
|
25
|
+
:noResult="false"
|
|
26
|
+
:maxHeight="250"
|
|
27
|
+
ref="multiselect"
|
|
28
|
+
selectLabel
|
|
29
|
+
deselectLabel
|
|
30
|
+
selectedLabel
|
|
31
|
+
>
|
|
32
|
+
<div slot="beforeList">
|
|
33
|
+
<vue-loading
|
|
34
|
+
v-if="loading"
|
|
35
|
+
type="bubbles"
|
|
36
|
+
color="#577696"
|
|
37
|
+
:size="{ width: '40px', height: '40px' }"
|
|
38
|
+
></vue-loading>
|
|
39
|
+
<div class="before-list" v-if="!loading">
|
|
40
|
+
<Button
|
|
41
|
+
v-if="showNewRegister"
|
|
42
|
+
key="addNewRegister"
|
|
43
|
+
type="primary"
|
|
44
|
+
title="Novo"
|
|
45
|
+
size="small"
|
|
46
|
+
:clicked="addNewRegister"
|
|
47
|
+
/>
|
|
48
|
+
<Button
|
|
49
|
+
key="cleanSelect"
|
|
50
|
+
type="warning"
|
|
51
|
+
classIcon="fas fa-broom"
|
|
52
|
+
size="small"
|
|
53
|
+
:clicked="cleanSelect"
|
|
54
|
+
/>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
<div slot="afterList" v-if="totalRecords > 20 && data.length < totalRecords">
|
|
58
|
+
<div class="after-list text-center">
|
|
59
|
+
<Button
|
|
60
|
+
key="loadingMore"
|
|
61
|
+
type="info"
|
|
62
|
+
title="Carregar mais..."
|
|
63
|
+
classIcon="fas fa-redo-alt"
|
|
64
|
+
size="small"
|
|
65
|
+
:clicked="loadingMore"
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
<div slot="noOptions">Lista está vazia</div>
|
|
70
|
+
<div slot="noResult">Nenhum registro encontrado</div>
|
|
71
|
+
</multiselect>
|
|
72
|
+
<div v-if="formDirty">
|
|
73
|
+
<div v-for="message in notifications" :key="message">
|
|
74
|
+
<span class="invalid">{{ message }}</span>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
<vodal
|
|
80
|
+
v-if="nameNewRegister"
|
|
81
|
+
:duration="50"
|
|
82
|
+
:show="showVodal(nameNewRegister)"
|
|
83
|
+
@hide="hide()"
|
|
84
|
+
:width="widthNewRegister"
|
|
85
|
+
:height="heightNewRegister"
|
|
86
|
+
:closeOnEsc="true"
|
|
87
|
+
:closeButton="true"
|
|
88
|
+
>
|
|
89
|
+
<Messages v-if="vodal.open" />
|
|
90
|
+
<div class="title-new-form">{{ titleNewRegister }}</div>
|
|
91
|
+
<hr class="hr" />
|
|
92
|
+
<slot></slot>
|
|
93
|
+
</vodal>
|
|
94
|
+
</div>
|
|
95
|
+
</template>
|
|
96
|
+
<script>
|
|
97
|
+
import Tip from "../shared/Tip.vue";
|
|
98
|
+
import Messages from "../shared/Messages.vue";
|
|
99
|
+
import Multiselect from "vue-multiselect";
|
|
100
|
+
|
|
101
|
+
import Button from "./Button.vue";
|
|
102
|
+
import Vodal from "vodal";
|
|
103
|
+
|
|
104
|
+
import { mapState, mapActions, mapMutations, mapGetters } from "vuex";
|
|
105
|
+
|
|
106
|
+
export default {
|
|
107
|
+
name: "Select",
|
|
108
|
+
props: {
|
|
109
|
+
title: String,
|
|
110
|
+
field: String,
|
|
111
|
+
formName: String,
|
|
112
|
+
required: Boolean,
|
|
113
|
+
url: String,
|
|
114
|
+
disabled: Boolean,
|
|
115
|
+
fieldTarget: String,
|
|
116
|
+
propsParams: Object,
|
|
117
|
+
value: Object,
|
|
118
|
+
changed: Function,
|
|
119
|
+
nameNewRegister: String,
|
|
120
|
+
showNewRegister: {
|
|
121
|
+
type: Boolean,
|
|
122
|
+
default: true,
|
|
123
|
+
},
|
|
124
|
+
titleNewRegister: String,
|
|
125
|
+
widthNewRegister: Number,
|
|
126
|
+
heightNewRegister: Number,
|
|
127
|
+
markFormDirty: {
|
|
128
|
+
type: Boolean,
|
|
129
|
+
default: true,
|
|
130
|
+
},
|
|
131
|
+
showBorder: {
|
|
132
|
+
type: Boolean,
|
|
133
|
+
default: true,
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
components: {
|
|
137
|
+
Multiselect,
|
|
138
|
+
Button,
|
|
139
|
+
Vodal,
|
|
140
|
+
Messages,
|
|
141
|
+
Tip,
|
|
142
|
+
},
|
|
143
|
+
data() {
|
|
144
|
+
return {
|
|
145
|
+
currentValue: {},
|
|
146
|
+
data: [],
|
|
147
|
+
totalRecords: 0,
|
|
148
|
+
baseParams: {
|
|
149
|
+
search: "",
|
|
150
|
+
currentPage: 1,
|
|
151
|
+
totalPerPage: 20,
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
registerNew: false,
|
|
155
|
+
loading: true,
|
|
156
|
+
notifications: [],
|
|
157
|
+
formDirty: false,
|
|
158
|
+
};
|
|
159
|
+
},
|
|
160
|
+
created() {
|
|
161
|
+
this.validate();
|
|
162
|
+
if (this.value)
|
|
163
|
+
this.currentValue = { id: this.value.id, content: this.value.content };
|
|
164
|
+
},
|
|
165
|
+
mounted() {
|
|
166
|
+
let el = this.$el.getElementsByClassName("multiselect")[0];
|
|
167
|
+
if (el) {
|
|
168
|
+
el.tabIndex = 0;
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
computed: {
|
|
172
|
+
...mapState("validation", ["resetForm", "vodal"]),
|
|
173
|
+
...mapState("generic", ["vodal"]),
|
|
174
|
+
...mapGetters("generic", ["showVodal"]),
|
|
175
|
+
},
|
|
176
|
+
methods: {
|
|
177
|
+
...mapActions("generic", ["getApi"]),
|
|
178
|
+
...mapMutations("generic", [
|
|
179
|
+
"removeLoading",
|
|
180
|
+
"openVodal",
|
|
181
|
+
"hideVodal",
|
|
182
|
+
"removeNotificarions",
|
|
183
|
+
"addFilter",
|
|
184
|
+
]),
|
|
185
|
+
...mapMutations("validation", [
|
|
186
|
+
"addValidation",
|
|
187
|
+
"removeValidation",
|
|
188
|
+
"resetValidation",
|
|
189
|
+
"updateFormDirty",
|
|
190
|
+
]),
|
|
191
|
+
onOpen() {
|
|
192
|
+
this.getAll();
|
|
193
|
+
},
|
|
194
|
+
onSelected(value) {
|
|
195
|
+
this.$emit("input", value);
|
|
196
|
+
if (this.changed) this.changed();
|
|
197
|
+
if (this.fieldTarget) {
|
|
198
|
+
let obj = { fieldTarget: this.fieldTarget, value: value.id };
|
|
199
|
+
this.addFilter(obj);
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
onSearch(value) {
|
|
203
|
+
this.baseParams.search = value;
|
|
204
|
+
this.getAll();
|
|
205
|
+
},
|
|
206
|
+
label(value) {
|
|
207
|
+
if (value.content) return `${value.content}`;
|
|
208
|
+
},
|
|
209
|
+
getAll() {
|
|
210
|
+
let obj = { ...this.baseParams, ...this.propsParams };
|
|
211
|
+
let params = { url: this.url, obj: obj };
|
|
212
|
+
this.loading = true;
|
|
213
|
+
this.getApi(params).then((response) => {
|
|
214
|
+
this.totalRecords = response.content.totalRecords;
|
|
215
|
+
let self = this;
|
|
216
|
+
if (this.baseParams.currentPage == 1) {
|
|
217
|
+
this.data = [];
|
|
218
|
+
}
|
|
219
|
+
response.content.data.map(function (value, key) {
|
|
220
|
+
self.data.push(value);
|
|
221
|
+
});
|
|
222
|
+
this.loading = false;
|
|
223
|
+
this.removeLoading(["loadingMore"]);
|
|
224
|
+
});
|
|
225
|
+
},
|
|
226
|
+
addNewRegister() {
|
|
227
|
+
this.openVodal(this.nameNewRegister);
|
|
228
|
+
this.resetValidation(this.nameNewRegister);
|
|
229
|
+
this.removeNotificarions();
|
|
230
|
+
this.$refs.multiselect.deactivate();
|
|
231
|
+
this.removeLoading(["addNewRegister"]);
|
|
232
|
+
},
|
|
233
|
+
hide() {
|
|
234
|
+
this.hideVodal();
|
|
235
|
+
},
|
|
236
|
+
cleanSelect() {
|
|
237
|
+
let obj = { id: "", conteudo: "" };
|
|
238
|
+
this.currentValue = obj;
|
|
239
|
+
this.$emit("input", obj);
|
|
240
|
+
this.$refs.multiselect.deactivate();
|
|
241
|
+
this.removeLoading(["cleanSelect"]);
|
|
242
|
+
|
|
243
|
+
if (this.fieldTarget) {
|
|
244
|
+
let obj = { fieldTarget: this.fieldTarget, value: "" };
|
|
245
|
+
this.addFilter(obj);
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
loadingMore() {
|
|
249
|
+
this.baseParams.currentPage++;
|
|
250
|
+
this.getAll();
|
|
251
|
+
},
|
|
252
|
+
validate() {
|
|
253
|
+
this.notifications = [];
|
|
254
|
+
if (this.required && !this.value.id) {
|
|
255
|
+
var message = `${this.title} não pode ser vazio!`;
|
|
256
|
+
this.notifications.push(message);
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
watch: {
|
|
261
|
+
"value.id": function () {
|
|
262
|
+
this.validate();
|
|
263
|
+
this.formDirty = true;
|
|
264
|
+
if (this.markFormDirty) this.updateFormDirty(true);
|
|
265
|
+
this.currentValue = { id: this.value.id, content: this.value.content };
|
|
266
|
+
},
|
|
267
|
+
notifications() {
|
|
268
|
+
let self = this;
|
|
269
|
+
this.notifications.forEach(function (notification) {
|
|
270
|
+
let obj = {
|
|
271
|
+
key: self.field + "&" + self.formName,
|
|
272
|
+
formName: self.formName,
|
|
273
|
+
notification: notification,
|
|
274
|
+
};
|
|
275
|
+
self.addValidation(obj);
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
if (this.notifications.length == 0) {
|
|
279
|
+
let obj = {
|
|
280
|
+
key: self.field + "&" + self.formName,
|
|
281
|
+
formName: self.formName,
|
|
282
|
+
};
|
|
283
|
+
self.removeValidation(obj);
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
resetForm: {
|
|
287
|
+
handler(form) {
|
|
288
|
+
if (form.nome == this.formName) {
|
|
289
|
+
let obj = { id: "", conteudo: "" };
|
|
290
|
+
this.currentValue = obj;
|
|
291
|
+
this.$emit("input", obj);
|
|
292
|
+
this.formDirty = false;
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
deep: true,
|
|
296
|
+
},
|
|
297
|
+
"vodal.open": function (value) {
|
|
298
|
+
if (!value) this.registerNew = false;
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
};
|
|
302
|
+
</script>
|
|
303
|
+
|
|
304
|
+
<style scoped>
|
|
305
|
+
.margin{
|
|
306
|
+
margin-bottom: 10px;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
div.before-list {
|
|
311
|
+
padding: 8px;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
div.after-list {
|
|
315
|
+
padding: 8px;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.invalid {
|
|
319
|
+
color: #f0134d;
|
|
320
|
+
font-size: 14px;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.select {
|
|
324
|
+
min-width: 300px;
|
|
325
|
+
height: 36px;
|
|
326
|
+
border-bottom: 1px solid #d6dadf;
|
|
327
|
+
border-radius: 0px !important;
|
|
328
|
+
z-index: 100;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.select-invalid {
|
|
332
|
+
border-bottom: 1px solid #ff5454;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.select-valid {
|
|
336
|
+
border-bottom: 1px solid #94aa2a;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.title-new-form {
|
|
340
|
+
font-size: 18px;
|
|
341
|
+
margin-bottom: 5px;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.border {
|
|
345
|
+
border: 1px solid #dbdee0 !important;
|
|
346
|
+
border-radius: 5px !important;
|
|
347
|
+
height: 38px !important;
|
|
348
|
+
}
|
|
349
|
+
</style>
|