@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.
Files changed (122) hide show
  1. package/docs/src/component/template/ModeloRelatorioView.drawio +160 -0
  2. package/docs/src/store/modulos/relatorio.drawio +37 -0
  3. package/package.json +77 -75
  4. package/public/index.html +2 -4
  5. package/public/styles/app.css +1 -2
  6. package/src/component/forms/{Botao.vue → Button.vue} +53 -57
  7. package/src/component/forms/CheckboxGroup.vue +63 -0
  8. package/src/component/forms/{CheckboxUnico.vue → CheckboxSimple.vue} +6 -6
  9. package/src/component/forms/{Cor.vue → Color.vue} +9 -9
  10. package/src/component/forms/DateTime.vue +53 -53
  11. package/src/component/forms/{BotaoDropdown.vue → Dropdown.vue} +50 -50
  12. package/src/component/forms/EditorHtml.vue +123 -0
  13. package/src/component/forms/FileUpload.vue +189 -0
  14. package/src/component/forms/InputDecimal.vue +137 -0
  15. package/src/component/forms/InputNumber.vue +149 -0
  16. package/src/component/forms/InputPassword.vue +135 -0
  17. package/src/component/forms/InputText.vue +157 -0
  18. package/src/component/forms/Modal.vue +15 -15
  19. package/src/component/forms/RadioGroup.vue +50 -0
  20. package/src/component/forms/Select.vue +337 -0
  21. package/src/component/forms/SelectStatic.vue +120 -0
  22. package/src/component/forms/TextArea.vue +126 -0
  23. package/src/component/forms/Toggle.vue +13 -13
  24. package/src/component/layout/{Conta.vue → Account.vue} +28 -28
  25. package/src/component/layout/{Alerta.vue → Alert.vue} +22 -22
  26. package/src/component/layout/Badge.vue +23 -23
  27. package/src/component/layout/{BarraFixa.vue → FixedBar.vue} +16 -16
  28. package/src/component/layout/{CarregandoTelaInteira.vue → LoadingFullPage.vue} +3 -3
  29. package/src/component/layout/Menu.vue +66 -66
  30. package/src/component/layout/{Moldura.vue → Molded.vue} +4 -4
  31. package/src/component/layout/Panel.vue +142 -0
  32. package/src/component/layout/Popover.vue +1 -1
  33. package/src/component/layout/{BarraRolagem.vue → Scrollbar.vue} +9 -11
  34. package/src/component/layout/Tag.vue +9 -9
  35. package/src/component/layout/Topo.vue +1 -1
  36. package/src/component/layout/Wizard.vue +3 -3
  37. package/src/component/shared/BotaoCarregarMais.vue +9 -9
  38. package/src/component/shared/BotaoConsulta.vue +9 -9
  39. package/src/component/shared/CabecalhoImpressao.vue +6 -6
  40. package/src/component/shared/CodigoEditor.vue +16 -16
  41. package/src/component/shared/Confirmacao.vue +28 -28
  42. package/src/component/shared/Dica.vue +10 -10
  43. package/src/component/shared/DocumentoEditor.vue +3 -3
  44. package/src/component/shared/DocumentoPreview.vue +2 -2
  45. package/src/component/shared/EsconderMostrar.vue +26 -26
  46. package/src/component/shared/ExportarExcel.vue +14 -14
  47. package/src/component/shared/ExportarPDF.vue +10 -10
  48. package/src/component/shared/FiltroHorizontal.vue +19 -19
  49. package/src/component/shared/LegendaParametro.vue +17 -17
  50. package/src/component/shared/{Carregando.vue → Loading.vue} +11 -11
  51. package/src/component/shared/Messages.vue +83 -0
  52. package/src/component/shared/Paginacao.vue +10 -10
  53. package/src/component/shared/Progresso.vue +2 -2
  54. package/src/component/shared/Registro.vue +2 -2
  55. package/src/component/shared/ResumoTabela.vue +6 -6
  56. package/src/component/shared/SalvarCancelar.vue +26 -26
  57. package/src/component/shared/{Pesquisa.vue → Search.vue} +36 -36
  58. package/src/component/shared/Tabela.vue +49 -49
  59. package/src/component/shared/TabelaBotao.vue +13 -13
  60. package/src/component/shared/Toast.vue +7 -7
  61. package/src/component/shared/{FiltroVertical.vue → VerticalFilter.vue} +14 -14
  62. package/src/component/shared/construtor-consulta/AdicionaFiltro.vue +191 -0
  63. package/src/component/shared/construtor-consulta/Campo.vue +127 -0
  64. package/src/component/shared/construtor-consulta/ComponenteDinamico.vue +109 -0
  65. package/src/component/shared/construtor-consulta/ConstrutorConsulta.vue +70 -0
  66. package/src/component/shared/construtor-consulta/ConverteParaOdata.js +80 -0
  67. package/src/component/shared/construtor-consulta/EscolherFiltro.vue +96 -0
  68. package/src/component/shared/{query-builder → construtor-consulta}/Filtro.vue +11 -16
  69. package/src/component/shared/construtor-consulta/ListaComponenteDinamico.vue +41 -0
  70. package/src/component/shared/{query-builder → construtor-consulta}/Rodape.vue +9 -9
  71. package/src/component/shared/{query-builder → construtor-consulta}/Tags.vue +7 -7
  72. package/src/component/shared/{query-builder → construtor-consulta}/utilities.js +0 -0
  73. package/src/component/template/ModeloAdicionarModificarView.vue +11 -11
  74. package/src/component/template/ModeloDocumentoView.vue +79 -79
  75. package/src/component/template/ModeloLista.vue +66 -66
  76. package/src/component/template/ModeloRelatorioListaView.vue +71 -68
  77. package/src/component/template/ModeloRelatorioView.vue +218 -200
  78. package/src/component/template/ModeloSubView.vue +13 -13
  79. package/src/component/template/ModeloView.vue +17 -17
  80. package/src/component/template/Relatorio.js +1 -5
  81. package/src/component/template/RelatorioAdicionarModificar.vue +44 -44
  82. package/src/component/value-objects/DadosContato.vue +27 -27
  83. package/src/component/value-objects/DadosPessoa.js +1 -1
  84. package/src/component/value-objects/DadosPessoa.vue +52 -52
  85. package/src/component/value-objects/Endereco.js +1 -1
  86. package/src/component/value-objects/Endereco.vue +83 -83
  87. package/src/config/dicas.js +1 -1
  88. package/src/config/token.js +2 -2
  89. package/src/store/modules/generic.js +489 -0
  90. package/src/store/modules/report.js +246 -0
  91. package/src/store/modules/user.js +38 -0
  92. package/src/store/modules/validation.js +39 -0
  93. package/src/store/store.js +4 -4
  94. package/public/js/menu.js +0 -11
  95. package/public/styles/menu.css +0 -1399
  96. package/src/component/forms/ArquivoUpload.vue +0 -199
  97. package/src/component/forms/CheckboxMultiplo.vue +0 -63
  98. package/src/component/forms/Decimal.vue +0 -137
  99. package/src/component/forms/Escolher.vue +0 -324
  100. package/src/component/forms/EscolherEstatico.vue +0 -139
  101. package/src/component/forms/Numero.vue +0 -153
  102. package/src/component/forms/Opcoes.vue +0 -51
  103. package/src/component/forms/Senha.vue +0 -139
  104. package/src/component/forms/Texto.vue +0 -161
  105. package/src/component/forms/TextoArea.vue +0 -126
  106. package/src/component/forms/TextoEditor.vue +0 -123
  107. package/src/component/layout/Painel.vue +0 -142
  108. package/src/component/shared/Mensagem.vue +0 -86
  109. package/src/component/shared/query-builder/Campo.vue +0 -116
  110. package/src/component/shared/query-builder/ConverteParaOdata.js +0 -73
  111. package/src/component/shared/query-builder/QueryBuilder.vue +0 -164
  112. package/src/component/shared/query-builder/components/CustomSelect.vue +0 -115
  113. package/src/component/shared/query-builder/components/QueryBuilderChildren.vue +0 -46
  114. package/src/component/shared/query-builder/components/QueryBuilderGroup.vue +0 -151
  115. package/src/component/shared/query-builder/components/QueryBuilderRule.vue +0 -81
  116. package/src/component/shared/query-builder/layouts/Bootstrap/BootstrapGroup.vue +0 -120
  117. package/src/component/shared/query-builder/layouts/Bootstrap/BootstrapRule.vue +0 -171
  118. package/src/component/shared/query-builder/main.js +0 -81
  119. package/src/store/modulos/generic.js +0 -494
  120. package/src/store/modulos/relatorio.js +0 -201
  121. package/src/store/modulos/usuario.js +0 -38
  122. package/src/store/modulos/validation.js +0 -39
