@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,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="form-group">
|
|
3
3
|
<div>
|
|
4
|
-
<span class="
|
|
5
|
-
<compact-picker v-model.trim="
|
|
4
|
+
<span class="title">{{ title }} </span>
|
|
5
|
+
<compact-picker v-model.trim="color.hex" />
|
|
6
6
|
</div>
|
|
7
7
|
</div>
|
|
8
8
|
</template>
|
|
@@ -11,26 +11,26 @@
|
|
|
11
11
|
import { Chrome } from "vue-color";
|
|
12
12
|
|
|
13
13
|
export default {
|
|
14
|
-
name: "
|
|
14
|
+
name: "Color",
|
|
15
15
|
components: {
|
|
16
16
|
"compact-picker": Chrome,
|
|
17
17
|
},
|
|
18
18
|
props: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
title: String,
|
|
20
|
+
field: String,
|
|
21
|
+
formName: String,
|
|
22
22
|
value: String,
|
|
23
23
|
},
|
|
24
24
|
data() {
|
|
25
25
|
return {
|
|
26
|
-
|
|
26
|
+
color: { hex: "#40BF84" },
|
|
27
27
|
};
|
|
28
28
|
},
|
|
29
29
|
watch: {
|
|
30
30
|
value() {
|
|
31
|
-
this.
|
|
31
|
+
this.color.hex = this.value;
|
|
32
32
|
},
|
|
33
|
-
"
|
|
33
|
+
"color.hex": function (value) {
|
|
34
34
|
if (value.hex) this.$emit("input", value.hex);
|
|
35
35
|
},
|
|
36
36
|
},
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="form-group">
|
|
3
3
|
<label>
|
|
4
|
-
<span class="
|
|
5
|
-
<span class="
|
|
6
|
-
<Dica :
|
|
4
|
+
<span class="title">{{ title }} </span>
|
|
5
|
+
<span class="required" v-if="required">*</span>
|
|
6
|
+
<Dica :field="field" :formName="formName" />
|
|
7
7
|
</label>
|
|
8
8
|
<div class="inner-addon right-addon">
|
|
9
9
|
<i
|
|
10
|
-
v-if="
|
|
11
|
-
class="
|
|
10
|
+
v-if="notifications.length > 0 && formDirty"
|
|
11
|
+
class="required glyphicon fas fa-exclamation-triangle"
|
|
12
12
|
></i>
|
|
13
13
|
<date-picker
|
|
14
14
|
lang="pt-br"
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
:placeholder="placeholder"
|
|
31
31
|
:type="type"
|
|
32
32
|
v-model="valor"
|
|
33
|
-
:class="{ 'is-invalid':
|
|
33
|
+
:class="{ 'is-invalid': notifications.length > 0 && formDirty }"
|
|
34
34
|
></date-picker>
|
|
35
35
|
</div>
|
|
36
36
|
|
|
37
|
-
<div v-if="
|
|
38
|
-
<div v-for="
|
|
39
|
-
<span class="
|
|
37
|
+
<div v-if="formDirty">
|
|
38
|
+
<div v-for="message in notifications" :key="message">
|
|
39
|
+
<span class="invalid">{{ message }}</span>
|
|
40
40
|
</div>
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
@@ -53,12 +53,12 @@ export default {
|
|
|
53
53
|
name: "Data",
|
|
54
54
|
mixins: [],
|
|
55
55
|
props: [
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
56
|
+
"title",
|
|
57
|
+
"field",
|
|
58
|
+
"fieldTarget",
|
|
59
59
|
"placeholder",
|
|
60
|
-
"
|
|
61
|
-
"
|
|
60
|
+
"formName",
|
|
61
|
+
"required",
|
|
62
62
|
"format",
|
|
63
63
|
"type",
|
|
64
64
|
"value",
|
|
@@ -67,12 +67,12 @@ export default {
|
|
|
67
67
|
"confirmText",
|
|
68
68
|
],
|
|
69
69
|
/* props: {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
title: String,
|
|
71
|
+
field: String,
|
|
72
|
+
fieldTarget: String,
|
|
73
73
|
placeholder: String,
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
formName: String,
|
|
75
|
+
required: Boolean,
|
|
76
76
|
format: String,
|
|
77
77
|
type: String,
|
|
78
78
|
value: String,
|
|
@@ -82,82 +82,82 @@ export default {
|
|
|
82
82
|
},*/
|
|
83
83
|
data() {
|
|
84
84
|
return {
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
notifications: [],
|
|
86
|
+
formDirty: false,
|
|
87
87
|
valor: "",
|
|
88
88
|
};
|
|
89
89
|
},
|
|
90
90
|
created() {
|
|
91
|
-
this.
|
|
91
|
+
this.validate();
|
|
92
92
|
this.valor = this.value;
|
|
93
93
|
},
|
|
94
94
|
methods: {
|
|
95
95
|
...mapMutations("validation", [
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
96
|
+
"addValidation",
|
|
97
|
+
"removeValidation",
|
|
98
|
+
"addFormDirty",
|
|
99
99
|
]),
|
|
100
|
-
...mapMutations("generic", ["
|
|
101
|
-
|
|
102
|
-
this.
|
|
100
|
+
...mapMutations("generic", ["addFilter"]),
|
|
101
|
+
validate() {
|
|
102
|
+
this.notifications = [];
|
|
103
103
|
|
|
104
|
-
if (this.
|
|
105
|
-
var
|
|
106
|
-
this.
|
|
104
|
+
if (this.required && this.valor.length == 0) {
|
|
105
|
+
var message = `${this.title} não pode ser vazio!`;
|
|
106
|
+
this.notifications.push(message);
|
|
107
107
|
}
|
|
108
108
|
},
|
|
109
109
|
confirma() {
|
|
110
110
|
if (this.range) {
|
|
111
111
|
let obj = {
|
|
112
|
-
|
|
112
|
+
fieldTarget: this.fieldTarget,
|
|
113
113
|
valor: { inicio: this.valor[0], fim: this.valor[1] },
|
|
114
114
|
};
|
|
115
|
-
this.
|
|
115
|
+
this.addFilter(obj);
|
|
116
116
|
}
|
|
117
117
|
},
|
|
118
118
|
fechar() {
|
|
119
119
|
let obj = {
|
|
120
|
-
|
|
120
|
+
fieldTarget: this.fieldTarget,
|
|
121
121
|
valor: { inicio: "", fim: "" },
|
|
122
122
|
};
|
|
123
|
-
this.
|
|
123
|
+
this.addFilter(obj);
|
|
124
124
|
},
|
|
125
125
|
},
|
|
126
126
|
computed: {
|
|
127
|
-
...mapState("validation", ["
|
|
127
|
+
...mapState("validation", ["resetForm", "validations"]),
|
|
128
128
|
},
|
|
129
129
|
watch: {
|
|
130
130
|
valor() {
|
|
131
|
-
this.
|
|
132
|
-
this.
|
|
133
|
-
this.
|
|
131
|
+
this.validate();
|
|
132
|
+
this.formDirty = true;
|
|
133
|
+
this.addFormDirty(true);
|
|
134
134
|
this.$emit("input", this.valor);
|
|
135
135
|
},
|
|
136
136
|
value() {
|
|
137
137
|
this.valor = this.value;
|
|
138
138
|
},
|
|
139
|
-
|
|
139
|
+
notifications() {
|
|
140
140
|
let self = this;
|
|
141
|
-
this.
|
|
141
|
+
this.notifications.forEach(function (notification) {
|
|
142
142
|
let obj = {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
key: self.field + "&" + self.formName,
|
|
144
|
+
formName: self.formName,
|
|
145
|
+
notification: notification,
|
|
146
146
|
};
|
|
147
|
-
self.
|
|
147
|
+
self.addValidation(obj);
|
|
148
148
|
});
|
|
149
149
|
|
|
150
|
-
if (this.
|
|
150
|
+
if (this.notifications.length == 0) {
|
|
151
151
|
let obj = {
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
key: self.field + "&" + self.formName,
|
|
153
|
+
formName: self.formName,
|
|
154
154
|
};
|
|
155
|
-
self.
|
|
155
|
+
self.removeValidation(obj);
|
|
156
156
|
}
|
|
157
157
|
},
|
|
158
|
-
|
|
158
|
+
resetForm: {
|
|
159
159
|
handler(form) {
|
|
160
|
-
if (form.nome == this.
|
|
160
|
+
if (form.nome == this.formName) this.formDirty = false;
|
|
161
161
|
},
|
|
162
162
|
deep: true,
|
|
163
163
|
},
|
|
@@ -166,11 +166,11 @@ export default {
|
|
|
166
166
|
</script>
|
|
167
167
|
|
|
168
168
|
<style scoped>
|
|
169
|
-
.
|
|
169
|
+
.success {
|
|
170
170
|
color: #94aa2a;
|
|
171
171
|
font-size: 14px;
|
|
172
172
|
}
|
|
173
|
-
.
|
|
173
|
+
.invalid {
|
|
174
174
|
color: #f0134d;
|
|
175
175
|
font-size: 14px;
|
|
176
176
|
}
|
|
@@ -4,81 +4,81 @@
|
|
|
4
4
|
<button
|
|
5
5
|
class="botao dropbtn"
|
|
6
6
|
:class="{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
info:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
small: size === 'small',
|
|
8
|
+
medium: size === 'medium',
|
|
9
|
+
large: size === 'large',
|
|
10
|
+
primary: type === 'primary',
|
|
11
|
+
success: type === 'success',
|
|
12
|
+
warning: type === 'warning',
|
|
13
|
+
info: type === 'info',
|
|
14
|
+
edit: type === 'edit',
|
|
15
|
+
danger: type === 'danger',
|
|
16
|
+
disabled: disabled,
|
|
17
17
|
}"
|
|
18
|
-
:disabled="
|
|
18
|
+
:disabled="disabled"
|
|
19
19
|
@click="mostrarEsconder()"
|
|
20
20
|
>
|
|
21
|
-
{{
|
|
21
|
+
{{ title }} <i :class="classIcon"></i>
|
|
22
22
|
</button>
|
|
23
23
|
<div
|
|
24
|
-
v-show="
|
|
24
|
+
v-show="show"
|
|
25
25
|
class="text-left dropdown-content"
|
|
26
|
-
@mouseleave="
|
|
26
|
+
@mouseleave="show = false"
|
|
27
27
|
>
|
|
28
|
-
<
|
|
29
|
-
<div v-for="item in
|
|
28
|
+
<Molded>
|
|
29
|
+
<div v-for="item in items" :key="item.nomeEvento">
|
|
30
30
|
<div
|
|
31
31
|
v-if="visivel(item.condicaoVisibilidade)"
|
|
32
|
-
:style="item.
|
|
32
|
+
:style="item.style"
|
|
33
33
|
class="item"
|
|
34
34
|
@click="executar(item.nomeEvento)"
|
|
35
35
|
>
|
|
36
|
-
<i :class="item.
|
|
37
|
-
<span class="
|
|
36
|
+
<i :class="item.classIcon"></i>
|
|
37
|
+
<span class="title"> {{ item.title }}</span>
|
|
38
38
|
</div>
|
|
39
39
|
</div>
|
|
40
|
-
</
|
|
40
|
+
</Molded>
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
43
43
|
</div>
|
|
44
44
|
</template>
|
|
45
45
|
|
|
46
46
|
<script>
|
|
47
|
-
import
|
|
47
|
+
import Molded from "../layout/Molded.vue";
|
|
48
48
|
|
|
49
49
|
import { mapMutations } from "vuex";
|
|
50
50
|
|
|
51
51
|
export default {
|
|
52
|
-
components: {
|
|
53
|
-
name: "
|
|
52
|
+
components: { Molded },
|
|
53
|
+
name: "Button",
|
|
54
54
|
props: {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
title: String,
|
|
56
|
+
type: String,
|
|
57
|
+
classIcon: String,
|
|
58
|
+
size: String,
|
|
59
|
+
disabled: Boolean,
|
|
60
60
|
dadosEvento: Object,
|
|
61
|
-
|
|
61
|
+
items: Array,
|
|
62
62
|
},
|
|
63
63
|
data() {
|
|
64
64
|
return {
|
|
65
|
-
|
|
65
|
+
show: false,
|
|
66
66
|
};
|
|
67
67
|
},
|
|
68
68
|
methods: {
|
|
69
|
-
...mapMutations("generic", ["
|
|
69
|
+
...mapMutations("generic", ["addEvent"]),
|
|
70
70
|
mostrarEsconder() {
|
|
71
|
-
this.
|
|
71
|
+
this.show = this.show ? false : true;
|
|
72
72
|
},
|
|
73
73
|
executar(nomeEvento) {
|
|
74
74
|
this.mostrarEsconder();
|
|
75
|
-
this.
|
|
75
|
+
this.addEvent({
|
|
76
76
|
nome: nomeEvento,
|
|
77
|
-
|
|
77
|
+
data: this.dadosEvento,
|
|
78
78
|
});
|
|
79
79
|
},
|
|
80
80
|
visivel(condicaoVisibilidade) {
|
|
81
|
-
// se for undefined, quer dizer que não tem condicional, então pode
|
|
81
|
+
// se for undefined, quer dizer que não tem condicional, então pode show
|
|
82
82
|
if (condicaoVisibilidade == undefined) return true;
|
|
83
83
|
|
|
84
84
|
var verifica = `this.dadosEvento.${condicaoVisibilidade}`;
|
|
@@ -98,7 +98,7 @@ export default {
|
|
|
98
98
|
background-color: #fafafc;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
.
|
|
101
|
+
.title {
|
|
102
102
|
padding-left: 5px;
|
|
103
103
|
}
|
|
104
104
|
|
|
@@ -141,44 +141,44 @@ export default {
|
|
|
141
141
|
box-shadow: 0px 10px 20px -6px rgb(0 0 0 / 12%);
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
.
|
|
144
|
+
.small {
|
|
145
145
|
padding: 5px 10px;
|
|
146
146
|
font-size: 13px;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
.
|
|
149
|
+
.medium {
|
|
150
150
|
padding: 7px 12px;
|
|
151
151
|
font-size: 13px;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
.
|
|
154
|
+
.large {
|
|
155
155
|
padding: 10px 15px;
|
|
156
156
|
font-size: 14px;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
.
|
|
159
|
+
.disabled {
|
|
160
160
|
background: #bbbbbb !important;
|
|
161
161
|
border-color: #bbbbbb !important;
|
|
162
162
|
color: #fff;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
.
|
|
165
|
+
.primary {
|
|
166
166
|
background: #577696;
|
|
167
167
|
border-color: #577696;
|
|
168
168
|
color: #fff;
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
.
|
|
171
|
+
.primary:hover {
|
|
172
172
|
background: #355472;
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
.
|
|
175
|
+
.success {
|
|
176
176
|
color: #fff;
|
|
177
177
|
background: #94aa2a;
|
|
178
178
|
border-color: #94aa2a;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
.
|
|
181
|
+
.success:hover {
|
|
182
182
|
background: #6d7e1c;
|
|
183
183
|
}
|
|
184
184
|
|
|
@@ -192,33 +192,33 @@ export default {
|
|
|
192
192
|
background: #3e90b3;
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
.
|
|
195
|
+
.edit {
|
|
196
196
|
color: #fff;
|
|
197
197
|
border-color: #7b7f83;
|
|
198
198
|
background: #7b7f83;
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
.
|
|
201
|
+
.edit:hover {
|
|
202
202
|
background: #595c5f;
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
.
|
|
205
|
+
.warning {
|
|
206
206
|
color: #fff;
|
|
207
207
|
border-color: #f1bc31;
|
|
208
208
|
background: #f1bc31;
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
.
|
|
211
|
+
.warning:hover {
|
|
212
212
|
background: #a37d1b;
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
.
|
|
215
|
+
.danger {
|
|
216
216
|
color: #fff;
|
|
217
217
|
border-color: #f0134d;
|
|
218
218
|
background: #f0134d;
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
.
|
|
221
|
+
.danger:hover {
|
|
222
222
|
background: #c70f40;
|
|
223
223
|
}
|
|
224
224
|
</style>
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<label>
|
|
4
|
+
<span class="title">{{ title }}</span>
|
|
5
|
+
<span class="required" v-if="required">*</span>
|
|
6
|
+
<Dica :field="field" :formName="formName" />
|
|
7
|
+
</label>
|
|
8
|
+
<div class="inner-addon right-addon">
|
|
9
|
+
<i
|
|
10
|
+
v-if="notifications.length > 0 && formDirty"
|
|
11
|
+
class="required glyphicon fas fa-exclamation-triangle"
|
|
12
|
+
></i>
|
|
13
|
+
<vue-editor v-model.trim="value" :editorToolbar="customToolbar"></vue-editor>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<div v-if="formDirty">
|
|
17
|
+
<div v-for="message in notifications" :key="message">
|
|
18
|
+
<span class="invalid">{{ message }}</span>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
import Dica from "../shared/Dica.vue";
|
|
26
|
+
import { VueEditor } from "vue2-editor";
|
|
27
|
+
|
|
28
|
+
import { mapState, mapMutations } from "vuex";
|
|
29
|
+
|
|
30
|
+
export default {
|
|
31
|
+
components: { Dica, VueEditor },
|
|
32
|
+
name: "EditorHtml",
|
|
33
|
+
mixins: [],
|
|
34
|
+
props: {
|
|
35
|
+
title: String,
|
|
36
|
+
field: String,
|
|
37
|
+
formName: String,
|
|
38
|
+
required: Boolean,
|
|
39
|
+
maxLength: Number,
|
|
40
|
+
value: String,
|
|
41
|
+
},
|
|
42
|
+
data() {
|
|
43
|
+
return {
|
|
44
|
+
notifications: [],
|
|
45
|
+
formDirty: false,
|
|
46
|
+
textoEditor: "",
|
|
47
|
+
customToolbar: [
|
|
48
|
+
["bold", "italic", "underline"],
|
|
49
|
+
[{ list: "ordered" }, { list: "bullet" }],
|
|
50
|
+
[{ align: "" }, { align: "center" }, { align: "right" }, { align: "justify" }],
|
|
51
|
+
[{ header: [false] }],
|
|
52
|
+
],
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
created() {
|
|
56
|
+
this.validate();
|
|
57
|
+
},
|
|
58
|
+
methods: {
|
|
59
|
+
...mapMutations("validation", ["addValidation", "removeValidation"]),
|
|
60
|
+
validate() {
|
|
61
|
+
this.notifications = [];
|
|
62
|
+
|
|
63
|
+
if (this.required && this.value.length == 0) {
|
|
64
|
+
var message = `${this.title} não pode ser vazio!`;
|
|
65
|
+
this.notifications.push(message);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (this.maxLength > 0) {
|
|
69
|
+
if (this.value.length > this.maxLength) {
|
|
70
|
+
var message = `Máximo de ${this.maxLength} caracteres!`;
|
|
71
|
+
this.notifications.push(message);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
computed: {
|
|
77
|
+
...mapState("validation", ["resetForm", "validations"]),
|
|
78
|
+
},
|
|
79
|
+
watch: {
|
|
80
|
+
value() {
|
|
81
|
+
this.validate();
|
|
82
|
+
this.formDirty = true;
|
|
83
|
+
this.$emit("input", this.value);
|
|
84
|
+
},
|
|
85
|
+
notifications() {
|
|
86
|
+
let self = this;
|
|
87
|
+
this.notifications.forEach(function (notification) {
|
|
88
|
+
let obj = {
|
|
89
|
+
key: self.field + "&" + self.formName,
|
|
90
|
+
formName: self.formName,
|
|
91
|
+
notification: notification,
|
|
92
|
+
};
|
|
93
|
+
self.addValidation(obj);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
if (this.notifications.length == 0) {
|
|
97
|
+
let obj = {
|
|
98
|
+
key: self.field + "&" + self.formName,
|
|
99
|
+
formName: self.formName,
|
|
100
|
+
};
|
|
101
|
+
self.removeValidation(obj);
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
resetForm: {
|
|
105
|
+
handler(form) {
|
|
106
|
+
if (form.nome == this.formName) this.formDirty = false;
|
|
107
|
+
},
|
|
108
|
+
deep: true,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
</script>
|
|
113
|
+
|
|
114
|
+
<style scoped>
|
|
115
|
+
.success {
|
|
116
|
+
color: #94aa2a;
|
|
117
|
+
font-size: 14px;
|
|
118
|
+
}
|
|
119
|
+
.invalid {
|
|
120
|
+
color: #f0134d;
|
|
121
|
+
font-size: 14px;
|
|
122
|
+
}
|
|
123
|
+
</style>
|