@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.
Files changed (135) hide show
  1. package/docs/src/component/template/ModeloRelatorioView.drawio +2 -2
  2. package/docs/src/store/modulos/relatorio.drawio +2 -2
  3. package/package.json +77 -77
  4. package/public/styles/app.css +1 -1
  5. package/src/component/forms/{Botao.vue → Button.vue} +53 -57
  6. package/src/component/forms/CheckboxGroup.vue +63 -0
  7. package/src/component/forms/{CheckboxUnico.vue → CheckboxSimple.vue} +8 -8
  8. package/src/component/forms/{Cor.vue → Color.vue} +9 -9
  9. package/src/component/forms/DateTime.vue +55 -55
  10. package/src/component/forms/{BotaoDropdown.vue → Dropdown.vue} +58 -58
  11. package/src/component/forms/EditorHtml.vue +123 -0
  12. package/src/component/forms/FileUpload.vue +189 -0
  13. package/src/component/forms/InputDecimal.vue +137 -0
  14. package/src/component/forms/InputNumber.vue +149 -0
  15. package/src/component/forms/InputPassword.vue +135 -0
  16. package/src/component/forms/InputText.vue +157 -0
  17. package/src/component/forms/Modal.vue +15 -15
  18. package/src/component/forms/RadioGroup.vue +50 -0
  19. package/src/component/forms/Select.vue +337 -0
  20. package/src/component/forms/SelectStatic.vue +120 -0
  21. package/src/component/forms/TextArea.vue +126 -0
  22. package/src/component/forms/Toggle.vue +13 -13
  23. package/src/component/layout/{Conta.vue → Account.vue} +28 -28
  24. package/src/component/layout/{Alerta.vue → Alert.vue} +22 -22
  25. package/src/component/layout/Badge.vue +23 -23
  26. package/src/component/layout/{BarraFixa.vue → FixedBar.vue} +16 -16
  27. package/src/component/layout/{Topo.vue → Header.vue} +5 -5
  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 +15 -15
  35. package/src/component/layout/Wizard.vue +3 -3
  36. package/src/component/shared/{CodigoEditor.vue → CodeEditor.vue} +25 -25
  37. package/src/component/shared/Collapse.vue +131 -0
  38. package/src/component/shared/Confirmation.vue +80 -0
  39. package/src/component/shared/{DocumentoEditor.vue → DocumentEditor.vue} +10 -16
  40. package/src/component/shared/{DocumentoPreview.vue → DocumentPreview.vue} +2 -2
  41. package/src/component/shared/ExportExcel.vue +67 -0
  42. package/src/component/shared/{ExportarPDF.vue → ExportPDF.vue} +18 -18
  43. package/src/component/shared/HeaderPrint.vue +36 -0
  44. package/src/component/shared/HorizontalFilter.vue +59 -0
  45. package/src/component/shared/LegendaParametro.vue +22 -22
  46. package/src/component/shared/{Carregando.vue → Loading.vue} +16 -16
  47. package/src/component/shared/LoadingMoreButton.vue +23 -0
  48. package/src/component/shared/Messages.vue +83 -0
  49. package/src/component/shared/{Paginacao.vue → Pagination.vue} +12 -12
  50. package/src/component/shared/ProgressBar.vue +21 -0
  51. package/src/component/shared/{BotaoConsulta.vue → QueryButton.vue} +16 -16
  52. package/src/component/shared/SaveCancel.vue +56 -0
  53. package/src/component/shared/{Pesquisa.vue → Search.vue} +46 -46
  54. package/src/component/shared/Table.vue +243 -0
  55. package/src/component/shared/TableButton.vue +36 -0
  56. package/src/component/shared/{Registro.vue → TableTotalRecords.vue} +7 -7
  57. package/src/component/shared/{ResumoTabela.vue → TableTotalization.vue} +12 -8
  58. package/src/component/shared/Tip.vue +42 -0
  59. package/src/component/shared/Toast.vue +7 -7
  60. package/src/component/shared/{FiltroVertical.vue → VerticalFilter.vue} +24 -24
  61. package/src/component/shared/query-builder/AddRule.vue +187 -0
  62. package/src/component/shared/query-builder/ConvertToOdata.js +80 -0
  63. package/src/component/shared/query-builder/DynamicComponent.vue +107 -0
  64. package/src/component/shared/query-builder/Fields.vue +127 -0
  65. package/src/component/shared/query-builder/ListDynamicComponent.vue +42 -0
  66. package/src/component/shared/query-builder/QueryBuilder.vue +25 -120
  67. package/src/component/shared/query-builder/{Filtro.vue → Rules.vue} +13 -18
  68. package/src/component/shared/query-builder/SelectRule.vue +96 -0
  69. package/src/component/shared/query-builder/Tags.vue +14 -14
  70. package/src/component/shared/query-builder/{Rodape.vue → Totalization.vue} +10 -10
  71. package/src/component/template/AddEditReport.vue +106 -0
  72. package/src/component/template/ListViewWithHandlerData.vue +231 -0
  73. package/src/component/template/ViewTemplateConfiguration.vue +69 -0
  74. package/src/component/template/ViewTemplateDocumentView.vue +227 -0
  75. package/src/component/template/ViewTemplateReportList.vue +230 -0
  76. package/src/component/template/ViewTemplateReportPreview.vue +500 -0
  77. package/src/component/template/ViewTemplateWithSalveCancel.vue +32 -0
  78. package/src/component/template/ViewTemplateWithTable.vue +49 -0
  79. package/src/component/template/model/Report.js +6 -0
  80. package/src/component/value-objects/DadosContato.vue +34 -35
  81. package/src/component/value-objects/DadosPessoa.vue +58 -58
  82. package/src/component/value-objects/Endereco.vue +96 -97
  83. package/src/config/dicas.js +1 -1
  84. package/src/config/token.js +2 -2
  85. package/src/store/modules/generic.js +489 -0
  86. package/src/store/modules/report.js +246 -0
  87. package/src/store/modules/user.js +38 -0
  88. package/src/store/modules/validation.js +39 -0
  89. package/src/store/store.js +4 -4
  90. package/src/component/forms/ArquivoUpload.vue +0 -199
  91. package/src/component/forms/CheckboxMultiplo.vue +0 -63
  92. package/src/component/forms/Decimal.vue +0 -137
  93. package/src/component/forms/Escolher.vue +0 -335
  94. package/src/component/forms/EscolherEstatico.vue +0 -139
  95. package/src/component/forms/Numero.vue +0 -153
  96. package/src/component/forms/Opcoes.vue +0 -51
  97. package/src/component/forms/Senha.vue +0 -139
  98. package/src/component/forms/Texto.vue +0 -161
  99. package/src/component/forms/TextoArea.vue +0 -126
  100. package/src/component/forms/TextoEditor.vue +0 -123
  101. package/src/component/layout/Painel.vue +0 -142
  102. package/src/component/shared/BotaoCarregarMais.vue +0 -23
  103. package/src/component/shared/CabecalhoImpressao.vue +0 -36
  104. package/src/component/shared/Confirmacao.vue +0 -80
  105. package/src/component/shared/Dica.vue +0 -42
  106. package/src/component/shared/EsconderMostrar.vue +0 -131
  107. package/src/component/shared/ExportarExcel.vue +0 -67
  108. package/src/component/shared/FiltroHorizontal.vue +0 -59
  109. package/src/component/shared/Mensagem.vue +0 -86
  110. package/src/component/shared/Progresso.vue +0 -21
  111. package/src/component/shared/SalvarCancelar.vue +0 -56
  112. package/src/component/shared/Tabela.vue +0 -275
  113. package/src/component/shared/TabelaBotao.vue +0 -36
  114. package/src/component/shared/query-builder/Campo.vue +0 -116
  115. package/src/component/shared/query-builder/ConverteParaOdata.js +0 -77
  116. package/src/component/shared/query-builder/components/CustomSelect.vue +0 -115
  117. package/src/component/shared/query-builder/components/QueryBuilderChildren.vue +0 -46
  118. package/src/component/shared/query-builder/components/QueryBuilderGroup.vue +0 -151
  119. package/src/component/shared/query-builder/components/QueryBuilderRule.vue +0 -81
  120. package/src/component/shared/query-builder/layouts/Bootstrap/BootstrapGroup.vue +0 -120
  121. package/src/component/shared/query-builder/layouts/Bootstrap/BootstrapRule.vue +0 -187
  122. package/src/component/shared/query-builder/main.js +0 -81
  123. package/src/component/template/ModeloAdicionarModificarView.vue +0 -32
  124. package/src/component/template/ModeloDocumentoView.vue +0 -227
  125. package/src/component/template/ModeloLista.vue +0 -231
  126. package/src/component/template/ModeloRelatorioListaView.vue +0 -227
  127. package/src/component/template/ModeloRelatorioView.vue +0 -489
  128. package/src/component/template/ModeloSubView.vue +0 -69
  129. package/src/component/template/ModeloView.vue +0 -49
  130. package/src/component/template/Relatorio.js +0 -10
  131. package/src/component/template/RelatorioAdicionarModificar.vue +0 -106
  132. package/src/store/modulos/generic.js +0 -494
  133. package/src/store/modulos/relatorio.js +0 -204
  134. package/src/store/modulos/usuario.js +0 -38
  135. package/src/store/modulos/validation.js +0 -39