@@ -1,110 +1,112 @@
1
1
  <template>
2
2
  <div>
3
3
  <Painel
4
- :modulo="painel.modulo"
5
- :titulo="painel.titulo"
6
- :mostrarFiltroVertical="painel.mostrarFiltroVertical"
7
- :mostrarPesquisa="painel.mostrarPesquisa"
8
- :mostrarBotoes="painel.mostrarBotoes"
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="conteudo-principal">
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 ${conteudo.totalRegistros}`"
15
+ :texto="`Carregando ${tamanhoDados} registro(s) de ${content.totalRecords}`"
15
16
  :valor="tamanhoDados"
16
- :maximo="conteudo.totalRegistros"
17
- tamanho="medium"
17
+ :maximo="content.totalRecords"
18
+ size="medium"
18
19
  />
19
20
  </div>
20
- <Modal titulo="Salvar" :largura="550" v-show="mostrarModal('salvar')">
21
- <RelatorioAdicionarModificar :modulo="painel.modulo" />
21
+ <Modal title="Salvar" :width="550" v-show="mostrarModal('salvar')">
22
+ <RelatorioAdicionarModificar :module="panel.module" />
22
23
  </Modal>
23
- <Moldura>
24
+ <Molded>
24
25
  <div>
25
- <div slot="conteudo-filtro-horizontal">
26
+ <div slot="content-filter-horizontal">
26
27
  <b-row>
27
28
  <b-col sm="6">
28
- <div class="lado-a-lado">
29
- <Botao
30
- chave="buscarRelatorio"
31
- tipo="primario"
32
- titulo="Buscar"
33
- classeIcone="fas fa-file-search"
34
- tamanho="medio"
35
- :desabilitado="invalido || btnDesativado"
36
- :clique="obterTodos"
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="lado-a-lado">
40
- <Botao
41
- v-if="!invalido"
42
- chave="salvarRelatorio"
43
- tipo="sucesso"
44
- titulo="Salvar Modelo"
45
- classeIcone="fas fa-save"
46
- :desabilitado="carregando || invalido"
47
- tamanho="pequeno"
48
- :clique="salvarRelatorio"
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="lado-a-lado">
54
- <Botao
55
- chave="abrirCampo"
56
- tipo="info"
57
- titulo="Campos"
58
- classeIcone="fas fa-database"
59
- tamanho="pequeno"
60
- :desabilitado="carregando"
61
- :clique="abrirCampo"
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="lado-a-lado">
65
- <Botao
66
- chave="abrirFiltro"
67
- tipo="info"
68
- titulo="Filtros"
69
- classeIcone="fas fa-filter"
70
- tamanho="pequeno"
71
- :desabilitado="carregando"
72
- :clique="abrirFiltro"
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 titulo="Filtros" :largura="900" v-show="mostrarModal('filtro')">
78
- <slot name="filtro"></slot>
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="lado-a-lado">
83
- <Botao
84
- chave="aplicaFiltro"
85
- tipo="primario"
86
- titulo="Aplicar"
87
- classeIcone="fas fa-filter"
88
- tamanho="pequeno"
89
- :clique="aplicarFiltro"
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 titulo="Campos" :largura="600" v-show="mostrarModal('campo')">
96
- <slot name="campo"></slot>
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="lado-a-lado">
100
- <Botao
101
- chave="aplicaFiltro"
102
- tipo="primario"
103
- titulo="Aplicar"
104
- classeIcone="fas fa-filter"
105
- tamanho="pequeno"
106
- :desabilitado="campoSelecionado.length == 0"
107
- :clique="aplicarFiltro"
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
- </Moldura>
116
- <div class="div-obrigatorio" v-show="invalido">
117
- <Alerta tipo="info" v-for="item in filtroObrigatorio" :key="item.id">
118
- É necessário informar o filtro
119
- <span class="filtro-obrigatorio">{{ item.label }}</span
120
- >, clique no botão "Filtros" para adicionar.
121
- </Alerta>
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-moldura div-tabela" v-if="!carregando && tamanhoDados > 0">
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="lado-a-lado">
130
- <ExportarExcel
131
- :botao="{ tipo: 'editar', titulo: 'Excel', tamanho: 'pequeno' }"
132
- nomeArquivo="Auditoria"
133
- :cabecalho="conteudo.cabecalhoTabela"
134
- :dados="conteudo.dados"
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="conteudo.totalRegistros" />
156
+ <Registro :totalRegistro="content.totalRecords" />
153
157
  </b-col>
154
158
  </b-row>
155
- <BarraRolagem :alturaMinima="400" :alturaMaxima="600">
159
+ <BarraRolagem :minHeight="400" :maxHeight="600">
156
160
  <div id="printMe">
157
161
  <CabecalhoImpressao />
162
+ {{ content.headerTable }}
158
163
  <Tabela
159
- :cabecalhoTabela="conteudo.cabecalhoTabela"
160
- :dados="conteudo.dados"
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-dados" v-if="nenhumDadoRetornado">
167
- <Alerta tipo="info">
171
+ <div class="div-sem-data" v-if="nenhumDadoRetornado">
172
+ <Alert type="info">
168
173
  <span> Nenhum registro foi encontrato!</span>
169
- </Alerta>
174
+ </Alert>
170
175
  </div>
171
- <div class="div-rodape" v-if="conteudo.resumo.length > 0">
172
- <Rodape :dados="conteudo.resumo" />
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 Alerta from "@nixweb/nixloc-ui/src/component/layout/Alerta";
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 Botao from "@nixweb/nixloc-ui/src/component/forms/Botao";
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 Moldura from "@nixweb/nixloc-ui/src/component/layout/Moldura";
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/query-builder/Rodape.vue";
192
- import Tags from "@nixweb/nixloc-ui/src/component/shared/query-builder/Tags.vue";
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
- campo: Array,
206
- painel: Object,
210
+ field: Array,
211
+ panel: Object,
207
212
  },
208
213
  components: {
209
- Alerta,
214
+ Alert,
210
215
  Modal,
211
- Botao,
216
+ Button,
212
217
  Registro,
213
218
  Tabela,
214
219
  Painel,
215
220
  BarraRolagem,
216
- Moldura,
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
- conteudo: {
227
- cabecalhoTabela: [],
228
- dados: [],
229
- resumo: [],
231
+ content: {
232
+ headerTable: [],
233
+ data: [],
234
+ totalization: [],
230
235
  paginacao: 0,
231
- paginaAtual: 1,
232
- totalPorPagina: 100,
233
- totalRegistros: 0,
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.removeCarregando(["painel"]);
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("relatorio", [
247
- "cabecalhoTabela",
248
- "filtroSelecionado",
249
- "filtroObrigatorio",
250
- "temCampoSelecionado",
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("relatorio", ["relatorio", "campoSelecionado", "resumo"]),
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.conteudo.totalPorPagina}&$count=true`;
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.resumo
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.resumo})`;
275
+ let baseUrl = `${this.modeloLista.urlGetApi}?${consulta}aggregate(${this.oDataFilter.totalization})`;
265
276
  return baseUrl;
266
277
  },
267
278
  skip() {
268
- return (this.conteudo.paginaAtual - 1) * this.conteudo.totalPorPagina;
279
+ return (this.content.currentPage - 1) * this.content.totalPerPage;
269
280
  },
270
- invalido() {
281
+ invalid() {
271
282
  let retorno = true;
272
- this.filtroObrigatorio.forEach((filtro) => {
273
- var existe = this.filtroSelecionado.children.find((value) => {
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.filtroObrigatorio.length == 0) retorno = false;
287
+ if (this.requiredRules.length == 0) retorno = false;
279
288
 
280
289
  return retorno;
281
290
  },
282
291
  tamanhoDados() {
283
- return this.conteudo.dados.length;
292
+ return this.content.data.length;
284
293
  },
285
294
  },
286
295
  methods: {
287
296
  ...mapActions("generic", ["getApiOdata"]),
288
- ...mapMutations("generic", ["abrirModal", "fecharModal", "removeCarregando"]),
289
- ...mapMutations("relatorio", ["atualizaCabecalhoTabela", "atualizaConsultaFiltro"]),
290
-
291
- obterTodos() {
292
- this.conteudo.dados = [];
293
- this.conteudo.resumo = [];
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.invalido) {
314
+ if (!this.invalid) {
297
315
  this.mostraEscondeCampos();
298
316
  this.paginacao();
299
- this.removeCarregando(["buscarRelatorio"]);
317
+ this.removeLoading(["buscarRelatorio"]);
300
318
 
301
- if (this.oDataFilter.resumo) this.resumoOData();
302
- if (!this.oDataFilter.resumo) this.conteudo.resumo = [];
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 totalRegistros = response["@odata.count"];
311
- if (totalRegistros == 0) this.nenhumDadoRetornado = true;
312
- this.conteudo.totalRegistros = totalRegistros;
313
- this.conteudo.paginacao = Math.round(
314
- totalRegistros / this.conteudo.totalPorPagina
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 (totalRegistros <= this.conteudo.totalPorPagina) {
335
+ if (totalRecords <= this.content.totalPerPage) {
318
336
  this.consultaOdata();
319
- this.conteudo.cabecalhoTabela = this.cabecalhoTabela;
337
+ this.content.headerTable = this.headerTable;
320
338
  }
321
- if (this.conteudo.paginacao == 0) this.carregando = false;
339
+ if (this.content.paginacao == 0) this.carregando = false;
322
340
  });
323
341
  },
324
342
  reiniciaDados() {
325
343
  this.carregando = true;
326
- this.conteudo.dados = [];
327
- this.conteudo.paginaAtual = 1;
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.conteudo.dados.push(obj);
353
+ self.content.data.push(obj);
336
354
  });
337
- this.conteudo.paginaAtual++;
355
+ this.content.currentPage++;
338
356
  });
339
- this.conteudo.cabecalhoTabela = this.cabecalhoTabela;
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.conteudo.resumo = [];
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.resumo.forEach(function (legenda) {
366
+ self.totalization.forEach(function (legenda) {
349
367
  let obj = {
350
- titulo: "",
368
+ title: "",
351
369
  valor: value[1],
352
370
  classeCss: legenda.classeCss,
353
- tipo: legenda.tipo,
371
+ type: legenda.type,
354
372
  };
355
373
  if (legenda.valor == value[0]) {
356
- obj.titulo = legenda.titulo;
357
- self.conteudo.resumo.push(obj);
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("campo");
365
- this.removeCarregando(["abrirCampo"]);
382
+ this.abrirModal("field");
383
+ this.removeLoading(["abrirCampo"]);
366
384
  },
367
385
  abrirFiltro() {
368
- this.abrirModal("filtro");
369
- this.removeCarregando(["abrirFiltro"]);
386
+ this.abrirModal("filter");
387
+ this.removeLoading(["abrirFiltro"]);
370
388
  },
371
389
  aplicarFiltro() {
372
- this.fecharModal();
373
- this.removeCarregando(["aplicaFiltro", "aplicaCampo"]);
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.removeCarregando(["salvarRelatorio"]);
396
+ this.removeLoading(["salvarRelatorio"]);
378
397
  },
379
398
  mostraEscondeCampos() {
380
399
  let self = this;
381
- this.relatorio.campo.forEach(function (value) {
382
- if (self.temCampoSelecionado(value.campo, self.campoSelecionado)) {
383
- value.mostrar = true;
400
+ this.report.fields.forEach(function (field) {
401
+ if (self.hasSelectedField(field.field, self.selectedField)) {
402
+ value.show = true;
384
403
  } else {
385
- value.mostrar = false;
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("filtro");
412
+ if (evento.nome == "tagRelatorio") this.abrirModal("filter");
394
413
  },
395
414
  deep: true,
396
415
  },
397
- campoSelecionado: {
416
+ selectedField: {
398
417
  handler() {
399
418
  this.mostraEscondeCampos();
400
419
  },
401
420
  deep: true,
402
421
  },
403
- filtroSelecionado: {
404
- handler(filtro) {
405
- this.atualizaConsultaFiltro(filtro);
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 (value == this.conteudo.paginacao && value != 0) this.carregando = false;
430
+ if (currentPage == this.content.paginacao && currentPage != 0)
431
+ this.carregando = false;
418
432
  },
419
433
  deep: true,
420
434
  },
421
- "conteudo.paginacao": {
422
- handler(value) {
435
+ "content.paginacao": {
436
+ handler() {
423
437
  this.consultaOdata();
424
438
  },
425
439
  deep: true,
426
440
  },
427
441
  "oDataFilter.consulta": {
428
- handler(value) {
442
+ handler() {
429
443
  this.btnDesativado = false;
430
444
  },
431
445
  deep: true,
432
446
  },
433
447
  oDataSelect: {
434
- handler(value) {
448
+ handler() {
435
449
  this.btnDesativado = false;
436
450
  },
437
451
  deep: true,
438
452
  },
439
453
  oDataOrderBy: {
440
- handler(value) {
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-dados {
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
- .filtro-obrigatorio {
497
+ .filter-obrigatorio {
480
498
  font-weight: 500;
481
499
  }
482
500
  </style>