@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.
Files changed (122) hide show
  1. package/docs/src/component/template/ModeloRelatorioView.drawio +160 -0
  2. package/docs/src/store/modulos/relatorio.drawio +37 -0
  3. package/package.json +77 -75
  4. package/public/index.html +2 -4
  5. package/public/styles/app.css +1 -2
  6. package/src/component/forms/{Botao.vue → Button.vue} +53 -57
  7. package/src/component/forms/CheckboxGroup.vue +63 -0
  8. package/src/component/forms/{CheckboxUnico.vue → CheckboxSimple.vue} +6 -6
  9. package/src/component/forms/{Cor.vue → Color.vue} +9 -9
  10. package/src/component/forms/DateTime.vue +53 -53
  11. package/src/component/forms/{BotaoDropdown.vue → Dropdown.vue} +50 -50
  12. package/src/component/forms/EditorHtml.vue +123 -0
  13. package/src/component/forms/FileUpload.vue +189 -0
  14. package/src/component/forms/InputDecimal.vue +137 -0
  15. package/src/component/forms/InputNumber.vue +149 -0
  16. package/src/component/forms/InputPassword.vue +135 -0
  17. package/src/component/forms/InputText.vue +157 -0
  18. package/src/component/forms/Modal.vue +15 -15
  19. package/src/component/forms/RadioGroup.vue +50 -0
  20. package/src/component/forms/Select.vue +337 -0
  21. package/src/component/forms/SelectStatic.vue +120 -0
  22. package/src/component/forms/TextArea.vue +126 -0
  23. package/src/component/forms/Toggle.vue +13 -13
  24. package/src/component/layout/{Conta.vue → Account.vue} +28 -28
  25. package/src/component/layout/{Alerta.vue → Alert.vue} +22 -22
  26. package/src/component/layout/Badge.vue +23 -23
  27. package/src/component/layout/{BarraFixa.vue → FixedBar.vue} +16 -16
  28. package/src/component/layout/{CarregandoTelaInteira.vue → LoadingFullPage.vue} +3 -3
  29. package/src/component/layout/Menu.vue +66 -66
  30. package/src/component/layout/{Moldura.vue → Molded.vue} +4 -4
  31. package/src/component/layout/Panel.vue +142 -0
  32. package/src/component/layout/Popover.vue +1 -1
  33. package/src/component/layout/{BarraRolagem.vue → Scrollbar.vue} +9 -11
  34. package/src/component/layout/Tag.vue +9 -9
  35. package/src/component/layout/Topo.vue +1 -1
  36. package/src/component/layout/Wizard.vue +3 -3
  37. package/src/component/shared/BotaoCarregarMais.vue +9 -9
  38. package/src/component/shared/BotaoConsulta.vue +9 -9
  39. package/src/component/shared/CabecalhoImpressao.vue +6 -6
  40. package/src/component/shared/CodigoEditor.vue +16 -16
  41. package/src/component/shared/Confirmacao.vue +28 -28
  42. package/src/component/shared/Dica.vue +10 -10
  43. package/src/component/shared/DocumentoEditor.vue +3 -3
  44. package/src/component/shared/DocumentoPreview.vue +2 -2
  45. package/src/component/shared/EsconderMostrar.vue +26 -26
  46. package/src/component/shared/ExportarExcel.vue +14 -14
  47. package/src/component/shared/ExportarPDF.vue +10 -10
  48. package/src/component/shared/FiltroHorizontal.vue +19 -19
  49. package/src/component/shared/LegendaParametro.vue +17 -17
  50. package/src/component/shared/{Carregando.vue → Loading.vue} +11 -11
  51. package/src/component/shared/Messages.vue +83 -0
  52. package/src/component/shared/Paginacao.vue +10 -10
  53. package/src/component/shared/Progresso.vue +2 -2
  54. package/src/component/shared/Registro.vue +2 -2
  55. package/src/component/shared/ResumoTabela.vue +6 -6
  56. package/src/component/shared/SalvarCancelar.vue +26 -26
  57. package/src/component/shared/{Pesquisa.vue → Search.vue} +36 -36
  58. package/src/component/shared/Tabela.vue +49 -49
  59. package/src/component/shared/TabelaBotao.vue +13 -13
  60. package/src/component/shared/Toast.vue +7 -7
  61. package/src/component/shared/{FiltroVertical.vue → VerticalFilter.vue} +14 -14
  62. package/src/component/shared/construtor-consulta/AdicionaFiltro.vue +191 -0
  63. package/src/component/shared/construtor-consulta/Campo.vue +127 -0
  64. package/src/component/shared/construtor-consulta/ComponenteDinamico.vue +109 -0
  65. package/src/component/shared/construtor-consulta/ConstrutorConsulta.vue +70 -0
  66. package/src/component/shared/construtor-consulta/ConverteParaOdata.js +80 -0
  67. package/src/component/shared/construtor-consulta/EscolherFiltro.vue +96 -0
  68. package/src/component/shared/{query-builder → construtor-consulta}/Filtro.vue +11 -16
  69. package/src/component/shared/construtor-consulta/ListaComponenteDinamico.vue +41 -0
  70. package/src/component/shared/{query-builder → construtor-consulta}/Rodape.vue +9 -9
  71. package/src/component/shared/{query-builder → construtor-consulta}/Tags.vue +7 -7
  72. package/src/component/shared/{query-builder → construtor-consulta}/utilities.js +0 -0
  73. package/src/component/template/ModeloAdicionarModificarView.vue +11 -11
  74. package/src/component/template/ModeloDocumentoView.vue +79 -79
  75. package/src/component/template/ModeloLista.vue +66 -66
  76. package/src/component/template/ModeloRelatorioListaView.vue +71 -68
  77. package/src/component/template/ModeloRelatorioView.vue +218 -200
  78. package/src/component/template/ModeloSubView.vue +13 -13
  79. package/src/component/template/ModeloView.vue +17 -17
  80. package/src/component/template/Relatorio.js +1 -5
  81. package/src/component/template/RelatorioAdicionarModificar.vue +44 -44
  82. package/src/component/value-objects/DadosContato.vue +27 -27
  83. package/src/component/value-objects/DadosPessoa.js +1 -1
  84. package/src/component/value-objects/DadosPessoa.vue +52 -52
  85. package/src/component/value-objects/Endereco.js +1 -1
  86. package/src/component/value-objects/Endereco.vue +83 -83
  87. package/src/config/dicas.js +1 -1
  88. package/src/config/token.js +2 -2
  89. package/src/store/modules/generic.js +489 -0
  90. package/src/store/modules/report.js +246 -0
  91. package/src/store/modules/user.js +38 -0
  92. package/src/store/modules/validation.js +39 -0
  93. package/src/store/store.js +4 -4
  94. package/public/js/menu.js +0 -11
  95. package/public/styles/menu.css +0 -1399
  96. package/src/component/forms/ArquivoUpload.vue +0 -199
  97. package/src/component/forms/CheckboxMultiplo.vue +0 -63
  98. package/src/component/forms/Decimal.vue +0 -137
  99. package/src/component/forms/Escolher.vue +0 -324
  100. package/src/component/forms/EscolherEstatico.vue +0 -139
  101. package/src/component/forms/Numero.vue +0 -153
  102. package/src/component/forms/Opcoes.vue +0 -51
  103. package/src/component/forms/Senha.vue +0 -139
  104. package/src/component/forms/Texto.vue +0 -161
  105. package/src/component/forms/TextoArea.vue +0 -126
  106. package/src/component/forms/TextoEditor.vue +0 -123
  107. package/src/component/layout/Painel.vue +0 -142
  108. package/src/component/shared/Mensagem.vue +0 -86
  109. package/src/component/shared/query-builder/Campo.vue +0 -116
  110. package/src/component/shared/query-builder/ConverteParaOdata.js +0 -73
  111. package/src/component/shared/query-builder/QueryBuilder.vue +0 -164
  112. package/src/component/shared/query-builder/components/CustomSelect.vue +0 -115
  113. package/src/component/shared/query-builder/components/QueryBuilderChildren.vue +0 -46
  114. package/src/component/shared/query-builder/components/QueryBuilderGroup.vue +0 -151
  115. package/src/component/shared/query-builder/components/QueryBuilderRule.vue +0 -81
  116. package/src/component/shared/query-builder/layouts/Bootstrap/BootstrapGroup.vue +0 -120
  117. package/src/component/shared/query-builder/layouts/Bootstrap/BootstrapRule.vue +0 -171
  118. package/src/component/shared/query-builder/main.js +0 -81
  119. package/src/store/modulos/generic.js +0 -494
  120. package/src/store/modulos/relatorio.js +0 -201
  121. package/src/store/modulos/usuario.js +0 -38
  122. package/src/store/modulos/validation.js +0 -39
