@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,489 +1,513 @@
|
|
|
1
|
-
import axios from "@/config/axios";
|
|
2
|
-
import
|
|
3
|
-
import Token from "@nixweb/nixloc-ui/src/config/token";
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
namespaced: true,
|
|
7
|
-
state: {
|
|
8
|
-
modal: {
|
|
9
|
-
name: undefined,
|
|
10
|
-
open: false
|
|
11
|
-
},
|
|
12
|
-
vodal: {
|
|
13
|
-
name: undefined,
|
|
14
|
-
open: false
|
|
15
|
-
},
|
|
16
|
-
notifications: [],
|
|
17
|
-
pagination: [],
|
|
18
|
-
selected: [],
|
|
19
|
-
loading: [],
|
|
20
|
-
event: {
|
|
21
|
-
dateTime: undefined,
|
|
22
|
-
name: undefined,
|
|
23
|
-
data: {}
|
|
24
|
-
},
|
|
25
|
-
toast: {
|
|
26
|
-
dateTime: undefined,
|
|
27
|
-
type: undefined,
|
|
28
|
-
},
|
|
29
|
-
ids: undefined,
|
|
30
|
-
search: { content: "", filter: {
|
|
31
|
-
documentHtml: "",
|
|
32
|
-
selectStatic: { dateTime: undefined,
|
|
33
|
-
executedSearch: false,
|
|
34
|
-
clearedSearch: false,
|
|
35
|
-
methodExecutedApi: undefined,
|
|
36
|
-
},
|
|
37
|
-
getters: {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
let
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
let
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
let
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
obj.vForSimple = "v-for='
|
|
100
|
-
config.push(obj);
|
|
101
|
-
} else if (
|
|
102
|
-
obj.vForSimple = "v-for='
|
|
103
|
-
config.push(obj);
|
|
104
|
-
} else if (
|
|
105
|
-
obj.
|
|
106
|
-
obj
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
config.push(obj);
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
var
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
.replaceAll("n.
|
|
142
|
-
.replaceAll("
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
result[item[obj.key]]
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
state.modal.open =
|
|
164
|
-
},
|
|
165
|
-
|
|
166
|
-
state.
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
state.vodal.
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
state.
|
|
175
|
-
},
|
|
176
|
-
|
|
177
|
-
state.
|
|
178
|
-
},
|
|
179
|
-
|
|
180
|
-
state.
|
|
181
|
-
},
|
|
182
|
-
|
|
183
|
-
state.
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
state.
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
state.
|
|
191
|
-
},
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
},
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
state.
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
if (
|
|
274
|
-
context.commit('
|
|
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
|
-
if (
|
|
304
|
-
context.commit('
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
context.commit('
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
if (response
|
|
320
|
-
context.commit('
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
context.commit('
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
return axios.post(params.url,
|
|
435
|
-
headers: new Token().tokenHeaders(),
|
|
436
|
-
})
|
|
437
|
-
.then((response) => {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
1
|
+
import axios from "@/config/axios";
|
|
2
|
+
import Tips from "@/config/tips";
|
|
3
|
+
import Token from "@nixweb/nixloc-ui/src/config/token";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
namespaced: true,
|
|
7
|
+
state: {
|
|
8
|
+
modal: {
|
|
9
|
+
name: undefined,
|
|
10
|
+
open: false
|
|
11
|
+
},
|
|
12
|
+
vodal: {
|
|
13
|
+
name: undefined,
|
|
14
|
+
open: false
|
|
15
|
+
},
|
|
16
|
+
notifications: [],
|
|
17
|
+
pagination: [],
|
|
18
|
+
selected: [],
|
|
19
|
+
loading: [],
|
|
20
|
+
event: {
|
|
21
|
+
dateTime: undefined,
|
|
22
|
+
name: undefined,
|
|
23
|
+
data: {}
|
|
24
|
+
},
|
|
25
|
+
toast: {
|
|
26
|
+
dateTime: undefined,
|
|
27
|
+
type: undefined,
|
|
28
|
+
},
|
|
29
|
+
ids: undefined,
|
|
30
|
+
search: { content: "", filter: { content: "Contém", id: "contains" } },
|
|
31
|
+
documentHtml: "",
|
|
32
|
+
selectStatic: { dateTime: undefined, fieldTarget: undefined, value: undefined },
|
|
33
|
+
executedSearch: false,
|
|
34
|
+
clearedSearch: false,
|
|
35
|
+
methodExecutedApi: undefined,
|
|
36
|
+
},
|
|
37
|
+
getters: {
|
|
38
|
+
tip: (state) => (tipId) => {
|
|
39
|
+
var tips = new Tips();
|
|
40
|
+
let message = "";
|
|
41
|
+
tips.help.find(value => {
|
|
42
|
+
if (value.tipId == tipId)
|
|
43
|
+
message = value.message;
|
|
44
|
+
})
|
|
45
|
+
return message;
|
|
46
|
+
},
|
|
47
|
+
showModal: (state) => (name) => {
|
|
48
|
+
if (name == state.modal.name) return true;
|
|
49
|
+
return false;
|
|
50
|
+
},
|
|
51
|
+
showVodal: (state) => (name) => {
|
|
52
|
+
if (name == state.vodal.name) return true;
|
|
53
|
+
return false;
|
|
54
|
+
},
|
|
55
|
+
isLoading: (state) => (key) => {
|
|
56
|
+
var loading = state.loading.find(value => {
|
|
57
|
+
return value === key
|
|
58
|
+
})
|
|
59
|
+
if (loading) return true;
|
|
60
|
+
return false;
|
|
61
|
+
},
|
|
62
|
+
pagination: (state) => (key) => {
|
|
63
|
+
return state.pagination.find(obj => {
|
|
64
|
+
return obj.key === key
|
|
65
|
+
})
|
|
66
|
+
},
|
|
67
|
+
event: (state) => {
|
|
68
|
+
return state.event;
|
|
69
|
+
},
|
|
70
|
+
documentPreview: (state) => {
|
|
71
|
+
let documentHtml = state.documentHtml
|
|
72
|
+
let ret = documentHtml;
|
|
73
|
+
|
|
74
|
+
var tables = document.getElementsByTagName("table");
|
|
75
|
+
let total = tables.length;
|
|
76
|
+
|
|
77
|
+
let config = [];
|
|
78
|
+
|
|
79
|
+
let index = 0;
|
|
80
|
+
while (index <= total - 1) {
|
|
81
|
+
|
|
82
|
+
let table = document.getElementsByTagName("table")[index];
|
|
83
|
+
let th = table.getElementsByTagName("th")[0];
|
|
84
|
+
|
|
85
|
+
let obj = {
|
|
86
|
+
vForGrouped: "",
|
|
87
|
+
vForSimple: "",
|
|
88
|
+
nameGroup: "",
|
|
89
|
+
nameGroupReplace: ""
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
if (th) {
|
|
93
|
+
let isGrouped = th.innerText.includes("n.grupo");
|
|
94
|
+
let isProduct = th.innerText.includes("n.produto");
|
|
95
|
+
let isPeriod = th.innerText.includes("n.periodo");
|
|
96
|
+
let isPayment = th.innerText.includes("n.pagamento");
|
|
97
|
+
|
|
98
|
+
if (isProduct) {
|
|
99
|
+
obj.vForSimple = "v-for='p in d.produto'";
|
|
100
|
+
config.push(obj);
|
|
101
|
+
} else if (isPeriod) {
|
|
102
|
+
obj.vForSimple = "v-for='pe in d.periodo'";
|
|
103
|
+
config.push(obj);
|
|
104
|
+
} else if (isPayment) {
|
|
105
|
+
obj.vForSimple = "v-for='pg in d.pagamento'";
|
|
106
|
+
config.push(obj);
|
|
107
|
+
} else if (isGrouped) {
|
|
108
|
+
obj.vForGrouped = "v-for='(produto, grN) in produtoAgrupado'";
|
|
109
|
+
obj.vForSimple = "v-for='p in d.produto'";
|
|
110
|
+
|
|
111
|
+
var initIndex = documentHtml.split("<tbody>", index + 1).join("<tbody>").length;
|
|
112
|
+
var lastIndex = documentHtml.split("</tbody>", index + 1).join("</tbody>").length;
|
|
113
|
+
|
|
114
|
+
let tbody = documentHtml.substring(documentHtml.indexOf("<tbody>", initIndex), documentHtml.lastIndexOf("</tbody>", lastIndex));
|
|
115
|
+
|
|
116
|
+
let tr = tbody.substring(tbody.indexOf("<tr>"), tbody.lastIndexOf("</tr>"));
|
|
117
|
+
|
|
118
|
+
obj.nameGroup = tr.substring(0, tr.indexOf('</tr>')) + "</tr>";
|
|
119
|
+
obj.nameGroup = obj.nameGroup.replaceAll("\"", "'");
|
|
120
|
+
obj.nameGroupReplace = obj.nameGroup.replace("<tr>", "").replace("</tr>", "");
|
|
121
|
+
config.push(obj);
|
|
122
|
+
|
|
123
|
+
} else {
|
|
124
|
+
config.push(obj);
|
|
125
|
+
}
|
|
126
|
+
} else {
|
|
127
|
+
config.push(obj);
|
|
128
|
+
}
|
|
129
|
+
index++;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
let replace = "";
|
|
133
|
+
config.forEach(x => {
|
|
134
|
+
replace += `.replace("<tbody>${x.nameGroup}<tr>", "<tbody ${x.vForGrouped}>${x.nameGroupReplace}<tr ${x.vForSimple}>")`;
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
var retParse = ret.replaceAll("\"", "'");
|
|
138
|
+
retParse = eval(`ret${replace}`);
|
|
139
|
+
|
|
140
|
+
var classImportant = retParse
|
|
141
|
+
.replaceAll("n.grupo", "")
|
|
142
|
+
.replaceAll("n.produto", "")
|
|
143
|
+
.replaceAll("n.periodo", "")
|
|
144
|
+
.replaceAll("n.pagamento", "")
|
|
145
|
+
.replaceAll("<p> !important;</p>", "<p> </p>");
|
|
146
|
+
|
|
147
|
+
return classImportant;
|
|
148
|
+
},
|
|
149
|
+
groupBy: () => (obj) => {
|
|
150
|
+
const result = {};
|
|
151
|
+
obj.array.forEach((item) => {
|
|
152
|
+
if (!result[item[obj.key]]) {
|
|
153
|
+
result[item[obj.key]] = [];
|
|
154
|
+
}
|
|
155
|
+
result[item[obj.key]].push(item);
|
|
156
|
+
});
|
|
157
|
+
return result;
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
mutations: {
|
|
161
|
+
openModal: (state, name) => {
|
|
162
|
+
state.modal.name = name;
|
|
163
|
+
state.modal.open = true;
|
|
164
|
+
},
|
|
165
|
+
hideModal: (state) => {
|
|
166
|
+
state.modal.open = false;
|
|
167
|
+
},
|
|
168
|
+
openVodal: (state, name) => {
|
|
169
|
+
state.vodal.name = name;
|
|
170
|
+
state.vodal.open = true;
|
|
171
|
+
},
|
|
172
|
+
hideVodal: (state) => {
|
|
173
|
+
state.vodal.name = "";
|
|
174
|
+
state.vodal.open = false;
|
|
175
|
+
},
|
|
176
|
+
updateSearch: (state, value) => {
|
|
177
|
+
state.search = value;
|
|
178
|
+
},
|
|
179
|
+
executedSearch: (state) => {
|
|
180
|
+
state.executedSearch = state.executedSearch = !state.executedSearch
|
|
181
|
+
},
|
|
182
|
+
clearedSearch: (state) => {
|
|
183
|
+
state.clearedSearch = state.clearedSearch = !state.clearedSearch
|
|
184
|
+
},
|
|
185
|
+
addSelected: (state, selected) => {
|
|
186
|
+
state.selected = selected;
|
|
187
|
+
},
|
|
188
|
+
addToast: (state, action) => {
|
|
189
|
+
state.toast.dateTime = new Date();
|
|
190
|
+
state.toast.type = action;
|
|
191
|
+
},
|
|
192
|
+
addMethodExecutedApi: (state, action) => {
|
|
193
|
+
setTimeout(function () {
|
|
194
|
+
state.methodExecutedApi = action;
|
|
195
|
+
}, 100);
|
|
196
|
+
},
|
|
197
|
+
cleanMethodExecutedApi: (state) => {
|
|
198
|
+
setTimeout(function () {
|
|
199
|
+
state.methodExecutedApi = "";
|
|
200
|
+
}, 100);
|
|
201
|
+
},
|
|
202
|
+
addLoading: (state, key) => {
|
|
203
|
+
state.loading.push(key);
|
|
204
|
+
},
|
|
205
|
+
removeLoading: (state, listKey) => {
|
|
206
|
+
listKey.forEach(function (key) {
|
|
207
|
+
let filter = state.loading.filter(function (item) {
|
|
208
|
+
return item != key;
|
|
209
|
+
});
|
|
210
|
+
state.loading = filter;
|
|
211
|
+
});
|
|
212
|
+
},
|
|
213
|
+
addPagination: (state, pagination) => {
|
|
214
|
+
state.pagination.push(pagination);
|
|
215
|
+
},
|
|
216
|
+
updatePagination: (state, pagination) => {
|
|
217
|
+
state.pagination.forEach(function (obj) {
|
|
218
|
+
if (obj.key == pagination.key)
|
|
219
|
+
obj.totalPerPage = pagination.totalPerPage;
|
|
220
|
+
});
|
|
221
|
+
},
|
|
222
|
+
updateDocumentHtml: (state, value) => {
|
|
223
|
+
state.documentHtml = value;
|
|
224
|
+
},
|
|
225
|
+
addEvent: (state, obj) => {
|
|
226
|
+
setTimeout(function () {
|
|
227
|
+
state.event.dateTime = new Date();
|
|
228
|
+
state.event.name = obj.name;
|
|
229
|
+
state.event.data = obj.data;
|
|
230
|
+
}, 100);
|
|
231
|
+
},
|
|
232
|
+
removeEvent: (state) => {
|
|
233
|
+
state.event = {};
|
|
234
|
+
},
|
|
235
|
+
addNotifications: (state, notifications) => {
|
|
236
|
+
state.notifications = notifications;
|
|
237
|
+
},
|
|
238
|
+
removeNotificarions: (state) => {
|
|
239
|
+
state.notifications = [];
|
|
240
|
+
},
|
|
241
|
+
addNotificationErrorApi: (state) => {
|
|
242
|
+
var erro = { property: "ERRO API", message: "Falha de Comunicação!" };
|
|
243
|
+
state.notifications = [erro];
|
|
244
|
+
},
|
|
245
|
+
listIdToString: (state, listId) => {
|
|
246
|
+
state.ids = "";
|
|
247
|
+
listId.forEach(function (id) {
|
|
248
|
+
state.ids += `${id},`;
|
|
249
|
+
});
|
|
250
|
+
},
|
|
251
|
+
addFilter: (state, obj) => {
|
|
252
|
+
state.selectStatic.dateTime = new Date();
|
|
253
|
+
state.selectStatic.fieldTarget = obj.fieldTarget;
|
|
254
|
+
state.selectStatic.value = obj.value;
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
actions: {
|
|
258
|
+
postApi: async function (context, params) {
|
|
259
|
+
context.commit('cleanMethodExecutedApi');
|
|
260
|
+
return axios.post(params.url, params.obj, {
|
|
261
|
+
headers: new Token().tokenHeaders(),
|
|
262
|
+
})
|
|
263
|
+
.then((response) => {
|
|
264
|
+
|
|
265
|
+
if (response.data.success) {
|
|
266
|
+
context.commit('addMethodExecutedApi', 'postApi');
|
|
267
|
+
|
|
268
|
+
if (!params.notNotifyToast)
|
|
269
|
+
context.commit('addToast', 'postApi');
|
|
270
|
+
|
|
271
|
+
context.commit('removeNotificarions');
|
|
272
|
+
|
|
273
|
+
if (!params.notRemoveFormDirty)
|
|
274
|
+
context.commit('validation/removeFormDirty', null, { root: true });
|
|
275
|
+
|
|
276
|
+
return response.data;
|
|
277
|
+
} else {
|
|
278
|
+
|
|
279
|
+
context.commit('addNotifications', response.data.notifications)
|
|
280
|
+
context.commit('addToast', 'postApiError');
|
|
281
|
+
return response.data;
|
|
282
|
+
}
|
|
283
|
+
}, (err) => {
|
|
284
|
+
|
|
285
|
+
if (err.response)
|
|
286
|
+
if (err.response.status === 403)
|
|
287
|
+
context.commit('addNotifications', [{ message: "Usuário sem permissão para adicionar!" }])
|
|
288
|
+
|
|
289
|
+
if (!err.response)
|
|
290
|
+
context.commit('addNotificationErrorApi');
|
|
291
|
+
return false;
|
|
292
|
+
})
|
|
293
|
+
},
|
|
294
|
+
putApi: async function (context, params) {
|
|
295
|
+
context.commit('cleanMethodExecutedApi');
|
|
296
|
+
return axios.put(params.url, params.obj, {
|
|
297
|
+
headers: new Token().tokenHeaders(),
|
|
298
|
+
})
|
|
299
|
+
.then((response) => {
|
|
300
|
+
if (response.data.success) {
|
|
301
|
+
context.commit('addMethodExecutedApi', 'putApi');
|
|
302
|
+
|
|
303
|
+
if (!params.notNotifyToast)
|
|
304
|
+
context.commit('addToast', 'putApi');
|
|
305
|
+
|
|
306
|
+
context.commit('removeNotificarions');
|
|
307
|
+
context.commit('validation/removeFormDirty', null, { root: true });
|
|
308
|
+
return response.data;
|
|
309
|
+
} else {
|
|
310
|
+
context.commit('addToast', 'putApiErro');
|
|
311
|
+
context.commit('addNotifications', response.data.notifications)
|
|
312
|
+
return response.data;
|
|
313
|
+
}
|
|
314
|
+
}, (err) => {
|
|
315
|
+
if (err.response)
|
|
316
|
+
if (err.response.status === 403)
|
|
317
|
+
context.commit('addNotifications', [{ message: "Usuário sem permissão para modificar!" }])
|
|
318
|
+
|
|
319
|
+
if (!err.response)
|
|
320
|
+
context.commit('addNotificationErrorApi');
|
|
321
|
+
|
|
322
|
+
return false;
|
|
323
|
+
})
|
|
324
|
+
},
|
|
325
|
+
getApi: async function (context, params) {
|
|
326
|
+
context.commit('cleanMethodExecutedApi');
|
|
327
|
+
return axios.get(params.url, {
|
|
328
|
+
params: params.obj,
|
|
329
|
+
headers: new Token().tokenHeaders(),
|
|
330
|
+
})
|
|
331
|
+
.then((response) => {
|
|
332
|
+
if (response.data.success) {
|
|
333
|
+
context.commit('addMethodExecutedApi', params.methodExecutedApi);
|
|
334
|
+
context.commit('removeNotificarions');
|
|
335
|
+
return response.data;
|
|
336
|
+
} else {
|
|
337
|
+
context.commit('addNotifications', response.data.notifications)
|
|
338
|
+
context.commit('addToast', 'falhaGenerica');
|
|
339
|
+
return response.data;
|
|
340
|
+
}
|
|
341
|
+
}, (err) => {
|
|
342
|
+
context.commit('addNotificationErrorApi');
|
|
343
|
+
return false;
|
|
344
|
+
})
|
|
345
|
+
},
|
|
346
|
+
orderAllApi: async function (context, params) {
|
|
347
|
+
return axios.put(params.url, params.obj, {
|
|
348
|
+
headers: new Token().tokenHeaders(),
|
|
349
|
+
})
|
|
350
|
+
.then((response) => {
|
|
351
|
+
return response.data;
|
|
352
|
+
}, (err) => {
|
|
353
|
+
context.commit('addNotificationErrorApi');
|
|
354
|
+
return false;
|
|
355
|
+
})
|
|
356
|
+
},
|
|
357
|
+
getApiOdata: async function (context, params) {
|
|
358
|
+
return axios.get(params.url, {
|
|
359
|
+
headers: new Token().tokenHeaders(),
|
|
360
|
+
})
|
|
361
|
+
.then((response) => {
|
|
362
|
+
return response.data;
|
|
363
|
+
}, (err) => {
|
|
364
|
+
context.commit('addNotificationErrorApi');
|
|
365
|
+
return false;
|
|
366
|
+
})
|
|
367
|
+
},
|
|
368
|
+
deleteAllApi: async function (context, params) {
|
|
369
|
+
|
|
370
|
+
context.commit('cleanMethodExecutedApi');
|
|
371
|
+
context.commit('listIdToString', params.selected);
|
|
372
|
+
|
|
373
|
+
let url = params.url;
|
|
374
|
+
let ids = context.state.ids;
|
|
375
|
+
|
|
376
|
+
return axios.delete(`${url}?ids=${ids}`, {
|
|
377
|
+
headers: new Token().tokenHeaders(),
|
|
378
|
+
})
|
|
379
|
+
.then((response) => {
|
|
380
|
+
if (response.data.success) {
|
|
381
|
+
context.commit('addMethodExecutedApi', 'deleteAllApi');
|
|
382
|
+
context.commit('addToast', 'deleteApiSucesso');
|
|
383
|
+
context.commit('removeNotificarions');
|
|
384
|
+
return response.data;
|
|
385
|
+
} else {
|
|
386
|
+
context.commit('addNotifications', response.data.notifications)
|
|
387
|
+
context.commit('addMethodExecutedApi', 'deleteAllApiErro');
|
|
388
|
+
context.commit('addToast', 'deleteApiErro');
|
|
389
|
+
return response.data;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
}, (err) => {
|
|
393
|
+
if (err.response)
|
|
394
|
+
if (err.response.status === 403)
|
|
395
|
+
context.commit('addNotifications', [{ message: "Usuário sem permissão para remove!" }])
|
|
396
|
+
|
|
397
|
+
if (!err.response)
|
|
398
|
+
context.commit('addNotificationErrorApi');
|
|
399
|
+
return false;
|
|
400
|
+
})
|
|
401
|
+
},
|
|
402
|
+
deleteApi: async function (context, params) {
|
|
403
|
+
|
|
404
|
+
context.commit('cleanMethodExecutedApi');
|
|
405
|
+
let url = params.url;
|
|
406
|
+
|
|
407
|
+
return axios.delete(`${url}`, {
|
|
408
|
+
headers: new Token().tokenHeaders(),
|
|
409
|
+
})
|
|
410
|
+
.then((response) => {
|
|
411
|
+
if (response.data.success) {
|
|
412
|
+
context.commit('addMethodExecutedApi', 'deleteApi')
|
|
413
|
+
context.commit('addToast', 'deleteApiSucesso');
|
|
414
|
+
context.commit('removeNotificarions');
|
|
415
|
+
return response.data;
|
|
416
|
+
} else {
|
|
417
|
+
context.commit('addNotifications', response.data.notifications)
|
|
418
|
+
context.commit('addToast', 'deleteApiErro');
|
|
419
|
+
return response.data;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
}, (err) => {
|
|
423
|
+
if (err.response)
|
|
424
|
+
if (err.response.status === 403)
|
|
425
|
+
context.commit('addNotifications', [{ message: "Usuário sem permissão para remove!" }])
|
|
426
|
+
|
|
427
|
+
if (!err.response)
|
|
428
|
+
context.commit('addNotificationErrorApi');
|
|
429
|
+
return false;
|
|
430
|
+
})
|
|
431
|
+
},
|
|
432
|
+
getFileApi: async function (context, params) {
|
|
433
|
+
context.commit('cleanMethodExecutedApi');
|
|
434
|
+
return axios.post(params.url, params.obj, {
|
|
435
|
+
headers: new Token().tokenHeaders(), responseType: "arraybuffer",
|
|
436
|
+
})
|
|
437
|
+
.then((response) => {
|
|
438
|
+
let blob = new Blob([response.data], { type: "application/pdf" }),
|
|
439
|
+
url = window.URL.createObjectURL(blob);
|
|
440
|
+
window.open(url);
|
|
441
|
+
context.commit('addMethodExecutedApi', 'getPdfApi');
|
|
442
|
+
context.commit('removeNotificarions');
|
|
443
|
+
|
|
444
|
+
}, (err) => {
|
|
445
|
+
context.commit('addNotificationErrorApi');
|
|
446
|
+
return false;
|
|
447
|
+
})
|
|
448
|
+
},
|
|
449
|
+
postFileApi: async function (context, params) {
|
|
450
|
+
context.commit('cleanMethodExecutedApi');
|
|
451
|
+
|
|
452
|
+
let formData = new FormData();
|
|
453
|
+
formData.append("file", params.file);
|
|
454
|
+
formData.append(params.container, params.container);
|
|
455
|
+
formData.append(params.name, params.name);
|
|
456
|
+
formData.append(params.accepted, params.accepted);
|
|
457
|
+
|
|
458
|
+
return axios.post(params.url, formData, {
|
|
459
|
+
headers: new Token().tokenHeaders(),
|
|
460
|
+
})
|
|
461
|
+
.then((response) => {
|
|
462
|
+
if (response.data.success) {
|
|
463
|
+
context.commit('addMethodExecutedApi', 'postFileApi');
|
|
464
|
+
context.commit('removeNotificarions');
|
|
465
|
+
return response.data;
|
|
466
|
+
} else {
|
|
467
|
+
context.commit('addToast', 'addApiError');
|
|
468
|
+
context.commit('addNotifications', response.data.notifications)
|
|
469
|
+
|
|
470
|
+
return response.data;
|
|
471
|
+
}
|
|
472
|
+
}, (err) => {
|
|
473
|
+
if (err.response)
|
|
474
|
+
if (err.response.status === 403)
|
|
475
|
+
context.commit('addNotifications', [{ message: "Usuário sem permissão para adicionar!" }])
|
|
476
|
+
|
|
477
|
+
if (!err.response)
|
|
478
|
+
context.commit('addNotificationErrorApi');
|
|
479
|
+
return false;
|
|
480
|
+
})
|
|
481
|
+
},
|
|
482
|
+
deleteFileApi: async function (context, params) {
|
|
483
|
+
context.commit('cleanMethodExecutedApi');
|
|
484
|
+
|
|
485
|
+
let url = params.url;
|
|
486
|
+
let name = params.obj.name;
|
|
487
|
+
let container = params.obj.container;
|
|
488
|
+
|
|
489
|
+
return axios.delete(`${url}?name=${name}&container=${container}`, {
|
|
490
|
+
headers: new Token().tokenHeaders(),
|
|
491
|
+
})
|
|
492
|
+
.then((response) => {
|
|
493
|
+
if (response.data.success) {
|
|
494
|
+
context.commit('addMethodExecutedApi', 'deleteFileApi');
|
|
495
|
+
context.commit('removeNotificarions');
|
|
496
|
+
return response.data;
|
|
497
|
+
} else {
|
|
498
|
+
context.commit('addNotifications', response.data.notifications)
|
|
499
|
+
context.commit('addToast', 'addApiError');
|
|
500
|
+
return response.data;
|
|
501
|
+
}
|
|
502
|
+
}, (err) => {
|
|
503
|
+
if (err.response)
|
|
504
|
+
if (err.response.status === 403)
|
|
505
|
+
context.commit('addNotifications', [{ message: "Usuário sem permissão para remove!" }])
|
|
506
|
+
|
|
507
|
+
if (!err.response)
|
|
508
|
+
context.commit('addNotificationErrorApi');
|
|
509
|
+
return false;
|
|
510
|
+
})
|
|
511
|
+
},
|
|
512
|
+
}
|
|
489
513
|
}
|