@nixweb/nixloc-ui 0.0.44 → 0.0.47
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/package.json +1 -1
- package/src/component/forms/Botao.vue +1 -1
- package/src/component/forms/Senha.vue +7 -2
- package/src/component/forms/Texto.vue +7 -2
- package/src/component/forms/Toggle.vue +24 -7
- package/src/component/layout/Menu.vue +2 -2
- package/src/component/shared/SalvarCancelar.vue +50 -0
- package/src/component/template/InserirEditarModeloView.vue +3 -2
- package/src/store/modulos/generic.js +27 -2
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
v-bind:value="value"
|
|
19
19
|
v-on:input="$emit('input', $event.target.value)"
|
|
20
20
|
class="form-control"
|
|
21
|
-
:class="{
|
|
21
|
+
:class="{ requerido: notificacoes.length > 0 && formSujo }"
|
|
22
22
|
/>
|
|
23
23
|
</div>
|
|
24
24
|
<div v-if="formSujo">
|
|
@@ -64,7 +64,11 @@ export default {
|
|
|
64
64
|
this.valida();
|
|
65
65
|
},
|
|
66
66
|
methods: {
|
|
67
|
-
...mapMutations("validation", [
|
|
67
|
+
...mapMutations("validation", [
|
|
68
|
+
"insereValidacao",
|
|
69
|
+
"removeValidacao",
|
|
70
|
+
"insereFormSujo",
|
|
71
|
+
]),
|
|
68
72
|
valida() {
|
|
69
73
|
this.notificacoes = [];
|
|
70
74
|
|
|
@@ -88,6 +92,7 @@ export default {
|
|
|
88
92
|
value() {
|
|
89
93
|
this.valida();
|
|
90
94
|
this.formSujo = true;
|
|
95
|
+
this.insereFormSujo(true);
|
|
91
96
|
},
|
|
92
97
|
notificacoes() {
|
|
93
98
|
let self = this;
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
v-bind:value="value"
|
|
24
24
|
v-on:input="$emit('input', $event.target.value)"
|
|
25
25
|
class="form-control"
|
|
26
|
-
:class="{
|
|
26
|
+
:class="{ requerido: notificacoes.length > 0 && formSujo }"
|
|
27
27
|
/>
|
|
28
28
|
</div>
|
|
29
29
|
<div v-if="formSujo">
|
|
@@ -74,7 +74,11 @@ export default {
|
|
|
74
74
|
this.valida();
|
|
75
75
|
},
|
|
76
76
|
methods: {
|
|
77
|
-
...mapMutations("validation", [
|
|
77
|
+
...mapMutations("validation", [
|
|
78
|
+
"insereValidacao",
|
|
79
|
+
"removeValidacao",
|
|
80
|
+
"insereFormSujo",
|
|
81
|
+
]),
|
|
78
82
|
valida() {
|
|
79
83
|
this.notificacoes = [];
|
|
80
84
|
|
|
@@ -109,6 +113,7 @@ export default {
|
|
|
109
113
|
value() {
|
|
110
114
|
this.valida();
|
|
111
115
|
this.formSujo = true;
|
|
116
|
+
this.insereFormSujo(true);
|
|
112
117
|
},
|
|
113
118
|
notificacoes() {
|
|
114
119
|
let self = this;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="principal">
|
|
3
3
|
<b-row>
|
|
4
|
-
<b-col xs="
|
|
4
|
+
<b-col xs="6" sm="6" md="6" lg="4" xl="4">
|
|
5
5
|
<div class="lado-a-lado titulo">{{ titulo }}</div>
|
|
6
6
|
</b-col>
|
|
7
|
-
<b-col xs="
|
|
7
|
+
<b-col xs="6" sm="6" md="6" lg="4" xl="4">
|
|
8
8
|
<VueToggles
|
|
9
9
|
height="23"
|
|
10
10
|
width="60"
|
|
@@ -12,8 +12,9 @@
|
|
|
12
12
|
uncheckedText="Não"
|
|
13
13
|
:checkedBg="cor"
|
|
14
14
|
uncheckedBg="lightgrey"
|
|
15
|
-
:
|
|
16
|
-
|
|
15
|
+
:disabled="desabilitado"
|
|
16
|
+
:value="valor"
|
|
17
|
+
@click="clique"
|
|
17
18
|
/>
|
|
18
19
|
</b-col>
|
|
19
20
|
</b-row>
|
|
@@ -31,11 +32,27 @@ export default {
|
|
|
31
32
|
props: {
|
|
32
33
|
titulo: String,
|
|
33
34
|
cor: String,
|
|
35
|
+
desabilitado: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: false,
|
|
38
|
+
},
|
|
39
|
+
params: Object,
|
|
40
|
+
alterou: Function,
|
|
34
41
|
value: Boolean,
|
|
35
42
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
43
|
+
data() {
|
|
44
|
+
return {
|
|
45
|
+
valor: false,
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
created() {
|
|
49
|
+
this.valor = this.value;
|
|
50
|
+
},
|
|
51
|
+
methods: {
|
|
52
|
+
clique() {
|
|
53
|
+
this.valor = !this.valor;
|
|
54
|
+
this.$emit("input", this.valor);
|
|
55
|
+
if (this.alterou) this.alterou(this.params);
|
|
39
56
|
},
|
|
40
57
|
},
|
|
41
58
|
};
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
<ul v-for="item in menu" :key="item.titulo">
|
|
9
9
|
<li>
|
|
10
10
|
<span>{{ item.titulo }}</span>
|
|
11
|
-
<ul
|
|
12
|
-
<li>
|
|
11
|
+
<ul>
|
|
12
|
+
<li v-for="primeiroNivel in item.primeiroNivel" :key="primeiroNivel.titulo">
|
|
13
13
|
<span
|
|
14
14
|
:class="{ titulo: primeiroNivel.rotaDestino != '' }"
|
|
15
15
|
@click="navegarPara(primeiroNivel.rotaDestino)"
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<BarraFixa posicao="rodape" v-show="formSujo">
|
|
4
|
+
<div>
|
|
5
|
+
<Botao
|
|
6
|
+
chave="cancelarSalvarCancelar"
|
|
7
|
+
titulo="Cancelar"
|
|
8
|
+
tipo="perigo"
|
|
9
|
+
tamanho="medio"
|
|
10
|
+
:clique="cancelar"
|
|
11
|
+
/>
|
|
12
|
+
<Botao
|
|
13
|
+
chave="salvarSalvarCancelar"
|
|
14
|
+
titulo="Salvar"
|
|
15
|
+
tipo="sucesso"
|
|
16
|
+
:desabilitado="!formValido(formNome)"
|
|
17
|
+
tamanho="medio"
|
|
18
|
+
:clique="salvar"
|
|
19
|
+
/>
|
|
20
|
+
</div>
|
|
21
|
+
</BarraFixa>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
<script>
|
|
25
|
+
import BarraFixa from "@nixweb/nixloc-ui/src/component/layout/BarraFixa.vue";
|
|
26
|
+
import Botao from "@nixweb/nixloc-ui/src/component/forms/Botao";
|
|
27
|
+
|
|
28
|
+
import { mapState, mapMutations, mapGetters } from "vuex";
|
|
29
|
+
|
|
30
|
+
export default {
|
|
31
|
+
name: "SalvarCancelar",
|
|
32
|
+
components: { BarraFixa, Botao },
|
|
33
|
+
props: {
|
|
34
|
+
formNome: String,
|
|
35
|
+
},
|
|
36
|
+
computed: {
|
|
37
|
+
...mapState("validation", ["formSujo"]),
|
|
38
|
+
...mapGetters("validation", ["formValido"]),
|
|
39
|
+
},
|
|
40
|
+
methods: {
|
|
41
|
+
...mapMutations("validation", ["insereFormSujo"]),
|
|
42
|
+
...mapMutations("generic", ["removeCarregando"]),
|
|
43
|
+
salvar() {},
|
|
44
|
+
cancelar() {
|
|
45
|
+
this.insereFormSujo(false);
|
|
46
|
+
this.removeCarregando(["cancelarSalvarCancelar"]);
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
</script>
|
|
@@ -14,16 +14,17 @@
|
|
|
14
14
|
<slot name="conteudo-principal"></slot>
|
|
15
15
|
</div>
|
|
16
16
|
</Painel>
|
|
17
|
+
<SalvarCancelar :formNome="painel.formNome" />
|
|
17
18
|
</div>
|
|
18
19
|
</template>
|
|
19
20
|
|
|
20
21
|
<script>
|
|
21
22
|
import Painel from "@nixweb/nixloc-ui/src/component/layout/Painel";
|
|
22
|
-
|
|
23
|
+
import SalvarCancelar from "@nixweb/nixloc-ui/src/component/shared/SalvarCancelar";
|
|
23
24
|
|
|
24
25
|
export default {
|
|
25
26
|
name: "InserirEditarModeloView",
|
|
26
|
-
components: { Painel },
|
|
27
|
+
components: { Painel, SalvarCancelar },
|
|
27
28
|
props: {
|
|
28
29
|
painel: Object,
|
|
29
30
|
},
|
|
@@ -202,7 +202,7 @@ export default {
|
|
|
202
202
|
params: params.obj,
|
|
203
203
|
headers: new Token().tokenHeaders(),
|
|
204
204
|
})
|
|
205
|
-
.then((response) => {
|
|
205
|
+
.then((response) => {
|
|
206
206
|
if (response.data.sucesso) {
|
|
207
207
|
context.commit('insereMetodoExecutadoApi', params.MetodoExecutadoApi);
|
|
208
208
|
context.commit('removeNotificacao');
|
|
@@ -217,7 +217,7 @@ export default {
|
|
|
217
217
|
return false;
|
|
218
218
|
})
|
|
219
219
|
},
|
|
220
|
-
|
|
220
|
+
deleteAllApi: async function (context, params) {
|
|
221
221
|
|
|
222
222
|
context.commit('limpaMetodoExecutadoApi');
|
|
223
223
|
context.commit('listaIdParaStringVirgula', params.selecionados);
|
|
@@ -245,6 +245,31 @@ export default {
|
|
|
245
245
|
return false;
|
|
246
246
|
})
|
|
247
247
|
},
|
|
248
|
+
deleteApi: async function (context, params) {
|
|
249
|
+
|
|
250
|
+
context.commit('limpaMetodoExecutadoApi');
|
|
251
|
+
let url = params.url;
|
|
252
|
+
|
|
253
|
+
return axios.delete(`${url}`, {
|
|
254
|
+
headers: new Token().tokenHeaders(),
|
|
255
|
+
})
|
|
256
|
+
.then((response) => {
|
|
257
|
+
if (response.data.sucesso) {
|
|
258
|
+
context.commit('insereMetodoExecutadoApi', 'deleteApi')
|
|
259
|
+
context.commit('insereToast', 'deleteApiSucesso');
|
|
260
|
+
context.commit('removeNotificacao');
|
|
261
|
+
return response.data;
|
|
262
|
+
} else {
|
|
263
|
+
context.commit('insereNotificacao', response.data.notificacoes)
|
|
264
|
+
context.commit('insereToast', 'deleteApiErro');
|
|
265
|
+
return response.data;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
}, (err) => {
|
|
269
|
+
context.commit('insereNotificacaoErroApi');
|
|
270
|
+
return false;
|
|
271
|
+
})
|
|
272
|
+
},
|
|
248
273
|
getPdfApi: async function (context, params) {
|
|
249
274
|
context.commit('limpaMetodoExecutadoApi');
|
|
250
275
|
return axios.post(params.url, params.obj, {
|