@@ -0,0 +1,127 @@
1
+ <template>
2
+ <div>
3
+ <b-row>
4
+ <b-col sm="6">
5
+ <BarraRolagem :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
+ </BarraRolagem>
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
+ <EscolherEstatico
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 EscolherEstatico from "@nixweb/nixloc-ui/src/component/forms/EscolherEstatico";
37
+ import options from "@nixweb/nixloc-ui/src/component/forms/options";
38
+ import CheckboxGroup from "@nixweb/nixloc-ui/src/component/forms/CheckboxGroup";
39
+ import BarraRolagem from "@nixweb/nixloc-ui/src/component/layout/BarraRolagem.vue";
40
+
41
+ import { mapMutations, mapGetters } from "vuex";
42
+
43
+ export default {
44
+ name: "CampoRelatorio",
45
+ components: {
46
+ CheckboxGroup,
47
+ EscolherEstatico,
48
+ BarraRolagem,
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,109 @@
1
+ <template>
2
+ <div class="vqb-rule card">
3
+ <div class="form-inline">
4
+ <label :class="rule.classeCss" 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
+ <options
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.operatores" :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
+ <Escolher
46
+ v-if="rule.fieldType == 'escolher'"
47
+ :url="rule.props.url"
48
+ v-model="rule.valor"
49
+ />
50
+ <div @click="removeRegra" class="ml-auto btn-remover">
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 Escolher from "@nixweb/nixloc-ui/src/component/forms/Escolher";
60
+ import CheckboxGroup from "@nixweb/nixloc-ui/src/component/forms/CheckboxGroup";
61
+ import options from "@nixweb/nixloc-ui/src/component/forms/options.vue";
62
+
63
+ import deepClone from "./utilities.js";
64
+
65
+ import { mapMutations } from "vuex";
66
+
67
+ export default {
68
+ name: "ComponenteDinamico",
69
+ components: {
70
+ DateTime,
71
+ Escolher,
72
+ CheckboxGroup,
73
+ options,
74
+ },
75
+ props: ["rule"],
76
+ methods: {
77
+ ...mapMutations("generic", ["addEvent"]),
78
+ ...mapMutations("report", ["removeSelectedRule"]),
79
+ removeRegra() {
80
+ this.removeSelectedRule(this.rule.id);
81
+ this.addEvent({
82
+ nome: "selectedRuleRemovida",
83
+ data: { id: this.rule.id },
84
+ });
85
+ },
86
+ },
87
+ computed: {
88
+ options() {
89
+ let options = [];
90
+ this.rule.options.forEach((item) => {
91
+ let option = { text: item.title, value: item.valor };
92
+ options.push(option);
93
+ });
94
+ return options;
95
+ },
96
+ },
97
+ };
98
+ </script>
99
+ <style scoped>
100
+ .btn-remover {
101
+ font-size: 16px;
102
+ color: darkgray;
103
+ cursor: pointer;
104
+ }
105
+
106
+ .div-escolher {
107
+ width: 320px;
108
+ }
109
+ </style>
@@ -0,0 +1,70 @@
1
+ <template>
2
+ <div class="vue-query-builder">
3
+ <slot v-bind="vqbProps">
4
+ <AdicionaFiltro v-bind="vqbProps" />
5
+ </slot>
6
+ </div>
7
+ </template>
8
+
9
+ <script>
10
+ import AdicionaFiltro from "./AdicionaFiltro.vue";
11
+ import deepClone from "./utilities.js";
12
+
13
+ export default {
14
+ name: "ConstrutorConsulta",
15
+ components: {
16
+ AdicionaFiltro,
17
+ },
18
+ props: {
19
+ rules: Array,
20
+ },
21
+ data() {
22
+ return {
23
+ consulta: {},
24
+ typeRegra: {
25
+ text: {
26
+ id: "text-field",
27
+ operatores: ["igual", "diferente", "contem"],
28
+ fieldType: "text",
29
+ },
30
+ numeric: {
31
+ id: "number-field",
32
+ operatores: ["=", "!=", "<", "<=", ">", ">="],
33
+ fieldType: "number",
34
+ },
35
+ radio: {
36
+ id: "radio-field",
37
+ operatores: [],
38
+ options: [],
39
+ fieldType: "radio",
40
+ },
41
+ checkbox: {
42
+ id: "checkbox-field",
43
+ operatores: ["checkbox"],
44
+ options: [],
45
+ fieldType: "checkbox",
46
+ },
47
+ },
48
+ };
49
+ },
50
+ computed: {
51
+ mesclarRegras() {
52
+ var mesclarRegras = [];
53
+ var self = this;
54
+ self.rules.forEach(function (rule) {
55
+ if (typeof self.typeRegra[rule.fieldType] !== "undefined") {
56
+ mesclarRegras.push(Object.assign({}, self.typeRegra[rule.fieldType], rule));
57
+ } else {
58
+ mesclarRegras.push(rule);
59
+ }
60
+ });
61
+ return mesclarRegras;
62
+ },
63
+ vqbProps() {
64
+ return {
65
+ rules: this.mesclarRegras,
66
+ };
67
+ },
68
+ },
69
+ };
70
+ </script>
@@ -0,0 +1,80 @@
1
+ export default class ConverteParaOdata {
2
+ converteRegra(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.convertePeriodo(valor);
20
+ if (rule.fieldType === "escolher") return this.converteEscolher(nome, valor);
21
+ if (rule.fieldType === "checkbox") return this.converteCheckbox(nome, title, type, valor);
22
+
23
+ }
24
+ convertePeriodo(valor) {
25
+ let inicio = this.converteData(valor[0]);
26
+ let fim = this.converteData(valor[1]);
27
+ return `data ge ${inicio} and data le ${fim}`;
28
+ }
29
+ converteEscolher(nome, valor) {
30
+ return `${nome} eq '${valor.id}'`;
31
+ }
32
+ converteCheckbox(nome, title, type, options) {
33
+ let consulta = "";
34
+ let sequencia = 0;
35
+ var size = options.length;
36
+ let self = this;
37
+ options.forEach(function (valor) {
38
+ if (type == "field") {
39
+ consulta += `${nome} eq ${valor}`;
40
+ if (sequencia + 1 != size) consulta += ` or `;
41
+ }
42
+ if (type == "totalization") {
43
+ let nomeConvertido = self.converteNome(valor);
44
+ consulta += `${nome} with ${valor} as ${nomeConvertido}${title}`;
45
+ if (sequencia + 1 != size) consulta += `,`;
46
+ }
47
+ sequencia++;
48
+ });
49
+
50
+ if (size > 1 && type == "field") return `(${consulta})`;
51
+ return `${consulta}`;
52
+ }
53
+ converteData(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
+ converteNome(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,96 @@
1
+ <template>
2
+ <div class="escolher-filter" :tabindex="tabindex" @blur="abrir = false">
3
+ <div class="selecionado" :class="{ abrir: abrir }" @click="abrir = !abrir">
4
+ {{ selecionado }}
5
+ </div>
6
+ <div class="items" :class="{ esconder: !abrir }">
7
+ <div v-for="(options, i) of options" :key="i">
8
+ <div @click="selecionar(options)">
9
+ <span :class="options.classeCss">
10
+ <i :class="options.icon"></i>
11
+ <span> {{ options.title }}</span>
12
+ </span>
13
+ </div>
14
+ </div>
15
+ </div>
16
+ </div>
17
+ </template>
18
+
19
+ <script>
20
+ export default {
21
+ props: ["options", "tabindex", "value"],
22
+ data() {
23
+ return {
24
+ selecionado: "Selecione os filtros",
25
+ abrir: false,
26
+ };
27
+ },
28
+ mounted() {
29
+ this.$emit("input", this.selecionado);
30
+ },
31
+ methods: {
32
+ selecionar(options) {
33
+ this.$emit("input", options);
34
+ this.selecionado = options.title;
35
+ this.abrir = false;
36
+ },
37
+ },
38
+ };
39
+ </script>
40
+
41
+ <style scoped>
42
+ .escolher-filter {
43
+ position: relative;
44
+ width: 100%;
45
+ text-align: left;
46
+ outline: none;
47
+ height: 40px;
48
+ line-height: 40px;
49
+ z-index: 1000;
50
+ }
51
+
52
+ .escolher-filter .selecionado {
53
+ background-color: white;
54
+ border-bottom: 1px solid #dbdee0;
55
+ color: black;
56
+ padding-left: 1em;
57
+ cursor: pointer;
58
+ user-select: none;
59
+ }
60
+
61
+ .escolher-filter .selecionado:after {
62
+ position: absolute;
63
+ content: "";
64
+ top: 22px;
65
+ right: 1em;
66
+ width: 0;
67
+ height: 0;
68
+ border: 5px solid transparent;
69
+ border-color: black transparent transparent transparent;
70
+ }
71
+
72
+ .escolher-filter .items {
73
+ color: black;
74
+ border-radius: 0px 0px 6px 6px;
75
+ overflow: hidden;
76
+ position: absolute;
77
+ background-color: #fafafc;
78
+ left: 0;
79
+ right: 0;
80
+ z-index: 1;
81
+ height: 200px;
82
+ overflow-y: visible;
83
+ overflow-x: hidden;
84
+ }
85
+
86
+ .escolher-filter .items div {
87
+ color: black;
88
+ padding-left: 1em;
89
+ cursor: pointer;
90
+ user-select: none;
91
+ }
92
+
93
+ .esconder {
94
+ display: none;
95
+ }
96
+ </style>
@@ -1,33 +1,28 @@
1
1
  <template>
2
2
  <div>
3
- <BarraRolagem :alturaMinima="450" :alturaMaxima="600">
4
- <QueryBuilder :rules="relatorio.filtro" v-model="filtroSelecionado" />
3
+ <BarraRolagem :minHeight="450" :maxHeight="600">
4
+ <ConstrutorConsulta :rules="rules" />
5
5
  </BarraRolagem>
6
6
  </div>
7
7
  </template>
8
8
 
9
9
  <script>
10
- import QueryBuilder from "./QueryBuilder.vue";
10
+ import ConstrutorConsulta from "./ConstrutorConsulta.vue";
11
11
  import BarraRolagem from "@nixweb/nixloc-ui/src/component/layout/BarraRolagem.vue";
12
12
 
13
- import { mapMutations, mapState } from "vuex";
13
+ import { mapMutations } from "vuex";
14
14
 
15
15
  export default {
16
16
  name: "Filtro",
17
- components: { BarraRolagem, QueryBuilder },
18
- computed: {
19
- ...mapState("relatorio", ["relatorio"]),
20
- filtroSelecionado: {
21
- get() {
22
- return this.$store.state.relatorio.filtroSelecionado;
23
- },
24
- set(value) {
25
- this.atualizaFiltroSelecionado(value);
26
- },
27
- },
17
+ components: { BarraRolagem, ConstrutorConsulta },
18
+ props: {
19
+ rules: Array,
20
+ },
21
+ mounted() {
22
+ this.addRulesReport(this.rules);
28
23
  },
29
24
  methods: {
30
- ...mapMutations("relatorio", ["atualizaFiltroSelecionado"]),
25
+ ...mapMutations("report", ["addRulesReport"]),
31
26
  },
32
27
  };
33
28
  </script>
@@ -0,0 +1,41 @@
1
+ <template>
2
+ <div class="vqb-children">
3
+ <component
4
+ :is="componente()"
5
+ v-for="(rule, index) in query_builder.rules"
6
+ :rule="rule"
7
+ />
8
+ </div>
9
+ </template>
10
+
11
+ <script>
12
+ import { mapState, mapMutations } from "vuex";
13
+
14
+ export default {
15
+ data() {
16
+ return {
17
+ componenteDinamico: null,
18
+ };
19
+ },
20
+ computed: {
21
+ ...mapState("report", ["query_builder"]),
22
+ },
23
+ mounted() {
24
+ this.componenteDinamico = this.$parent.$options.components["ComponenteDinamico"];
25
+ },
26
+ methods: {
27
+ ...mapMutations("report", ["convertRulesToOdata"]),
28
+ componente() {
29
+ return this.componenteDinamico;
30
+ },
31
+ },
32
+ watch: {
33
+ "query_builder.rules": {
34
+ handler() {
35
+ this.convertRulesToOdata(this.query_builder.rules);
36
+ },
37
+ deep: true,
38
+ },
39
+ },
40
+ };
41
+ </script>
@@ -1,37 +1,37 @@
1
1
  <template>
2
2
  <div>
3
- <Moldura>
4
- <div v-for="item in dados" :key="item.titulo">
3
+ <Molded>
4
+ <div v-for="item in data" :key="item.title">
5
5
  <div :class="item.classeCss">
6
6
  <b-row>
7
7
  <b-col class="text-right" sm="10">
8
- <span class="titulo">{{ item.titulo }}</span>
8
+ <span class="title">{{ item.title }}</span>
9
9
  </b-col>
10
10
  <b-col class="text-right" sm="2">
11
- <span class="titulo">{{ item.valor }}</span>
11
+ <span class="title">{{ item.valor }}</span>
12
12
  </b-col>
13
13
  </b-row>
14
14
  </div>
15
15
  </div>
16
- </Moldura>
16
+ </Molded>
17
17
  </div>
18
18
  </template>
19
19
  <script>
20
- import Moldura from "@nixweb/nixloc-ui/src/component/layout/Moldura";
20
+ import Molded from "@nixweb/nixloc-ui/src/component/layout/Molded";
21
21
 
22
22
  export default {
23
23
  name: "RodapeRelatorio",
24
24
  components: {
25
- Moldura,
25
+ Molded,
26
26
  },
27
27
  props: {
28
- dados: Array,
28
+ data: Array,
29
29
  },
30
30
  };
31
31
  </script>
32
32
 
33
33
  <style scoped>
34
- .titulo {
34
+ .title {
35
35
  font-size: 15px;
36
36
  font-weight: 400;
37
37
  }
@@ -1,10 +1,10 @@
1
1
  <template>
2
2
  <div>
3
- <div class="lado-a-lado div-tag" v-for="tag in tags" :key="tag.id">
3
+ <div class="side-by-side div-tag" v-for="tag in tags" :key="tag.id">
4
4
  <Tag
5
5
  :nomeEvento="nomeEvento"
6
6
  :dadosEvento="tag"
7
- :titulo="tag.titulo"
7
+ :title="tag.title"
8
8
  :valor="tag.valor"
9
9
  />
10
10
  </div>
@@ -24,21 +24,21 @@ export default {
24
24
  },
25
25
 
26
26
  computed: {
27
- ...mapGetters("relatorio", ["tags"]),
27
+ ...mapGetters("report", ["tags"]),
28
28
  ...mapGetters("generic", ["mostrarModal", "evento"]),
29
29
  },
30
30
  methods: {
31
- ...mapMutations("relatorio", ["removeFiltroSelecionado"]),
31
+ ...mapMutations("report", ["removeFiltroSelecionado"]),
32
32
  },
33
33
  watch: {
34
34
  evento: {
35
35
  handler(evento) {
36
36
  if (evento.nome == "tagRemovida") {
37
- var tags = this.tags.filter((x) => {
38
- return x.id != evento.dados.id;
37
+ var tags = this.tags.filter((item) => {
38
+ return item.id != evento.data.id;
39
39
  });
40
40
  this.tags = tags;
41
- this.removeFiltroSelecionado(evento.dados.id);
41
+ this.removeFiltroSelecionado(evento.data.id);
42
42
  }
43
43
  },
44
44
  deep: true,