@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.
Files changed (135) hide show
  1. package/docs/src/component/template/ModeloRelatorioView.drawio +2 -2
  2. package/docs/src/store/modulos/relatorio.drawio +2 -2
  3. package/package.json +77 -77
  4. package/public/styles/app.css +1 -1
  5. package/src/component/forms/{Botao.vue → Button.vue} +53 -57
  6. package/src/component/forms/CheckboxGroup.vue +63 -0
  7. package/src/component/forms/{CheckboxUnico.vue → CheckboxSimple.vue} +8 -8
  8. package/src/component/forms/{Cor.vue → Color.vue} +9 -9
  9. package/src/component/forms/DateTime.vue +55 -55
  10. package/src/component/forms/{BotaoDropdown.vue → Dropdown.vue} +58 -58
  11. package/src/component/forms/EditorHtml.vue +123 -0
  12. package/src/component/forms/FileUpload.vue +189 -0
  13. package/src/component/forms/InputDecimal.vue +137 -0
  14. package/src/component/forms/InputNumber.vue +149 -0
  15. package/src/component/forms/InputPassword.vue +135 -0
  16. package/src/component/forms/InputText.vue +157 -0
  17. package/src/component/forms/Modal.vue +15 -15
  18. package/src/component/forms/RadioGroup.vue +50 -0
  19. package/src/component/forms/Select.vue +337 -0
  20. package/src/component/forms/SelectStatic.vue +120 -0
  21. package/src/component/forms/TextArea.vue +126 -0
  22. package/src/component/forms/Toggle.vue +13 -13
  23. package/src/component/layout/{Conta.vue → Account.vue} +28 -28
  24. package/src/component/layout/{Alerta.vue → Alert.vue} +22 -22
  25. package/src/component/layout/Badge.vue +23 -23
  26. package/src/component/layout/{BarraFixa.vue → FixedBar.vue} +16 -16
  27. package/src/component/layout/{Topo.vue → Header.vue} +5 -5
  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 +15 -15
  35. package/src/component/layout/Wizard.vue +3 -3
  36. package/src/component/shared/{CodigoEditor.vue → CodeEditor.vue} +25 -25
  37. package/src/component/shared/Collapse.vue +131 -0
  38. package/src/component/shared/Confirmation.vue +80 -0
  39. package/src/component/shared/{DocumentoEditor.vue → DocumentEditor.vue} +10 -16
  40. package/src/component/shared/{DocumentoPreview.vue → DocumentPreview.vue} +2 -2
  41. package/src/component/shared/ExportExcel.vue +67 -0
  42. package/src/component/shared/{ExportarPDF.vue → ExportPDF.vue} +18 -18
  43. package/src/component/shared/HeaderPrint.vue +36 -0
  44. package/src/component/shared/HorizontalFilter.vue +59 -0
  45. package/src/component/shared/LegendaParametro.vue +22 -22
  46. package/src/component/shared/{Carregando.vue → Loading.vue} +16 -16
  47. package/src/component/shared/LoadingMoreButton.vue +23 -0
  48. package/src/component/shared/Messages.vue +83 -0
  49. package/src/component/shared/{Paginacao.vue → Pagination.vue} +12 -12
  50. package/src/component/shared/ProgressBar.vue +21 -0
  51. package/src/component/shared/{BotaoConsulta.vue → QueryButton.vue} +16 -16
  52. package/src/component/shared/SaveCancel.vue +56 -0
  53. package/src/component/shared/{Pesquisa.vue → Search.vue} +46 -46
  54. package/src/component/shared/Table.vue +243 -0
  55. package/src/component/shared/TableButton.vue +36 -0
  56. package/src/component/shared/{Registro.vue → TableTotalRecords.vue} +7 -7
  57. package/src/component/shared/{ResumoTabela.vue → TableTotalization.vue} +12 -8
  58. package/src/component/shared/Tip.vue +42 -0
  59. package/src/component/shared/Toast.vue +7 -7
  60. package/src/component/shared/{FiltroVertical.vue → VerticalFilter.vue} +24 -24
  61. package/src/component/shared/query-builder/AddRule.vue +187 -0
  62. package/src/component/shared/query-builder/ConvertToOdata.js +80 -0
  63. package/src/component/shared/query-builder/DynamicComponent.vue +107 -0
  64. package/src/component/shared/query-builder/Fields.vue +127 -0
  65. package/src/component/shared/query-builder/ListDynamicComponent.vue +42 -0
  66. package/src/component/shared/query-builder/QueryBuilder.vue +25 -120
  67. package/src/component/shared/query-builder/{Filtro.vue → Rules.vue} +13 -18
  68. package/src/component/shared/query-builder/SelectRule.vue +96 -0
  69. package/src/component/shared/query-builder/Tags.vue +14 -14
  70. package/src/component/shared/query-builder/{Rodape.vue → Totalization.vue} +10 -10
  71. package/src/component/template/AddEditReport.vue +106 -0
  72. package/src/component/template/ListViewWithHandlerData.vue +231 -0
  73. package/src/component/template/ViewTemplateConfiguration.vue +69 -0
  74. package/src/component/template/ViewTemplateDocumentView.vue +227 -0
  75. package/src/component/template/ViewTemplateReportList.vue +230 -0
  76. package/src/component/template/ViewTemplateReportPreview.vue +500 -0
  77. package/src/component/template/ViewTemplateWithSalveCancel.vue +32 -0
  78. package/src/component/template/ViewTemplateWithTable.vue +49 -0
  79. package/src/component/template/model/Report.js +6 -0
  80. package/src/component/value-objects/DadosContato.vue +34 -35
  81. package/src/component/value-objects/DadosPessoa.vue +58 -58
  82. package/src/component/value-objects/Endereco.vue +96 -97
  83. package/src/config/dicas.js +1 -1
  84. package/src/config/token.js +2 -2
  85. package/src/store/modules/generic.js +489 -0
  86. package/src/store/modules/report.js +246 -0
  87. package/src/store/modules/user.js +38 -0
  88. package/src/store/modules/validation.js +39 -0
  89. package/src/store/store.js +4 -4
  90. package/src/component/forms/ArquivoUpload.vue +0 -199
  91. package/src/component/forms/CheckboxMultiplo.vue +0 -63
  92. package/src/component/forms/Decimal.vue +0 -137
  93. package/src/component/forms/Escolher.vue +0 -335
  94. package/src/component/forms/EscolherEstatico.vue +0 -139
  95. package/src/component/forms/Numero.vue +0 -153
  96. package/src/component/forms/Opcoes.vue +0 -51
  97. package/src/component/forms/Senha.vue +0 -139
  98. package/src/component/forms/Texto.vue +0 -161
  99. package/src/component/forms/TextoArea.vue +0 -126
  100. package/src/component/forms/TextoEditor.vue +0 -123
  101. package/src/component/layout/Painel.vue +0 -142
  102. package/src/component/shared/BotaoCarregarMais.vue +0 -23
  103. package/src/component/shared/CabecalhoImpressao.vue +0 -36
  104. package/src/component/shared/Confirmacao.vue +0 -80
  105. package/src/component/shared/Dica.vue +0 -42
  106. package/src/component/shared/EsconderMostrar.vue +0 -131
  107. package/src/component/shared/ExportarExcel.vue +0 -67
  108. package/src/component/shared/FiltroHorizontal.vue +0 -59
  109. package/src/component/shared/Mensagem.vue +0 -86
  110. package/src/component/shared/Progresso.vue +0 -21
  111. package/src/component/shared/SalvarCancelar.vue +0 -56
  112. package/src/component/shared/Tabela.vue +0 -275
  113. package/src/component/shared/TabelaBotao.vue +0 -36
  114. package/src/component/shared/query-builder/Campo.vue +0 -116
  115. package/src/component/shared/query-builder/ConverteParaOdata.js +0 -77
  116. package/src/component/shared/query-builder/components/CustomSelect.vue +0 -115
  117. package/src/component/shared/query-builder/components/QueryBuilderChildren.vue +0 -46
  118. package/src/component/shared/query-builder/components/QueryBuilderGroup.vue +0 -151
  119. package/src/component/shared/query-builder/components/QueryBuilderRule.vue +0 -81
  120. package/src/component/shared/query-builder/layouts/Bootstrap/BootstrapGroup.vue +0 -120
  121. package/src/component/shared/query-builder/layouts/Bootstrap/BootstrapRule.vue +0 -187
  122. package/src/component/shared/query-builder/main.js +0 -81
  123. package/src/component/template/ModeloAdicionarModificarView.vue +0 -32
  124. package/src/component/template/ModeloDocumentoView.vue +0 -227
  125. package/src/component/template/ModeloLista.vue +0 -231
  126. package/src/component/template/ModeloRelatorioListaView.vue +0 -227
  127. package/src/component/template/ModeloRelatorioView.vue +0 -489
  128. package/src/component/template/ModeloSubView.vue +0 -69
  129. package/src/component/template/ModeloView.vue +0 -49
  130. package/src/component/template/Relatorio.js +0 -10
  131. package/src/component/template/RelatorioAdicionarModificar.vue +0 -106
  132. package/src/store/modulos/generic.js +0 -494
  133. package/src/store/modulos/relatorio.js +0 -204
  134. package/src/store/modulos/usuario.js +0 -38
  135. package/src/store/modulos/validation.js +0 -39
