@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,137 +0,0 @@
1
- <template>
2
- <div class="form-group">
3
- <label>
4
- <span class="titulo">{{ titulo }}</span>
5
- <span class="requerido" v-if="requerido">*</span>
6
- <Dica :campo="campo" :formNome="formNome" />
7
- </label>
8
- <div class="inner-addon right-addon">
9
- <i
10
- v-if="notificacoes.length > 0 && formSujo"
11
- class="requerido glyphicon fas fa-exclamation-triangle"
12
- ></i>
13
- <vue-numeric
14
- class="form-control"
15
- v-on:keyup.enter.native="apertouEnter"
16
- :class="{ 'is-invalid': notificacoes.length > 0 && formSujo }"
17
- :placeholder="placeholder"
18
- :disabled="desabilitado"
19
- currency="R$"
20
- separator="."
21
- v-bind:precision="2"
22
- v-model="valor"
23
- ></vue-numeric>
24
- </div>
25
-
26
- <div v-if="formSujo">
27
- <div v-for="mensagem in notificacoes" :key="mensagem">
28
- <span class="invalido">{{ mensagem }}</span>
29
- </div>
30
- </div>
31
- </div>
32
- </template>
33
-
34
- <script>
35
- import Dica from "../shared/Dica.vue";
36
- import VueNumeric from "vue-numeric";
37
-
38
- import { mapState, mapMutations } from "vuex";
39
-
40
- export default {
41
- name: "Numero",
42
- mixins: [],
43
- props: {
44
- titulo: String,
45
- campo: String,
46
- desabilitado: Boolean,
47
- placeholder: String,
48
- formNome: String,
49
- requerido: Boolean,
50
- value: Number,
51
- enter: Function,
52
- },
53
- components: {
54
- VueNumeric,
55
- Dica,
56
- },
57
- data() {
58
- return {
59
- notificacoes: [],
60
- formSujo: false,
61
- valor: 0,
62
- };
63
- },
64
- created() {
65
- // não carregar as validações iniciais para number
66
- this.valor = this.value;
67
- },
68
- methods: {
69
- ...mapMutations("validation", [
70
- "insereValidacao",
71
- "removeValidacao",
72
- "insereFormSujo",
73
- ]),
74
- valida() {
75
- this.notificacoes = [];
76
- if (this.value == 0) return;
77
- if (this.requerido && !this.value) {
78
- var mensagem = `${this.titulo} não pode ser vazio!`;
79
- this.notificacoes.push(mensagem);
80
- }
81
- },
82
- apertouEnter() {
83
- if (this.enter) this.enter();
84
- },
85
- },
86
- computed: {
87
- ...mapState("validation", ["reiniciaForm"]),
88
- },
89
- watch: {
90
- value() {
91
- this.valor = this.value;
92
- },
93
- valor() {
94
- this.valida();
95
- this.formSujo = true;
96
- this.insereFormSujo(true);
97
- this.$emit("input", this.valor);
98
- },
99
- notificacoes() {
100
- let self = this;
101
- this.notificacoes.forEach(function (notificacao) {
102
- let obj = {
103
- chave: self.campo + "&" + self.formNome,
104
- formNome: self.formNome,
105
- notificacao: notificacao,
106
- };
107
- self.insereValidacao(obj);
108
- });
109
-
110
- if (this.notificacoes.length == 0) {
111
- let obj = {
112
- chave: self.campo + "&" + self.formNome,
113
- formNome: self.formNome,
114
- };
115
- self.removeValidacao(obj);
116
- }
117
- },
118
- reiniciaForm: {
119
- handler(form) {
120
- if (form.nome == this.formNome) this.formSujo = false;
121
- },
122
- deep: true,
123
- },
124
- },
125
- };
126
- </script>
127
-
128
- <style scoped>
129
- .sucesso {
130
- color: #94aa2a;
131
- font-size: 14px;
132
- }
133
- .invalido {
134
- color: #f0134d;
135
- font-size: 14px;
136
- }
137
- </style>
@@ -1,335 +0,0 @@
1
- <template>
2
- <div>
3
- <label>
4
- <span class="titulo">{{ titulo }}</span>
5
- <span class="requerido" v-if="requerido">*</span>
6
- <Dica :campo="campo" :formNome="formNome" />
7
- </label>
8
- <div
9
- class="selecione"
10
- :class="{
11
- 'selecione-invalido': notificacoes.length > 0 && formSujo,
12
- borda: mostrarBorda,
13
- }"
14
- >
15
- <multiselect
16
- @open="aoAbrir"
17
- @select="aoSelecionar"
18
- @search-change="aoPesquisar"
19
- :options="dados"
20
- v-model.trim="valorAtual"
21
- :custom-label="rotulo"
22
- placeholder
23
- :disabled="desabilitado"
24
- :showLabels="true"
25
- :noResult="false"
26
- :maxHeight="250"
27
- ref="multiselect"
28
- selectLabel
29
- deselectLabel
30
- selectedLabel
31
- >
32
- <div slot="beforeList">
33
- <vue-loading
34
- v-if="carregando"
35
- type="bubbles"
36
- color="#577696"
37
- :size="{ width: '40px', height: '40px' }"
38
- ></vue-loading>
39
- <div class="antes-lista" v-if="!carregando">
40
- <Botao
41
- v-if="formNomeCadastrarNovo"
42
- chave="novoCadastroEscolher"
43
- tipo="primario"
44
- titulo="Novo"
45
- tamanho="pequeno"
46
- :clique="novoCadastroEscolher"
47
- />
48
- <Botao
49
- chave="limpaEscolher"
50
- tipo="alerta"
51
- classeIcone="fas fa-broom"
52
- tamanho="pequeno"
53
- :clique="limpaEscolher"
54
- />
55
- </div>
56
- </div>
57
- <div slot="afterList" v-if="totalRegistros > 20 && dados.length < totalRegistros">
58
- <div class="depois-lista text-center">
59
- <Botao
60
- chave="carregarMaisSelecione"
61
- tipo="info"
62
- titulo="Carregar mais..."
63
- classeIcone="fas fa-redo-alt"
64
- tamanho="pequeno"
65
- :clique="carregarMais"
66
- />
67
- </div>
68
- </div>
69
- <div slot="noOptions">Lista está vazia</div>
70
- <div slot="noResult">Nenhum registro encontrado</div>
71
- </multiselect>
72
- <div v-if="formSujo">
73
- <div v-for="mensagem in notificacoes" :key="mensagem">
74
- <span class="invalido">{{ mensagem }}</span>
75
- </div>
76
- </div>
77
- </div>
78
-
79
- <vodal
80
- v-if="formNomeCadastrarNovo"
81
- :show="mostrarVodal(formNomeCadastrarNovo)"
82
- @hide="escondeVodal()"
83
- :width="cadastrarNovoLargura"
84
- :height="cadastrarNovoAltura"
85
- :closeOnEsc="true"
86
- :closeButton="true"
87
- >
88
- <Mensagem v-if="vodal.abrir" />
89
- <div class="cadastrar-novo-titulo">{{ cadastrarNovoTitulo }}</div>
90
- <hr />
91
- <slot></slot>
92
- </vodal>
93
- </div>
94
- </template>
95
- <script>
96
- import Dica from "../shared/Dica.vue";
97
- import Mensagem from "../shared/Mensagem.vue";
98
- import Multiselect from "vue-multiselect";
99
-
100
- import Botao from "./Botao.vue";
101
- import Vodal from "vodal";
102
-
103
- import { mapState, mapActions, mapMutations, mapGetters } from "vuex";
104
-
105
- export default {
106
- name: "Escolher",
107
- props: {
108
- titulo: String,
109
- campo: String,
110
- formNome: String,
111
- requerido: Boolean,
112
- url: String,
113
- desabilitado: Boolean,
114
- campoAlvo: String,
115
- propsParams: Object,
116
- value: Object,
117
- alterou: Function,
118
- formNomeCadastrarNovo: String,
119
- cadastrarNovoTitulo: String,
120
- cadastrarNovoLargura: Number,
121
- cadastrarNovoAltura: Number,
122
- marcarFormSujo: {
123
- type: Boolean,
124
- default: true,
125
- },
126
- mostrarBorda: {
127
- type: Boolean,
128
- default: true,
129
- },
130
- },
131
- components: {
132
- Multiselect,
133
- Botao,
134
- Vodal,
135
- Mensagem,
136
- Dica,
137
- },
138
- data() {
139
- return {
140
- valorAtual: {},
141
- dados: [],
142
- totalRegistros: 0,
143
- baseParams: {
144
- pesquisa: "",
145
- paginaAtual: 1,
146
- totalPorPagina: 20,
147
- },
148
-
149
- cadastrarNovo: false,
150
- carregando: true,
151
- notificacoes: [],
152
- formSujo: false,
153
- };
154
- },
155
- created() {
156
- this.valida();
157
- },
158
- mounted() {
159
- let el = this.$el.getElementsByClassName("multiselect")[0];
160
- if (el) {
161
- el.tabIndex = 0;
162
- }
163
- },
164
- computed: {
165
- ...mapState("validation", ["reiniciaForm", "vodal"]),
166
- ...mapState("generic", ["vodal"]),
167
- ...mapGetters("generic", ["mostrarVodal"]),
168
- },
169
- methods: {
170
- ...mapActions("generic", ["getApi"]),
171
- ...mapMutations("generic", [
172
- "removeCarregando",
173
- "abrirVodal",
174
- "fecharVodal",
175
- "removeNotificacao",
176
- "insereFiltro",
177
- ]),
178
- ...mapMutations("validation", [
179
- "insereValidacao",
180
- "removeValidacao",
181
- "reiniciaValidacao",
182
- "insereFormSujo",
183
- ]),
184
- aoAbrir() {
185
- this.obterTodos();
186
- },
187
- aoSelecionar(value) {
188
- this.$emit("input", value);
189
- if (this.alterou) this.alterou();
190
- if (this.campoAlvo) {
191
- let obj = { campoAlvo: this.campoAlvo, valor: value.id };
192
- this.insereFiltro(obj);
193
- }
194
- },
195
- aoPesquisar(value) {
196
- this.baseParams.pesquisa = value;
197
- this.obterTodos();
198
- },
199
- rotulo(value) {
200
- if (value.conteudo) return `${value.conteudo}`;
201
- },
202
- obterTodos() {
203
- let obj = { ...this.baseParams, ...this.propsParams };
204
- let params = { url: this.url, obj: obj };
205
- this.carregando = true;
206
- this.getApi(params).then((response) => {
207
- this.totalRegistros = response.conteudo.totalRegistros;
208
- let self = this;
209
- if (this.baseParams.paginaAtual == 1) {
210
- this.dados = [];
211
- }
212
- response.conteudo.dados.map(function (value, key) {
213
- self.dados.push(value);
214
- });
215
- this.carregando = false;
216
- this.removeCarregando(["carregarMaisSelecione"]);
217
- });
218
- },
219
- novoCadastroEscolher() {
220
- this.abrirVodal(this.formNomeCadastrarNovo);
221
- this.reiniciaValidacao(this.formNomeCadastrarNovo);
222
- this.removeNotificacao();
223
- this.$refs.multiselect.deactivate();
224
- this.removeCarregando(["novoCadastroEscolher"]);
225
- },
226
- escondeVodal() {
227
- this.fecharVodal();
228
- },
229
- limpaEscolher() {
230
- let objLimpo = { id: "", conteudo: "" };
231
- this.valorAtual = objLimpo;
232
- this.$emit("input", objLimpo);
233
- this.$refs.multiselect.deactivate();
234
- this.removeCarregando(["limpaEscolher"]);
235
-
236
- if (this.campoAlvo) {
237
- let obj = { campoAlvo: this.campoAlvo, valor: "" };
238
- this.insereFiltro(obj);
239
- }
240
- },
241
- carregarMais() {
242
- this.baseParams.paginaAtual++;
243
- this.obterTodos();
244
- },
245
- valida() {
246
- this.notificacoes = [];
247
- if (this.requerido && !this.value.id) {
248
- var mensagem = `${this.titulo} não pode ser vazio!`;
249
- this.notificacoes.push(mensagem);
250
- }
251
- },
252
- },
253
- watch: {
254
- "value.id": function () {
255
- this.valida();
256
- this.formSujo = true;
257
- if (this.marcarFormSujo) this.insereFormSujo(true);
258
- this.valorAtual = { id: this.value.id, conteudo: this.value.conteudo };
259
- },
260
- notificacoes() {
261
- let self = this;
262
- this.notificacoes.forEach(function (notificacao) {
263
- let obj = {
264
- chave: self.campo + "&" + self.formNome,
265
- formNome: self.formNome,
266
- notificacao: notificacao,
267
- };
268
- self.insereValidacao(obj);
269
- });
270
-
271
- if (this.notificacoes.length == 0) {
272
- let obj = {
273
- chave: self.campo + "&" + self.formNome,
274
- formNome: self.formNome,
275
- };
276
- self.removeValidacao(obj);
277
- }
278
- },
279
- reiniciaForm: {
280
- handler(form) {
281
- if (form.nome == this.formNome) {
282
- let objLimpo = { id: "", conteudo: "" };
283
- this.valorAtual = objLimpo;
284
- this.$emit("input", objLimpo);
285
- this.formSujo = false;
286
- }
287
- },
288
- deep: true,
289
- },
290
- "vodal.abrir": function (value) {
291
- if (!value) this.cadastrarNovo = false;
292
- },
293
- },
294
- };
295
- </script>
296
-
297
- <style scoped>
298
- div.antes-lista {
299
- padding: 8px;
300
- }
301
-
302
- div.depois-lista {
303
- padding: 8px;
304
- }
305
-
306
- .invalido {
307
- color: #f0134d;
308
- font-size: 14px;
309
- }
310
-
311
- .selecione {
312
- height: 36px;
313
- border-bottom: 1px solid #d6dadf;
314
- border-radius: 0px !important;
315
- }
316
-
317
- .selecione-invalido {
318
- border-bottom: 1px solid #ff5454;
319
- }
320
-
321
- .selecione-valido {
322
- border-bottom: 1px solid #94aa2a;
323
- }
324
-
325
- .cadastrar-novo-titulo {
326
- font-size: 18px;
327
- margin-bottom: 5px;
328
- }
329
-
330
- .borda {
331
- border: 1px solid #dbdee0 !important;
332
- border-radius: 5px !important;
333
- height: 38px !important;
334
- }
335
- </style>
@@ -1,139 +0,0 @@
1
- <template>
2
- <div>
3
- <label>
4
- <span class="titulo">{{ titulo }}</span>
5
- </label>
6
- <div class="selecione" :class="{ borda: mostrarBorda }">
7
- <multiselect
8
- @open="aoAbrir"
9
- @select="aoSelecionar"
10
- @search-change="aoPesquisar"
11
- :options="dados"
12
- v-model.trim="valorAtual"
13
- :custom-label="rotulo"
14
- :disabled="desabilitado"
15
- placeholder
16
- :showLabels="true"
17
- :noResult="false"
18
- ref="multiselect"
19
- selectLabel
20
- deselectLabel
21
- selectedLabel
22
- >
23
- <div slot="beforeList">
24
- <div class="antes-lista">
25
- <!-- <b-button
26
- size="sm"
27
- variant="outline-danger"
28
- @click="limpaEscolherEstatico"
29
- v-tooltip.top-center="'Limpar'"
30
- >
31
- <font-awesome-icon icon="broom" />
32
- </b-button> -->
33
- <!-- <Botao
34
- chave="limpaEscolherEstatico"
35
- tipo="alerta"
36
- classeIcone="fas fa-broom"
37
- tamanho="pequeno"
38
- :clique="limpaEscolherEstatico"
39
- />-->
40
- </div>
41
- </div>
42
- </multiselect>
43
- </div>
44
- </div>
45
- </template>
46
- <script>
47
- import Multiselect from "vue-multiselect";
48
- import Botao from "./Botao";
49
-
50
- import { mapMutations } from "vuex";
51
-
52
- export default {
53
- name: "EscolherEstatico",
54
- props: {
55
- titulo: String,
56
- formNome: String,
57
- campoAlvo: String,
58
- valorInicial: Object,
59
- desabilitado: {
60
- type: Boolean,
61
- default: false,
62
- },
63
- somenteConsulta: {
64
- type: Boolean,
65
- default: false,
66
- },
67
- mostrarBorda: {
68
- type: Boolean,
69
- default: true,
70
- },
71
- dados: Array,
72
- value: Object,
73
- },
74
- components: {
75
- Multiselect,
76
- Botao,
77
- },
78
- data() {
79
- return {
80
- valorAtual: this.valorInicial,
81
- };
82
- },
83
- mounted() {
84
- let el = this.$el.getElementsByClassName("multiselect")[0];
85
- if (el) {
86
- el.tabIndex = 0;
87
- }
88
- },
89
- methods: {
90
- ...mapMutations("generic", ["insereFiltro", "removeCarregando"]),
91
- aoAbrir() {},
92
- aoSelecionar(value) {
93
- this.$emit("input", value);
94
- let obj = { campoAlvo: this.campoAlvo, valor: value.id };
95
- if (!this.somenteConsulta) this.insereFiltro(obj);
96
- },
97
- aoPesquisar(value) {},
98
- rotulo(value) {
99
- return `${value.conteudo}`;
100
- },
101
- limpaEscolherEstatico() {
102
- let objLimpo = { conteudo: "", id: "" };
103
- this.valorAtual = objLimpo;
104
- this.$emit("input", objLimpo);
105
- this.$refs.multiselect.deactivate();
106
- this.removeCarregando(["limpaEscolherEstatico"]);
107
-
108
- if (this.campoAlvo) {
109
- let obj = { campoAlvo: this.campoAlvo, valor: "" };
110
- this.insereFiltro(obj);
111
- }
112
- },
113
- },
114
- watch: {
115
- "value.id": function () {
116
- this.valorAtual = { id: this.value.id, conteudo: this.value.conteudo };
117
- },
118
- "valorInicial.id": function () {
119
- this.valorAtual = { id: this.value.id, conteudo: this.value.conteudo };
120
- },
121
- },
122
- };
123
- </script>
124
-
125
- <style scoped>
126
- div.antes-lista {
127
- padding: 8px;
128
- }
129
-
130
- .selecione {
131
- height: 38px;
132
- border-radius: 5px !important;
133
- margin-bottom: 20px;
134
- }
135
-
136
- .borda {
137
- border: 1px solid #dbdee0 !important;
138
- }
139
- </style>