@nixweb/nixloc-ui 0.0.121 → 0.0.122
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/ModeloRelatorioView.drawio +2 -2
- package/docs/src/store/modulos/relatorio.drawio +1 -1
- package/package.json +77 -77
- package/public/styles/app.css +1 -1
- package/src/component/forms/{Botao.vue → Button.vue} +53 -57
- package/src/component/forms/CheckboxGroup.vue +63 -0
- package/src/component/forms/{CheckboxUnico.vue → CheckboxSimple.vue} +6 -6
- package/src/component/forms/{Cor.vue → Color.vue} +9 -9
- package/src/component/forms/DateTime.vue +53 -53
- package/src/component/forms/{BotaoDropdown.vue → Dropdown.vue} +50 -50
- package/src/component/forms/EditorHtml.vue +123 -0
- package/src/component/forms/FileUpload.vue +189 -0
- package/src/component/forms/InputDecimal.vue +137 -0
- package/src/component/forms/InputNumber.vue +149 -0
- package/src/component/forms/InputPassword.vue +135 -0
- package/src/component/forms/InputText.vue +157 -0
- package/src/component/forms/Modal.vue +15 -15
- package/src/component/forms/RadioGroup.vue +50 -0
- package/src/component/forms/Select.vue +337 -0
- package/src/component/forms/SelectStatic.vue +120 -0
- package/src/component/forms/TextArea.vue +126 -0
- package/src/component/forms/Toggle.vue +13 -13
- package/src/component/layout/{Conta.vue → Account.vue} +28 -28
- package/src/component/layout/{Alerta.vue → Alert.vue} +22 -22
- package/src/component/layout/Badge.vue +23 -23
- package/src/component/layout/{BarraFixa.vue → FixedBar.vue} +16 -16
- package/src/component/layout/{CarregandoTelaInteira.vue → LoadingFullPage.vue} +3 -3
- package/src/component/layout/Menu.vue +66 -66
- package/src/component/layout/{Moldura.vue → Molded.vue} +4 -4
- package/src/component/layout/Panel.vue +142 -0
- package/src/component/layout/Popover.vue +1 -1
- package/src/component/layout/{BarraRolagem.vue → Scrollbar.vue} +9 -11
- package/src/component/layout/Tag.vue +9 -9
- package/src/component/layout/Topo.vue +1 -1
- package/src/component/layout/Wizard.vue +3 -3
- package/src/component/shared/BotaoCarregarMais.vue +9 -9
- package/src/component/shared/BotaoConsulta.vue +9 -9
- package/src/component/shared/CabecalhoImpressao.vue +6 -6
- package/src/component/shared/CodigoEditor.vue +16 -16
- package/src/component/shared/Confirmacao.vue +28 -28
- package/src/component/shared/Dica.vue +10 -10
- package/src/component/shared/DocumentoEditor.vue +3 -3
- package/src/component/shared/DocumentoPreview.vue +2 -2
- package/src/component/shared/EsconderMostrar.vue +26 -26
- package/src/component/shared/ExportarExcel.vue +14 -14
- package/src/component/shared/ExportarPDF.vue +10 -10
- package/src/component/shared/FiltroHorizontal.vue +19 -19
- package/src/component/shared/LegendaParametro.vue +17 -17
- package/src/component/shared/{Carregando.vue → Loading.vue} +11 -11
- package/src/component/shared/Messages.vue +83 -0
- package/src/component/shared/Paginacao.vue +10 -10
- package/src/component/shared/Progresso.vue +2 -2
- package/src/component/shared/Registro.vue +2 -2
- package/src/component/shared/ResumoTabela.vue +6 -6
- package/src/component/shared/SalvarCancelar.vue +26 -26
- package/src/component/shared/{Pesquisa.vue → Search.vue} +36 -36
- package/src/component/shared/Tabela.vue +49 -49
- package/src/component/shared/TabelaBotao.vue +13 -13
- package/src/component/shared/Toast.vue +7 -7
- package/src/component/shared/{FiltroVertical.vue → VerticalFilter.vue} +14 -14
- package/src/component/shared/construtor-consulta/AdicionaFiltro.vue +191 -0
- package/src/component/shared/construtor-consulta/Campo.vue +127 -0
- package/src/component/shared/construtor-consulta/ComponenteDinamico.vue +109 -0
- package/src/component/shared/construtor-consulta/ConstrutorConsulta.vue +70 -0
- package/src/component/shared/construtor-consulta/ConverteParaOdata.js +80 -0
- package/src/component/shared/construtor-consulta/EscolherFiltro.vue +96 -0
- package/src/component/shared/{query-builder → construtor-consulta}/Filtro.vue +11 -16
- package/src/component/shared/construtor-consulta/ListaComponenteDinamico.vue +41 -0
- package/src/component/shared/{query-builder → construtor-consulta}/Rodape.vue +9 -9
- package/src/component/shared/{query-builder → construtor-consulta}/Tags.vue +7 -7
- package/src/component/shared/{query-builder → construtor-consulta}/utilities.js +0 -0
- package/src/component/template/ModeloAdicionarModificarView.vue +11 -11
- package/src/component/template/ModeloDocumentoView.vue +79 -79
- package/src/component/template/ModeloLista.vue +66 -66
- package/src/component/template/ModeloRelatorioListaView.vue +71 -68
- package/src/component/template/ModeloRelatorioView.vue +201 -190
- package/src/component/template/ModeloSubView.vue +13 -13
- package/src/component/template/ModeloView.vue +17 -17
- package/src/component/template/Relatorio.js +1 -5
- package/src/component/template/RelatorioAdicionarModificar.vue +44 -44
- package/src/component/value-objects/DadosContato.vue +27 -27
- package/src/component/value-objects/DadosPessoa.js +1 -1
- package/src/component/value-objects/DadosPessoa.vue +52 -52
- package/src/component/value-objects/Endereco.js +1 -1
- package/src/component/value-objects/Endereco.vue +83 -83
- package/src/config/dicas.js +1 -1
- package/src/config/token.js +2 -2
- package/src/store/modules/generic.js +489 -0
- package/src/store/modules/report.js +246 -0
- package/src/store/modules/user.js +38 -0
- package/src/store/modules/validation.js +39 -0
- package/src/store/store.js +4 -4
- package/src/component/forms/ArquivoUpload.vue +0 -199
- package/src/component/forms/CheckboxMultiplo.vue +0 -63
- package/src/component/forms/Decimal.vue +0 -137
- package/src/component/forms/Escolher.vue +0 -335
- package/src/component/forms/EscolherEstatico.vue +0 -139
- package/src/component/forms/Numero.vue +0 -153
- package/src/component/forms/Opcoes.vue +0 -51
- package/src/component/forms/Senha.vue +0 -139
- package/src/component/forms/Texto.vue +0 -161
- package/src/component/forms/TextoArea.vue +0 -126
- package/src/component/forms/TextoEditor.vue +0 -123
- package/src/component/layout/Painel.vue +0 -142
- package/src/component/shared/Mensagem.vue +0 -86
- package/src/component/shared/query-builder/Campo.vue +0 -116
- package/src/component/shared/query-builder/ConverteParaOdata.js +0 -77
- package/src/component/shared/query-builder/QueryBuilder.vue +0 -164
- package/src/component/shared/query-builder/components/CustomSelect.vue +0 -115
- package/src/component/shared/query-builder/components/QueryBuilderChildren.vue +0 -46
- package/src/component/shared/query-builder/components/QueryBuilderGroup.vue +0 -151
- package/src/component/shared/query-builder/components/QueryBuilderRule.vue +0 -81
- package/src/component/shared/query-builder/layouts/Bootstrap/BootstrapGroup.vue +0 -120
- package/src/component/shared/query-builder/layouts/Bootstrap/BootstrapRule.vue +0 -187
- package/src/component/shared/query-builder/main.js +0 -81
- package/src/store/modulos/generic.js +0 -494
- package/src/store/modulos/relatorio.js +0 -204
- package/src/store/modulos/usuario.js +0 -38
- package/src/store/modulos/validation.js +0 -39
|
@@ -1,110 +1,112 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<Painel
|
|
4
|
-
:
|
|
5
|
-
:
|
|
6
|
-
:
|
|
7
|
-
:
|
|
8
|
-
:
|
|
4
|
+
:module="panel.module"
|
|
5
|
+
:title="panel.title"
|
|
6
|
+
:showVerticalFilter="panel.showVerticalFilter"
|
|
7
|
+
:showSearch="panel.showSearch"
|
|
8
|
+
:showButtons="panel.showButtons"
|
|
9
9
|
>
|
|
10
|
-
<div slot="
|
|
10
|
+
<div slot="content-main">
|
|
11
11
|
<br />
|
|
12
|
+
{{ urlConsulta }}
|
|
12
13
|
<div class="div-progresso" v-if="carregando && tamanhoDados > 0">
|
|
13
14
|
<Progresso
|
|
14
|
-
:texto="`Carregando ${tamanhoDados} registro(s) de ${
|
|
15
|
+
:texto="`Carregando ${tamanhoDados} registro(s) de ${content.totalRecords}`"
|
|
15
16
|
:valor="tamanhoDados"
|
|
16
|
-
:maximo="
|
|
17
|
-
|
|
17
|
+
:maximo="content.totalRecords"
|
|
18
|
+
size="medium"
|
|
18
19
|
/>
|
|
19
20
|
</div>
|
|
20
|
-
<Modal
|
|
21
|
-
<RelatorioAdicionarModificar :
|
|
21
|
+
<Modal title="Salvar" :width="550" v-show="mostrarModal('salvar')">
|
|
22
|
+
<RelatorioAdicionarModificar :module="panel.module" />
|
|
22
23
|
</Modal>
|
|
23
|
-
<
|
|
24
|
+
<Molded>
|
|
24
25
|
<div>
|
|
25
|
-
<div slot="
|
|
26
|
+
<div slot="content-filter-horizontal">
|
|
26
27
|
<b-row>
|
|
27
28
|
<b-col sm="6">
|
|
28
|
-
<div class="
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
:
|
|
29
|
+
<div class="side-by-side">
|
|
30
|
+
{{ invalid }}
|
|
31
|
+
<Button
|
|
32
|
+
key="buscarRelatorio"
|
|
33
|
+
type="primary"
|
|
34
|
+
title="Buscar"
|
|
35
|
+
classIcon="fas fa-file-search"
|
|
36
|
+
size="medium"
|
|
37
|
+
:disabled="invalid || btnDesativado"
|
|
38
|
+
:clicked="getAll"
|
|
37
39
|
/>
|
|
38
40
|
</div>
|
|
39
|
-
<div class="
|
|
40
|
-
<
|
|
41
|
-
v-if="!
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
:
|
|
47
|
-
|
|
48
|
-
:
|
|
41
|
+
<div class="side-by-side">
|
|
42
|
+
<Button
|
|
43
|
+
v-if="!invalid"
|
|
44
|
+
key="salvarRelatorio"
|
|
45
|
+
type="success"
|
|
46
|
+
title="Salvar Modelo"
|
|
47
|
+
classIcon="fas fa-save"
|
|
48
|
+
:disabled="carregando || invalid"
|
|
49
|
+
size="small"
|
|
50
|
+
:clicked="salvarRelatorio"
|
|
49
51
|
/>
|
|
50
52
|
</div>
|
|
51
53
|
</b-col>
|
|
52
54
|
<b-col class="text-right" sm="6">
|
|
53
|
-
<div class="
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
:
|
|
61
|
-
:
|
|
55
|
+
<div class="side-by-side">
|
|
56
|
+
<Button
|
|
57
|
+
key="abrirCampo"
|
|
58
|
+
type="info"
|
|
59
|
+
title="fields"
|
|
60
|
+
classIcon="fas fa-database"
|
|
61
|
+
size="small"
|
|
62
|
+
:disabled="carregando"
|
|
63
|
+
:clicked="abrirCampo"
|
|
62
64
|
/>
|
|
63
65
|
</div>
|
|
64
|
-
<div class="
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
:
|
|
72
|
-
:
|
|
66
|
+
<div class="side-by-side">
|
|
67
|
+
<Button
|
|
68
|
+
key="abrirFiltro"
|
|
69
|
+
type="info"
|
|
70
|
+
title="Filtros"
|
|
71
|
+
classIcon="fas fa-filter"
|
|
72
|
+
size="small"
|
|
73
|
+
:disabled="carregando"
|
|
74
|
+
:clicked="abrirFiltro"
|
|
73
75
|
/>
|
|
74
76
|
</div>
|
|
75
77
|
</b-col>
|
|
76
78
|
</b-row>
|
|
77
|
-
<Modal
|
|
78
|
-
<slot name="
|
|
79
|
+
<Modal title="Filtros" :width="900" v-show="mostrarModal('filter')">
|
|
80
|
+
<slot name="filter"></slot>
|
|
79
81
|
<br />
|
|
80
82
|
<b-row>
|
|
81
83
|
<b-col class="text-right" sm="12">
|
|
82
|
-
<div class="
|
|
83
|
-
<
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
:
|
|
84
|
+
<div class="side-by-side">
|
|
85
|
+
<Button
|
|
86
|
+
key="aplicaFiltro"
|
|
87
|
+
type="primary"
|
|
88
|
+
title="Aplicar"
|
|
89
|
+
classIcon="fas fa-filter"
|
|
90
|
+
size="small"
|
|
91
|
+
:clicked="aplicarFiltro"
|
|
90
92
|
/>
|
|
91
93
|
</div>
|
|
92
94
|
</b-col>
|
|
93
95
|
</b-row>
|
|
94
96
|
</Modal>
|
|
95
|
-
<Modal
|
|
96
|
-
<slot name="
|
|
97
|
+
<Modal title="fields" :width="600" v-show="mostrarModal('field')">
|
|
98
|
+
<slot name="field"></slot>
|
|
97
99
|
<b-row>
|
|
98
100
|
<b-col class="text-right" sm="12">
|
|
99
|
-
<div class="
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
:
|
|
107
|
-
:
|
|
101
|
+
<div class="side-by-side">
|
|
102
|
+
<Button
|
|
103
|
+
key="aplicaFiltro"
|
|
104
|
+
type="primary"
|
|
105
|
+
title="Aplicar"
|
|
106
|
+
classIcon="fas fa-filter"
|
|
107
|
+
size="small"
|
|
108
|
+
:disabled="selectedField.length == 0"
|
|
109
|
+
:clicked="aplicarFiltro"
|
|
108
110
|
/>
|
|
109
111
|
</div>
|
|
110
112
|
</b-col>
|
|
@@ -112,66 +114,67 @@
|
|
|
112
114
|
</Modal>
|
|
113
115
|
</div>
|
|
114
116
|
</div>
|
|
115
|
-
</
|
|
116
|
-
<div class="div-obrigatorio" v-show="
|
|
117
|
-
<
|
|
118
|
-
É necessário informar o
|
|
119
|
-
<span class="
|
|
120
|
-
>,
|
|
121
|
-
</
|
|
117
|
+
</Molded>
|
|
118
|
+
<div class="div-obrigatorio" v-show="invalid">
|
|
119
|
+
<Alert type="info" v-for="item in requiredRules" :key="item.id">
|
|
120
|
+
É necessário informar o filter
|
|
121
|
+
<span class="filter-obrigatorio">{{ item.title }}</span
|
|
122
|
+
>, clicked no botão "Filtros" para adicionar.
|
|
123
|
+
</Alert>
|
|
122
124
|
</div>
|
|
123
125
|
<div class="div-tags">
|
|
124
126
|
<Tags nomeEvento="tagRelatorio" />
|
|
125
127
|
</div>
|
|
126
|
-
<div class="g-div-
|
|
128
|
+
<div class="g-div-molded div-tabela" v-if="!carregando && tamanhoDados > 0">
|
|
127
129
|
<b-row>
|
|
128
130
|
<b-col sm="6">
|
|
129
131
|
<div class="div-botao">
|
|
130
|
-
<div class="
|
|
132
|
+
<div class="side-by-side">
|
|
131
133
|
<ExportarExcel
|
|
132
|
-
:botao="{
|
|
134
|
+
:botao="{ type: 'edit', title: 'Excel', size: 'small' }"
|
|
133
135
|
nomeArquivo="Auditoria"
|
|
134
|
-
:cabecalho="
|
|
135
|
-
:
|
|
136
|
+
:cabecalho="content.headerTable"
|
|
137
|
+
:data="content.data"
|
|
136
138
|
/>
|
|
137
139
|
</div>
|
|
138
|
-
<div class="
|
|
140
|
+
<div class="side-by-side">
|
|
139
141
|
<div>
|
|
140
|
-
<
|
|
142
|
+
<Button
|
|
141
143
|
v-print="'#printMe'"
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
:
|
|
144
|
+
key="aplicaFiltro"
|
|
145
|
+
type="edit"
|
|
146
|
+
title="Imprimir"
|
|
147
|
+
classIcon="fas fa-print"
|
|
148
|
+
size="small"
|
|
149
|
+
:clicked="aplicarFiltro"
|
|
148
150
|
/>
|
|
149
151
|
</div>
|
|
150
152
|
</div>
|
|
151
153
|
</div>
|
|
152
154
|
</b-col>
|
|
153
155
|
<b-col sm="6">
|
|
154
|
-
<Registro :totalRegistro="
|
|
156
|
+
<Registro :totalRegistro="content.totalRecords" />
|
|
155
157
|
</b-col>
|
|
156
158
|
</b-row>
|
|
157
|
-
<BarraRolagem :
|
|
159
|
+
<BarraRolagem :minHeight="400" :maxHeight="600">
|
|
158
160
|
<div id="printMe">
|
|
159
161
|
<CabecalhoImpressao />
|
|
162
|
+
{{ content.headerTable }}
|
|
160
163
|
<Tabela
|
|
161
|
-
:
|
|
162
|
-
:
|
|
164
|
+
:headerTable="content.headerTable"
|
|
165
|
+
:data="content.data"
|
|
163
166
|
:mostrarChecks="modeloLista.mostrarChecks"
|
|
164
167
|
/>
|
|
165
168
|
</div>
|
|
166
169
|
</BarraRolagem>
|
|
167
170
|
</div>
|
|
168
|
-
<div class="div-sem-
|
|
169
|
-
<
|
|
171
|
+
<div class="div-sem-data" v-if="nenhumDadoRetornado">
|
|
172
|
+
<Alert type="info">
|
|
170
173
|
<span> Nenhum registro foi encontrato!</span>
|
|
171
|
-
</
|
|
174
|
+
</Alert>
|
|
172
175
|
</div>
|
|
173
|
-
<div class="div-rodape" v-if="
|
|
174
|
-
<Rodape :
|
|
176
|
+
<div class="div-rodape" v-if="content.totalization.length > 0">
|
|
177
|
+
<Rodape :data="content.totalization" />
|
|
175
178
|
</div>
|
|
176
179
|
</div>
|
|
177
180
|
</Painel>
|
|
@@ -179,19 +182,19 @@
|
|
|
179
182
|
</template>
|
|
180
183
|
|
|
181
184
|
<script>
|
|
182
|
-
import
|
|
185
|
+
import Alert from "@nixweb/nixloc-ui/src/component/layout/Alert";
|
|
183
186
|
import Modal from "@nixweb/nixloc-ui/src/component/forms/Modal";
|
|
184
|
-
import
|
|
187
|
+
import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
|
|
185
188
|
import ExportarExcel from "@nixweb/nixloc-ui/src/component/shared/ExportarExcel";
|
|
186
189
|
import Tabela from "../shared/Tabela.vue";
|
|
187
190
|
import CabecalhoImpressao from "../shared/CabecalhoImpressao.vue";
|
|
188
191
|
import Registro from "../shared/Registro.vue";
|
|
189
192
|
import Painel from "@nixweb/nixloc-ui/src/component/layout/Painel.vue";
|
|
190
193
|
import BarraRolagem from "@nixweb/nixloc-ui/src/component/layout/BarraRolagem.vue";
|
|
191
|
-
import
|
|
194
|
+
import Molded from "@nixweb/nixloc-ui/src/component/layout/Molded";
|
|
192
195
|
import Progresso from "@nixweb/nixloc-ui/src/component/shared/Progresso";
|
|
193
|
-
import Rodape from "@nixweb/nixloc-ui/src/component/shared/
|
|
194
|
-
import Tags from "@nixweb/nixloc-ui/src/component/shared/
|
|
196
|
+
import Rodape from "@nixweb/nixloc-ui/src/component/shared/construtor-consulta/Rodape.vue";
|
|
197
|
+
import Tags from "@nixweb/nixloc-ui/src/component/shared/construtor-consulta/Tags.vue";
|
|
195
198
|
import RelatorioAdicionarModificar from "@nixweb/nixloc-ui/src/component/template/RelatorioAdicionarModificar.vue";
|
|
196
199
|
import print from "vue-print-nb";
|
|
197
200
|
|
|
@@ -204,18 +207,18 @@ export default {
|
|
|
204
207
|
},
|
|
205
208
|
props: {
|
|
206
209
|
modeloLista: Object,
|
|
207
|
-
|
|
208
|
-
|
|
210
|
+
field: Array,
|
|
211
|
+
panel: Object,
|
|
209
212
|
},
|
|
210
213
|
components: {
|
|
211
|
-
|
|
214
|
+
Alert,
|
|
212
215
|
Modal,
|
|
213
|
-
|
|
216
|
+
Button,
|
|
214
217
|
Registro,
|
|
215
218
|
Tabela,
|
|
216
219
|
Painel,
|
|
217
220
|
BarraRolagem,
|
|
218
|
-
|
|
221
|
+
Molded,
|
|
219
222
|
Rodape,
|
|
220
223
|
Progresso,
|
|
221
224
|
Tags,
|
|
@@ -225,14 +228,14 @@ export default {
|
|
|
225
228
|
},
|
|
226
229
|
data() {
|
|
227
230
|
return {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
231
|
+
content: {
|
|
232
|
+
headerTable: [],
|
|
233
|
+
data: [],
|
|
234
|
+
totalization: [],
|
|
232
235
|
paginacao: 0,
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
+
currentPage: 1,
|
|
237
|
+
totalPerPage: 100,
|
|
238
|
+
totalRecords: 0,
|
|
236
239
|
},
|
|
237
240
|
btnDesativado: true,
|
|
238
241
|
carregando: false,
|
|
@@ -241,67 +244,80 @@ export default {
|
|
|
241
244
|
};
|
|
242
245
|
},
|
|
243
246
|
mounted() {
|
|
244
|
-
this.
|
|
247
|
+
this.removeLoading(["panel"]);
|
|
248
|
+
},
|
|
249
|
+
beforeDestroy() {
|
|
250
|
+
this.updateOptionsInitValue({});
|
|
251
|
+
this.atualizaCampoOrdenado({});
|
|
252
|
+
this.atualizaFiltroSelecionado({ children: [] });
|
|
245
253
|
},
|
|
246
254
|
computed: {
|
|
247
255
|
...mapGetters("generic", ["mostrarModal", "evento"]),
|
|
248
|
-
...mapGetters("
|
|
249
|
-
"
|
|
250
|
-
"
|
|
251
|
-
"
|
|
252
|
-
"
|
|
256
|
+
...mapGetters("report", [
|
|
257
|
+
"headerTable",
|
|
258
|
+
"selectedRules",
|
|
259
|
+
"requiredRules",
|
|
260
|
+
"regraObrigatoriaJaAdicionada",
|
|
261
|
+
"hasSelectedField",
|
|
253
262
|
"oDataSelect",
|
|
254
263
|
"oDataFilter",
|
|
255
264
|
"oDataOrderBy",
|
|
256
265
|
]),
|
|
257
|
-
...mapState("
|
|
266
|
+
...mapState("report", ["report", "selectedField", "totalization"]),
|
|
258
267
|
urlConsulta() {
|
|
259
|
-
let baseUrl = `${this.modeloLista.urlGetApi}?${this.oDataSelect}&${this.oDataOrderBy}&${this.oDataFilter.consulta}&$skip=${this.skip}&$top=${this.
|
|
268
|
+
let baseUrl = `${this.modeloLista.urlGetApi}?${this.oDataSelect}&${this.oDataOrderBy}&${this.oDataFilter.consulta}&$skip=${this.skip}&$top=${this.content.totalPerPage}&$count=true`;
|
|
260
269
|
return baseUrl.replace("&&", "&");
|
|
261
270
|
},
|
|
262
271
|
urlResumo() {
|
|
263
|
-
let consulta = this.oDataFilter.
|
|
272
|
+
let consulta = this.oDataFilter.totalization
|
|
264
273
|
? `$apply=filter(${this.oDataFilter.consulta.replace("$filter=", "")})/`
|
|
265
274
|
: "$apply=";
|
|
266
|
-
let baseUrl = `${this.modeloLista.urlGetApi}?${consulta}aggregate(${this.oDataFilter.
|
|
275
|
+
let baseUrl = `${this.modeloLista.urlGetApi}?${consulta}aggregate(${this.oDataFilter.totalization})`;
|
|
267
276
|
return baseUrl;
|
|
268
277
|
},
|
|
269
278
|
skip() {
|
|
270
|
-
return (this.
|
|
279
|
+
return (this.content.currentPage - 1) * this.content.totalPerPage;
|
|
271
280
|
},
|
|
272
|
-
|
|
281
|
+
invalid() {
|
|
273
282
|
let retorno = true;
|
|
274
|
-
this.
|
|
275
|
-
|
|
276
|
-
if (filtro.label == value.query.label) retorno = false;
|
|
277
|
-
});
|
|
283
|
+
this.requiredRules.forEach((rule) => {
|
|
284
|
+
retorno = this.regraObrigatoriaJaAdicionada(rule);
|
|
278
285
|
});
|
|
279
286
|
|
|
280
|
-
if (this.
|
|
287
|
+
if (this.requiredRules.length == 0) retorno = false;
|
|
281
288
|
|
|
282
289
|
return retorno;
|
|
283
290
|
},
|
|
284
291
|
tamanhoDados() {
|
|
285
|
-
return this.
|
|
292
|
+
return this.content.data.length;
|
|
286
293
|
},
|
|
287
294
|
},
|
|
288
295
|
methods: {
|
|
289
296
|
...mapActions("generic", ["getApiOdata"]),
|
|
290
|
-
...mapMutations("generic", [
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
297
|
+
...mapMutations("generic", [
|
|
298
|
+
"addEvent",
|
|
299
|
+
"abrirModal",
|
|
300
|
+
"hideModal",
|
|
301
|
+
"removeLoading",
|
|
302
|
+
]),
|
|
303
|
+
...mapMutations("report", [
|
|
304
|
+
"atualizaFiltroSelecionado",
|
|
305
|
+
"atualizaCampoOrdenado",
|
|
306
|
+
"updateOptionsInitValue",
|
|
307
|
+
"atualizaCabecalhoTabela",
|
|
308
|
+
]),
|
|
309
|
+
getAll() {
|
|
310
|
+
this.content.data = [];
|
|
311
|
+
this.content.totalization = [];
|
|
296
312
|
this.btnDesativado = true;
|
|
297
313
|
|
|
298
|
-
if (!this.
|
|
314
|
+
if (!this.invalid) {
|
|
299
315
|
this.mostraEscondeCampos();
|
|
300
316
|
this.paginacao();
|
|
301
|
-
this.
|
|
317
|
+
this.removeLoading(["buscarRelatorio"]);
|
|
302
318
|
|
|
303
|
-
if (this.oDataFilter.
|
|
304
|
-
if (!this.oDataFilter.
|
|
319
|
+
if (this.oDataFilter.totalization) this.resumoOData();
|
|
320
|
+
if (!this.oDataFilter.totalization) this.content.totalization = [];
|
|
305
321
|
}
|
|
306
322
|
},
|
|
307
323
|
paginacao() {
|
|
@@ -309,24 +325,24 @@ export default {
|
|
|
309
325
|
this.reiniciaDados();
|
|
310
326
|
|
|
311
327
|
this.getApiOdata(paramsConsulta).then((response) => {
|
|
312
|
-
let
|
|
313
|
-
if (
|
|
314
|
-
this.
|
|
315
|
-
this.
|
|
316
|
-
|
|
328
|
+
let totalRecords = response["@odata.count"];
|
|
329
|
+
if (totalRecords == 0) this.nenhumDadoRetornado = true;
|
|
330
|
+
this.content.totalRecords = totalRecords;
|
|
331
|
+
this.content.paginacao = Math.round(
|
|
332
|
+
totalRecords / this.content.totalPerPage
|
|
317
333
|
);
|
|
318
334
|
|
|
319
|
-
if (
|
|
335
|
+
if (totalRecords <= this.content.totalPerPage) {
|
|
320
336
|
this.consultaOdata();
|
|
321
|
-
this.
|
|
337
|
+
this.content.headerTable = this.headerTable;
|
|
322
338
|
}
|
|
323
|
-
if (this.
|
|
339
|
+
if (this.content.paginacao == 0) this.carregando = false;
|
|
324
340
|
});
|
|
325
341
|
},
|
|
326
342
|
reiniciaDados() {
|
|
327
343
|
this.carregando = true;
|
|
328
|
-
this.
|
|
329
|
-
this.
|
|
344
|
+
this.content.data = [];
|
|
345
|
+
this.content.currentPage = 1;
|
|
330
346
|
this.nenhumDadoRetornado = false;
|
|
331
347
|
},
|
|
332
348
|
consultaOdata() {
|
|
@@ -334,57 +350,58 @@ export default {
|
|
|
334
350
|
this.getApiOdata(paramsConsulta).then((response) => {
|
|
335
351
|
let self = this;
|
|
336
352
|
response.value.forEach(function (obj) {
|
|
337
|
-
self.
|
|
353
|
+
self.content.data.push(obj);
|
|
338
354
|
});
|
|
339
|
-
this.
|
|
355
|
+
this.content.currentPage++;
|
|
340
356
|
});
|
|
341
|
-
this.
|
|
357
|
+
this.content.headerTable = this.headerTable;
|
|
342
358
|
},
|
|
343
359
|
resumoOData() {
|
|
344
360
|
let paramsResumo = { url: this.urlResumo };
|
|
345
361
|
this.getApiOdata(paramsResumo).then((response) => {
|
|
346
|
-
this.
|
|
362
|
+
this.content.totalization = [];
|
|
347
363
|
const result = Object.entries(response[0]);
|
|
348
364
|
let self = this;
|
|
349
365
|
result.forEach(function (value) {
|
|
350
|
-
self.
|
|
366
|
+
self.totalization.forEach(function (legenda) {
|
|
351
367
|
let obj = {
|
|
352
|
-
|
|
368
|
+
title: "",
|
|
353
369
|
valor: value[1],
|
|
354
370
|
classeCss: legenda.classeCss,
|
|
355
|
-
|
|
371
|
+
type: legenda.type,
|
|
356
372
|
};
|
|
357
373
|
if (legenda.valor == value[0]) {
|
|
358
|
-
obj.
|
|
359
|
-
self.
|
|
374
|
+
obj.title = legenda.title;
|
|
375
|
+
self.content.totalization.push(obj);
|
|
360
376
|
}
|
|
361
377
|
});
|
|
362
378
|
});
|
|
363
379
|
});
|
|
364
380
|
},
|
|
365
381
|
abrirCampo() {
|
|
366
|
-
this.abrirModal("
|
|
367
|
-
this.
|
|
382
|
+
this.abrirModal("field");
|
|
383
|
+
this.removeLoading(["abrirCampo"]);
|
|
368
384
|
},
|
|
369
385
|
abrirFiltro() {
|
|
370
|
-
this.abrirModal("
|
|
371
|
-
this.
|
|
386
|
+
this.abrirModal("filter");
|
|
387
|
+
this.removeLoading(["abrirFiltro"]);
|
|
372
388
|
},
|
|
373
389
|
aplicarFiltro() {
|
|
374
|
-
this.
|
|
375
|
-
this.
|
|
390
|
+
this.hideModal();
|
|
391
|
+
this.removeLoading(["aplicaFiltro", "aplicaCampo"]);
|
|
376
392
|
},
|
|
377
393
|
salvarRelatorio() {
|
|
394
|
+
this.addEvent({ nome: "modificarRelatorio" });
|
|
378
395
|
this.abrirModal("salvar");
|
|
379
|
-
this.
|
|
396
|
+
this.removeLoading(["salvarRelatorio"]);
|
|
380
397
|
},
|
|
381
398
|
mostraEscondeCampos() {
|
|
382
399
|
let self = this;
|
|
383
|
-
this.
|
|
384
|
-
if (self.
|
|
385
|
-
value.
|
|
400
|
+
this.report.fields.forEach(function (field) {
|
|
401
|
+
if (self.hasSelectedField(field.field, self.selectedField)) {
|
|
402
|
+
value.show = true;
|
|
386
403
|
} else {
|
|
387
|
-
value.
|
|
404
|
+
value.show = false;
|
|
388
405
|
}
|
|
389
406
|
});
|
|
390
407
|
},
|
|
@@ -392,36 +409,30 @@ export default {
|
|
|
392
409
|
watch: {
|
|
393
410
|
evento: {
|
|
394
411
|
handler(evento) {
|
|
395
|
-
if (evento.nome == "tagRelatorio") this.abrirModal("
|
|
412
|
+
if (evento.nome == "tagRelatorio") this.abrirModal("filter");
|
|
396
413
|
},
|
|
397
414
|
deep: true,
|
|
398
415
|
},
|
|
399
|
-
|
|
416
|
+
selectedField: {
|
|
400
417
|
handler() {
|
|
401
418
|
this.mostraEscondeCampos();
|
|
402
419
|
},
|
|
403
420
|
deep: true,
|
|
404
421
|
},
|
|
405
|
-
|
|
406
|
-
handler(
|
|
407
|
-
this.
|
|
408
|
-
},
|
|
409
|
-
deep: true,
|
|
410
|
-
},
|
|
411
|
-
"conteudo.paginaAtual": {
|
|
412
|
-
handler(paginaAtual) {
|
|
413
|
-
if (paginaAtual <= this.conteudo.paginacao - 1) {
|
|
422
|
+
"content.currentPage": {
|
|
423
|
+
handler(currentPage) {
|
|
424
|
+
if (currentPage <= this.content.paginacao - 1) {
|
|
414
425
|
let self = this;
|
|
415
426
|
setTimeout(function () {
|
|
416
427
|
self.consultaOdata();
|
|
417
428
|
}, 200);
|
|
418
429
|
}
|
|
419
|
-
if (
|
|
430
|
+
if (currentPage == this.content.paginacao && currentPage != 0)
|
|
420
431
|
this.carregando = false;
|
|
421
432
|
},
|
|
422
433
|
deep: true,
|
|
423
434
|
},
|
|
424
|
-
"
|
|
435
|
+
"content.paginacao": {
|
|
425
436
|
handler() {
|
|
426
437
|
this.consultaOdata();
|
|
427
438
|
},
|
|
@@ -458,7 +469,7 @@ export default {
|
|
|
458
469
|
margin-bottom: 10px;
|
|
459
470
|
}
|
|
460
471
|
|
|
461
|
-
.div-sem-
|
|
472
|
+
.div-sem-data {
|
|
462
473
|
margin-top: 20px;
|
|
463
474
|
}
|
|
464
475
|
|
|
@@ -483,7 +494,7 @@ export default {
|
|
|
483
494
|
margin-top: 20px;
|
|
484
495
|
}
|
|
485
496
|
|
|
486
|
-
.
|
|
497
|
+
.filter-obrigatorio {
|
|
487
498
|
font-weight: 500;
|
|
488
499
|
}
|
|
489
500
|
</style>
|