@nixweb/nixloc-ui 0.0.121 → 0.0.124
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 +2 -2
- 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} +8 -8
- package/src/component/forms/{Cor.vue → Color.vue} +9 -9
- package/src/component/forms/DateTime.vue +55 -55
- package/src/component/forms/{BotaoDropdown.vue → Dropdown.vue} +58 -58
- 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/{Topo.vue → Header.vue} +5 -5
- 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 +15 -15
- package/src/component/layout/Wizard.vue +3 -3
- package/src/component/shared/{CodigoEditor.vue → CodeEditor.vue} +25 -25
- package/src/component/shared/Collapse.vue +131 -0
- package/src/component/shared/Confirmation.vue +80 -0
- package/src/component/shared/{DocumentoEditor.vue → DocumentEditor.vue} +10 -16
- package/src/component/shared/{DocumentoPreview.vue → DocumentPreview.vue} +2 -2
- package/src/component/shared/ExportExcel.vue +67 -0
- package/src/component/shared/{ExportarPDF.vue → ExportPDF.vue} +18 -18
- package/src/component/shared/HeaderPrint.vue +36 -0
- package/src/component/shared/HorizontalFilter.vue +59 -0
- package/src/component/shared/LegendaParametro.vue +22 -22
- package/src/component/shared/{Carregando.vue → Loading.vue} +16 -16
- package/src/component/shared/LoadingMoreButton.vue +23 -0
- package/src/component/shared/Messages.vue +83 -0
- package/src/component/shared/{Paginacao.vue → Pagination.vue} +12 -12
- package/src/component/shared/ProgressBar.vue +21 -0
- package/src/component/shared/{BotaoConsulta.vue → QueryButton.vue} +16 -16
- package/src/component/shared/SaveCancel.vue +56 -0
- package/src/component/shared/{Pesquisa.vue → Search.vue} +46 -46
- package/src/component/shared/Table.vue +243 -0
- package/src/component/shared/TableButton.vue +36 -0
- package/src/component/shared/{Registro.vue → TableTotalRecords.vue} +7 -7
- package/src/component/shared/{ResumoTabela.vue → TableTotalization.vue} +12 -8
- package/src/component/shared/Tip.vue +42 -0
- package/src/component/shared/Toast.vue +7 -7
- package/src/component/shared/{FiltroVertical.vue → VerticalFilter.vue} +24 -24
- package/src/component/shared/query-builder/AddRule.vue +187 -0
- package/src/component/shared/query-builder/ConvertToOdata.js +80 -0
- package/src/component/shared/query-builder/DynamicComponent.vue +107 -0
- package/src/component/shared/query-builder/Fields.vue +127 -0
- package/src/component/shared/query-builder/ListDynamicComponent.vue +42 -0
- package/src/component/shared/query-builder/QueryBuilder.vue +25 -120
- package/src/component/shared/query-builder/{Filtro.vue → Rules.vue} +13 -18
- package/src/component/shared/query-builder/SelectRule.vue +96 -0
- package/src/component/shared/query-builder/Tags.vue +14 -14
- package/src/component/shared/query-builder/{Rodape.vue → Totalization.vue} +10 -10
- package/src/component/template/AddEditReport.vue +106 -0
- package/src/component/template/ListViewWithHandlerData.vue +231 -0
- package/src/component/template/ViewTemplateConfiguration.vue +69 -0
- package/src/component/template/ViewTemplateDocumentView.vue +227 -0
- package/src/component/template/ViewTemplateReportList.vue +230 -0
- package/src/component/template/ViewTemplateReportPreview.vue +500 -0
- package/src/component/template/ViewTemplateWithSalveCancel.vue +32 -0
- package/src/component/template/ViewTemplateWithTable.vue +49 -0
- package/src/component/template/model/Report.js +6 -0
- package/src/component/value-objects/DadosContato.vue +34 -35
- package/src/component/value-objects/DadosPessoa.vue +58 -58
- package/src/component/value-objects/Endereco.vue +96 -97
- 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/BotaoCarregarMais.vue +0 -23
- package/src/component/shared/CabecalhoImpressao.vue +0 -36
- package/src/component/shared/Confirmacao.vue +0 -80
- package/src/component/shared/Dica.vue +0 -42
- package/src/component/shared/EsconderMostrar.vue +0 -131
- package/src/component/shared/ExportarExcel.vue +0 -67
- package/src/component/shared/FiltroHorizontal.vue +0 -59
- package/src/component/shared/Mensagem.vue +0 -86
- package/src/component/shared/Progresso.vue +0 -21
- package/src/component/shared/SalvarCancelar.vue +0 -56
- package/src/component/shared/Tabela.vue +0 -275
- package/src/component/shared/TabelaBotao.vue +0 -36
- 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/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/component/template/ModeloAdicionarModificarView.vue +0 -32
- package/src/component/template/ModeloDocumentoView.vue +0 -227
- package/src/component/template/ModeloLista.vue +0 -231
- package/src/component/template/ModeloRelatorioListaView.vue +0 -227
- package/src/component/template/ModeloRelatorioView.vue +0 -489
- package/src/component/template/ModeloSubView.vue +0 -69
- package/src/component/template/ModeloView.vue +0 -49
- package/src/component/template/Relatorio.js +0 -10
- package/src/component/template/RelatorioAdicionarModificar.vue +0 -106
- 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
|
@@ -0,0 +1,500 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<Panel
|
|
4
|
+
:module="panel.module"
|
|
5
|
+
:title="panel.title"
|
|
6
|
+
:showVerticalFilter="panel.showVerticalFilter"
|
|
7
|
+
:showSearch="panel.showSearch"
|
|
8
|
+
:showButtons="panel.showButtons"
|
|
9
|
+
>
|
|
10
|
+
<div slot="content-main">
|
|
11
|
+
<br />
|
|
12
|
+
{{ urlConsulta }}
|
|
13
|
+
<div class="div-progresso" v-if="carregando && tamanhoDados > 0">
|
|
14
|
+
<ProgressBar
|
|
15
|
+
:texto="`Loading ${tamanhoDados} registro(s) de ${content.totalRecords}`"
|
|
16
|
+
:valor="tamanhoDados"
|
|
17
|
+
:maximo="content.totalRecords"
|
|
18
|
+
size="medium"
|
|
19
|
+
/>
|
|
20
|
+
</div>
|
|
21
|
+
<Modal title="Salvar" :width="550" v-show="showModal('salvar')">
|
|
22
|
+
<AddEditReport :module="panel.module" />
|
|
23
|
+
</Modal>
|
|
24
|
+
<Molded>
|
|
25
|
+
<div>
|
|
26
|
+
<div slot="content-filter-horizontal">
|
|
27
|
+
<b-row>
|
|
28
|
+
<b-col sm="6">
|
|
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"
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
<div class="side-by-side">
|
|
42
|
+
<Button
|
|
43
|
+
v-if="!invalid"
|
|
44
|
+
key="saveReport"
|
|
45
|
+
type="success"
|
|
46
|
+
title="Salvar Modelo"
|
|
47
|
+
classIcon="fas fa-save"
|
|
48
|
+
:disabled="carregando || invalid"
|
|
49
|
+
size="small"
|
|
50
|
+
:clicked="saveReport"
|
|
51
|
+
/>
|
|
52
|
+
</div>
|
|
53
|
+
</b-col>
|
|
54
|
+
<b-col class="text-right" sm="6">
|
|
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"
|
|
64
|
+
/>
|
|
65
|
+
</div>
|
|
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"
|
|
75
|
+
/>
|
|
76
|
+
</div>
|
|
77
|
+
</b-col>
|
|
78
|
+
</b-row>
|
|
79
|
+
<Modal title="Filtros" :width="900" v-show="showModal('filter')">
|
|
80
|
+
<slot name="filter"></slot>
|
|
81
|
+
<br />
|
|
82
|
+
<b-row>
|
|
83
|
+
<b-col class="text-right" sm="12">
|
|
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"
|
|
92
|
+
/>
|
|
93
|
+
</div>
|
|
94
|
+
</b-col>
|
|
95
|
+
</b-row>
|
|
96
|
+
</Modal>
|
|
97
|
+
<Modal title="fields" :width="600" v-show="showModal('field')">
|
|
98
|
+
<slot name="field"></slot>
|
|
99
|
+
<b-row>
|
|
100
|
+
<b-col class="text-right" sm="12">
|
|
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"
|
|
110
|
+
/>
|
|
111
|
+
</div>
|
|
112
|
+
</b-col>
|
|
113
|
+
</b-row>
|
|
114
|
+
</Modal>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
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>
|
|
124
|
+
</div>
|
|
125
|
+
<div class="div-tags">
|
|
126
|
+
<Tags eventName="tagRelatorio" />
|
|
127
|
+
</div>
|
|
128
|
+
<div class="g-div-molded div-tabela" v-if="!carregando && tamanhoDados > 0">
|
|
129
|
+
<b-row>
|
|
130
|
+
<b-col sm="6">
|
|
131
|
+
<div class="div-button">
|
|
132
|
+
<div class="side-by-side">
|
|
133
|
+
<ExportExcel
|
|
134
|
+
:button="{ type: 'edit', title: 'Excel', size: 'small' }"
|
|
135
|
+
fileName="Auditoria"
|
|
136
|
+
:cabecalho="content.headerTable"
|
|
137
|
+
:data="content.data"
|
|
138
|
+
/>
|
|
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>
|
|
153
|
+
</div>
|
|
154
|
+
</b-col>
|
|
155
|
+
<b-col sm="6">
|
|
156
|
+
<TableTotalRecords :totalRecords="content.totalRecords" />
|
|
157
|
+
</b-col>
|
|
158
|
+
</b-row>
|
|
159
|
+
<ScrollBar :minHeight="400" :maxHeight="600">
|
|
160
|
+
<div id="printMe">
|
|
161
|
+
<HeaderPrint />
|
|
162
|
+
{{ content.headerTable }}
|
|
163
|
+
<Table
|
|
164
|
+
:headerTable="content.headerTable"
|
|
165
|
+
:data="content.data"
|
|
166
|
+
:showChecks="templateList.showChecks"
|
|
167
|
+
/>
|
|
168
|
+
</div>
|
|
169
|
+
</ScrollBar>
|
|
170
|
+
</div>
|
|
171
|
+
<div class="div-sem-data" v-if="nenhumDadoRetornado">
|
|
172
|
+
<Alert type="info">
|
|
173
|
+
<span> Nenhum registro foi encontrato!</span>
|
|
174
|
+
</Alert>
|
|
175
|
+
</div>
|
|
176
|
+
<div class="div-rodape" v-if="content.totalization.length > 0">
|
|
177
|
+
<Rodape :data="content.totalization" />
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
</Panel>
|
|
181
|
+
</div>
|
|
182
|
+
</template>
|
|
183
|
+
|
|
184
|
+
<script>
|
|
185
|
+
import Alert from "@nixweb/nixloc-ui/src/component/layout/Alert";
|
|
186
|
+
import Modal from "@nixweb/nixloc-ui/src/component/forms/Modal";
|
|
187
|
+
import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
|
|
188
|
+
import ExportExcel from "@nixweb/nixloc-ui/src/component/shared/ExportExcel";
|
|
189
|
+
import Table from "../shared/Table.vue";
|
|
190
|
+
import HeaderPrint from "../shared/HeaderPrint.vue";
|
|
191
|
+
import TableTotalRecords from "../shared/TableTotalRecords.vue";
|
|
192
|
+
import Panel from "@nixweb/nixloc-ui/src/component/layout/Panel.vue";
|
|
193
|
+
import ScrollBar from "@nixweb/nixloc-ui/src/component/layout/ScrollBar.vue";
|
|
194
|
+
import Molded from "@nixweb/nixloc-ui/src/component/layout/Molded";
|
|
195
|
+
import ProgressBar from "@nixweb/nixloc-ui/src/component/shared/ProgressBar";
|
|
196
|
+
import Rodape from "@nixweb/nixloc-ui/src/component/shared/construtor-query/Rodape.vue";
|
|
197
|
+
import Tags from "@nixweb/nixloc-ui/src/component/shared/construtor-query/Tags.vue";
|
|
198
|
+
import AddEditReport from "@nixweb/nixloc-ui/src/component/template/AddEditReport.vue";
|
|
199
|
+
import print from "vue-print-nb";
|
|
200
|
+
|
|
201
|
+
import { mapState, mapGetters, mapActions, mapMutations } from "vuex";
|
|
202
|
+
|
|
203
|
+
export default {
|
|
204
|
+
name: "TemplateReportView",
|
|
205
|
+
directives: {
|
|
206
|
+
print,
|
|
207
|
+
},
|
|
208
|
+
props: {
|
|
209
|
+
templateList: Object,
|
|
210
|
+
field: Array,
|
|
211
|
+
panel: Object,
|
|
212
|
+
},
|
|
213
|
+
components: {
|
|
214
|
+
Alert,
|
|
215
|
+
Modal,
|
|
216
|
+
Button,
|
|
217
|
+
TableTotalRecords,
|
|
218
|
+
Table,
|
|
219
|
+
Panel,
|
|
220
|
+
ScrollBar,
|
|
221
|
+
Molded,
|
|
222
|
+
Rodape,
|
|
223
|
+
ProgressBar,
|
|
224
|
+
Tags,
|
|
225
|
+
AddEditReport,
|
|
226
|
+
ExportExcel,
|
|
227
|
+
HeaderPrint,
|
|
228
|
+
},
|
|
229
|
+
data() {
|
|
230
|
+
return {
|
|
231
|
+
content: {
|
|
232
|
+
headerTable: [],
|
|
233
|
+
data: [],
|
|
234
|
+
totalization: [],
|
|
235
|
+
pagination: 0,
|
|
236
|
+
currentPage: 1,
|
|
237
|
+
totalPerPage: 100,
|
|
238
|
+
totalRecords: 0,
|
|
239
|
+
},
|
|
240
|
+
btnDesativado: true,
|
|
241
|
+
carregando: false,
|
|
242
|
+
nenhumDadoRetornado: false,
|
|
243
|
+
teste: this.router,
|
|
244
|
+
};
|
|
245
|
+
},
|
|
246
|
+
mounted() {
|
|
247
|
+
this.removeLoading(["panel"]);
|
|
248
|
+
},
|
|
249
|
+
beforeDestroy() {
|
|
250
|
+
this.updateOptionsInitValue({});
|
|
251
|
+
this.atualizaCampoOrdenado({});
|
|
252
|
+
this.atualizaFiltroSelecionado({ children: [] });
|
|
253
|
+
},
|
|
254
|
+
computed: {
|
|
255
|
+
...mapGetters("generic", ["showModal", "event"]),
|
|
256
|
+
...mapGetters("report", [
|
|
257
|
+
"headerTable",
|
|
258
|
+
"selectedRules",
|
|
259
|
+
"requiredRules",
|
|
260
|
+
"regraObrigatoriaJaAdicionada",
|
|
261
|
+
"hasSelectedField",
|
|
262
|
+
"oDataSelect",
|
|
263
|
+
"oDataFilter",
|
|
264
|
+
"oDataOrderBy",
|
|
265
|
+
]),
|
|
266
|
+
...mapState("report", ["report", "selectedField", "totalization"]),
|
|
267
|
+
urlConsulta() {
|
|
268
|
+
let baseUrl = `${this.templateList.urlGetApi}?${this.oDataSelect}&${this.oDataOrderBy}&${this.oDataFilter.query}&$skip=${this.skip}&$top=${this.content.totalPerPage}&$count=true`;
|
|
269
|
+
return baseUrl.replace("&&", "&");
|
|
270
|
+
},
|
|
271
|
+
urlResumo() {
|
|
272
|
+
let query = this.oDataFilter.totalization
|
|
273
|
+
? `$apply=filter(${this.oDataFilter.query.replace("$filter=", "")})/`
|
|
274
|
+
: "$apply=";
|
|
275
|
+
let baseUrl = `${this.templateList.urlGetApi}?${query}aggregate(${this.oDataFilter.totalization})`;
|
|
276
|
+
return baseUrl;
|
|
277
|
+
},
|
|
278
|
+
skip() {
|
|
279
|
+
return (this.content.currentPage - 1) * this.content.totalPerPage;
|
|
280
|
+
},
|
|
281
|
+
invalid() {
|
|
282
|
+
let retorno = true;
|
|
283
|
+
this.requiredRules.forEach((rule) => {
|
|
284
|
+
retorno = this.regraObrigatoriaJaAdicionada(rule);
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
if (this.requiredRules.length == 0) retorno = false;
|
|
288
|
+
|
|
289
|
+
return retorno;
|
|
290
|
+
},
|
|
291
|
+
tamanhoDados() {
|
|
292
|
+
return this.content.data.length;
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
methods: {
|
|
296
|
+
...mapActions("generic", ["getApiOdata"]),
|
|
297
|
+
...mapMutations("generic", [
|
|
298
|
+
"addEvent",
|
|
299
|
+
"showModal",
|
|
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 = [];
|
|
312
|
+
this.btnDesativado = true;
|
|
313
|
+
|
|
314
|
+
if (!this.invalid) {
|
|
315
|
+
this.mostraEscondeCampos();
|
|
316
|
+
this.pagination();
|
|
317
|
+
this.removeLoading(["buscarRelatorio"]);
|
|
318
|
+
|
|
319
|
+
if (this.oDataFilter.totalization) this.resumoOData();
|
|
320
|
+
if (!this.oDataFilter.totalization) this.content.totalization = [];
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
pagination() {
|
|
324
|
+
let paramsConsulta = { url: this.urlConsulta };
|
|
325
|
+
this.reiniciaDados();
|
|
326
|
+
|
|
327
|
+
this.getApiOdata(paramsConsulta).then((response) => {
|
|
328
|
+
let totalRecords = response["@odata.count"];
|
|
329
|
+
if (totalRecords == 0) this.nenhumDadoRetornado = true;
|
|
330
|
+
this.content.totalRecords = totalRecords;
|
|
331
|
+
this.content.pagination = Math.round(
|
|
332
|
+
totalRecords / this.content.totalPerPage
|
|
333
|
+
);
|
|
334
|
+
|
|
335
|
+
if (totalRecords <= this.content.totalPerPage) {
|
|
336
|
+
this.consultaOdata();
|
|
337
|
+
this.content.headerTable = this.headerTable;
|
|
338
|
+
}
|
|
339
|
+
if (this.content.pagination == 0) this.carregando = false;
|
|
340
|
+
});
|
|
341
|
+
},
|
|
342
|
+
reiniciaDados() {
|
|
343
|
+
this.carregando = true;
|
|
344
|
+
this.content.data = [];
|
|
345
|
+
this.content.currentPage = 1;
|
|
346
|
+
this.nenhumDadoRetornado = false;
|
|
347
|
+
},
|
|
348
|
+
consultaOdata() {
|
|
349
|
+
let paramsConsulta = { url: this.urlConsulta };
|
|
350
|
+
this.getApiOdata(paramsConsulta).then((response) => {
|
|
351
|
+
let self = this;
|
|
352
|
+
response.value.forEach(function (obj) {
|
|
353
|
+
self.content.data.push(obj);
|
|
354
|
+
});
|
|
355
|
+
this.content.currentPage++;
|
|
356
|
+
});
|
|
357
|
+
this.content.headerTable = this.headerTable;
|
|
358
|
+
},
|
|
359
|
+
resumoOData() {
|
|
360
|
+
let paramsResumo = { url: this.urlResumo };
|
|
361
|
+
this.getApiOdata(paramsResumo).then((response) => {
|
|
362
|
+
this.content.totalization = [];
|
|
363
|
+
const result = Object.entries(response[0]);
|
|
364
|
+
let self = this;
|
|
365
|
+
result.forEach(function (value) {
|
|
366
|
+
self.totalization.forEach(function (legenda) {
|
|
367
|
+
let obj = {
|
|
368
|
+
title: "",
|
|
369
|
+
valor: value[1],
|
|
370
|
+
classCss: legenda.classCss,
|
|
371
|
+
type: legenda.type,
|
|
372
|
+
};
|
|
373
|
+
if (legenda.valor == value[0]) {
|
|
374
|
+
obj.title = legenda.title;
|
|
375
|
+
self.content.totalization.push(obj);
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
});
|
|
379
|
+
});
|
|
380
|
+
},
|
|
381
|
+
abrirCampo() {
|
|
382
|
+
this.showModal("field");
|
|
383
|
+
this.removeLoading(["abrirCampo"]);
|
|
384
|
+
},
|
|
385
|
+
abrirFiltro() {
|
|
386
|
+
this.showModal("filter");
|
|
387
|
+
this.removeLoading(["abrirFiltro"]);
|
|
388
|
+
},
|
|
389
|
+
aplicarFiltro() {
|
|
390
|
+
this.hideModal();
|
|
391
|
+
this.removeLoading(["aplicaFiltro", "aplicaCampo"]);
|
|
392
|
+
},
|
|
393
|
+
saveReport() {
|
|
394
|
+
this.addEvent({ nome: "changeReport" });
|
|
395
|
+
this.showModal("salvar");
|
|
396
|
+
this.removeLoading(["saveReport"]);
|
|
397
|
+
},
|
|
398
|
+
mostraEscondeCampos() {
|
|
399
|
+
let self = this;
|
|
400
|
+
this.report.fields.forEach(function (field) {
|
|
401
|
+
if (self.hasSelectedField(field.field, self.selectedField)) {
|
|
402
|
+
value.show = true;
|
|
403
|
+
} else {
|
|
404
|
+
value.show = false;
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
},
|
|
408
|
+
},
|
|
409
|
+
watch: {
|
|
410
|
+
event: {
|
|
411
|
+
handler(event) {
|
|
412
|
+
if (event.nome == "tagRelatorio") this.showModal("filter");
|
|
413
|
+
},
|
|
414
|
+
deep: true,
|
|
415
|
+
},
|
|
416
|
+
selectedField: {
|
|
417
|
+
handler() {
|
|
418
|
+
this.mostraEscondeCampos();
|
|
419
|
+
},
|
|
420
|
+
deep: true,
|
|
421
|
+
},
|
|
422
|
+
"content.currentPage": {
|
|
423
|
+
handler(currentPage) {
|
|
424
|
+
if (currentPage <= this.content.pagination - 1) {
|
|
425
|
+
let self = this;
|
|
426
|
+
setTimeout(function () {
|
|
427
|
+
self.consultaOdata();
|
|
428
|
+
}, 200);
|
|
429
|
+
}
|
|
430
|
+
if (currentPage == this.content.pagination && currentPage != 0)
|
|
431
|
+
this.carregando = false;
|
|
432
|
+
},
|
|
433
|
+
deep: true,
|
|
434
|
+
},
|
|
435
|
+
"content.pagination": {
|
|
436
|
+
handler() {
|
|
437
|
+
this.consultaOdata();
|
|
438
|
+
},
|
|
439
|
+
deep: true,
|
|
440
|
+
},
|
|
441
|
+
"oDataFilter.query": {
|
|
442
|
+
handler() {
|
|
443
|
+
this.btnDesativado = false;
|
|
444
|
+
},
|
|
445
|
+
deep: true,
|
|
446
|
+
},
|
|
447
|
+
oDataSelect: {
|
|
448
|
+
handler() {
|
|
449
|
+
this.btnDesativado = false;
|
|
450
|
+
},
|
|
451
|
+
deep: true,
|
|
452
|
+
},
|
|
453
|
+
oDataOrderBy: {
|
|
454
|
+
handler() {
|
|
455
|
+
this.btnDesativado = false;
|
|
456
|
+
},
|
|
457
|
+
deep: true,
|
|
458
|
+
},
|
|
459
|
+
},
|
|
460
|
+
};
|
|
461
|
+
</script>
|
|
462
|
+
|
|
463
|
+
<style scoped>
|
|
464
|
+
.div-button {
|
|
465
|
+
padding-bottom: 15px;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.div-progresso {
|
|
469
|
+
margin-bottom: 10px;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.div-sem-data {
|
|
473
|
+
margin-top: 20px;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.div-tabela {
|
|
477
|
+
margin-top: 20px;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.div-separacao {
|
|
481
|
+
margin-left: 10px;
|
|
482
|
+
margin-right: 5px;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
.div-rodape {
|
|
486
|
+
margin-top: 20px;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
.div-tags {
|
|
490
|
+
margin-top: 15px;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
.div-obrigatorio {
|
|
494
|
+
margin-top: 20px;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
.filter-obrigatorio {
|
|
498
|
+
font-weight: 500;
|
|
499
|
+
}
|
|
500
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<Panel
|
|
4
|
+
:module="panel.module"
|
|
5
|
+
:title="panel.title"
|
|
6
|
+
:showFilter="panel.showFilter"
|
|
7
|
+
:showSearch="panel.showSearch"
|
|
8
|
+
:showButtons="panel.showButtons"
|
|
9
|
+
>
|
|
10
|
+
<div slot="content-buttons">
|
|
11
|
+
<slot name="content-buttons"></slot>
|
|
12
|
+
</div>
|
|
13
|
+
<div slot="content-main">
|
|
14
|
+
<slot name="content-main"></slot>
|
|
15
|
+
</div>
|
|
16
|
+
</Panel>
|
|
17
|
+
<SaveCancel :formName="panel.formName" />
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script>
|
|
22
|
+
import Panel from "@nixweb/nixloc-ui/src/component/layout/Panel";
|
|
23
|
+
import SaveCancel from "@nixweb/nixloc-ui/src/component/shared/SaveCancel";
|
|
24
|
+
|
|
25
|
+
export default {
|
|
26
|
+
name: "ViewTemplateCrud",
|
|
27
|
+
components: { Panel, SaveCancel },
|
|
28
|
+
props: {
|
|
29
|
+
panel: Object,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
</script>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<Panel
|
|
4
|
+
:module="panel.module"
|
|
5
|
+
:title="panel.title"
|
|
6
|
+
:showVerticalFilter="panel.showVerticalFilter"
|
|
7
|
+
:showSearch="panel.showSearch"
|
|
8
|
+
:showButtons="panel.showButtons"
|
|
9
|
+
>
|
|
10
|
+
<div slot="content-filter-vertical">
|
|
11
|
+
<slot name="content-filter-vertical"></slot>
|
|
12
|
+
</div>
|
|
13
|
+
<div slot="content-buttons">
|
|
14
|
+
<slot name="content-buttons"></slot>
|
|
15
|
+
</div>
|
|
16
|
+
<div slot="content-main">
|
|
17
|
+
<ListViewWithHandlerData :templateList="templateList" :buttonRemove="buttonRemove">
|
|
18
|
+
<div slot="content-buttons-table-header">
|
|
19
|
+
<slot name="content-buttons-table-header"></slot>
|
|
20
|
+
</div>
|
|
21
|
+
<div slot="content-filter-horizontal">
|
|
22
|
+
<slot name="content-filter-horizontal"></slot>
|
|
23
|
+
</div>
|
|
24
|
+
<div slot="content-buttons-table">
|
|
25
|
+
<slot name="content-buttons-table"></slot>
|
|
26
|
+
</div>
|
|
27
|
+
</ListViewWithHandlerData>
|
|
28
|
+
</div>
|
|
29
|
+
</Panel>
|
|
30
|
+
</div>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script>
|
|
34
|
+
import Panel from '@nixweb/nixloc-ui/src/component/layout/Panel.vue'
|
|
35
|
+
import ListViewWithHandlerData from "@nixweb/nixloc-ui/src/component/template/ListViewWithHandlerData.vue";
|
|
36
|
+
|
|
37
|
+
export default {
|
|
38
|
+
name: "TemplateView",
|
|
39
|
+
components: { Panel, ListViewWithHandlerData },
|
|
40
|
+
props: {
|
|
41
|
+
panel: Object,
|
|
42
|
+
templateList: Object,
|
|
43
|
+
buttonRemove: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: true,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
</script>
|