@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
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="custom-escolher" :tabindex="tabindex" @blur="open = false">
|
|
3
|
-
<div class="selected" :class="{ open: open }" @click="open = !open">
|
|
4
|
-
{{ selected }}
|
|
5
|
-
</div>
|
|
6
|
-
<div class="items" :class="{ selectHide: !open }">
|
|
7
|
-
<div v-for="(option, i) of options" :key="i">
|
|
8
|
-
<div @click="selecionar(option)">
|
|
9
|
-
<span :class="option.classeCss">
|
|
10
|
-
<i :class="option.icone"></i>
|
|
11
|
-
<span> {{ option.label }}</span>
|
|
12
|
-
</span>
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<script>
|
|
20
|
-
export default {
|
|
21
|
-
props: [
|
|
22
|
-
"options",
|
|
23
|
-
"tabindex",
|
|
24
|
-
"value",
|
|
25
|
-
] /* {
|
|
26
|
-
options: {
|
|
27
|
-
type: Array,
|
|
28
|
-
required: true,
|
|
29
|
-
},
|
|
30
|
-
default: {
|
|
31
|
-
type: String,
|
|
32
|
-
required: false,
|
|
33
|
-
default: null,
|
|
34
|
-
},
|
|
35
|
-
tabindex: {
|
|
36
|
-
type: Number,
|
|
37
|
-
required: false,
|
|
38
|
-
default: 0,
|
|
39
|
-
},
|
|
40
|
-
value: Object,
|
|
41
|
-
},*/,
|
|
42
|
-
data() {
|
|
43
|
-
return {
|
|
44
|
-
selected: "Selecione os filtros",
|
|
45
|
-
open: false,
|
|
46
|
-
};
|
|
47
|
-
},
|
|
48
|
-
mounted() {
|
|
49
|
-
this.$emit("input", this.selected);
|
|
50
|
-
},
|
|
51
|
-
methods: {
|
|
52
|
-
selecionar(option) {
|
|
53
|
-
this.$emit("input", option);
|
|
54
|
-
this.selected = option.label;
|
|
55
|
-
this.open = false;
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
</script>
|
|
60
|
-
|
|
61
|
-
<style scoped>
|
|
62
|
-
.custom-escolher {
|
|
63
|
-
position: relative;
|
|
64
|
-
width: 100%;
|
|
65
|
-
text-align: left;
|
|
66
|
-
outline: none;
|
|
67
|
-
height: 40px;
|
|
68
|
-
line-height: 40px;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.custom-escolher .selected {
|
|
72
|
-
background-color: white;
|
|
73
|
-
border-bottom: 1px solid #dbdee0;
|
|
74
|
-
color: black;
|
|
75
|
-
padding-left: 1em;
|
|
76
|
-
cursor: pointer;
|
|
77
|
-
user-select: none;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.custom-escolher .selected:after {
|
|
81
|
-
position: absolute;
|
|
82
|
-
content: "";
|
|
83
|
-
top: 22px;
|
|
84
|
-
right: 1em;
|
|
85
|
-
width: 0;
|
|
86
|
-
height: 0;
|
|
87
|
-
border: 5px solid transparent;
|
|
88
|
-
border-color: black transparent transparent transparent;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.custom-escolher .items {
|
|
92
|
-
color: black;
|
|
93
|
-
border-radius: 0px 0px 6px 6px;
|
|
94
|
-
overflow: hidden;
|
|
95
|
-
position: absolute;
|
|
96
|
-
background-color: #fafafc;
|
|
97
|
-
left: 0;
|
|
98
|
-
right: 0;
|
|
99
|
-
z-index: 1;
|
|
100
|
-
height: 200px;
|
|
101
|
-
overflow-y: visible;
|
|
102
|
-
overflow-x: hidden;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.custom-escolher .items div {
|
|
106
|
-
color: black;
|
|
107
|
-
padding-left: 1em;
|
|
108
|
-
cursor: pointer;
|
|
109
|
-
user-select: none;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.selectHide {
|
|
113
|
-
display: none;
|
|
114
|
-
}
|
|
115
|
-
</style>
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="vqb-children">
|
|
3
|
-
<component
|
|
4
|
-
:is="getComponent(child.type)"
|
|
5
|
-
v-for="(child, index) in query.children"
|
|
6
|
-
:key="index"
|
|
7
|
-
:type="child.type"
|
|
8
|
-
:query.sync="child.query"
|
|
9
|
-
:rule-types="ruleTypes"
|
|
10
|
-
:rules="rules"
|
|
11
|
-
:rule="$parent.ruleById(child.query.rule)"
|
|
12
|
-
:index="index"
|
|
13
|
-
:max-depth="maxDepth"
|
|
14
|
-
:depth="depth + 1"
|
|
15
|
-
:labels="labels"
|
|
16
|
-
@child-deletion-requested="$parent.removeChild"
|
|
17
|
-
/>
|
|
18
|
-
</div>
|
|
19
|
-
</template>
|
|
20
|
-
|
|
21
|
-
<script>
|
|
22
|
-
export default {
|
|
23
|
-
// eslint-disable-next-line vue/require-prop-types
|
|
24
|
-
props: ['query', 'ruleTypes', 'rules', 'maxDepth', 'labels', 'depth'],
|
|
25
|
-
|
|
26
|
-
data() {
|
|
27
|
-
return {
|
|
28
|
-
groupComponent: null,
|
|
29
|
-
ruleComponent: null
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
mounted() {
|
|
34
|
-
this.groupComponent = this.$parent.$options.components['QueryBuilderGroup'];
|
|
35
|
-
this.ruleComponent = this.$parent.$options.components['QueryBuilderRule'];
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
methods: {
|
|
39
|
-
getComponent(type) {
|
|
40
|
-
return type === 'query-builder-group'
|
|
41
|
-
? this.groupComponent
|
|
42
|
-
: this.ruleComponent;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
</script>
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div></div>
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script>
|
|
6
|
-
/* eslint-disable vue/require-default-prop */
|
|
7
|
-
import deepClone from "../utilities.js";
|
|
8
|
-
import QueryBuilderChildren from "./QueryBuilderChildren.vue";
|
|
9
|
-
|
|
10
|
-
import { mapMutations, mapGetters } from "vuex";
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
components: {
|
|
14
|
-
// eslint-disable-next-line vue/no-unused-components
|
|
15
|
-
QueryBuilderChildren,
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
props: {
|
|
19
|
-
ruleTypes: Object,
|
|
20
|
-
type: {
|
|
21
|
-
type: String,
|
|
22
|
-
default: "query-builder-group",
|
|
23
|
-
},
|
|
24
|
-
query: Object,
|
|
25
|
-
rules: Array,
|
|
26
|
-
index: Number,
|
|
27
|
-
maxDepth: Number,
|
|
28
|
-
depth: Number,
|
|
29
|
-
labels: Object,
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
data() {
|
|
33
|
-
return {
|
|
34
|
-
selectedRule: this.rules[0],
|
|
35
|
-
valida: [],
|
|
36
|
-
};
|
|
37
|
-
},
|
|
38
|
-
computed: {
|
|
39
|
-
...mapGetters("generic", ["evento"]),
|
|
40
|
-
},
|
|
41
|
-
methods: {
|
|
42
|
-
...mapMutations("generic", ["insereNotificacao"]),
|
|
43
|
-
|
|
44
|
-
ruleById(ruleId) {
|
|
45
|
-
var rule = null;
|
|
46
|
-
|
|
47
|
-
this.rules.forEach(function (value) {
|
|
48
|
-
if (value.id === ruleId) {
|
|
49
|
-
rule = value;
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
return rule;
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
addRule() {
|
|
58
|
-
let updated_query = deepClone(this.query);
|
|
59
|
-
let child = {
|
|
60
|
-
type: "query-builder-rule",
|
|
61
|
-
query: {
|
|
62
|
-
id: Math.random()
|
|
63
|
-
.toString(36)
|
|
64
|
-
.replace(/[^a-z]+/g, "")
|
|
65
|
-
.substr(0, 5),
|
|
66
|
-
obrigatorio: this.selectedRule.obrigatorio,
|
|
67
|
-
type: this.selectedRule.type,
|
|
68
|
-
choices: this.selectedRule.choices,
|
|
69
|
-
classeCss: this.selectedRule.classeCss,
|
|
70
|
-
valida: this.selectedRule.valida,
|
|
71
|
-
tipo: this.selectedRule.tipo,
|
|
72
|
-
label: this.selectedRule.label,
|
|
73
|
-
rule: this.selectedRule.id,
|
|
74
|
-
operator: this.selectedRule.operators[0],
|
|
75
|
-
operand:
|
|
76
|
-
typeof this.selectedRule.operands === "undefined"
|
|
77
|
-
? this.selectedRule.label
|
|
78
|
-
: this.selectedRule.operands[0],
|
|
79
|
-
value: null,
|
|
80
|
-
},
|
|
81
|
-
};
|
|
82
|
-
// A bit hacky, but `v-model` on `select` requires an array.
|
|
83
|
-
if (this.ruleById(child.query.rule).type === "multi-select") {
|
|
84
|
-
child.query.value = [];
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
if (!this.jaExiste(child.query.rule)) {
|
|
88
|
-
updated_query.children.push(child);
|
|
89
|
-
if (child.query.valida) this.valida.push(child);
|
|
90
|
-
} else {
|
|
91
|
-
var erro = {
|
|
92
|
-
property: "ERRO QUERY BUILDER",
|
|
93
|
-
mensagem: `Não é possível adicionar o filtro ${child.query.label} 2 vezes!`,
|
|
94
|
-
};
|
|
95
|
-
this.insereNotificacao([erro]);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
this.$emit("update:query", updated_query);
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
addGroup() {
|
|
102
|
-
let updated_query = deepClone(this.query);
|
|
103
|
-
if (this.depth < this.maxDepth) {
|
|
104
|
-
updated_query.children.push({
|
|
105
|
-
type: "query-builder-group",
|
|
106
|
-
query: {
|
|
107
|
-
logicalOperator: this.labels.matchTypes[0].id,
|
|
108
|
-
children: [],
|
|
109
|
-
},
|
|
110
|
-
});
|
|
111
|
-
this.$emit("update:query", updated_query);
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
remove() {
|
|
116
|
-
this.$emit("child-deletion-requested", this.index);
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
removeChild(index) {
|
|
120
|
-
this.valida.splice(this.valida.indexOf(index, 1));
|
|
121
|
-
|
|
122
|
-
let updated_query = deepClone(this.query);
|
|
123
|
-
|
|
124
|
-
updated_query.children.splice(index, 1);
|
|
125
|
-
|
|
126
|
-
this.$emit("update:query", updated_query);
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
jaExiste(chave) {
|
|
130
|
-
var existe = this.valida.find((value) => {
|
|
131
|
-
return value.query.rule === chave;
|
|
132
|
-
});
|
|
133
|
-
if (existe) return true;
|
|
134
|
-
return false;
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
watch: {
|
|
138
|
-
evento: {
|
|
139
|
-
handler(evento) {
|
|
140
|
-
if (evento.nome == "tagRemovida") {
|
|
141
|
-
var valida = this.valida.filter((x) => {
|
|
142
|
-
return x.query.id != evento.dados.id;
|
|
143
|
-
});
|
|
144
|
-
this.valida = valida;
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
deep: true,
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
};
|
|
151
|
-
</script>
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div></div>
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script>
|
|
6
|
-
import deepClone from "../utilities.js";
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
// eslint-disable-next-line vue/require-prop-types
|
|
10
|
-
props: ["query", "index", "rule", "labels", "depth"],
|
|
11
|
-
|
|
12
|
-
computed: {
|
|
13
|
-
isCustomComponent() {
|
|
14
|
-
return this.rule.type === "custom-component";
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
selectOptions() {
|
|
18
|
-
if (typeof this.rule.choices === "undefined") {
|
|
19
|
-
return {};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Nest items to support <optgroup> if the rule's choices have
|
|
23
|
-
// defined groups. Otherwise just return a single-level array
|
|
24
|
-
return this.rule.choices.reduce(function (groups, item, index) {
|
|
25
|
-
let key = item["group"];
|
|
26
|
-
if (typeof key !== "undefined") {
|
|
27
|
-
groups[key] = groups[key] || [];
|
|
28
|
-
groups[key].push(item);
|
|
29
|
-
} else {
|
|
30
|
-
groups[index] = item;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return groups;
|
|
34
|
-
}, {});
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
hasOptionGroups() {
|
|
38
|
-
return this.selectOptions.length && Array.isArray(this.selectOptions[0]);
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
beforeMount() {
|
|
43
|
-
if (this.rule.type === "custom-component") {
|
|
44
|
-
this.$options.components[this.id] = this.rule.component;
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
mounted() {
|
|
49
|
-
let updated_query = deepClone(this.query);
|
|
50
|
-
|
|
51
|
-
// Set a default value for these types if one isn't provided already
|
|
52
|
-
if (this.query.value === null) {
|
|
53
|
-
if (this.rule.inputType === "checkbox") {
|
|
54
|
-
updated_query.value = [];
|
|
55
|
-
}
|
|
56
|
-
if (this.rule.type === "select") {
|
|
57
|
-
updated_query.value = this.rule.choices[0].value;
|
|
58
|
-
}
|
|
59
|
-
if (this.rule.type === "custom-component") {
|
|
60
|
-
updated_query.value = null;
|
|
61
|
-
if (typeof this.rule.default !== "undefined") {
|
|
62
|
-
updated_query.value = deepClone(this.rule.default);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
this.$emit("update:query", updated_query);
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
methods: {
|
|
71
|
-
remove: function () {
|
|
72
|
-
this.$emit("child-deletion-requested", this.index);
|
|
73
|
-
},
|
|
74
|
-
updateQuery(value) {
|
|
75
|
-
let updated_query = deepClone(this.query);
|
|
76
|
-
updated_query.value = value;
|
|
77
|
-
this.$emit("update:query", updated_query);
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
</script>
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- eslint-disable vue/no-v-html -->
|
|
3
|
-
<div class="vqb-group card" :class="'depth-' + depth.toString()">
|
|
4
|
-
<div class="vqb-group-heading card-header" v-if="false">
|
|
5
|
-
<div class="match-type-container form-inline">
|
|
6
|
-
<label class="mr-2" for="vqb-match-type">
|
|
7
|
-
{{ labels.matchType }}
|
|
8
|
-
</label>
|
|
9
|
-
|
|
10
|
-
<select id="vqb-match-type" v-model="query.logicalOperator" class="form-control">
|
|
11
|
-
<option v-for="label in labels.matchTypes" :key="label.id" :value="label.id">
|
|
12
|
-
{{ label.label }}
|
|
13
|
-
</option>
|
|
14
|
-
</select>
|
|
15
|
-
|
|
16
|
-
<button
|
|
17
|
-
v-if="depth > 1"
|
|
18
|
-
type="button"
|
|
19
|
-
class="close ml-auto"
|
|
20
|
-
@click="remove"
|
|
21
|
-
v-html="labels.removeGroup"
|
|
22
|
-
></button>
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
|
|
26
|
-
<div class="vqb-group-body card-body">
|
|
27
|
-
<div class="rule-actions form-inline">
|
|
28
|
-
<div class="div-custom">
|
|
29
|
-
<b-row>
|
|
30
|
-
<b-col sm="6">
|
|
31
|
-
<CustomSelect :options="rules" class="select" v-model="selectedRule" />
|
|
32
|
-
</b-col>
|
|
33
|
-
<b-col sm="4">
|
|
34
|
-
<button type="button" class="btn btn-secondary mr-2" @click="addRule">
|
|
35
|
-
{{ labels.addRule }}
|
|
36
|
-
</button>
|
|
37
|
-
</b-col>
|
|
38
|
-
</b-row>
|
|
39
|
-
|
|
40
|
-
<!-- <button
|
|
41
|
-
v-if="depth < maxDepth"
|
|
42
|
-
type="button"
|
|
43
|
-
class="btn btn-secondary"
|
|
44
|
-
@click="addGroup"
|
|
45
|
-
>
|
|
46
|
-
{{ labels.addGroup }}
|
|
47
|
-
</button> -->
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
|
|
51
|
-
<query-builder-children v-bind="$props" />
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
</template>
|
|
55
|
-
|
|
56
|
-
<script>
|
|
57
|
-
import CustomSelect from "../../components/CustomSelect.vue";
|
|
58
|
-
import QueryBuilderGroup from "../../components/QueryBuilderGroup";
|
|
59
|
-
import QueryBuilderRule from "./BootstrapRule.vue";
|
|
60
|
-
|
|
61
|
-
export default {
|
|
62
|
-
name: "QueryBuilderGroup",
|
|
63
|
-
|
|
64
|
-
components: {
|
|
65
|
-
// eslint-disable-next-line vue/no-unused-components
|
|
66
|
-
QueryBuilderRule: QueryBuilderRule,
|
|
67
|
-
CustomSelect,
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
extends: QueryBuilderGroup,
|
|
71
|
-
};
|
|
72
|
-
</script>
|
|
73
|
-
|
|
74
|
-
<style>
|
|
75
|
-
.titulo-option {
|
|
76
|
-
padding: 10px;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.div-custom {
|
|
80
|
-
width: 100%;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.vue-query-builder .vqb-group .rule-actions {
|
|
84
|
-
margin-bottom: 20px;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.vue-query-builder .vqb-rule {
|
|
88
|
-
margin-top: 15px;
|
|
89
|
-
margin-bottom: 15px;
|
|
90
|
-
background-color: #f5f5f5;
|
|
91
|
-
border-color: #ddd;
|
|
92
|
-
padding: 15px;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.vue-query-builder .vqb-group.depth-1 .vqb-rule,
|
|
96
|
-
.vue-query-builder .vqb-group.depth-2 {
|
|
97
|
-
border-left: 2px solid #8bc34a;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.vue-query-builder .vqb-group.depth-2 .vqb-rule,
|
|
101
|
-
.vue-query-builder .vqb-group.depth-3 {
|
|
102
|
-
border-left: 2px solid #00bcd4;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.vue-query-builder .vqb-group.depth-3 .vqb-rule,
|
|
106
|
-
.vue-query-builder .vqb-group.depth-4 {
|
|
107
|
-
border-left: 2px solid #ff5722;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.vue-query-builder .close {
|
|
111
|
-
opacity: 1;
|
|
112
|
-
color: rgb(150, 150, 150);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
@media (min-width: 768px) {
|
|
116
|
-
.vue-query-builder .vqb-rule.form-inline .form-group {
|
|
117
|
-
display: block;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
</style>
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- eslint-disable vue/no-v-html -->
|
|
3
|
-
<div class="vqb-rule card">
|
|
4
|
-
<div class="form-inline">
|
|
5
|
-
<label :class="rule.classeCss" class="mr-5">
|
|
6
|
-
<i :class="rule.icone"></i>
|
|
7
|
-
<span style="margin-left: 10px">{{ rule.label }} </span>
|
|
8
|
-
</label>
|
|
9
|
-
|
|
10
|
-
<!-- List of operands (optional) -->
|
|
11
|
-
<select
|
|
12
|
-
v-if="typeof rule.operands !== 'undefined'"
|
|
13
|
-
v-model="query.operand"
|
|
14
|
-
class="form-control mr-2"
|
|
15
|
-
>
|
|
16
|
-
<option v-for="operand in rule.operands" :key="operand">
|
|
17
|
-
{{ operand }}
|
|
18
|
-
</option>
|
|
19
|
-
</select>
|
|
20
|
-
|
|
21
|
-
<!-- List of operators (e.g. =, !=, >, <) -->
|
|
22
|
-
<select
|
|
23
|
-
v-if="typeof rule.operators !== 'undefined' && rule.operators.length > 1"
|
|
24
|
-
v-model="query.operator"
|
|
25
|
-
class="form-control mr-2"
|
|
26
|
-
>
|
|
27
|
-
<option v-for="operator in rule.operators" :key="operator" :value="operator">
|
|
28
|
-
{{ operator }}
|
|
29
|
-
</option>
|
|
30
|
-
</select>
|
|
31
|
-
|
|
32
|
-
<!-- Basic text input -->
|
|
33
|
-
<input
|
|
34
|
-
v-if="rule.inputType === 'text'"
|
|
35
|
-
v-model="query.value"
|
|
36
|
-
class="form-control"
|
|
37
|
-
type="text"
|
|
38
|
-
:placeholder="labels.textInputPlaceholder"
|
|
39
|
-
/>
|
|
40
|
-
|
|
41
|
-
<!-- Basic number input -->
|
|
42
|
-
<input
|
|
43
|
-
v-if="rule.inputType === 'number'"
|
|
44
|
-
v-model="query.value"
|
|
45
|
-
class="form-control"
|
|
46
|
-
type="number"
|
|
47
|
-
/>
|
|
48
|
-
|
|
49
|
-
<!-- Datepicker -->
|
|
50
|
-
<input
|
|
51
|
-
v-if="rule.inputType === 'date'"
|
|
52
|
-
v-model="query.value"
|
|
53
|
-
class="form-control"
|
|
54
|
-
type="date"
|
|
55
|
-
/>
|
|
56
|
-
|
|
57
|
-
<!-- Custom component input -->
|
|
58
|
-
<div v-if="isCustomComponent" class="vqb-custom-component-wrap">
|
|
59
|
-
<DateTime
|
|
60
|
-
v-if="rule.component == 'datetime'"
|
|
61
|
-
:format="rule.props.format"
|
|
62
|
-
:type="rule.props.type"
|
|
63
|
-
:range="rule.props.range"
|
|
64
|
-
:value="query.value"
|
|
65
|
-
@input="updateQuery"
|
|
66
|
-
/>
|
|
67
|
-
|
|
68
|
-
<div class="div-escolher" v-if="rule.component == 'escolher'">
|
|
69
|
-
<Escolher :url="rule.props.url" :value="query.value" @input="updateQuery" />
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
|
|
73
|
-
<!-- Checkbox input -->
|
|
74
|
-
<template v-if="rule.inputType === 'checkbox'">
|
|
75
|
-
<div
|
|
76
|
-
v-for="choice in rule.choices"
|
|
77
|
-
:key="choice.value"
|
|
78
|
-
class="form-check form-check-inline"
|
|
79
|
-
>
|
|
80
|
-
<input
|
|
81
|
-
:id="'depth' + depth + '-' + rule.id + '-' + index + '-' + choice.value"
|
|
82
|
-
v-model="query.value"
|
|
83
|
-
type="checkbox"
|
|
84
|
-
:value="choice.value"
|
|
85
|
-
class="form-check-input"
|
|
86
|
-
/>
|
|
87
|
-
<label
|
|
88
|
-
class="form-check-label"
|
|
89
|
-
:for="'depth' + depth + '-' + rule.id + '-' + index + '-' + choice.value"
|
|
90
|
-
>
|
|
91
|
-
{{ choice.label }}
|
|
92
|
-
</label>
|
|
93
|
-
</div>
|
|
94
|
-
</template>
|
|
95
|
-
|
|
96
|
-
<!-- Radio input -->
|
|
97
|
-
<template v-if="rule.inputType === 'radio'">
|
|
98
|
-
<div
|
|
99
|
-
v-for="choice in rule.choices"
|
|
100
|
-
:key="choice.value"
|
|
101
|
-
class="form-check form-check-inline"
|
|
102
|
-
>
|
|
103
|
-
<input
|
|
104
|
-
:id="'depth' + depth + '-' + rule.id + '-' + index + '-' + choice.value"
|
|
105
|
-
v-model="query.value"
|
|
106
|
-
:name="'depth' + depth + '-' + rule.id + '-' + index"
|
|
107
|
-
type="radio"
|
|
108
|
-
:value="choice.value"
|
|
109
|
-
class="form-check-input"
|
|
110
|
-
/>
|
|
111
|
-
<label
|
|
112
|
-
class="form-check-label"
|
|
113
|
-
:for="'depth' + depth + '-' + rule.id + '-' + index + '-' + choice.value"
|
|
114
|
-
>
|
|
115
|
-
{{ choice.label }}
|
|
116
|
-
</label>
|
|
117
|
-
</div>
|
|
118
|
-
</template>
|
|
119
|
-
|
|
120
|
-
<!-- Select without groups -->
|
|
121
|
-
<select
|
|
122
|
-
v-if="rule.inputType === 'select' && !hasOptionGroups"
|
|
123
|
-
v-model="query.value"
|
|
124
|
-
class="form-control"
|
|
125
|
-
:multiple="rule.type === 'multi-select'"
|
|
126
|
-
>
|
|
127
|
-
<option v-for="option in selectOptions" :key="option.value" :value="option.value">
|
|
128
|
-
{{ option.label }}
|
|
129
|
-
</option>
|
|
130
|
-
</select>
|
|
131
|
-
|
|
132
|
-
<!-- Select with groups -->
|
|
133
|
-
<select
|
|
134
|
-
v-if="rule.inputType === 'select' && hasOptionGroups"
|
|
135
|
-
v-model="query.value"
|
|
136
|
-
class="form-control"
|
|
137
|
-
:multiple="rule.type === 'multi-select'"
|
|
138
|
-
>
|
|
139
|
-
<optgroup
|
|
140
|
-
v-for="(option, option_key) in selectOptions"
|
|
141
|
-
:key="option_key"
|
|
142
|
-
:label="option_key"
|
|
143
|
-
>
|
|
144
|
-
<option
|
|
145
|
-
v-for="sub_option in option"
|
|
146
|
-
:key="sub_option.value"
|
|
147
|
-
:value="sub_option.value"
|
|
148
|
-
>
|
|
149
|
-
{{ sub_option.label }}
|
|
150
|
-
</option>
|
|
151
|
-
</optgroup>
|
|
152
|
-
</select>
|
|
153
|
-
|
|
154
|
-
<!-- Remove rule button -->
|
|
155
|
-
<button
|
|
156
|
-
type="button"
|
|
157
|
-
class="close ml-auto"
|
|
158
|
-
@click="remove"
|
|
159
|
-
v-html="labels.removeRule"
|
|
160
|
-
></button>
|
|
161
|
-
</div>
|
|
162
|
-
</div>
|
|
163
|
-
</template>
|
|
164
|
-
|
|
165
|
-
<script>
|
|
166
|
-
import QueryBuilderRule from "../../components/QueryBuilderRule";
|
|
167
|
-
import DateTime from "@nixweb/nixloc-ui/src/component/forms/DateTime";
|
|
168
|
-
import Escolher from "@nixweb/nixloc-ui/src/component/forms/Escolher";
|
|
169
|
-
|
|
170
|
-
export default {
|
|
171
|
-
extends: QueryBuilderRule,
|
|
172
|
-
components: {
|
|
173
|
-
DateTime,
|
|
174
|
-
Escolher,
|
|
175
|
-
},
|
|
176
|
-
data() {
|
|
177
|
-
return {
|
|
178
|
-
teste: {},
|
|
179
|
-
};
|
|
180
|
-
},
|
|
181
|
-
};
|
|
182
|
-
</script>
|
|
183
|
-
<style scoped>
|
|
184
|
-
.div-escolher {
|
|
185
|
-
width: 320px;
|
|
186
|
-
}
|
|
187
|
-
</style>
|