@@ -1,81 +0,0 @@
1
- import Vue from 'vue'
2
- import VueQueryBuilder from '@nixweb/nixloc-ui/src/component/shared/QueryBuilder/VueQueryBuilder.vue'
3
-
4
- Vue.config.productionTip = false
5
-
6
- let rules = [
7
- {
8
- type: "text",
9
- id: "first-name",
10
- label: "First Name",
11
- },
12
- {
13
- type: "text",
14
- id: "last-name",
15
- label: "Last Name",
16
- },
17
- {
18
- type: "radio",
19
- id: "plan-type",
20
- label: "Plan Type",
21
- choices: [
22
- {label: "Standard", value: "standard"},
23
- {label: "Premium", value: "premium"}
24
- ]
25
- },
26
- {
27
- type: "checkbox",
28
- id: "sizes",
29
- label: "Sizes",
30
- choices: [
31
- {label: "Small", value: "small"},
32
- {label: "Medium", value: "medium"},
33
- {label: "Large", value: "large"}
34
- ]
35
- },
36
- {
37
- type: "text",
38
- id: "date",
39
- inputType:"date",
40
- label: "Date",
41
- operands: ['Start Date', 'End Date']
42
- },
43
- {
44
- type: "select",
45
- id: 'select',
46
- label: 'Color',
47
- operators: ['=', '<>'],
48
- choices: [
49
- {label: "red", value: 'Red'},
50
- {label: "orange", value: 'Orange'},
51
- {label: "yellow", value: 'Yellow'},
52
- {label: "green", value: 'Green'},
53
- {label: "blue", value: 'Blue'},
54
- {label: "indigo", value: 'Indigo'},
55
- {label: "violet", value: 'Violet'},
56
- ]
57
- },
58
- ];
59
-
60
- new Vue({
61
- el: '#app',
62
-
63
- components: { VueQueryBuilder },
64
-
65
- data: {
66
- rules: rules,
67
- output: {},
68
- },
69
-
70
- computed: {
71
- outputFormatted: function() {
72
- return JSON.stringify(this.output, null, 2);
73
- }
74
- },
75
-
76
- methods: {
77
- updateQuery: function(value){
78
- this.output = value;
79
- }
80
- }
81
- });
@@ -1,32 +0,0 @@
1
- <template>
2
- <div>
3
- <Painel
4
- :modulo="painel.modulo"
5
- :titulo="painel.titulo"
6
- :mostrarFiltro="painel.mostrarFiltro"
7
- :mostrarPesquisa="painel.mostrarPesquisa"
8
- :mostrarBotoes="painel.mostrarBotoes"
9
- >
10
- <div slot="conteudo-botoes">
11
- <slot name="conteudo-botoes"></slot>
12
- </div>
13
- <div slot="conteudo-principal">
14
- <slot name="conteudo-principal"></slot>
15
- </div>
16
- </Painel>
17
- <SalvarCancelar :formNome="painel.formNome" />
18
- </div>
19
- </template>
20
-
21
- <script>
22
- import Painel from "@nixweb/nixloc-ui/src/component/layout/Painel";
23
- import SalvarCancelar from "@nixweb/nixloc-ui/src/component/shared/SalvarCancelar";
24
-
25
- export default {
26
- name: "ModeloAdicionarModificarView",
27
- components: { Painel, SalvarCancelar },
28
- props: {
29
- painel: Object,
30
- },
31
- };
32
- </script>
@@ -1,227 +0,0 @@
1
- <template>
2
- <div>
3
- <Painel
4
- :modulo="painel.modulo"
5
- :titulo="painel.titulo"
6
- :mostrarFiltro="painel.mostrarFiltro"
7
- :mostrarPesquisa="painel.mostrarPesquisa"
8
- :mostrarBotoes="painel.mostrarBotoes"
9
- >
10
- <div slot="conteudo-principal">
11
- <div>
12
- <div class="div-top">
13
- <Moldura>
14
- <b-row>
15
- <b-col sm="6">
16
- <div class="lado-a-lado">
17
- <Botao
18
- chave="salvarDocumento"
19
- tipo="sucesso"
20
- titulo="Salvar"
21
- classeIcone="fas fa-save"
22
- :desabilitado="salvarDesabilitado"
23
- tamanho="pequeno"
24
- :clique="salvarDocumento"
25
- />
26
- </div>
27
- <div class="lado-a-lado">
28
- <Botao
29
- v-if="id"
30
- chave="fazerCopia"
31
- tipo="sucesso"
32
- titulo="Fazer uma cópia"
33
- classeIcone="fas fa-clone"
34
- tamanho="pequeno"
35
- :clique="fazerCopia"
36
- />
37
- </div>
38
- </b-col>
39
- <b-col class="text-right" sm="6">
40
- <div class="lado-a-lado">
41
- <Botao
42
- chave="abrirLegenda"
43
- tipo="info"
44
- classeIcone="fas fa-book-reader"
45
- tamanho="pequeno"
46
- :clique="abrirLegenda"
47
- />
48
- </div>
49
- <div class="lado-a-lado">
50
- <Botao
51
- chave="abrirCodigo"
52
- tipo="info"
53
- classeIcone="far fa-code"
54
- tamanho="pequeno"
55
- :clique="abrirCodigo"
56
- />
57
- </div>
58
- <div class="lado-a-lado">
59
- <Botao
60
- chave="abrirVisualizar"
61
- tipo="info"
62
- titulo="Visualizar"
63
- classeIcone="far fa-eye"
64
- tamanho="pequeno"
65
- :clique="abrirVisualizar"
66
- />
67
- </div>
68
- </b-col>
69
- </b-row>
70
- </Moldura>
71
- </div>
72
- <Modal titulo="Salvar" :largura="500" v-show="mostrarModal('salvarDocumento')">
73
- <slot></slot>
74
- </Modal>
75
- <Modal titulo="Parâmetros" :largura="1100" v-if="mostrarModal('legenda')">
76
- <LegendaParametro v-if="modal.abrir" :legenda="legenda" />
77
- </Modal>
78
- <Modal titulo="Editor de Código" :largura="900" v-if="mostrarModal('codigo')">
79
- <CodigoEditor v-if="modal.abrir" />
80
- </Modal>
81
- <Modal titulo="Visualizar" :largura="1200" v-if="mostrarModal('visualizar')">
82
- <div v-if="modal.abrir">
83
- <b-row>
84
- <b-col class="text-center">
85
- <Botao
86
- v-print="'#printMe'"
87
- chave="imprimir"
88
- tipo="editar"
89
- titulo="Imprimir"
90
- classeIcone="fas fa-print"
91
- tamanho="pequeno"
92
- :clique="imprimir"
93
- />
94
- </b-col>
95
- </b-row>
96
- <br />
97
- <BarraRolagem :alturaMinima="500" :alturaMaxima="500">
98
- <div>
99
- <div class="a4">
100
- <div id="printMe">
101
- <DocumentoPreview :template="documentoPreview" :d="dados" />
102
- </div>
103
- </div>
104
- </div>
105
- </BarraRolagem>
106
- </div>
107
- </Modal>
108
- <div class="div-editor">
109
- <DocumentoEditor />
110
- </div>
111
- </div>
112
- </div>
113
- </Painel>
114
- </div>
115
- </template>
116
-
117
- <script>
118
- import Painel from "@nixweb/nixloc-ui/src/component/layout/Painel";
119
-
120
- import DocumentoEditor from "@nixweb/nixloc-ui/src/component/shared/DocumentoEditor.vue";
121
- import DocumentoPreview from "@nixweb/nixloc-ui/src/component/shared/DocumentoPreview.vue";
122
- import CodigoEditor from "@nixweb/nixloc-ui/src/component/shared/CodigoEditor.vue";
123
- import LegendaParametro from "@nixweb/nixloc-ui/src/component/shared/LegendaParametro.vue";
124
- import Moldura from "@nixweb/nixloc-ui/src/component/layout/Moldura";
125
- import Botao from "@nixweb/nixloc-ui/src/component/forms/Botao";
126
- import Modal from "@nixweb/nixloc-ui/src/component/forms/Modal";
127
- import BarraRolagem from "@nixweb/nixloc-ui/src/component/layout/BarraRolagem.vue";
128
-
129
- import print from "vue-print-nb";
130
-
131
- import { mapState, mapGetters, mapMutations } from "vuex";
132
-
133
- export default {
134
- name: "DocumentoAdicionarModificarView",
135
- directives: {
136
- print,
137
- },
138
- components: {
139
- Painel,
140
- DocumentoEditor,
141
- DocumentoPreview,
142
- CodigoEditor,
143
- LegendaParametro,
144
- Moldura,
145
- Botao,
146
- Modal,
147
- BarraRolagem,
148
- },
149
- props: {
150
- painel: Object,
151
- dados: Object,
152
- legenda: Array,
153
- },
154
- data() {
155
- return {
156
- id: this.$route.params.id,
157
- salvarDesabilitado: true,
158
- };
159
- },
160
- computed: {
161
- ...mapState("generic", ["modal", "documentoHtml"]),
162
- ...mapGetters("generic", ["mostrarModal", "evento", "documentoPreview"]),
163
- },
164
- methods: {
165
- ...mapMutations("generic", [
166
- "abrirModal",
167
- "fecharModal",
168
- "removeCarregando",
169
- "insereEvento",
170
- ]),
171
- salvarDocumento() {
172
- if (this.id) {
173
- this.insereEvento({ nome: "salvarDocumento" });
174
- } else {
175
- this.abrirModal("salvarDocumento");
176
- this.removeCarregando(["salvarDocumento"]);
177
- }
178
- },
179
- fazerCopia() {
180
- this.insereEvento({ nome: "fazerCopia" });
181
- },
182
- abrirLegenda() {
183
- this.abrirModal("legenda");
184
- this.removeCarregando(["abrirLegenda"]);
185
- },
186
- abrirCodigo() {
187
- this.abrirModal("codigo");
188
- this.removeCarregando(["abrirCodigo"]);
189
- },
190
- abrirVisualizar() {
191
- this.abrirModal("visualizar");
192
- this.removeCarregando(["abrirVisualizar"]);
193
- },
194
- imprimir() {
195
- this.removeCarregando(["imprimir"]);
196
- },
197
- },
198
- watch: {
199
- evento: {
200
- handler(evento) {
201
- if (evento.nome == "documentoEditorModificado") this.salvarDesabilitado = true;
202
- if (evento.nome == "documentoEditorFocus") this.salvarDesabilitado = false;
203
- },
204
- deep: true,
205
- },
206
- },
207
- };
208
- </script>
209
- <style scoped>
210
- .div-top {
211
- margin-top: 30px;
212
- }
213
- .div-editor {
214
- margin-top: 25px;
215
- }
216
- .a4 {
217
- max-width: 1140px;
218
- min-height: 21cm;
219
- padding: 20px;
220
- border: 1px hsl(0, 0%, 82.7%) solid;
221
- border-radius: var(--ck-border-radius);
222
- background: white;
223
- box-shadow: 0 0 5px hsl(0deg 0% 0% / 10%);
224
- margin: 0 auto;
225
- }
226
-
227
- </style>
@@ -1,231 +0,0 @@
1
- <template>
2
- <div>
3
- <div :class="{ 'g-div-moldura': mostrarMoldura }">
4
- <b-row>
5
- <b-col sm="12"
6
- ><div>
7
- <FiltroHorizontal v-if="mostrarFiltroHorizontal">
8
- <div slot="conteudo-filtro-horizontal">
9
- <slot name="conteudo-filtro-horizontal"></slot>
10
- </div>
11
- </FiltroHorizontal></div
12
- ></b-col>
13
- </b-row>
14
- <b-row>
15
- <b-col sm="6">
16
- <ResumoTabela :resumo="conteudo.resumo" />
17
- </b-col>
18
-
19
- <b-col sm="6">
20
- <Registro :totalRegistro="conteudo.totalRegistros" />
21
- </b-col>
22
- </b-row>
23
- <BarraFixa posicao="topo" v-show="selecionados.length > 0">
24
- <div>
25
- <Botao
26
- v-if="botaoExcluir"
27
- chave="remover"
28
- :titulo="`Remover ${selecionados.length}`"
29
- tipo="perigo"
30
- tamanho="pequeno"
31
- :clique="removerSelecionados"
32
- />
33
- <slot name="conteudo-botoes-tabela-cabecalho"></slot></div
34
- ></BarraFixa>
35
- <Tabela
36
- :cabecalhoTabela="modeloLista.cabecalhoTabela"
37
- :dados="conteudo.dados"
38
- :mostrarChecks="modeloLista.mostrarChecks"
39
- >
40
- <div slot="conteudo-botoes-tabela">
41
- <slot name="conteudo-botoes-tabela"></slot>
42
- </div>
43
- </Tabela>
44
- </div>
45
- <br />
46
- <Paginacao chave="modeloLista" :totalRegistros="conteudo.totalRegistros" />
47
- </div>
48
- </template>
49
-
50
- <script>
51
- import Paginacao from "../shared/Paginacao.vue";
52
- import Tabela from "../shared/Tabela.vue";
53
- import Botao from "../forms/Botao.vue";
54
- import BarraFixa from "../layout/BarraFixa.vue";
55
- import Registro from "../shared/Registro.vue";
56
- import ResumoTabela from "../shared/ResumoTabela.vue";
57
- import FiltroHorizontal from "../shared/FiltroHorizontal.vue";
58
-
59
- import { mapState, mapGetters, mapActions, mapMutations } from "vuex";
60
-
61
- export default {
62
- name: "ModeloLista",
63
- props: {
64
- modeloLista: Object,
65
- propsParam: Object,
66
- mostrarMoldura: {
67
- type: Boolean,
68
- default: true,
69
- },
70
- mostrarFiltroHorizontal: {
71
- type: Boolean,
72
- default: true,
73
- },
74
- botaoExcluir: {
75
- type: Boolean,
76
- default: true,
77
- },
78
- },
79
- components: {
80
- FiltroHorizontal,
81
- ResumoTabela,
82
- Registro,
83
- BarraFixa,
84
- Botao,
85
- Tabela,
86
- Paginacao,
87
- },
88
- data() {
89
- return {
90
- conteudo: {
91
- dados: [],
92
- totalRegistros: 0,
93
- },
94
- baseParams: {
95
- pesquisa: undefined,
96
- filtro: "contem",
97
- paginaAtual: 1,
98
- totalPorPagina: 10,
99
- },
100
- paramsFiltro: [],
101
- filtroDinamico: {},
102
- };
103
- },
104
- created() {
105
- // o carregamento inicial obterTodos() é feito pela mudança no paginacaoChave
106
- },
107
- mounted() {
108
- this.atualizaPaginacao({
109
- chave: "modeloLista",
110
- totalPorPagina: this.baseParams.totalPorPagina,
111
- });
112
- },
113
- beforeDestroy() {
114
- let pesquisa = { conteudo: "", filtro: { conteudo: "contem", id: "contem" } };
115
- this.atualizaCampoPesquisa(pesquisa);
116
- },
117
- computed: {
118
- ...mapState("generic", [
119
- "selecionados",
120
- "metodoExecutadoApi",
121
- "pesquisa",
122
- "buscouPesquisa",
123
- "limpouPesquisa",
124
- "totalPorPagina",
125
- "EscolherEstatico",
126
- ]),
127
- ...mapGetters("generic", ["paginacao"]),
128
- paginacaoChave: function () {
129
- return this.paginacao("modeloLista");
130
- },
131
- },
132
- methods: {
133
- ...mapActions("generic", ["getApi", "deleteAllApi"]),
134
- ...mapMutations("generic", [
135
- "removeCarregando",
136
- "adicionaSelecao",
137
- "atualizaPaginacao",
138
- "atualizaCampoPesquisa",
139
- ]),
140
- obterTodos() {
141
- let obj = { ...this.baseParams, ...this.filtroDinamico, ...this.propsParam };
142
- let params = { url: this.modeloLista.urlGetApi, obj: obj };
143
- this.getApi(params).then((response) => {
144
- this.conteudo = response.conteudo;
145
- this.removeCarregando(["painel", "modeloSubView", "pesquisar", "limpar"]);
146
- });
147
- },
148
- removerSelecionados() {
149
- let params = {
150
- url: this.modeloLista.urlRemoverTodosApi,
151
- selecionados: this.selecionados,
152
- };
153
- this.deleteAllApi(params).then(() => {
154
- this.removeCarregando(["remover"]);
155
- this.adicionaSelecao([]);
156
- });
157
- },
158
- limpaParams() {
159
- this.baseParams.paginaAtual = 1;
160
- },
161
- },
162
- watch: {
163
- metodoExecutadoApi: function (value) {
164
- if (
165
- value === "postApi" ||
166
- value === "putApi" ||
167
- value === "deleteAllApi" ||
168
- value === "deleteAllApiErro"
169
- ) {
170
- this.obterTodos();
171
- }
172
- },
173
- buscouPesquisa: function () {
174
- this.baseParams.pesquisa = this.pesquisa.conteudo;
175
- this.baseParams.filtro = this.pesquisa.filtro.id;
176
- this.limpaParams();
177
- this.obterTodos();
178
- },
179
- limpouPesquisa: function () {
180
- this.baseParams.pesquisa = "";
181
- this.baseParams.filtro = "";
182
- this.limpaParams();
183
- this.obterTodos();
184
- },
185
- paginacaoChave: {
186
- handler(value) {
187
- this.limpaParams();
188
- this.baseParams.paginaAtual = value.paginaAtual;
189
- this.obterTodos();
190
- },
191
- deep: true,
192
- },
193
- EscolherEstatico: {
194
- handler(value) {
195
- let campoAlvo = value.campoAlvo;
196
- let obj = { chave: campoAlvo, valor: value.valor };
197
- this.paramsFiltro.push(obj);
198
-
199
- var result = {};
200
- for (var i = 0; i < this.paramsFiltro.length; i++) {
201
- let chave = this.paramsFiltro[i].chave;
202
- let valor = this.paramsFiltro[i].valor;
203
-
204
- if (chave == "periodo") {
205
- result["inicio"] = valor.inicio;
206
- result["fim"] = valor.fim;
207
- } else {
208
- result[chave] = valor;
209
- }
210
- }
211
-
212
- this.filtroDinamico = result;
213
-
214
- this.atualizaPaginacao({
215
- chave: "modeloLista",
216
- totalPorPagina: this.filtroDinamico.totalPorPagina,
217
- });
218
-
219
- this.obterTodos();
220
- },
221
- deep: true,
222
- },
223
- },
224
- };
225
- </script>
226
-
227
- <style scoped>
228
- .div-botao-excluir {
229
- padding-bottom: 10px;
230
- }
231
- </style>