@@ -1,86 +0,0 @@
1
- <template>
2
- <div>
3
- <div
4
- :class="{ 'div-mensagem': !modal.abrir }"
5
- v-if="notificacaoArmazenada.length > 0"
6
- >
7
- <div>
8
- <Alerta tipo="perigo">
9
- <div v-for="notificacao in notificacaoArmazenada">
10
- {{ notificacao.mensagem }}
11
- </div>
12
- </Alerta>
13
- </div>
14
- <b-alert
15
- v-show="false"
16
- :show="contagemRegressiva"
17
- dismissible
18
- variant="danger"
19
- @dismissed="contagemRegressiva = 0"
20
- @dismiss-count-down="contagemRegressivaAlterada"
21
- >
22
- </b-alert>
23
- </div>
24
- </div>
25
- </template>
26
-
27
- <script>
28
- import Alerta from "../layout/Alerta.vue";
29
- import { mapState, mapMutations } from "vuex";
30
-
31
- export default {
32
- components: { Alerta },
33
- name: "Mensagem",
34
- data() {
35
- return {
36
- maximoSegundos: 10,
37
- contagemRegressiva: 10,
38
- notificacaoArmazenada: [],
39
- };
40
- },
41
- computed: {
42
- ...mapState("generic", ["notificacoes", "modal"]),
43
- },
44
- watch: {
45
- notificacoes() {
46
- if (this.notificacoes.length > 0) {
47
- this.notificacaoArmazenada = this.notificacoes;
48
- this.contagemRegressiva = 5;
49
- }
50
- },
51
- contagemRegressiva() {
52
- if (this.contagemRegressiva === 0) {
53
- this.notificacaoArmazenada = [];
54
- this.removeNotificacao();
55
- }
56
- },
57
- },
58
- methods: {
59
- ...mapMutations("generic", ["removeNotificacao"]),
60
- contagemRegressivaAlterada(contagemRegressiva) {
61
- this.contagemRegressiva = contagemRegressiva;
62
- },
63
- mensagens(notificacoes) {
64
- var mensagem = "";
65
- notificacoes.forEach(function (notificacao) {
66
- mensagem += notificacao.mensagem + " ";
67
- });
68
-
69
- return mensagem;
70
- },
71
- },
72
- };
73
- </script>
74
- <style scoped>
75
- .div-mensagem {
76
- margin-top: 15px;
77
- }
78
-
79
- .div-mensagem-modal {
80
- margin-bottom: 5px;
81
- }
82
-
83
- .invalido {
84
- color: #f0134d;
85
- }
86
- </style>
@@ -1,21 +0,0 @@
1
- <template>
2
- <div>
3
- <progress-bar :size="tamanho" :text="texto" :val="valor" :max="maximo"></progress-bar>
4
- </div>
5
- </template>
6
- <script>
7
- import ProgressBar from "vue-simple-progress";
8
-
9
- export default {
10
- name: "Progresso",
11
- components: {
12
- ProgressBar,
13
- },
14
- props: {
15
- texto: String,
16
- valor: Number,
17
- maximo: Number,
18
- tamanho: String,
19
- },
20
- };
21
- </script>
@@ -1,56 +0,0 @@
1
- <template>
2
- <div>
3
- <BarraFixa posicao="rodape" v-show="formSujo && !modal.abrir">
4
- <div>
5
- <Botao
6
- chave="cancelarSalvarCancelar"
7
- nomeEvento="cancelarSalvarCancelar"
8
- titulo="Cancelar"
9
- tipo="perigo"
10
- tamanho="medio"
11
- :clique="cancelar"
12
- />
13
- <Botao
14
- chave="salvarSalvarCancelar"
15
- nomeEvento="salvarSalvarCancelar"
16
- titulo="Salvar"
17
- tipo="sucesso"
18
- :desabilitado="!formValido(formNome)"
19
- tamanho="medio"
20
- />
21
- </div>
22
- </BarraFixa>
23
- </div>
24
- </template>
25
- <script>
26
- import BarraFixa from "@nixweb/nixloc-ui/src/component/layout/BarraFixa.vue";
27
- import Botao from "@nixweb/nixloc-ui/src/component/forms/Botao";
28
-
29
- import { mapState, mapMutations, mapGetters } from "vuex";
30
-
31
- export default {
32
- name: "SalvarCancelar",
33
- components: { BarraFixa, Botao },
34
- props: {
35
- formNome: String,
36
- },
37
- computed: {
38
- ...mapState("validation", ["formSujo"]),
39
- ...mapGetters("validation", ["formValido"]),
40
- ...mapState("generic", ["modal"]),
41
- },
42
- methods: {
43
- ...mapMutations("validation", ["insereFormSujo"]),
44
- ...mapMutations("generic", ["removeCarregando"]),
45
- cancelar() {
46
- this.insereFormSujo(false);
47
- this.removeCarregando(["cancelarSalvarCancelar"]);
48
- },
49
- },
50
- watch: {
51
- "modal.abrir": function (valor) {
52
- this.insereFormSujo(false);
53
- },
54
- },
55
- };
56
- </script>
@@ -1,275 +0,0 @@
1
- <template>
2
- <div>
3
- <table class="table table-responsive-xs">
4
- <thead>
5
- <tr>
6
- <th class="td-checkbox" v-if="mostrarChecks">
7
- <div>
8
- <b-form-checkbox v-model="selecionarTodos" @change="selecionar" />
9
- </div>
10
- </th>
11
- <th v-for="(obj, ind) in cabecalhoTabela" :key="ind">
12
- <div class="titulo-margem" :class="obj.classeCssTitulo">
13
- <i class="fas fa-search" v-if="obj.iconeBusca"></i>
14
- <span class="titulo-cabecalho"> {{ obj.titulo }}</span>
15
- </div>
16
- </th>
17
- </tr>
18
- </thead>
19
- <tbody>
20
- <tr v-for="(linha, index) in dados" :key="index" :style="linha.linhaCss">
21
- <td class="td-checkbox" v-if="mostrarChecks">
22
- <b-form-checkbox v-model="selecionados" :value="linha.id" />
23
- </td>
24
- <td v-for="(obj, ind) in cabecalhoTabela" :key="ind">
25
- <div
26
- :class="converteClasse(linha[obj.campoComparacao], obj.classeCssCorpo)"
27
- v-if="obj.tipo === 'texto'"
28
- >
29
- {{ linha[obj.campo] }}
30
- </div>
31
- <div
32
- :class="converteClasse(linha[obj.campoComparacao], obj.classeCssCorpo)"
33
- v-if="obj.tipo === 'classe'"
34
- >
35
- {{ linha[obj.campo] }}
36
- </div>
37
- <div
38
- :class="converteClasse(linha[obj.campoComparacao], obj.classeCssCorpo)"
39
- v-if="obj.tipo === 'html'"
40
- >
41
- <div v-if="linha[obj.campo]" v-html="linha[obj.campo]"></div>
42
- <div v-else v-html="obj.html"></div>
43
- </div>
44
- <div
45
- :class="converteClasse(linha[obj.campoComparacao], obj.classeCssCorpo)"
46
- v-if="obj.tipo === 'escolher'"
47
- >
48
- {{ linha[obj.campo].conteudo }}
49
- </div>
50
- <div
51
- :class="converteClasse(linha[obj.campoComparacao], obj.classeCssCorpo)"
52
- v-if="obj.tipo === 'data'"
53
- >
54
- {{ linha[obj.campo] | moment("DD/MM/YYYY") }}
55
- </div>
56
- <div
57
- :class="converteClasse(linha[obj.campoComparacao], obj.classeCssCorpo)"
58
- v-if="obj.tipo === 'dataHora'"
59
- >
60
- {{ linha[obj.campo] | moment("DD/MM/YYYY HH:mm") }}
61
- </div>
62
- <div
63
- :class="converteClasse(linha[obj.campoComparacao], obj.classeCssCorpo)"
64
- v-if="obj.tipo === 'valor'"
65
- >
66
- {{ linha[obj.campo] | currency }}
67
- </div>
68
- <div
69
- :class="converteClasse(linha[obj.campoComparacao], obj.classeCssCorpo)"
70
- v-if="obj.tipo === 'pdf'"
71
- >
72
- <span
73
- @click="solicitarPdf(obj.pdf, linha[obj.campo])"
74
- class="icone"
75
- v-if="linha[obj.campo]"
76
- >
77
- <i :class="obj.icone"></i
78
- ></span>
79
- <span v-else>N/I</span>
80
- </div>
81
- <div
82
- :class="converteClasse(linha[obj.campoComparacao], obj.classeCssCorpo)"
83
- v-if="obj.tipo === 'telerik'"
84
- >
85
- <span
86
- @click="solicitarTelerik(obj.pdf, linha[obj.campo])"
87
- class="icone"
88
- v-if="linha[obj.campo]"
89
- >
90
- <i :class="obj.icone"></i
91
- ></span>
92
- <span v-else>N/I</span>
93
- </div>
94
- <div
95
- :class="converteClasse(linha[obj.campoComparacao], obj.classeCssCorpo)"
96
- v-if="obj.tipo === 'botao'"
97
- >
98
- <TabelaBotao :obj="obj" :linha="linha" />
99
- </div>
100
- <div class="link" v-if="obj.tipo === 'link'" @click="navegarPara(obj, linha)">
101
- <span> {{ linha[obj.campo] }}</span>
102
- </div>
103
- </td>
104
- </tr>
105
- </tbody>
106
- <tbody v-show="dados.length == 0">
107
- <tr>
108
- <td colspan="12">
109
- <span>Nenhum registro encontrado!</span>
110
- </td>
111
- </tr>
112
- </tbody>
113
- </table>
114
- </div>
115
- </template>
116
-
117
- <script>
118
- import TabelaBotao from "@nixweb/nixloc-ui/src/component/shared/TabelaBotao.vue";
119
-
120
- import { mapState, mapMutations, mapActions } from "vuex";
121
-
122
- export default {
123
- components: { TabelaBotao },
124
- props: {
125
- cabecalhoTabela: Array,
126
- dados: Array,
127
- mostrarChecks: {
128
- type: Boolean,
129
- default: true,
130
- },
131
- },
132
- data() {
133
- return {
134
- selecionarTodos: false,
135
- };
136
- },
137
- computed: {
138
- ...mapState("generic", ["selecionados"]),
139
- selecionados: {
140
- get() {
141
- return this.$store.state.generic.selecionados;
142
- },
143
- set(value) {
144
- this.adicionaSelecao(value);
145
- },
146
- },
147
- },
148
- methods: {
149
- ...mapMutations("generic", ["adicionaSelecao", "insereEvento"]),
150
- ...mapActions("generic", ["pdfApi"]),
151
- selecionar() {
152
- this.adicionaSelecao([]);
153
- if (this.selecionarTodos) {
154
- for (let i in this.dados) {
155
- this.selecionados.push(this.dados[i].id);
156
- }
157
- }
158
- },
159
- converteClasse(campoComparacao, classeCssCorpo) {
160
- if (Array.isArray(classeCssCorpo)) {
161
- let ret = [];
162
- classeCssCorpo.forEach(function (value) {
163
- let classe = value.classe;
164
- let condicao = value.campoComparacao == campoComparacao;
165
- let obj = {
166
- [classe]: condicao,
167
- };
168
-
169
- ret.push(obj);
170
- });
171
- return ret;
172
- } else {
173
- return classeCssCorpo;
174
- }
175
- },
176
- solicitarPdf(pdf, id) {
177
- let params = { url: pdf.url, obj: { id: id } };
178
- this.pdfApi(params).then((response) => {});
179
- },
180
- solicitarTelerik(pdf, id) {
181
- let params = {
182
- url: pdf.url,
183
- obj: {
184
- ReportName: pdf.nomeRelatorio,
185
- ParameterValues: {
186
- Logo: this.urlLogoEmpresa,
187
- FaturaId: id,
188
- EmpresaId: this.empresaId,
189
- },
190
- },
191
- };
192
- this.pdfApi(params).then((response) => {});
193
- },
194
- navegarPara(obj, linha) {
195
- if (obj.nomeRota) {
196
- this.$router.push({
197
- name: obj.nomeRota,
198
- params: { id: linha.id },
199
- });
200
- } else {
201
- this.insereEvento({
202
- nome: obj.nomeEvento,
203
- dados: linha,
204
- });
205
- }
206
- },
207
- },
208
-
209
- beforeDestroy() {
210
- this.adicionaSelecao([]);
211
- },
212
- };
213
- </script>
214
-
215
- <style scoped>
216
- table tbody tr td {
217
- max-width: 350px;
218
- }
219
-
220
- .table th,
221
- .table td {
222
- height: 10px !important;
223
- padding-left: 5px !important;
224
- padding-top: 7px !important;
225
- padding-bottom: 5px !important;
226
- padding-right: 5px !important;
227
- border-bottom: 0px !important;
228
- }
229
-
230
- .td-checkbox {
231
- width: 30px;
232
- }
233
-
234
- tr:hover {
235
- background-color: #fafafc;
236
- }
237
-
238
- .titulo-cabecalho {
239
- font-size: 13px;
240
- color: #757d8c;
241
- font-weight: 400;
242
- text-transform: uppercase;
243
- }
244
-
245
- .tabela-numero {
246
- font-size: 14px;
247
- font-weight: bold;
248
- }
249
-
250
- .tabela-principal {
251
- color: #757d8c;
252
- max-width: 200px;
253
- }
254
-
255
- .tabela-valor {
256
- font-size: 14px;
257
- min-width: 100px;
258
- }
259
-
260
- .link {
261
- color: #3F529B;
262
- font-size: 14px;
263
- font-weight: 400;
264
- cursor: pointer;
265
- }
266
-
267
- .link:hover {
268
- text-decoration: underline;
269
- transition: 0.1s;
270
- }
271
-
272
- .icone-link:hover {
273
- font-size: 12.5px;
274
- }
275
- </style>
@@ -1,36 +0,0 @@
1
- <template>
2
- <div>
3
- <Botao
4
- v-if="obj.qualBotao == 'botao'"
5
- :chave="linha.id"
6
- :titulo="obj.botao.titulo"
7
- :tipo="obj.botao.tipo"
8
- :tamanho="obj.botao.tamanho"
9
- :classeIcone="obj.botao.classeIcone"
10
- :nomeEvento="obj.botao.nomeEvento"
11
- :dadosEvento="linha"
12
- />
13
- <BotaoDropdown
14
- v-if="obj.qualBotao == 'botaodropdown'"
15
- :titulo="obj.botao.titulo"
16
- :tipo="obj.botao.tipo"
17
- :tamanho="obj.botao.tamanho"
18
- :classeIcone="obj.botao.classeIcone"
19
- :dadosEvento="linha"
20
- :itens="obj.botao.itens"
21
- />
22
- </div>
23
- </template>
24
-
25
- <script>
26
- import BotaoDropdown from "../forms/BotaoDropdown";
27
- import Botao from "../forms/Botao";
28
- export default {
29
- name: "TabelaBotao",
30
- components: { Botao, BotaoDropdown },
31
- props: {
32
- obj: Object,
33
- linha: Object,
34
- },
35
- };
36
- </script>
@@ -1,116 +0,0 @@
1
- <template>
2
- <div>
3
- <b-row>
4
- <b-col sm="6">
5
- <BarraRolagem :alturaMinima="200" :alturaMaxima="250">
6
- <div class="div-opcoes">
7
- <CheckboxMultiplo
8
- :empilhado="true"
9
- :valorInicial="opcoes.valorInicial"
10
- :opcoes="opcoes.opcoes"
11
- v-model="campoSelecionado"
12
- />
13
- </div>
14
- </BarraRolagem>
15
- </b-col>
16
- <b-col sm="6">
17
- <Opcoes
18
- :opcoes="[
19
- { text: 'Crescente', value: 'asc' },
20
- { text: 'Decrescente', value: 'desc' },
21
- ]"
22
- v-model="ordenar"
23
- />
24
- <EscolherEstatico
25
- titulo="Ordenar"
26
- campoAlvo="ordenar"
27
- :valorInicial="valorInicial"
28
- :dados="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 Opcoes from "@nixweb/nixloc-ui/src/component/forms/Opcoes";
38
- import CheckboxMultiplo from "@nixweb/nixloc-ui/src/component/forms/CheckboxMultiplo";
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
- CheckboxMultiplo,
47
- EscolherEstatico,
48
- BarraRolagem,
49
- Opcoes,
50
- },
51
- data() {
52
- return {
53
- ordenar: "asc",
54
- valorInicial: {},
55
- };
56
- },
57
- created() {
58
- this.valorInicial = this.ordenacao[0];
59
- let obj = {
60
- conteudo: this.valorInicial.conteudo,
61
- id: this.valorInicial.id,
62
- ordenar: this.ordenar,
63
- };
64
- this.atualizaCampoOrdenado(obj);
65
- },
66
- computed: {
67
- ...mapGetters("relatorio", ["opcoes"]),
68
- campoSelecionado: {
69
- get() {
70
- return this.$store.state.relatorio.campoSelecionado;
71
- },
72
- set(value) {
73
- this.atualizaCampoSelecionado(value);
74
- },
75
- },
76
- campoOrdenado: {
77
- get() {
78
- return this.$store.state.relatorio.campoOrdenado;
79
- },
80
- set(value) {
81
- let obj = { conteudo: value.conteudo, id: value.id, ordenar: this.ordenar };
82
- this.atualizaCampoOrdenado(obj);
83
- },
84
- },
85
- ordenacao() {
86
- let ordenacao = [];
87
- this.opcoes.opcoes.forEach((opcao) => {
88
- let obj = { conteudo: opcao.text, id: opcao.value };
89
- ordenacao.push(obj);
90
- });
91
- return ordenacao;
92
- },
93
- },
94
- methods: {
95
- ...mapMutations("relatorio", ["atualizaCampoSelecionado", "atualizaCampoOrdenado"]),
96
- },
97
- watch: {
98
- ordenar: {
99
- handler(value) {
100
- let obj = {
101
- conteudo: this.campoOrdenado.conteudo,
102
- id: this.campoOrdenado.id,
103
- ordenar: this.ordenar,
104
- };
105
- this.atualizaCampoOrdenado(obj);
106
- },
107
- deep: true,
108
- },
109
- },
110
- };
111
- </script>
112
- <style scoped>
113
- .div-opcoes {
114
- margin-left: 10px;
115
- }
116
- </style>
@@ -1,77 +0,0 @@
1
- export default class ConverteParaOdata {
2
- converteFiltro(query) {
3
- let campo = query.rule;
4
- let valor = query.value;
5
- let tipo = query.tipo;
6
- let label = query.label;
7
-
8
- if (query.operator === "igual") return `${campo} eq '${valor}'`;
9
- if (query.operator === "diferente") return `${campo} ne '${valor}'`;
10
- if (query.operator === "contem") return `contains(${campo},'${valor}')`;
11
- if (query.operator === "periodo") return this.convertePeriodo(valor);
12
- if (query.operator === "escolher") return this.converteEscolher(campo, valor);
13
- if (query.operator === "checkbox") return this.converteCheckbox(campo, valor, tipo, label);
14
- if (query.operator === "=") return `${campo} eq ${valor}`;
15
- if (query.operator === "!=") return `${campo} ne ${valor}`;
16
- if (query.operator === "<") return `${campo} lt ${valor}`;
17
- if (query.operator === "<=") return `${campo} le ${valor}`;
18
- if (query.operator === ">") return `${campo} gt ${valor}`;
19
- if (query.operator === ">=") return `${campo} ge ${valor}`;
20
- }
21
- convertePeriodo(valor) {
22
- let inicio = this.converteData(valor[0]);
23
- let fim = this.converteData(valor[1]);
24
- return `data ge ${inicio} and data le ${fim}`;
25
- }
26
- converteEscolher(campo, valor) {
27
- return `${campo} eq '${valor.id}'`;
28
- }
29
- converteCheckbox(campo, valor, tipo, label) {
30
- let consulta = "";
31
- let sequencia = 0;
32
- var tamanho = valor.length;
33
- let self = this;
34
- valor.forEach(function (value) {
35
- if (tipo == "campo") {
36
- consulta += `${campo} eq ${value}`;
37
- if (sequencia + 1 != tamanho) consulta += ` or `;
38
- }
39
- if (tipo == "resumo") {
40
- let nome = self.converteNome(value);
41
- consulta += `${campo} with ${value} as ${nome}${label}`;
42
- if (sequencia + 1 != tamanho) consulta += `,`;
43
- }
44
- sequencia++;
45
- });
46
-
47
- if (tamanho > 1 && tipo == "campo") return `(${consulta})`;
48
- return `${consulta}`;
49
- }
50
- converteData(data) {
51
- let str = data.replace("/", "").replace("/", "");
52
-
53
- let date = {
54
- dia: str.substr(0, 2),
55
- mes: str.substr(2, 2),
56
- ano: str.substr(4, 4),
57
- };
58
-
59
- var iso = date.ano + "-" + date.mes + "-" + date.dia;
60
-
61
- /*
62
- iso += date.dia + "T";
63
- iso += "00:00:00.000Z";
64
- iso += d.getHours().toString().padStart(2, "0") + ":";
65
- iso += d.getMinutes().toString().padStart(2, "0") + ":";
66
- iso += d.getSeconds().toString().padStart(2, "0");
67
- */
68
-
69
- return iso;
70
- }
71
- converteNome(value) {
72
- if (value === "sum") return "soma";
73
- if (value === "average") return "media";
74
- if (value === "max") return "maximo";
75
- if (value === "minimo") return "minimo";
76
- }
77
- }