@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.
- package/docs/src/component/template/ModeloRelatorioView.drawio +2 -2
- package/docs/src/store/modulos/relatorio.drawio +2 -2
- package/package.json +77 -77
- package/public/styles/app.css +1 -1
- 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} +8 -8
- package/src/component/forms/{Cor.vue → Color.vue} +9 -9
- package/src/component/forms/DateTime.vue +55 -55
- package/src/component/forms/{BotaoDropdown.vue → Dropdown.vue} +58 -58
- 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/{Topo.vue → Header.vue} +5 -5
- 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 +15 -15
- package/src/component/layout/Wizard.vue +3 -3
- package/src/component/shared/{CodigoEditor.vue → CodeEditor.vue} +25 -25
- package/src/component/shared/Collapse.vue +131 -0
- package/src/component/shared/Confirmation.vue +80 -0
- package/src/component/shared/{DocumentoEditor.vue → DocumentEditor.vue} +10 -16
- package/src/component/shared/{DocumentoPreview.vue → DocumentPreview.vue} +2 -2
- package/src/component/shared/ExportExcel.vue +67 -0
- package/src/component/shared/{ExportarPDF.vue → ExportPDF.vue} +18 -18
- package/src/component/shared/HeaderPrint.vue +36 -0
- package/src/component/shared/HorizontalFilter.vue +59 -0
- package/src/component/shared/LegendaParametro.vue +22 -22
- package/src/component/shared/{Carregando.vue → Loading.vue} +16 -16
- package/src/component/shared/LoadingMoreButton.vue +23 -0
- package/src/component/shared/Messages.vue +83 -0
- package/src/component/shared/{Paginacao.vue → Pagination.vue} +12 -12
- package/src/component/shared/ProgressBar.vue +21 -0
- package/src/component/shared/{BotaoConsulta.vue → QueryButton.vue} +16 -16
- package/src/component/shared/SaveCancel.vue +56 -0
- package/src/component/shared/{Pesquisa.vue → Search.vue} +46 -46
- package/src/component/shared/Table.vue +243 -0
- package/src/component/shared/TableButton.vue +36 -0
- package/src/component/shared/{Registro.vue → TableTotalRecords.vue} +7 -7
- package/src/component/shared/{ResumoTabela.vue → TableTotalization.vue} +12 -8
- package/src/component/shared/Tip.vue +42 -0
- package/src/component/shared/Toast.vue +7 -7
- package/src/component/shared/{FiltroVertical.vue → VerticalFilter.vue} +24 -24
- package/src/component/shared/query-builder/AddRule.vue +187 -0
- package/src/component/shared/query-builder/ConvertToOdata.js +80 -0
- package/src/component/shared/query-builder/DynamicComponent.vue +107 -0
- package/src/component/shared/query-builder/Fields.vue +127 -0
- package/src/component/shared/query-builder/ListDynamicComponent.vue +42 -0
- package/src/component/shared/query-builder/QueryBuilder.vue +25 -120
- package/src/component/shared/query-builder/{Filtro.vue → Rules.vue} +13 -18
- package/src/component/shared/query-builder/SelectRule.vue +96 -0
- package/src/component/shared/query-builder/Tags.vue +14 -14
- package/src/component/shared/query-builder/{Rodape.vue → Totalization.vue} +10 -10
- package/src/component/template/AddEditReport.vue +106 -0
- package/src/component/template/ListViewWithHandlerData.vue +231 -0
- package/src/component/template/ViewTemplateConfiguration.vue +69 -0
- package/src/component/template/ViewTemplateDocumentView.vue +227 -0
- package/src/component/template/ViewTemplateReportList.vue +230 -0
- package/src/component/template/ViewTemplateReportPreview.vue +500 -0
- package/src/component/template/ViewTemplateWithSalveCancel.vue +32 -0
- package/src/component/template/ViewTemplateWithTable.vue +49 -0
- package/src/component/template/model/Report.js +6 -0
- package/src/component/value-objects/DadosContato.vue +34 -35
- package/src/component/value-objects/DadosPessoa.vue +58 -58
- package/src/component/value-objects/Endereco.vue +96 -97
- 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/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 -335
- 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/BotaoCarregarMais.vue +0 -23
- package/src/component/shared/CabecalhoImpressao.vue +0 -36
- package/src/component/shared/Confirmacao.vue +0 -80
- package/src/component/shared/Dica.vue +0 -42
- package/src/component/shared/EsconderMostrar.vue +0 -131
- package/src/component/shared/ExportarExcel.vue +0 -67
- package/src/component/shared/FiltroHorizontal.vue +0 -59
- package/src/component/shared/Mensagem.vue +0 -86
- package/src/component/shared/Progresso.vue +0 -21
- package/src/component/shared/SalvarCancelar.vue +0 -56
- package/src/component/shared/Tabela.vue +0 -275
- package/src/component/shared/TabelaBotao.vue +0 -36
- package/src/component/shared/query-builder/Campo.vue +0 -116
- package/src/component/shared/query-builder/ConverteParaOdata.js +0 -77
- 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 -187
- package/src/component/shared/query-builder/main.js +0 -81
- package/src/component/template/ModeloAdicionarModificarView.vue +0 -32
- package/src/component/template/ModeloDocumentoView.vue +0 -227
- package/src/component/template/ModeloLista.vue +0 -231
- package/src/component/template/ModeloRelatorioListaView.vue +0 -227
- package/src/component/template/ModeloRelatorioView.vue +0 -489
- package/src/component/template/ModeloSubView.vue +0 -69
- package/src/component/template/ModeloView.vue +0 -49
- package/src/component/template/Relatorio.js +0 -10
- package/src/component/template/RelatorioAdicionarModificar.vue +0 -106
- package/src/store/modulos/generic.js +0 -494
- package/src/store/modulos/relatorio.js +0 -204
- package/src/store/modulos/usuario.js +0 -38
- package/src/store/modulos/validation.js +0 -39
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="vqb-group card">
|
|
3
|
+
<div class="vqb-group-body card-body">
|
|
4
|
+
<div class="rule-actions form-inline">
|
|
5
|
+
<div class="div-custom">
|
|
6
|
+
<b-row>
|
|
7
|
+
<b-col sm="6">
|
|
8
|
+
<SelectRule :options="rules" class="select" v-model="selectedRule" />
|
|
9
|
+
</b-col>
|
|
10
|
+
<b-col sm="3">
|
|
11
|
+
<RadioGroup
|
|
12
|
+
:options="[
|
|
13
|
+
{ text: 'e', value: 'and' },
|
|
14
|
+
{ text: 'ou', value: 'or' },
|
|
15
|
+
]"
|
|
16
|
+
v-model="andOr"
|
|
17
|
+
/>
|
|
18
|
+
</b-col>
|
|
19
|
+
<b-col sm="3">
|
|
20
|
+
<button type="button" class="btn btn-secondary" @click="Add">
|
|
21
|
+
+ Adicionar
|
|
22
|
+
</button>
|
|
23
|
+
</b-col>
|
|
24
|
+
</b-row>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
<ListDynamicComponent />
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
import SelectRule from "./SelectRule.vue";
|
|
34
|
+
import DynamicComponent from "./DynamicComponent.vue";
|
|
35
|
+
import RadioGroup from "@nixweb/nixloc-ui/src/component/forms/RadioGroup.vue";
|
|
36
|
+
import ListDynamicComponent from "@nixweb/nixloc-ui/src/component/shared/construtor-query/ListDynamicComponent.vue";
|
|
37
|
+
|
|
38
|
+
import deepClone from "./utilities.js";
|
|
39
|
+
|
|
40
|
+
import { mapGetters, mapMutations } from "vuex";
|
|
41
|
+
|
|
42
|
+
export default {
|
|
43
|
+
name: "AddRule",
|
|
44
|
+
components: {
|
|
45
|
+
SelectRule,
|
|
46
|
+
DynamicComponent,
|
|
47
|
+
RadioGroup,
|
|
48
|
+
ListDynamicComponent,
|
|
49
|
+
},
|
|
50
|
+
props: {
|
|
51
|
+
query: Object,
|
|
52
|
+
rules: Array,
|
|
53
|
+
index: Number,
|
|
54
|
+
maximaProfunidade: Number,
|
|
55
|
+
profundidade: Number,
|
|
56
|
+
titulos: Object,
|
|
57
|
+
},
|
|
58
|
+
data() {
|
|
59
|
+
return {
|
|
60
|
+
selectedRule: this.rules[0],
|
|
61
|
+
andOr: "or",
|
|
62
|
+
duplicidade: [],
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
computed: {
|
|
66
|
+
...mapGetters("generic", ["event"]),
|
|
67
|
+
},
|
|
68
|
+
methods: {
|
|
69
|
+
...mapMutations("generic", ["addNotifications"]),
|
|
70
|
+
...mapMutations("report", ["addSelectedRules"]),
|
|
71
|
+
add() {
|
|
72
|
+
this.selectedRule.andOr = this.andOr;
|
|
73
|
+
this.addRule();
|
|
74
|
+
},
|
|
75
|
+
addRule() {
|
|
76
|
+
let consulta_atualizada = deepClone(this.query);
|
|
77
|
+
let obj = this.montaFiltro();
|
|
78
|
+
|
|
79
|
+
if (!this.jaExiste(obj.nome)) {
|
|
80
|
+
this.addSelectedRules(obj);
|
|
81
|
+
if (obj.naoPermitirDuplicidade) this.duplicidade.push(obj);
|
|
82
|
+
} else {
|
|
83
|
+
var erro = {
|
|
84
|
+
property: "ERRO QUERY BUILDER",
|
|
85
|
+
message: `Não é possível adicionar o filter ${obj.title} 2 vezes!`,
|
|
86
|
+
};
|
|
87
|
+
this.addNotifications([erro]);
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
montaFiltro() {
|
|
91
|
+
let obj = {
|
|
92
|
+
id: this.geraId(),
|
|
93
|
+
nome: this.selectedRule.nome,
|
|
94
|
+
title: this.selectedRule.title,
|
|
95
|
+
fieldType: this.selectedRule.fieldType,
|
|
96
|
+
type: this.selectedRule.type,
|
|
97
|
+
options: this.selectedRule.options,
|
|
98
|
+
props: this.selectedRule.props,
|
|
99
|
+
classCss: this.selectedRule.classCss,
|
|
100
|
+
icon: this.selectedRule.icon,
|
|
101
|
+
operators: this.selectedRule.operators,
|
|
102
|
+
operator: null,
|
|
103
|
+
andOr: this.selectedRule.andOr,
|
|
104
|
+
isRequired: this.selectedRule.isRequired,
|
|
105
|
+
naoPermitirDuplicidade: this.selectedRule.naoPermitirDuplicidade,
|
|
106
|
+
valor: null,
|
|
107
|
+
};
|
|
108
|
+
return obj;
|
|
109
|
+
},
|
|
110
|
+
geraId() {
|
|
111
|
+
return Math.random()
|
|
112
|
+
.toString(36)
|
|
113
|
+
.replace(/[^a-z]+/g, "")
|
|
114
|
+
.substr(0, 5);
|
|
115
|
+
},
|
|
116
|
+
jaExiste(key) {
|
|
117
|
+
var existe = this.duplicidade.find((item) => {
|
|
118
|
+
return item.nome === key;
|
|
119
|
+
});
|
|
120
|
+
if (existe) return true;
|
|
121
|
+
return false;
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
watch: {
|
|
125
|
+
event: {
|
|
126
|
+
handler(event) {
|
|
127
|
+
// Se a tag ou a rule que está selecionada foi removida, é necessário remove tambem do array "duplicidade" para liberar e adicionar novamente.
|
|
128
|
+
if (event.nome == "tagRemovida" || event.nome == "selectedRuleRemovida") {
|
|
129
|
+
var duplicidade = this.duplicidade.filter((item) => {
|
|
130
|
+
return item.id != event.data.id;
|
|
131
|
+
});
|
|
132
|
+
this.duplicidade = duplicidade;
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
deep: true,
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
</script>
|
|
140
|
+
|
|
141
|
+
<style>
|
|
142
|
+
.title-option {
|
|
143
|
+
padding: 10px;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.div-custom {
|
|
147
|
+
width: 100%;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.vue-query-builder .vqb-group .rule-actions {
|
|
151
|
+
margin-bottom: 20px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.vue-query-builder .vqb-rule {
|
|
155
|
+
margin-top: 15px;
|
|
156
|
+
margin-bottom: 15px;
|
|
157
|
+
background-color: #f5f5f5;
|
|
158
|
+
border-color: #ddd;
|
|
159
|
+
padding: 15px;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.vue-query-builder .vqb-group.depth-1 .vqb-rule,
|
|
163
|
+
.vue-query-builder .vqb-group.depth-2 {
|
|
164
|
+
border-left: 2px solid #8bc34a;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.vue-query-builder .vqb-group.depth-2 .vqb-rule,
|
|
168
|
+
.vue-query-builder .vqb-group.depth-3 {
|
|
169
|
+
border-left: 2px solid #00bcd4;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.vue-query-builder .vqb-group.depth-3 .vqb-rule,
|
|
173
|
+
.vue-query-builder .vqb-group.depth-4 {
|
|
174
|
+
border-left: 2px solid #ff5722;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.vue-query-builder .close {
|
|
178
|
+
opacity: 1;
|
|
179
|
+
color: rgb(150, 150, 150);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
@media (min-width: 768px) {
|
|
183
|
+
.vue-query-builder .vqb-rule.form-inline .form-group {
|
|
184
|
+
display: block;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
</style>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export default class ConvertToOdata {
|
|
2
|
+
convertRule(rule) {
|
|
3
|
+
let nome = rule.nome;
|
|
4
|
+
let title = rule.title;
|
|
5
|
+
let valor = rule.valor;
|
|
6
|
+
let type = rule.type;
|
|
7
|
+
let operator = rule.operator;
|
|
8
|
+
|
|
9
|
+
if (operator === "igual") return `${nome} eq '${valor}'`;
|
|
10
|
+
if (operator === "diferente") return `${nome} ne '${valor}'`;
|
|
11
|
+
if (operator === "contem") return `contains(${nome},'${valor}')`;
|
|
12
|
+
if (operator === "=") return `${nome} eq ${valor}`;
|
|
13
|
+
if (operator === "!=") return `${nome} ne ${valor}`;
|
|
14
|
+
if (operator === "<") return `${nome} lt ${valor}`;
|
|
15
|
+
if (operator === "<=") return `${nome} le ${valor}`;
|
|
16
|
+
if (operator === ">") return `${nome} gt ${valor}`;
|
|
17
|
+
if (operator === ">=") return `${nome} ge ${valor}`;
|
|
18
|
+
|
|
19
|
+
if (rule.fieldType === "dateTime") return this.convertDateTime(valor);
|
|
20
|
+
if (rule.fieldType === "escolher") return this.convertSelect(nome, valor);
|
|
21
|
+
if (rule.fieldType === "checkbox") return this.convertCheckbox(nome, title, type, valor);
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
convertDateTime(valor) {
|
|
25
|
+
let inicio = this.converteDate(valor[0]);
|
|
26
|
+
let fim = this.converteDate(valor[1]);
|
|
27
|
+
return `data ge ${inicio} and data le ${fim}`;
|
|
28
|
+
}
|
|
29
|
+
convertSelect(nome, valor) {
|
|
30
|
+
return `${nome} eq '${valor.id}'`;
|
|
31
|
+
}
|
|
32
|
+
convertCheckbox(nome, title, type, options) {
|
|
33
|
+
let query = "";
|
|
34
|
+
let sequencia = 0;
|
|
35
|
+
var size = options.length;
|
|
36
|
+
let self = this;
|
|
37
|
+
options.forEach(function (valor) {
|
|
38
|
+
if (type == "field") {
|
|
39
|
+
query += `${nome} eq ${valor}`;
|
|
40
|
+
if (sequencia + 1 != size) query += ` or `;
|
|
41
|
+
}
|
|
42
|
+
if (type == "totalization") {
|
|
43
|
+
let nomeConvertido = self.converteName(valor);
|
|
44
|
+
query += `${nome} with ${valor} as ${nomeConvertido}${title}`;
|
|
45
|
+
if (sequencia + 1 != size) query += `,`;
|
|
46
|
+
}
|
|
47
|
+
sequencia++;
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
if (size > 1 && type == "field") return `(${query})`;
|
|
51
|
+
return `${query}`;
|
|
52
|
+
}
|
|
53
|
+
converteDate(data) {
|
|
54
|
+
let str = data.replace("/", "").replace("/", "");
|
|
55
|
+
|
|
56
|
+
let date = {
|
|
57
|
+
dia: str.substr(0, 2),
|
|
58
|
+
mes: str.substr(2, 2),
|
|
59
|
+
ano: str.substr(4, 4),
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
var iso = date.ano + "-" + date.mes + "-" + date.dia;
|
|
63
|
+
|
|
64
|
+
/*
|
|
65
|
+
iso += date.dia + "T";
|
|
66
|
+
iso += "00:00:00.000Z";
|
|
67
|
+
iso += d.getHours().toString().padStart(2, "0") + ":";
|
|
68
|
+
iso += d.getMinutes().toString().padStart(2, "0") + ":";
|
|
69
|
+
iso += d.getSeconds().toString().padStart(2, "0");
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
return iso;
|
|
73
|
+
}
|
|
74
|
+
converteName(valor) {
|
|
75
|
+
if (valor === "sum") return "soma";
|
|
76
|
+
if (valor === "average") return "media";
|
|
77
|
+
if (valor === "max") return "maximo";
|
|
78
|
+
if (valor === "minimo") return "minimo";
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="vqb-rule card">
|
|
3
|
+
<div class="form-inline">
|
|
4
|
+
<label :class="rule.classCss" class="mr-5">
|
|
5
|
+
<i :class="rule.icon"></i>
|
|
6
|
+
<span style="margin-left: 10px">{{ rule.title }} </span>
|
|
7
|
+
</label>
|
|
8
|
+
<div style="margin-right: 20px">
|
|
9
|
+
<RadioGroup
|
|
10
|
+
:options="[
|
|
11
|
+
{ text: 'e', value: 'and' },
|
|
12
|
+
{ text: 'ou', value: 'or' },
|
|
13
|
+
]"
|
|
14
|
+
v-model="rule.andOr"
|
|
15
|
+
/>
|
|
16
|
+
</div>
|
|
17
|
+
<select
|
|
18
|
+
v-if="rule.fieldType == 'text' || rule.fieldType == 'numeric'"
|
|
19
|
+
v-model="rule.operator"
|
|
20
|
+
class="form-control mr-2"
|
|
21
|
+
>
|
|
22
|
+
<option v-for="operator in rule.operators" :key="operator">
|
|
23
|
+
{{ operator }}
|
|
24
|
+
</option>
|
|
25
|
+
</select>
|
|
26
|
+
<input
|
|
27
|
+
v-if="rule.fieldType == 'text' || rule.fieldType == 'numeric'"
|
|
28
|
+
class="form-control"
|
|
29
|
+
:type="rule.fieldType == 'text' ? 'text' : 'number'"
|
|
30
|
+
placeholder="Valor"
|
|
31
|
+
v-model="rule.valor"
|
|
32
|
+
/>
|
|
33
|
+
<CheckboxGroup
|
|
34
|
+
v-if="rule.fieldType == 'checkbox'"
|
|
35
|
+
:options="options"
|
|
36
|
+
v-model="rule.valor"
|
|
37
|
+
/>
|
|
38
|
+
<DateTime
|
|
39
|
+
v-if="rule.fieldType == 'dateTime'"
|
|
40
|
+
:format="rule.props.format"
|
|
41
|
+
:type="rule.props.type"
|
|
42
|
+
:range="rule.props.range"
|
|
43
|
+
v-model="rule.valor"
|
|
44
|
+
/>
|
|
45
|
+
<Select
|
|
46
|
+
v-if="rule.fieldType == 'select'"
|
|
47
|
+
:url="rule.props.url"
|
|
48
|
+
v-model="rule.valor"
|
|
49
|
+
/>
|
|
50
|
+
<div @click="removeRegra" class="ml-auto btn-remove">
|
|
51
|
+
<i class="fas fa-times"></i>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<script>
|
|
58
|
+
import DateTime from "@nixweb/nixloc-ui/src/component/forms/DateTime";
|
|
59
|
+
import Select from "@nixweb/nixloc-ui/src/component/forms/Select";
|
|
60
|
+
import CheckboxGroup from "@nixweb/nixloc-ui/src/component/forms/CheckboxGroup";
|
|
61
|
+
import RadioGroup from "@nixweb/nixloc-ui/src/component/forms/RadioGroup.vue";
|
|
62
|
+
|
|
63
|
+
import { mapMutations } from "vuex";
|
|
64
|
+
|
|
65
|
+
export default {
|
|
66
|
+
name: "DynamicComponent",
|
|
67
|
+
components: {
|
|
68
|
+
DateTime,
|
|
69
|
+
Select,
|
|
70
|
+
CheckboxGroup,
|
|
71
|
+
RadioGroup,
|
|
72
|
+
},
|
|
73
|
+
props: ["rule"],
|
|
74
|
+
methods: {
|
|
75
|
+
...mapMutations("generic", ["addEvent"]),
|
|
76
|
+
...mapMutations("report", ["removeSelectedRule"]),
|
|
77
|
+
removeRegra() {
|
|
78
|
+
this.removeSelectedRule(this.rule.id);
|
|
79
|
+
this.addEvent({
|
|
80
|
+
nome: "selectedRuleRemovida",
|
|
81
|
+
data: { id: this.rule.id },
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
computed: {
|
|
86
|
+
options() {
|
|
87
|
+
let options = [];
|
|
88
|
+
this.rule.options.forEach((item) => {
|
|
89
|
+
let option = { text: item.title, value: item.valor };
|
|
90
|
+
options.push(option);
|
|
91
|
+
});
|
|
92
|
+
return options;
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
</script>
|
|
97
|
+
<style scoped>
|
|
98
|
+
.btn-remove {
|
|
99
|
+
font-size: 16px;
|
|
100
|
+
color: darkgray;
|
|
101
|
+
cursor: pointer;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.div-select {
|
|
105
|
+
width: 320px;
|
|
106
|
+
}
|
|
107
|
+
</style>
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<b-row>
|
|
4
|
+
<b-col sm="6">
|
|
5
|
+
<ScrollBar :minHeight="200" :maxHeight="250">
|
|
6
|
+
<div class="div-options">
|
|
7
|
+
<CheckboxGroup
|
|
8
|
+
:stacked="true"
|
|
9
|
+
:initialValue="optionTable.initialValue"
|
|
10
|
+
:options="optionTable.options"
|
|
11
|
+
v-model="selectedField"
|
|
12
|
+
/>
|
|
13
|
+
</div>
|
|
14
|
+
</ScrollBar>
|
|
15
|
+
</b-col>
|
|
16
|
+
<b-col sm="6">
|
|
17
|
+
<options
|
|
18
|
+
:options="[
|
|
19
|
+
{ text: 'Crescente', value: 'asc' },
|
|
20
|
+
{ text: 'Decrescente', value: 'desc' },
|
|
21
|
+
]"
|
|
22
|
+
v-model="ordenar"
|
|
23
|
+
/>
|
|
24
|
+
<SelectStatic
|
|
25
|
+
title="Ordenar"
|
|
26
|
+
fieldTarget="ordenar"
|
|
27
|
+
:initialValue="initialValue"
|
|
28
|
+
:data="ordenacao"
|
|
29
|
+
v-model="campoOrdenado"
|
|
30
|
+
/>
|
|
31
|
+
</b-col>
|
|
32
|
+
</b-row>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
<script>
|
|
36
|
+
import SelectStatic from "@nixweb/nixloc-ui/src/component/forms/SelectStatic";
|
|
37
|
+
import options from "@nixweb/nixloc-ui/src/component/forms/options";
|
|
38
|
+
import CheckboxGroup from "@nixweb/nixloc-ui/src/component/forms/CheckboxGroup";
|
|
39
|
+
import ScrollBar from "@nixweb/nixloc-ui/src/component/layout/ScrollBar.vue";
|
|
40
|
+
|
|
41
|
+
import { mapMutations, mapGetters } from "vuex";
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
name: "CampoRelatorio",
|
|
45
|
+
components: {
|
|
46
|
+
CheckboxGroup,
|
|
47
|
+
SelectStatic,
|
|
48
|
+
ScrollBar,
|
|
49
|
+
options,
|
|
50
|
+
},
|
|
51
|
+
props: {
|
|
52
|
+
fields: Array,
|
|
53
|
+
},
|
|
54
|
+
data() {
|
|
55
|
+
return {
|
|
56
|
+
ordenar: "asc",
|
|
57
|
+
initialValue: {},
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
created() {
|
|
61
|
+
this.initialValue = this.ordenacao[0];
|
|
62
|
+
let obj = {
|
|
63
|
+
content: this.initialValue.content,
|
|
64
|
+
id: this.initialValue.id,
|
|
65
|
+
ordenar: this.ordenar,
|
|
66
|
+
};
|
|
67
|
+
this.atualizaCampoOrdenado(obj);
|
|
68
|
+
},
|
|
69
|
+
mounted() {
|
|
70
|
+
this.addFieldsReport(this.fields);
|
|
71
|
+
},
|
|
72
|
+
computed: {
|
|
73
|
+
...mapGetters("report", ["optionTable"]),
|
|
74
|
+
selectedField: {
|
|
75
|
+
get() {
|
|
76
|
+
return this.$store.state.report.selectedField;
|
|
77
|
+
},
|
|
78
|
+
set(value) {
|
|
79
|
+
this.updateSelectedField(value);
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
campoOrdenado: {
|
|
83
|
+
get() {
|
|
84
|
+
return this.$store.state.report.campoOrdenado;
|
|
85
|
+
},
|
|
86
|
+
set(value) {
|
|
87
|
+
let obj = { content: value.content, id: value.id, ordenar: this.ordenar };
|
|
88
|
+
this.atualizaCampoOrdenado(obj);
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
ordenacao() {
|
|
92
|
+
let ordenacao = [];
|
|
93
|
+
this.optionTable.options.forEach((option) => {
|
|
94
|
+
console.log(option);
|
|
95
|
+
/* let obj = { content: option.text, id: option.value };
|
|
96
|
+
ordenacao.push(obj);*/
|
|
97
|
+
});
|
|
98
|
+
return ordenacao;
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
methods: {
|
|
102
|
+
...mapMutations("report", [
|
|
103
|
+
"addFieldsReport",
|
|
104
|
+
"updateSelectedField",
|
|
105
|
+
"atualizaCampoOrdenado",
|
|
106
|
+
]),
|
|
107
|
+
},
|
|
108
|
+
watch: {
|
|
109
|
+
ordenar: {
|
|
110
|
+
handler(value) {
|
|
111
|
+
let obj = {
|
|
112
|
+
content: this.campoOrdenado.content,
|
|
113
|
+
id: this.campoOrdenado.id,
|
|
114
|
+
ordenar: this.ordenar,
|
|
115
|
+
};
|
|
116
|
+
this.atualizaCampoOrdenado(obj);
|
|
117
|
+
},
|
|
118
|
+
deep: true,
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
</script>
|
|
123
|
+
<style scoped>
|
|
124
|
+
.div-options {
|
|
125
|
+
margin-left: 10px;
|
|
126
|
+
}
|
|
127
|
+
</style>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="vqb-children">
|
|
3
|
+
<component
|
|
4
|
+
:is="component()"
|
|
5
|
+
v-for="(rule, index) in query_builder.rules"
|
|
6
|
+
:key="index"
|
|
7
|
+
:rule="rule"
|
|
8
|
+
/>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import { mapState, mapMutations } from "vuex";
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
data() {
|
|
17
|
+
return {
|
|
18
|
+
dynamicComponent: null,
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
computed: {
|
|
22
|
+
...mapState("report", ["query_builder"]),
|
|
23
|
+
},
|
|
24
|
+
mounted() {
|
|
25
|
+
this.dynamicComponent = this.$parent.$options.components["DynamicComponent"];
|
|
26
|
+
},
|
|
27
|
+
methods: {
|
|
28
|
+
...mapMutations("report", ["convertRulesToOdata"]),
|
|
29
|
+
component() {
|
|
30
|
+
return this.dynamicComponent;
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
watch: {
|
|
34
|
+
"query_builder.rules": {
|
|
35
|
+
handler() {
|
|
36
|
+
this.convertRulesToOdata(this.query_builder.rules);
|
|
37
|
+
},
|
|
38
|
+
deep: true,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
</script>
|