@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,164 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="vue-query-builder">
|
|
3
|
-
<slot v-bind="vqbProps">
|
|
4
|
-
<query-builder-group v-bind="vqbProps" :query.sync="query" />
|
|
5
|
-
</slot>
|
|
6
|
-
</div>
|
|
7
|
-
</template>
|
|
8
|
-
|
|
9
|
-
<script>
|
|
10
|
-
/* eslint-disable vue/require-default-prop */
|
|
11
|
-
import QueryBuilderGroup from "./layouts/Bootstrap/BootstrapGroup.vue";
|
|
12
|
-
import deepClone from "./utilities.js";
|
|
13
|
-
|
|
14
|
-
var defaultLabels = {
|
|
15
|
-
matchType: "Construtor de Consulta",
|
|
16
|
-
matchTypes: [
|
|
17
|
-
{ id: "all", label: "All" },
|
|
18
|
-
{ id: "any", label: "Any" },
|
|
19
|
-
],
|
|
20
|
-
addRule: "+ Adicionar",
|
|
21
|
-
removeRule: "×",
|
|
22
|
-
addGroup: "+ Adicionar",
|
|
23
|
-
removeGroup: "×",
|
|
24
|
-
textInputPlaceholder: "Valor",
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export default {
|
|
28
|
-
name: "VueQueryBuilder",
|
|
29
|
-
|
|
30
|
-
components: {
|
|
31
|
-
QueryBuilderGroup,
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
props: {
|
|
35
|
-
rules: Array,
|
|
36
|
-
labels: {
|
|
37
|
-
type: Object,
|
|
38
|
-
default() {
|
|
39
|
-
return defaultLabels;
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
maxDepth: {
|
|
43
|
-
type: Number,
|
|
44
|
-
default: 3,
|
|
45
|
-
validator: function (value) {
|
|
46
|
-
return value >= 1;
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
value: Object,
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
data() {
|
|
53
|
-
return {
|
|
54
|
-
query: {
|
|
55
|
-
logicalOperator: this.labels.matchTypes[0].id,
|
|
56
|
-
children: [],
|
|
57
|
-
},
|
|
58
|
-
ruleTypes: {
|
|
59
|
-
text: {
|
|
60
|
-
operators: ["igual", "diferente", "contem"],
|
|
61
|
-
inputType: "text",
|
|
62
|
-
id: "text-field",
|
|
63
|
-
},
|
|
64
|
-
numeric: {
|
|
65
|
-
operators: ["=", "!=", "<", "<=", ">", ">="],
|
|
66
|
-
inputType: "number",
|
|
67
|
-
id: "number-field",
|
|
68
|
-
},
|
|
69
|
-
custom: {
|
|
70
|
-
operators: [],
|
|
71
|
-
inputType: "text",
|
|
72
|
-
id: "custom-field",
|
|
73
|
-
},
|
|
74
|
-
radio: {
|
|
75
|
-
operators: [],
|
|
76
|
-
choices: [],
|
|
77
|
-
inputType: "radio",
|
|
78
|
-
id: "radio-field",
|
|
79
|
-
},
|
|
80
|
-
checkbox: {
|
|
81
|
-
operators: ["checkbox"],
|
|
82
|
-
choices: [],
|
|
83
|
-
inputType: "checkbox",
|
|
84
|
-
id: "checkbox-field",
|
|
85
|
-
},
|
|
86
|
-
select: {
|
|
87
|
-
operators: [],
|
|
88
|
-
choices: [],
|
|
89
|
-
inputType: "select",
|
|
90
|
-
id: "select-field",
|
|
91
|
-
},
|
|
92
|
-
"multi-select": {
|
|
93
|
-
operators: ["="],
|
|
94
|
-
choices: [],
|
|
95
|
-
inputType: "select",
|
|
96
|
-
id: "multi-select-field",
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
};
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
computed: {
|
|
103
|
-
mergedLabels() {
|
|
104
|
-
return Object.assign({}, defaultLabels, this.labels);
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
mergedRules() {
|
|
108
|
-
var mergedRules = [];
|
|
109
|
-
var vm = this;
|
|
110
|
-
|
|
111
|
-
vm.rules.forEach(function (rule) {
|
|
112
|
-
if (typeof vm.ruleTypes[rule.type] !== "undefined") {
|
|
113
|
-
mergedRules.push(Object.assign({}, vm.ruleTypes[rule.type], rule));
|
|
114
|
-
} else {
|
|
115
|
-
mergedRules.push(rule);
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
return mergedRules;
|
|
120
|
-
},
|
|
121
|
-
|
|
122
|
-
vqbProps() {
|
|
123
|
-
return {
|
|
124
|
-
index: 0,
|
|
125
|
-
depth: 1,
|
|
126
|
-
maxDepth: this.maxDepth,
|
|
127
|
-
ruleTypes: this.ruleTypes,
|
|
128
|
-
rules: this.mergedRules,
|
|
129
|
-
labels: this.mergedLabels,
|
|
130
|
-
};
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
mounted() {
|
|
135
|
-
this.$watch(
|
|
136
|
-
"query",
|
|
137
|
-
(newQuery) => {
|
|
138
|
-
if (JSON.stringify(newQuery) !== JSON.stringify(this.value)) {
|
|
139
|
-
this.$emit("input", deepClone(newQuery));
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
deep: true,
|
|
144
|
-
}
|
|
145
|
-
);
|
|
146
|
-
|
|
147
|
-
this.$watch(
|
|
148
|
-
"value",
|
|
149
|
-
(newValue) => {
|
|
150
|
-
if (JSON.stringify(newValue) !== JSON.stringify(this.query)) {
|
|
151
|
-
this.query = deepClone(newValue);
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
deep: true,
|
|
156
|
-
}
|
|
157
|
-
);
|
|
158
|
-
|
|
159
|
-
if (typeof this.$options.propsData.value !== "undefined") {
|
|
160
|
-
this.query = Object.assign(this.query, this.$options.propsData.value);
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
};
|
|
164
|
-
</script>
|
|
@@ -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>
|