@nixweb/nixloc-ui 0.0.119 → 0.0.122
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/src/component/template/ModeloRelatorioView.drawio +160 -0
- package/docs/src/store/modulos/relatorio.drawio +37 -0
- package/package.json +77 -75
- package/public/index.html +2 -4
- package/public/styles/app.css +1 -2
- package/src/component/forms/{Botao.vue → Button.vue} +53 -57
- package/src/component/forms/CheckboxGroup.vue +63 -0
- package/src/component/forms/{CheckboxUnico.vue → CheckboxSimple.vue} +6 -6
- package/src/component/forms/{Cor.vue → Color.vue} +9 -9
- package/src/component/forms/DateTime.vue +53 -53
- package/src/component/forms/{BotaoDropdown.vue → Dropdown.vue} +50 -50
- package/src/component/forms/EditorHtml.vue +123 -0
- package/src/component/forms/FileUpload.vue +189 -0
- package/src/component/forms/InputDecimal.vue +137 -0
- package/src/component/forms/InputNumber.vue +149 -0
- package/src/component/forms/InputPassword.vue +135 -0
- package/src/component/forms/InputText.vue +157 -0
- package/src/component/forms/Modal.vue +15 -15
- package/src/component/forms/RadioGroup.vue +50 -0
- package/src/component/forms/Select.vue +337 -0
- package/src/component/forms/SelectStatic.vue +120 -0
- package/src/component/forms/TextArea.vue +126 -0
- package/src/component/forms/Toggle.vue +13 -13
- package/src/component/layout/{Conta.vue → Account.vue} +28 -28
- package/src/component/layout/{Alerta.vue → Alert.vue} +22 -22
- package/src/component/layout/Badge.vue +23 -23
- package/src/component/layout/{BarraFixa.vue → FixedBar.vue} +16 -16
- package/src/component/layout/{CarregandoTelaInteira.vue → LoadingFullPage.vue} +3 -3
- package/src/component/layout/Menu.vue +66 -66
- package/src/component/layout/{Moldura.vue → Molded.vue} +4 -4
- package/src/component/layout/Panel.vue +142 -0
- package/src/component/layout/Popover.vue +1 -1
- package/src/component/layout/{BarraRolagem.vue → Scrollbar.vue} +9 -11
- package/src/component/layout/Tag.vue +9 -9
- package/src/component/layout/Topo.vue +1 -1
- package/src/component/layout/Wizard.vue +3 -3
- package/src/component/shared/BotaoCarregarMais.vue +9 -9
- package/src/component/shared/BotaoConsulta.vue +9 -9
- package/src/component/shared/CabecalhoImpressao.vue +6 -6
- package/src/component/shared/CodigoEditor.vue +16 -16
- package/src/component/shared/Confirmacao.vue +28 -28
- package/src/component/shared/Dica.vue +10 -10
- package/src/component/shared/DocumentoEditor.vue +3 -3
- package/src/component/shared/DocumentoPreview.vue +2 -2
- package/src/component/shared/EsconderMostrar.vue +26 -26
- package/src/component/shared/ExportarExcel.vue +14 -14
- package/src/component/shared/ExportarPDF.vue +10 -10
- package/src/component/shared/FiltroHorizontal.vue +19 -19
- package/src/component/shared/LegendaParametro.vue +17 -17
- package/src/component/shared/{Carregando.vue → Loading.vue} +11 -11
- package/src/component/shared/Messages.vue +83 -0
- package/src/component/shared/Paginacao.vue +10 -10
- package/src/component/shared/Progresso.vue +2 -2
- package/src/component/shared/Registro.vue +2 -2
- package/src/component/shared/ResumoTabela.vue +6 -6
- package/src/component/shared/SalvarCancelar.vue +26 -26
- package/src/component/shared/{Pesquisa.vue → Search.vue} +36 -36
- package/src/component/shared/Tabela.vue +49 -49
- package/src/component/shared/TabelaBotao.vue +13 -13
- package/src/component/shared/Toast.vue +7 -7
- package/src/component/shared/{FiltroVertical.vue → VerticalFilter.vue} +14 -14
- package/src/component/shared/construtor-consulta/AdicionaFiltro.vue +191 -0
- package/src/component/shared/construtor-consulta/Campo.vue +127 -0
- package/src/component/shared/construtor-consulta/ComponenteDinamico.vue +109 -0
- package/src/component/shared/construtor-consulta/ConstrutorConsulta.vue +70 -0
- package/src/component/shared/construtor-consulta/ConverteParaOdata.js +80 -0
- package/src/component/shared/construtor-consulta/EscolherFiltro.vue +96 -0
- package/src/component/shared/{query-builder → construtor-consulta}/Filtro.vue +11 -16
- package/src/component/shared/construtor-consulta/ListaComponenteDinamico.vue +41 -0
- package/src/component/shared/{query-builder → construtor-consulta}/Rodape.vue +9 -9
- package/src/component/shared/{query-builder → construtor-consulta}/Tags.vue +7 -7
- package/src/component/shared/{query-builder → construtor-consulta}/utilities.js +0 -0
- package/src/component/template/ModeloAdicionarModificarView.vue +11 -11
- package/src/component/template/ModeloDocumentoView.vue +79 -79
- package/src/component/template/ModeloLista.vue +66 -66
- package/src/component/template/ModeloRelatorioListaView.vue +71 -68
- package/src/component/template/ModeloRelatorioView.vue +218 -200
- package/src/component/template/ModeloSubView.vue +13 -13
- package/src/component/template/ModeloView.vue +17 -17
- package/src/component/template/Relatorio.js +1 -5
- package/src/component/template/RelatorioAdicionarModificar.vue +44 -44
- package/src/component/value-objects/DadosContato.vue +27 -27
- package/src/component/value-objects/DadosPessoa.js +1 -1
- package/src/component/value-objects/DadosPessoa.vue +52 -52
- package/src/component/value-objects/Endereco.js +1 -1
- package/src/component/value-objects/Endereco.vue +83 -83
- package/src/config/dicas.js +1 -1
- package/src/config/token.js +2 -2
- package/src/store/modules/generic.js +489 -0
- package/src/store/modules/report.js +246 -0
- package/src/store/modules/user.js +38 -0
- package/src/store/modules/validation.js +39 -0
- package/src/store/store.js +4 -4
- package/public/js/menu.js +0 -11
- package/public/styles/menu.css +0 -1399
- package/src/component/forms/ArquivoUpload.vue +0 -199
- package/src/component/forms/CheckboxMultiplo.vue +0 -63
- package/src/component/forms/Decimal.vue +0 -137
- package/src/component/forms/Escolher.vue +0 -324
- package/src/component/forms/EscolherEstatico.vue +0 -139
- package/src/component/forms/Numero.vue +0 -153
- package/src/component/forms/Opcoes.vue +0 -51
- package/src/component/forms/Senha.vue +0 -139
- package/src/component/forms/Texto.vue +0 -161
- package/src/component/forms/TextoArea.vue +0 -126
- package/src/component/forms/TextoEditor.vue +0 -123
- package/src/component/layout/Painel.vue +0 -142
- package/src/component/shared/Mensagem.vue +0 -86
- package/src/component/shared/query-builder/Campo.vue +0 -116
- package/src/component/shared/query-builder/ConverteParaOdata.js +0 -73
- package/src/component/shared/query-builder/QueryBuilder.vue +0 -164
- package/src/component/shared/query-builder/components/CustomSelect.vue +0 -115
- package/src/component/shared/query-builder/components/QueryBuilderChildren.vue +0 -46
- package/src/component/shared/query-builder/components/QueryBuilderGroup.vue +0 -151
- package/src/component/shared/query-builder/components/QueryBuilderRule.vue +0 -81
- package/src/component/shared/query-builder/layouts/Bootstrap/BootstrapGroup.vue +0 -120
- package/src/component/shared/query-builder/layouts/Bootstrap/BootstrapRule.vue +0 -171
- package/src/component/shared/query-builder/main.js +0 -81
- package/src/store/modulos/generic.js +0 -494
- package/src/store/modulos/relatorio.js +0 -201
- package/src/store/modulos/usuario.js +0 -38
- package/src/store/modulos/validation.js +0 -39
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<div>
|
|
4
|
-
<div class="arquivo" v-if="!value">
|
|
5
|
-
<button class="botao pequeno primario">
|
|
6
|
-
<span v-if="!carregandoAdicionar">
|
|
7
|
-
<i class="fas fa-cloud-upload-alt"></i> {{ titulo }}</span
|
|
8
|
-
>
|
|
9
|
-
<vue-loading
|
|
10
|
-
v-if="carregandoAdicionar"
|
|
11
|
-
type="bubbles"
|
|
12
|
-
color="#fff"
|
|
13
|
-
:size="{ width: '20px', height: '20px' }"
|
|
14
|
-
></vue-loading>
|
|
15
|
-
</button>
|
|
16
|
-
<input
|
|
17
|
-
type="file"
|
|
18
|
-
name="myfile"
|
|
19
|
-
ref="arquivo"
|
|
20
|
-
:accept="aceitos"
|
|
21
|
-
v-on:change="carregar()"
|
|
22
|
-
/>
|
|
23
|
-
</div>
|
|
24
|
-
<div v-if="value">
|
|
25
|
-
<button
|
|
26
|
-
class="botao pequeno sucesso"
|
|
27
|
-
@click="baixar()"
|
|
28
|
-
v-if="!carregandoAdicionar"
|
|
29
|
-
>
|
|
30
|
-
<i class="fas fa-cloud-download-alt"></i> Baixar
|
|
31
|
-
</button>
|
|
32
|
-
<button
|
|
33
|
-
class="botao pequeno perigo"
|
|
34
|
-
v-if="!carregandoAdicionar"
|
|
35
|
-
@click="remover()"
|
|
36
|
-
>
|
|
37
|
-
<span v-if="!carregandoRemover">Remover</span>
|
|
38
|
-
<vue-loading
|
|
39
|
-
v-if="carregandoRemover"
|
|
40
|
-
type="bubbles"
|
|
41
|
-
color="#fff"
|
|
42
|
-
:size="{ width: '20px', height: '20px' }"
|
|
43
|
-
></vue-loading>
|
|
44
|
-
</button>
|
|
45
|
-
</div>
|
|
46
|
-
<div class="div-alerta">
|
|
47
|
-
<Alerta tipo="info" v-if="value">
|
|
48
|
-
<span>{{ mensagem }}</span>
|
|
49
|
-
</Alerta>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
53
|
-
</template>
|
|
54
|
-
|
|
55
|
-
<script>
|
|
56
|
-
import Alerta from "../layout/Alerta.vue";
|
|
57
|
-
|
|
58
|
-
import { mapActions } from "vuex";
|
|
59
|
-
|
|
60
|
-
export default {
|
|
61
|
-
name: "ArquivoUpload",
|
|
62
|
-
components: { Alerta },
|
|
63
|
-
props: {
|
|
64
|
-
titulo: String,
|
|
65
|
-
nome: String,
|
|
66
|
-
container: String,
|
|
67
|
-
aceitos: String,
|
|
68
|
-
mensagem: String,
|
|
69
|
-
urlAdicionar: String,
|
|
70
|
-
urlRemover: String,
|
|
71
|
-
nomeBancoDados: String,
|
|
72
|
-
aoCarregar: Function,
|
|
73
|
-
value: String,
|
|
74
|
-
},
|
|
75
|
-
data() {
|
|
76
|
-
return {
|
|
77
|
-
arquivo: "",
|
|
78
|
-
carregandoAdicionar: false,
|
|
79
|
-
carregandoRemover: false,
|
|
80
|
-
urlAzure: "https://espaco.blob.core.windows.net",
|
|
81
|
-
};
|
|
82
|
-
},
|
|
83
|
-
methods: {
|
|
84
|
-
...mapActions("generic", ["postFileApi", "deleteFileApi"]),
|
|
85
|
-
carregar() {
|
|
86
|
-
this.arquivo = this.$refs.arquivo.files[0];
|
|
87
|
-
let params = {
|
|
88
|
-
url: this.urlAdicionar,
|
|
89
|
-
arquivo: this.arquivo,
|
|
90
|
-
container: this.container,
|
|
91
|
-
nome: this.nome,
|
|
92
|
-
aceitos: this.aceitos,
|
|
93
|
-
};
|
|
94
|
-
this.carregandoAdicionar = true;
|
|
95
|
-
this.postFileApi(params).then((response) => {
|
|
96
|
-
if (response.sucesso) {
|
|
97
|
-
if (this.aoCarregar) this.aoCarregar();
|
|
98
|
-
this.$emit("input", response.conteudo);
|
|
99
|
-
} else {
|
|
100
|
-
this.limpar();
|
|
101
|
-
}
|
|
102
|
-
this.carregandoAdicionar = false;
|
|
103
|
-
});
|
|
104
|
-
},
|
|
105
|
-
remover() {
|
|
106
|
-
let props = {
|
|
107
|
-
url: this.urlRemover,
|
|
108
|
-
container: this.container,
|
|
109
|
-
nome: this.nomeBancoDados,
|
|
110
|
-
};
|
|
111
|
-
this.carregandoRemover = true;
|
|
112
|
-
let params = { url: this.urlRemover, obj: props };
|
|
113
|
-
this.deleteFileApi(params).then((response) => {
|
|
114
|
-
if (response.sucesso) {
|
|
115
|
-
if (this.aoCarregar) this.aoCarregar();
|
|
116
|
-
this.limpar();
|
|
117
|
-
this.$emit("input", "");
|
|
118
|
-
}
|
|
119
|
-
this.carregandoRemover = false;
|
|
120
|
-
});
|
|
121
|
-
},
|
|
122
|
-
limpar() {
|
|
123
|
-
this.arquivo = "";
|
|
124
|
-
},
|
|
125
|
-
baixar() {
|
|
126
|
-
const url = `${this.urlAzure}/${this.container}/${this.nomeBancoDados}`;
|
|
127
|
-
window.location.href = url;
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
</script>
|
|
132
|
-
|
|
133
|
-
<style scoped>
|
|
134
|
-
.arquivo {
|
|
135
|
-
position: relative;
|
|
136
|
-
overflow: hidden;
|
|
137
|
-
display: inline-block;
|
|
138
|
-
cursor: pointer;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.botao {
|
|
142
|
-
padding: 8px 12px;
|
|
143
|
-
cursor: pointer;
|
|
144
|
-
border: none;
|
|
145
|
-
border-radius: 40px !important;
|
|
146
|
-
font-size: 14px;
|
|
147
|
-
font-weight: 400;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.primario {
|
|
151
|
-
background: #577696;
|
|
152
|
-
border-color: #577696;
|
|
153
|
-
color: #fff;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.primario:hover {
|
|
157
|
-
background: #355472;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.sucesso {
|
|
161
|
-
color: #fff;
|
|
162
|
-
background: #94aa2a;
|
|
163
|
-
border-color: #94aa2a;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.sucesso:hover {
|
|
167
|
-
background: #6d7e1c;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.perigo {
|
|
171
|
-
color: #fff;
|
|
172
|
-
border-color: #f0134d;
|
|
173
|
-
background: #f0134d;
|
|
174
|
-
margin-left: 5px;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.perigo:hover {
|
|
178
|
-
background: #c70f40;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.pequeno {
|
|
182
|
-
padding: 5px 10px;
|
|
183
|
-
font-size: 13px;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.arquivo input[type="file"] {
|
|
187
|
-
font-size: 100px;
|
|
188
|
-
position: absolute;
|
|
189
|
-
left: 0;
|
|
190
|
-
top: 0;
|
|
191
|
-
opacity: 0;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
.div-alerta{
|
|
195
|
-
margin-top:15px;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
</style>
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<b-form-group :label="titulo">
|
|
4
|
-
<b-form-checkbox-group
|
|
5
|
-
v-model="selecionado"
|
|
6
|
-
:options="opcoes"
|
|
7
|
-
:stacked="empilhado"
|
|
8
|
-
@click.native="executar"
|
|
9
|
-
></b-form-checkbox-group>
|
|
10
|
-
</b-form-group>
|
|
11
|
-
</div>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script>
|
|
15
|
-
import { mapState, mapMutations } from "vuex";
|
|
16
|
-
|
|
17
|
-
export default {
|
|
18
|
-
name: "CheckboxMultiplo",
|
|
19
|
-
props: {
|
|
20
|
-
titulo: String,
|
|
21
|
-
opcoes: Array,
|
|
22
|
-
params: Object,
|
|
23
|
-
alterou: Function,
|
|
24
|
-
clicou: Function,
|
|
25
|
-
valorInicial: Array,
|
|
26
|
-
value: Array,
|
|
27
|
-
empilhado: {
|
|
28
|
-
type: Boolean,
|
|
29
|
-
default: false,
|
|
30
|
-
},
|
|
31
|
-
marcarFormSujo: {
|
|
32
|
-
type: Boolean,
|
|
33
|
-
default: true,
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
data() {
|
|
37
|
-
return {
|
|
38
|
-
selecionado: [],
|
|
39
|
-
};
|
|
40
|
-
},
|
|
41
|
-
mounted() {
|
|
42
|
-
this.selecionado = this.valorInicial;
|
|
43
|
-
},
|
|
44
|
-
methods: {
|
|
45
|
-
...mapMutations("validation", ["insereFormSujo"]),
|
|
46
|
-
executar(event) {
|
|
47
|
-
if (this.marcarFormSujo) this.insereFormSujo(true);
|
|
48
|
-
this.$emit("input", this.selecionado);
|
|
49
|
-
let self = this;
|
|
50
|
-
setTimeout(function () {
|
|
51
|
-
// adicionado o pointerId para prevenir que não seja executado em duplicidade
|
|
52
|
-
if (self.clicou && event.pointerId === 1) self.clicou(self.params);
|
|
53
|
-
}, 100);
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
watch: {
|
|
57
|
-
selecionado() {
|
|
58
|
-
this.$emit("input", this.selecionado);
|
|
59
|
-
if (this.alterou) this.alterou(this.params);
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
</script>
|
|
@@ -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,324 +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
|
-
}"
|
|
13
|
-
>
|
|
14
|
-
<multiselect
|
|
15
|
-
@open="aoAbrir"
|
|
16
|
-
@select="aoSelecionar"
|
|
17
|
-
@search-change="aoPesquisar"
|
|
18
|
-
:options="dados"
|
|
19
|
-
v-model.trim="valorAtual"
|
|
20
|
-
:custom-label="rotulo"
|
|
21
|
-
placeholder
|
|
22
|
-
:disabled="desabilitado"
|
|
23
|
-
:showLabels="true"
|
|
24
|
-
:noResult="false"
|
|
25
|
-
:maxHeight="250"
|
|
26
|
-
ref="multiselect"
|
|
27
|
-
selectLabel
|
|
28
|
-
deselectLabel
|
|
29
|
-
selectedLabel
|
|
30
|
-
>
|
|
31
|
-
<div slot="beforeList">
|
|
32
|
-
<vue-loading
|
|
33
|
-
v-if="carregando"
|
|
34
|
-
type="bubbles"
|
|
35
|
-
color="#577696"
|
|
36
|
-
:size="{ width: '40px', height: '40px' }"
|
|
37
|
-
></vue-loading>
|
|
38
|
-
<div class="antes-lista" v-if="!carregando">
|
|
39
|
-
<Botao
|
|
40
|
-
v-if="formNomeCadastrarNovo"
|
|
41
|
-
chave="novoCadastroEscolher"
|
|
42
|
-
tipo="primario"
|
|
43
|
-
titulo="Novo"
|
|
44
|
-
tamanho="pequeno"
|
|
45
|
-
:clique="novoCadastroEscolher"
|
|
46
|
-
/>
|
|
47
|
-
<Botao
|
|
48
|
-
chave="limpaEscolher"
|
|
49
|
-
tipo="alerta"
|
|
50
|
-
classeIcone="fas fa-broom"
|
|
51
|
-
tamanho="pequeno"
|
|
52
|
-
:clique="limpaEscolher"
|
|
53
|
-
/>
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
<div slot="afterList" v-if="totalRegistros > 20 && dados.length < totalRegistros">
|
|
57
|
-
<div class="depois-lista text-center">
|
|
58
|
-
<Botao
|
|
59
|
-
chave="carregarMaisSelecione"
|
|
60
|
-
tipo="info"
|
|
61
|
-
titulo="Carregar mais..."
|
|
62
|
-
classeIcone="fas fa-redo-alt"
|
|
63
|
-
tamanho="pequeno"
|
|
64
|
-
:clique="carregarMais"
|
|
65
|
-
/>
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
<div slot="noOptions">Lista está vazia</div>
|
|
69
|
-
<div slot="noResult">Nenhum registro encontrado</div>
|
|
70
|
-
</multiselect>
|
|
71
|
-
<div v-if="formSujo">
|
|
72
|
-
<div v-for="mensagem in notificacoes" :key="mensagem">
|
|
73
|
-
<span class="invalido">{{ mensagem }}</span>
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
|
|
78
|
-
<vodal
|
|
79
|
-
v-if="formNomeCadastrarNovo"
|
|
80
|
-
:show="mostrarVodal(formNomeCadastrarNovo)"
|
|
81
|
-
@hide="escondeVodal()"
|
|
82
|
-
:width="cadastrarNovoLargura"
|
|
83
|
-
:height="cadastrarNovoAltura"
|
|
84
|
-
:closeOnEsc="true"
|
|
85
|
-
:closeButton="true"
|
|
86
|
-
>
|
|
87
|
-
<Mensagem v-if="vodal.abrir" />
|
|
88
|
-
<div class="cadastrar-novo-titulo">{{ cadastrarNovoTitulo }}</div>
|
|
89
|
-
<hr />
|
|
90
|
-
<slot></slot>
|
|
91
|
-
</vodal>
|
|
92
|
-
</div>
|
|
93
|
-
</template>
|
|
94
|
-
<script>
|
|
95
|
-
import Dica from "../shared/Dica.vue";
|
|
96
|
-
import Mensagem from "../shared/Mensagem.vue";
|
|
97
|
-
import Multiselect from "vue-multiselect";
|
|
98
|
-
|
|
99
|
-
import Botao from "./Botao.vue";
|
|
100
|
-
import Vodal from "vodal";
|
|
101
|
-
|
|
102
|
-
import { mapState, mapActions, mapMutations, mapGetters } from "vuex";
|
|
103
|
-
|
|
104
|
-
export default {
|
|
105
|
-
name: "Escolher",
|
|
106
|
-
props: {
|
|
107
|
-
titulo: String,
|
|
108
|
-
campo: String,
|
|
109
|
-
formNome: String,
|
|
110
|
-
requerido: Boolean,
|
|
111
|
-
url: String,
|
|
112
|
-
desabilitado: Boolean,
|
|
113
|
-
campoAlvo: String,
|
|
114
|
-
propsParams: Object,
|
|
115
|
-
value: Object,
|
|
116
|
-
alterou: Function,
|
|
117
|
-
formNomeCadastrarNovo: String,
|
|
118
|
-
cadastrarNovoTitulo: String,
|
|
119
|
-
cadastrarNovoLargura: Number,
|
|
120
|
-
cadastrarNovoAltura: Number,
|
|
121
|
-
marcarFormSujo: {
|
|
122
|
-
type: Boolean,
|
|
123
|
-
default: true,
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
components: {
|
|
127
|
-
Multiselect,
|
|
128
|
-
Botao,
|
|
129
|
-
Vodal,
|
|
130
|
-
Mensagem,
|
|
131
|
-
Dica,
|
|
132
|
-
},
|
|
133
|
-
data() {
|
|
134
|
-
return {
|
|
135
|
-
valorAtual: {},
|
|
136
|
-
dados: [],
|
|
137
|
-
totalRegistros: 0,
|
|
138
|
-
baseParams: {
|
|
139
|
-
pesquisa: "",
|
|
140
|
-
paginaAtual: 1,
|
|
141
|
-
totalPorPagina: 20,
|
|
142
|
-
},
|
|
143
|
-
cadastrarNovo: false,
|
|
144
|
-
carregando: true,
|
|
145
|
-
notificacoes: [],
|
|
146
|
-
formSujo: false,
|
|
147
|
-
};
|
|
148
|
-
},
|
|
149
|
-
created() {
|
|
150
|
-
this.valida();
|
|
151
|
-
},
|
|
152
|
-
mounted() {
|
|
153
|
-
let el = this.$el.getElementsByClassName("multiselect")[0];
|
|
154
|
-
if (el) {
|
|
155
|
-
el.tabIndex = 0;
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
computed: {
|
|
159
|
-
...mapState("validation", ["reiniciaForm", "vodal"]),
|
|
160
|
-
...mapState("generic", ["vodal"]),
|
|
161
|
-
...mapGetters("generic", ["mostrarVodal"]),
|
|
162
|
-
},
|
|
163
|
-
methods: {
|
|
164
|
-
...mapActions("generic", ["getApi"]),
|
|
165
|
-
...mapMutations("generic", [
|
|
166
|
-
"removeCarregando",
|
|
167
|
-
"abrirVodal",
|
|
168
|
-
"fecharVodal",
|
|
169
|
-
"removeNotificacao",
|
|
170
|
-
"insereFiltro",
|
|
171
|
-
]),
|
|
172
|
-
...mapMutations("validation", [
|
|
173
|
-
"insereValidacao",
|
|
174
|
-
"removeValidacao",
|
|
175
|
-
"reiniciaValidacao",
|
|
176
|
-
"insereFormSujo",
|
|
177
|
-
]),
|
|
178
|
-
aoAbrir() {
|
|
179
|
-
this.obterTodos();
|
|
180
|
-
},
|
|
181
|
-
aoSelecionar(value) {
|
|
182
|
-
this.$emit("input", value);
|
|
183
|
-
if (this.alterou) this.alterou();
|
|
184
|
-
if (this.campoAlvo) {
|
|
185
|
-
let obj = { campoAlvo: this.campoAlvo, valor: value.id };
|
|
186
|
-
this.insereFiltro(obj);
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
aoPesquisar(value) {
|
|
190
|
-
this.baseParams.pesquisa = value;
|
|
191
|
-
this.obterTodos();
|
|
192
|
-
},
|
|
193
|
-
rotulo(value) {
|
|
194
|
-
if (value.conteudo) return `${value.conteudo}`;
|
|
195
|
-
},
|
|
196
|
-
obterTodos() {
|
|
197
|
-
let obj = { ...this.baseParams, ...this.propsParams };
|
|
198
|
-
let params = { url: this.url, obj: obj };
|
|
199
|
-
this.carregando = true;
|
|
200
|
-
this.getApi(params).then((response) => {
|
|
201
|
-
this.totalRegistros = response.conteudo.totalRegistros;
|
|
202
|
-
let self = this;
|
|
203
|
-
if (this.baseParams.paginaAtual == 1) {
|
|
204
|
-
this.dados = [];
|
|
205
|
-
}
|
|
206
|
-
response.conteudo.dados.map(function (value, key) {
|
|
207
|
-
self.dados.push(value);
|
|
208
|
-
});
|
|
209
|
-
this.carregando = false;
|
|
210
|
-
this.removeCarregando(["carregarMaisSelecione"]);
|
|
211
|
-
});
|
|
212
|
-
},
|
|
213
|
-
novoCadastroEscolher() {
|
|
214
|
-
this.abrirVodal(this.formNomeCadastrarNovo);
|
|
215
|
-
this.reiniciaValidacao(this.formNomeCadastrarNovo);
|
|
216
|
-
this.removeNotificacao();
|
|
217
|
-
this.$refs.multiselect.deactivate();
|
|
218
|
-
this.removeCarregando(["novoCadastroEscolher"]);
|
|
219
|
-
},
|
|
220
|
-
escondeVodal() {
|
|
221
|
-
this.fecharVodal();
|
|
222
|
-
},
|
|
223
|
-
limpaEscolher() {
|
|
224
|
-
let objLimpo = { id: "", conteudo: "" };
|
|
225
|
-
this.valorAtual = objLimpo;
|
|
226
|
-
this.$emit("input", objLimpo);
|
|
227
|
-
this.$refs.multiselect.deactivate();
|
|
228
|
-
this.removeCarregando(["limpaEscolher"]);
|
|
229
|
-
|
|
230
|
-
if (this.campoAlvo) {
|
|
231
|
-
let obj = { campoAlvo: this.campoAlvo, valor: "" };
|
|
232
|
-
this.insereFiltro(obj);
|
|
233
|
-
}
|
|
234
|
-
},
|
|
235
|
-
carregarMais() {
|
|
236
|
-
this.baseParams.paginaAtual++;
|
|
237
|
-
this.obterTodos();
|
|
238
|
-
},
|
|
239
|
-
valida() {
|
|
240
|
-
this.notificacoes = [];
|
|
241
|
-
if (this.requerido && !this.value.id) {
|
|
242
|
-
var mensagem = `${this.titulo} não pode ser vazio!`;
|
|
243
|
-
this.notificacoes.push(mensagem);
|
|
244
|
-
}
|
|
245
|
-
},
|
|
246
|
-
},
|
|
247
|
-
watch: {
|
|
248
|
-
"value.id": function () {
|
|
249
|
-
this.valida();
|
|
250
|
-
this.formSujo = true;
|
|
251
|
-
if (this.marcarFormSujo) this.insereFormSujo(true);
|
|
252
|
-
this.valorAtual = { id: this.value.id, conteudo: this.value.conteudo };
|
|
253
|
-
},
|
|
254
|
-
notificacoes() {
|
|
255
|
-
let self = this;
|
|
256
|
-
this.notificacoes.forEach(function (notificacao) {
|
|
257
|
-
let obj = {
|
|
258
|
-
chave: self.campo + "&" + self.formNome,
|
|
259
|
-
formNome: self.formNome,
|
|
260
|
-
notificacao: notificacao,
|
|
261
|
-
};
|
|
262
|
-
self.insereValidacao(obj);
|
|
263
|
-
});
|
|
264
|
-
|
|
265
|
-
if (this.notificacoes.length == 0) {
|
|
266
|
-
let obj = {
|
|
267
|
-
chave: self.campo + "&" + self.formNome,
|
|
268
|
-
formNome: self.formNome,
|
|
269
|
-
};
|
|
270
|
-
self.removeValidacao(obj);
|
|
271
|
-
}
|
|
272
|
-
},
|
|
273
|
-
reiniciaForm: {
|
|
274
|
-
handler(form) {
|
|
275
|
-
if (form.nome == this.formNome) {
|
|
276
|
-
let objLimpo = { id: "", conteudo: "" };
|
|
277
|
-
this.valorAtual = objLimpo;
|
|
278
|
-
this.$emit("input", objLimpo);
|
|
279
|
-
this.formSujo = false;
|
|
280
|
-
}
|
|
281
|
-
},
|
|
282
|
-
deep: true,
|
|
283
|
-
},
|
|
284
|
-
"vodal.abrir": function (value) {
|
|
285
|
-
if (!value) this.cadastrarNovo = false;
|
|
286
|
-
},
|
|
287
|
-
},
|
|
288
|
-
};
|
|
289
|
-
</script>
|
|
290
|
-
|
|
291
|
-
<style scoped>
|
|
292
|
-
div.antes-lista {
|
|
293
|
-
padding: 8px;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
div.depois-lista {
|
|
297
|
-
padding: 8px;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.invalido {
|
|
301
|
-
color: #f0134d;
|
|
302
|
-
font-size: 14px;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
.selecione {
|
|
306
|
-
height: 36px;
|
|
307
|
-
border-bottom: 1px solid #d6dadf;
|
|
308
|
-
border-radius: 0px !important;
|
|
309
|
-
margin-bottom: 20px;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
.selecione-invalido {
|
|
313
|
-
border-bottom: 1px solid #ff5454;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
.selecione-valido {
|
|
317
|
-
border-bottom: 1px solid #94aa2a;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
.cadastrar-novo-titulo {
|
|
321
|
-
font-size: 18px;
|
|
322
|
-
margin-bottom: 5px;
|
|
323
|
-
}
|
|
324
|
-
</style>
|