@nixweb/nixloc-ui 0.0.119 → 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 +160 -0
- package/docs/src/store/modulos/relatorio.drawio +37 -0
- package/package.json +77 -75
- package/public/index.html +2 -4
- package/public/styles/app.css +1 -2
- 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 +218 -200
- 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/public/js/menu.js +0 -11
- package/public/styles/menu.css +0 -1399
- 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 -324
- 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 -73
- 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 -171
- 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 -201
- 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,64 +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
|
-
<div class="
|
|
130
|
-
<
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
</div>
|
|
137
|
-
<div class="lado-a-lado">
|
|
138
|
-
<div>
|
|
139
|
-
<Botao
|
|
140
|
-
v-print="'#printMe'"
|
|
141
|
-
chave="aplicaFiltro"
|
|
142
|
-
tipo="editar"
|
|
143
|
-
titulo="Imprimir"
|
|
144
|
-
classeIcone="fas fa-print"
|
|
145
|
-
tamanho="pequeno"
|
|
146
|
-
:clique="aplicarFiltro"
|
|
131
|
+
<div class="div-botao">
|
|
132
|
+
<div class="side-by-side">
|
|
133
|
+
<ExportarExcel
|
|
134
|
+
:botao="{ type: 'edit', title: 'Excel', size: 'small' }"
|
|
135
|
+
nomeArquivo="Auditoria"
|
|
136
|
+
:cabecalho="content.headerTable"
|
|
137
|
+
:data="content.data"
|
|
147
138
|
/>
|
|
148
139
|
</div>
|
|
140
|
+
<div class="side-by-side">
|
|
141
|
+
<div>
|
|
142
|
+
<Button
|
|
143
|
+
v-print="'#printMe'"
|
|
144
|
+
key="aplicaFiltro"
|
|
145
|
+
type="edit"
|
|
146
|
+
title="Imprimir"
|
|
147
|
+
classIcon="fas fa-print"
|
|
148
|
+
size="small"
|
|
149
|
+
:clicked="aplicarFiltro"
|
|
150
|
+
/>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
149
153
|
</div>
|
|
150
154
|
</b-col>
|
|
151
155
|
<b-col sm="6">
|
|
152
|
-
<Registro :totalRegistro="
|
|
156
|
+
<Registro :totalRegistro="content.totalRecords" />
|
|
153
157
|
</b-col>
|
|
154
158
|
</b-row>
|
|
155
|
-
<BarraRolagem :
|
|
159
|
+
<BarraRolagem :minHeight="400" :maxHeight="600">
|
|
156
160
|
<div id="printMe">
|
|
157
161
|
<CabecalhoImpressao />
|
|
162
|
+
{{ content.headerTable }}
|
|
158
163
|
<Tabela
|
|
159
|
-
:
|
|
160
|
-
:
|
|
164
|
+
:headerTable="content.headerTable"
|
|
165
|
+
:data="content.data"
|
|
161
166
|
:mostrarChecks="modeloLista.mostrarChecks"
|
|
162
167
|
/>
|
|
163
168
|
</div>
|
|
164
169
|
</BarraRolagem>
|
|
165
170
|
</div>
|
|
166
|
-
<div class="div-sem-
|
|
167
|
-
<
|
|
171
|
+
<div class="div-sem-data" v-if="nenhumDadoRetornado">
|
|
172
|
+
<Alert type="info">
|
|
168
173
|
<span> Nenhum registro foi encontrato!</span>
|
|
169
|
-
</
|
|
174
|
+
</Alert>
|
|
170
175
|
</div>
|
|
171
|
-
<div class="div-rodape" v-if="
|
|
172
|
-
<Rodape :
|
|
176
|
+
<div class="div-rodape" v-if="content.totalization.length > 0">
|
|
177
|
+
<Rodape :data="content.totalization" />
|
|
173
178
|
</div>
|
|
174
179
|
</div>
|
|
175
180
|
</Painel>
|
|
@@ -177,19 +182,19 @@
|
|
|
177
182
|
</template>
|
|
178
183
|
|
|
179
184
|
<script>
|
|
180
|
-
import
|
|
185
|
+
import Alert from "@nixweb/nixloc-ui/src/component/layout/Alert";
|
|
181
186
|
import Modal from "@nixweb/nixloc-ui/src/component/forms/Modal";
|
|
182
|
-
import
|
|
187
|
+
import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
|
|
183
188
|
import ExportarExcel from "@nixweb/nixloc-ui/src/component/shared/ExportarExcel";
|
|
184
189
|
import Tabela from "../shared/Tabela.vue";
|
|
185
190
|
import CabecalhoImpressao from "../shared/CabecalhoImpressao.vue";
|
|
186
191
|
import Registro from "../shared/Registro.vue";
|
|
187
192
|
import Painel from "@nixweb/nixloc-ui/src/component/layout/Painel.vue";
|
|
188
193
|
import BarraRolagem from "@nixweb/nixloc-ui/src/component/layout/BarraRolagem.vue";
|
|
189
|
-
import
|
|
194
|
+
import Molded from "@nixweb/nixloc-ui/src/component/layout/Molded";
|
|
190
195
|
import Progresso from "@nixweb/nixloc-ui/src/component/shared/Progresso";
|
|
191
|
-
import Rodape from "@nixweb/nixloc-ui/src/component/shared/
|
|
192
|
-
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";
|
|
193
198
|
import RelatorioAdicionarModificar from "@nixweb/nixloc-ui/src/component/template/RelatorioAdicionarModificar.vue";
|
|
194
199
|
import print from "vue-print-nb";
|
|
195
200
|
|
|
@@ -202,18 +207,18 @@ export default {
|
|
|
202
207
|
},
|
|
203
208
|
props: {
|
|
204
209
|
modeloLista: Object,
|
|
205
|
-
|
|
206
|
-
|
|
210
|
+
field: Array,
|
|
211
|
+
panel: Object,
|
|
207
212
|
},
|
|
208
213
|
components: {
|
|
209
|
-
|
|
214
|
+
Alert,
|
|
210
215
|
Modal,
|
|
211
|
-
|
|
216
|
+
Button,
|
|
212
217
|
Registro,
|
|
213
218
|
Tabela,
|
|
214
219
|
Painel,
|
|
215
220
|
BarraRolagem,
|
|
216
|
-
|
|
221
|
+
Molded,
|
|
217
222
|
Rodape,
|
|
218
223
|
Progresso,
|
|
219
224
|
Tags,
|
|
@@ -223,14 +228,14 @@ export default {
|
|
|
223
228
|
},
|
|
224
229
|
data() {
|
|
225
230
|
return {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
231
|
+
content: {
|
|
232
|
+
headerTable: [],
|
|
233
|
+
data: [],
|
|
234
|
+
totalization: [],
|
|
230
235
|
paginacao: 0,
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
236
|
+
currentPage: 1,
|
|
237
|
+
totalPerPage: 100,
|
|
238
|
+
totalRecords: 0,
|
|
234
239
|
},
|
|
235
240
|
btnDesativado: true,
|
|
236
241
|
carregando: false,
|
|
@@ -239,67 +244,80 @@ export default {
|
|
|
239
244
|
};
|
|
240
245
|
},
|
|
241
246
|
mounted() {
|
|
242
|
-
this.
|
|
247
|
+
this.removeLoading(["panel"]);
|
|
248
|
+
},
|
|
249
|
+
beforeDestroy() {
|
|
250
|
+
this.updateOptionsInitValue({});
|
|
251
|
+
this.atualizaCampoOrdenado({});
|
|
252
|
+
this.atualizaFiltroSelecionado({ children: [] });
|
|
243
253
|
},
|
|
244
254
|
computed: {
|
|
245
255
|
...mapGetters("generic", ["mostrarModal", "evento"]),
|
|
246
|
-
...mapGetters("
|
|
247
|
-
"
|
|
248
|
-
"
|
|
249
|
-
"
|
|
250
|
-
"
|
|
256
|
+
...mapGetters("report", [
|
|
257
|
+
"headerTable",
|
|
258
|
+
"selectedRules",
|
|
259
|
+
"requiredRules",
|
|
260
|
+
"regraObrigatoriaJaAdicionada",
|
|
261
|
+
"hasSelectedField",
|
|
251
262
|
"oDataSelect",
|
|
252
263
|
"oDataFilter",
|
|
253
264
|
"oDataOrderBy",
|
|
254
265
|
]),
|
|
255
|
-
...mapState("
|
|
266
|
+
...mapState("report", ["report", "selectedField", "totalization"]),
|
|
256
267
|
urlConsulta() {
|
|
257
|
-
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`;
|
|
258
269
|
return baseUrl.replace("&&", "&");
|
|
259
270
|
},
|
|
260
271
|
urlResumo() {
|
|
261
|
-
let consulta = this.oDataFilter.
|
|
272
|
+
let consulta = this.oDataFilter.totalization
|
|
262
273
|
? `$apply=filter(${this.oDataFilter.consulta.replace("$filter=", "")})/`
|
|
263
274
|
: "$apply=";
|
|
264
|
-
let baseUrl = `${this.modeloLista.urlGetApi}?${consulta}aggregate(${this.oDataFilter.
|
|
275
|
+
let baseUrl = `${this.modeloLista.urlGetApi}?${consulta}aggregate(${this.oDataFilter.totalization})`;
|
|
265
276
|
return baseUrl;
|
|
266
277
|
},
|
|
267
278
|
skip() {
|
|
268
|
-
return (this.
|
|
279
|
+
return (this.content.currentPage - 1) * this.content.totalPerPage;
|
|
269
280
|
},
|
|
270
|
-
|
|
281
|
+
invalid() {
|
|
271
282
|
let retorno = true;
|
|
272
|
-
this.
|
|
273
|
-
|
|
274
|
-
if (filtro.label == value.query.label) retorno = false;
|
|
275
|
-
});
|
|
283
|
+
this.requiredRules.forEach((rule) => {
|
|
284
|
+
retorno = this.regraObrigatoriaJaAdicionada(rule);
|
|
276
285
|
});
|
|
277
286
|
|
|
278
|
-
if (this.
|
|
287
|
+
if (this.requiredRules.length == 0) retorno = false;
|
|
279
288
|
|
|
280
289
|
return retorno;
|
|
281
290
|
},
|
|
282
291
|
tamanhoDados() {
|
|
283
|
-
return this.
|
|
292
|
+
return this.content.data.length;
|
|
284
293
|
},
|
|
285
294
|
},
|
|
286
295
|
methods: {
|
|
287
296
|
...mapActions("generic", ["getApiOdata"]),
|
|
288
|
-
...mapMutations("generic", [
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
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 = [];
|
|
294
312
|
this.btnDesativado = true;
|
|
295
313
|
|
|
296
|
-
if (!this.
|
|
314
|
+
if (!this.invalid) {
|
|
297
315
|
this.mostraEscondeCampos();
|
|
298
316
|
this.paginacao();
|
|
299
|
-
this.
|
|
317
|
+
this.removeLoading(["buscarRelatorio"]);
|
|
300
318
|
|
|
301
|
-
if (this.oDataFilter.
|
|
302
|
-
if (!this.oDataFilter.
|
|
319
|
+
if (this.oDataFilter.totalization) this.resumoOData();
|
|
320
|
+
if (!this.oDataFilter.totalization) this.content.totalization = [];
|
|
303
321
|
}
|
|
304
322
|
},
|
|
305
323
|
paginacao() {
|
|
@@ -307,24 +325,24 @@ export default {
|
|
|
307
325
|
this.reiniciaDados();
|
|
308
326
|
|
|
309
327
|
this.getApiOdata(paramsConsulta).then((response) => {
|
|
310
|
-
let
|
|
311
|
-
if (
|
|
312
|
-
this.
|
|
313
|
-
this.
|
|
314
|
-
|
|
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
|
|
315
333
|
);
|
|
316
334
|
|
|
317
|
-
if (
|
|
335
|
+
if (totalRecords <= this.content.totalPerPage) {
|
|
318
336
|
this.consultaOdata();
|
|
319
|
-
this.
|
|
337
|
+
this.content.headerTable = this.headerTable;
|
|
320
338
|
}
|
|
321
|
-
if (this.
|
|
339
|
+
if (this.content.paginacao == 0) this.carregando = false;
|
|
322
340
|
});
|
|
323
341
|
},
|
|
324
342
|
reiniciaDados() {
|
|
325
343
|
this.carregando = true;
|
|
326
|
-
this.
|
|
327
|
-
this.
|
|
344
|
+
this.content.data = [];
|
|
345
|
+
this.content.currentPage = 1;
|
|
328
346
|
this.nenhumDadoRetornado = false;
|
|
329
347
|
},
|
|
330
348
|
consultaOdata() {
|
|
@@ -332,57 +350,58 @@ export default {
|
|
|
332
350
|
this.getApiOdata(paramsConsulta).then((response) => {
|
|
333
351
|
let self = this;
|
|
334
352
|
response.value.forEach(function (obj) {
|
|
335
|
-
self.
|
|
353
|
+
self.content.data.push(obj);
|
|
336
354
|
});
|
|
337
|
-
this.
|
|
355
|
+
this.content.currentPage++;
|
|
338
356
|
});
|
|
339
|
-
this.
|
|
357
|
+
this.content.headerTable = this.headerTable;
|
|
340
358
|
},
|
|
341
359
|
resumoOData() {
|
|
342
360
|
let paramsResumo = { url: this.urlResumo };
|
|
343
361
|
this.getApiOdata(paramsResumo).then((response) => {
|
|
344
|
-
this.
|
|
362
|
+
this.content.totalization = [];
|
|
345
363
|
const result = Object.entries(response[0]);
|
|
346
364
|
let self = this;
|
|
347
365
|
result.forEach(function (value) {
|
|
348
|
-
self.
|
|
366
|
+
self.totalization.forEach(function (legenda) {
|
|
349
367
|
let obj = {
|
|
350
|
-
|
|
368
|
+
title: "",
|
|
351
369
|
valor: value[1],
|
|
352
370
|
classeCss: legenda.classeCss,
|
|
353
|
-
|
|
371
|
+
type: legenda.type,
|
|
354
372
|
};
|
|
355
373
|
if (legenda.valor == value[0]) {
|
|
356
|
-
obj.
|
|
357
|
-
self.
|
|
374
|
+
obj.title = legenda.title;
|
|
375
|
+
self.content.totalization.push(obj);
|
|
358
376
|
}
|
|
359
377
|
});
|
|
360
378
|
});
|
|
361
379
|
});
|
|
362
380
|
},
|
|
363
381
|
abrirCampo() {
|
|
364
|
-
this.abrirModal("
|
|
365
|
-
this.
|
|
382
|
+
this.abrirModal("field");
|
|
383
|
+
this.removeLoading(["abrirCampo"]);
|
|
366
384
|
},
|
|
367
385
|
abrirFiltro() {
|
|
368
|
-
this.abrirModal("
|
|
369
|
-
this.
|
|
386
|
+
this.abrirModal("filter");
|
|
387
|
+
this.removeLoading(["abrirFiltro"]);
|
|
370
388
|
},
|
|
371
389
|
aplicarFiltro() {
|
|
372
|
-
this.
|
|
373
|
-
this.
|
|
390
|
+
this.hideModal();
|
|
391
|
+
this.removeLoading(["aplicaFiltro", "aplicaCampo"]);
|
|
374
392
|
},
|
|
375
393
|
salvarRelatorio() {
|
|
394
|
+
this.addEvent({ nome: "modificarRelatorio" });
|
|
376
395
|
this.abrirModal("salvar");
|
|
377
|
-
this.
|
|
396
|
+
this.removeLoading(["salvarRelatorio"]);
|
|
378
397
|
},
|
|
379
398
|
mostraEscondeCampos() {
|
|
380
399
|
let self = this;
|
|
381
|
-
this.
|
|
382
|
-
if (self.
|
|
383
|
-
value.
|
|
400
|
+
this.report.fields.forEach(function (field) {
|
|
401
|
+
if (self.hasSelectedField(field.field, self.selectedField)) {
|
|
402
|
+
value.show = true;
|
|
384
403
|
} else {
|
|
385
|
-
value.
|
|
404
|
+
value.show = false;
|
|
386
405
|
}
|
|
387
406
|
});
|
|
388
407
|
},
|
|
@@ -390,54 +409,49 @@ export default {
|
|
|
390
409
|
watch: {
|
|
391
410
|
evento: {
|
|
392
411
|
handler(evento) {
|
|
393
|
-
if (evento.nome == "tagRelatorio") this.abrirModal("
|
|
412
|
+
if (evento.nome == "tagRelatorio") this.abrirModal("filter");
|
|
394
413
|
},
|
|
395
414
|
deep: true,
|
|
396
415
|
},
|
|
397
|
-
|
|
416
|
+
selectedField: {
|
|
398
417
|
handler() {
|
|
399
418
|
this.mostraEscondeCampos();
|
|
400
419
|
},
|
|
401
420
|
deep: true,
|
|
402
421
|
},
|
|
403
|
-
|
|
404
|
-
handler(
|
|
405
|
-
this.
|
|
406
|
-
},
|
|
407
|
-
deep: true,
|
|
408
|
-
},
|
|
409
|
-
"conteudo.paginaAtual": {
|
|
410
|
-
handler(value) {
|
|
411
|
-
if (value <= this.conteudo.paginacao - 1) {
|
|
422
|
+
"content.currentPage": {
|
|
423
|
+
handler(currentPage) {
|
|
424
|
+
if (currentPage <= this.content.paginacao - 1) {
|
|
412
425
|
let self = this;
|
|
413
426
|
setTimeout(function () {
|
|
414
427
|
self.consultaOdata();
|
|
415
428
|
}, 200);
|
|
416
429
|
}
|
|
417
|
-
if (
|
|
430
|
+
if (currentPage == this.content.paginacao && currentPage != 0)
|
|
431
|
+
this.carregando = false;
|
|
418
432
|
},
|
|
419
433
|
deep: true,
|
|
420
434
|
},
|
|
421
|
-
"
|
|
422
|
-
handler(
|
|
435
|
+
"content.paginacao": {
|
|
436
|
+
handler() {
|
|
423
437
|
this.consultaOdata();
|
|
424
438
|
},
|
|
425
439
|
deep: true,
|
|
426
440
|
},
|
|
427
441
|
"oDataFilter.consulta": {
|
|
428
|
-
handler(
|
|
442
|
+
handler() {
|
|
429
443
|
this.btnDesativado = false;
|
|
430
444
|
},
|
|
431
445
|
deep: true,
|
|
432
446
|
},
|
|
433
447
|
oDataSelect: {
|
|
434
|
-
handler(
|
|
448
|
+
handler() {
|
|
435
449
|
this.btnDesativado = false;
|
|
436
450
|
},
|
|
437
451
|
deep: true,
|
|
438
452
|
},
|
|
439
453
|
oDataOrderBy: {
|
|
440
|
-
handler(
|
|
454
|
+
handler() {
|
|
441
455
|
this.btnDesativado = false;
|
|
442
456
|
},
|
|
443
457
|
deep: true,
|
|
@@ -447,11 +461,15 @@ export default {
|
|
|
447
461
|
</script>
|
|
448
462
|
|
|
449
463
|
<style scoped>
|
|
464
|
+
.div-botao {
|
|
465
|
+
padding-bottom: 15px;
|
|
466
|
+
}
|
|
467
|
+
|
|
450
468
|
.div-progresso {
|
|
451
469
|
margin-bottom: 10px;
|
|
452
470
|
}
|
|
453
471
|
|
|
454
|
-
.div-sem-
|
|
472
|
+
.div-sem-data {
|
|
455
473
|
margin-top: 20px;
|
|
456
474
|
}
|
|
457
475
|
|
|
@@ -476,7 +494,7 @@ export default {
|
|
|
476
494
|
margin-top: 20px;
|
|
477
495
|
}
|
|
478
496
|
|
|
479
|
-
.
|
|
497
|
+
.filter-obrigatorio {
|
|
480
498
|
font-weight: 500;
|
|
481
499
|
}
|
|
482
500
|
</style>
|