@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
@@ -1,126 +0,0 @@
1
- <template>
2
- <div class="form-group">
3
- <label>
4
- <span class="titulo">{{ titulo }}</span>
5
- <span class="requerido" v-if="requerido">*</span>
6
- <Dica :campo="campo" :formNome="formNome" />
7
- </label>
8
- <div class="inner-addon right-addon">
9
- <i
10
- v-if="notificacoes.length > 0 && formSujo"
11
- class="requerido glyphicon fas fa-exclamation-triangle"
12
- ></i>
13
-
14
- <textarea
15
- type="text"
16
- :placeholder="placeholder"
17
- v-bind:value="value"
18
- v-on:input="$emit('input', $event.target.value)"
19
- class="form-control"
20
- :class="{ 'is-invalid': notificacoes.length > 0 && formSujo }"
21
- ></textarea>
22
- </div>
23
-
24
- <div v-if="formSujo">
25
- <div v-for="mensagem in notificacoes" :key="mensagem">
26
- <span class="invalido">{{ mensagem }}</span>
27
- </div>
28
- </div>
29
- </div>
30
- </template>
31
-
32
- <script>
33
- import Dica from "../shared/Dica.vue";
34
- import { mapState, mapMutations } from "vuex";
35
-
36
- export default {
37
- components: { Dica },
38
- name: "TextoArea",
39
- props: {
40
- titulo: String,
41
- campo: String,
42
- placeholder: String,
43
- formNome: String,
44
- requerido: Boolean,
45
- tamanhoMaximo: Number,
46
- value: String,
47
- },
48
- data() {
49
- return {
50
- notificacoes: [],
51
- formSujo: false,
52
- };
53
- },
54
- created() {
55
- this.valida();
56
- },
57
- methods: {
58
- ...mapMutations("validation", [
59
- "insereValidacao",
60
- "removeValidacao",
61
- "insereFormSujo",
62
- ]),
63
- valida() {
64
- this.notificacoes = [];
65
-
66
- if (this.requerido && this.value.length == 0) {
67
- var mensagem = `${this.titulo} não pode ser vazio!`;
68
- this.notificacoes.push(mensagem);
69
- }
70
-
71
- if (this.tamanhoMaximo > 0) {
72
- if (this.value.length > this.tamanhoMaximo) {
73
- var mensagem = `Máximo de ${this.tamanhoMaximo} caracteres!`;
74
- this.notificacoes.push(mensagem);
75
- }
76
- }
77
- },
78
- },
79
- computed: {
80
- ...mapState("validation", ["reiniciaForm", "validacao"]),
81
- },
82
- watch: {
83
- value() {
84
- this.valida();
85
- this.formSujo = true;
86
- this.insereFormSujo(true);
87
- },
88
- notificacoes() {
89
- let self = this;
90
- this.notificacoes.forEach(function (notificacao) {
91
- let obj = {
92
- chave: self.campo + "&" + self.formNome,
93
- formNome: self.formNome,
94
- notificacao: notificacao,
95
- };
96
- self.insereValidacao(obj);
97
- });
98
-
99
- if (this.notificacoes.length == 0) {
100
- let obj = {
101
- chave: self.campo + "&" + self.formNome,
102
- formNome: self.formNome,
103
- };
104
- self.removeValidacao(obj);
105
- }
106
- },
107
- reiniciaForm: {
108
- handler(form) {
109
- if (form.nome == this.formNome) this.formSujo = false;
110
- },
111
- deep: true,
112
- },
113
- },
114
- };
115
- </script>
116
-
117
- <style scoped>
118
- .sucesso {
119
- color: #94aa2a;
120
- font-size: 14px;
121
- }
122
- .invalido {
123
- color: #f0134d;
124
- font-size: 14px;
125
- }
126
- </style>
@@ -1,123 +0,0 @@
1
- <template>
2
- <div>
3
- <label>
4
- <span class="titulo">{{ titulo }}</span>
5
- <span class="requerido" v-if="requerido">*</span>
6
- <Dica :campo="campo" :formNome="formNome" />
7
- </label>
8
- <div class="inner-addon right-addon">
9
- <i
10
- v-if="notificacoes.length > 0 && formSujo"
11
- class="requerido glyphicon fas fa-exclamation-triangle"
12
- ></i>
13
- <vue-editor v-model.trim="value" :editorToolbar="customToolbar"></vue-editor>
14
- </div>
15
-
16
- <div v-if="formSujo">
17
- <div v-for="mensagem in notificacoes" :key="mensagem">
18
- <span class="invalido">{{ mensagem }}</span>
19
- </div>
20
- </div>
21
- </div>
22
- </template>
23
-
24
- <script>
25
- import Dica from "../shared/Dica.vue";
26
- import { VueEditor } from "vue2-editor";
27
-
28
- import { mapState, mapMutations } from "vuex";
29
-
30
- export default {
31
- components: { Dica, VueEditor },
32
- name: "TextoEditor",
33
- mixins: [],
34
- props: {
35
- titulo: String,
36
- campo: String,
37
- formNome: String,
38
- requerido: Boolean,
39
- tamanhoMaximo: Number,
40
- value: String,
41
- },
42
- data() {
43
- return {
44
- notificacoes: [],
45
- formSujo: false,
46
- textoEditor: "",
47
- customToolbar: [
48
- ["bold", "italic", "underline"],
49
- [{ list: "ordered" }, { list: "bullet" }],
50
- [{ align: "" }, { align: "center" }, { align: "right" }, { align: "justify" }],
51
- [{ header: [false] }],
52
- ],
53
- };
54
- },
55
- created() {
56
- this.valida();
57
- },
58
- methods: {
59
- ...mapMutations("validation", ["insereValidacao", "removeValidacao"]),
60
- valida() {
61
- this.notificacoes = [];
62
-
63
- if (this.requerido && this.value.length == 0) {
64
- var mensagem = `${this.titulo} não pode ser vazio!`;
65
- this.notificacoes.push(mensagem);
66
- }
67
-
68
- if (this.tamanhoMaximo > 0) {
69
- if (this.value.length > this.tamanhoMaximo) {
70
- var mensagem = `Máximo de ${this.tamanhoMaximo} caracteres!`;
71
- this.notificacoes.push(mensagem);
72
- }
73
- }
74
- },
75
- },
76
- computed: {
77
- ...mapState("validation", ["reiniciaForm", "validacao"]),
78
- },
79
- watch: {
80
- value() {
81
- this.valida();
82
- this.formSujo = true;
83
- this.$emit("input", this.value);
84
- },
85
- notificacoes() {
86
- let self = this;
87
- this.notificacoes.forEach(function (notificacao) {
88
- let obj = {
89
- chave: self.campo + "&" + self.formNome,
90
- formNome: self.formNome,
91
- notificacao: notificacao,
92
- };
93
- self.insereValidacao(obj);
94
- });
95
-
96
- if (this.notificacoes.length == 0) {
97
- let obj = {
98
- chave: self.campo + "&" + self.formNome,
99
- formNome: self.formNome,
100
- };
101
- self.removeValidacao(obj);
102
- }
103
- },
104
- reiniciaForm: {
105
- handler(form) {
106
- if (form.nome == this.formNome) this.formSujo = false;
107
- },
108
- deep: true,
109
- },
110
- },
111
- };
112
- </script>
113
-
114
- <style scoped>
115
- .sucesso {
116
- color: #94aa2a;
117
- font-size: 14px;
118
- }
119
- .invalido {
120
- color: #f0134d;
121
- font-size: 14px;
122
- }
123
- </style>
@@ -1,142 +0,0 @@
1
- <template>
2
- <div class="painel">
3
- <Toast />
4
- <Carregando v-show="carregando('painel')" />
5
- <div v-show="!carregando('painel')">
6
- <div v-show="mostrarFiltroVertical">
7
- <FiltroVertical>
8
- <slot name="conteudo-filtro"></slot>
9
- </FiltroVertical>
10
- </div>
11
- <div class="c-container">
12
- <Mensagem v-if="!modal.abrir" />
13
- <div class="row">
14
- <div class="col-10">
15
- <div class="div-titulo">
16
- <span class="modulo">
17
- <span class="icone"><i class="fas fa-compass"></i></span> {{ modulo }} |</span
18
- >
19
- <span class="titulo"> {{ titulo }}</span>
20
- </div>
21
- </div>
22
- <div class="col-2 text-right" v-show="rotaAtual != 'Dashboard'">
23
- <div class="c-voltar" @click="voltar()">
24
- <span class="g-espaco-esquerda">Voltar</span>
25
- </div>
26
- </div>
27
- </div>
28
- <br v-show="mostrarBotoes" />
29
- <div class="row" v-show="mostrarBotoes">
30
- <div class="col-12" v-show="mostrarBotoes">
31
- <slot name="conteudo-botoes"></slot>
32
- </div>
33
- </div>
34
- <br v-show="mostrarBotoes || mostrarPesquisa" />
35
- <div v-show="mostrarBotoes || mostrarPesquisa">
36
- <div>
37
- <div v-show="mostrarPesquisa"><Pesquisa /></div>
38
- </div>
39
- </div>
40
- <br v-show="mostrarPesquisa" />
41
- <div>
42
- <slot name="conteudo-principal"></slot>
43
- </div>
44
- </div>
45
- </div>
46
- <br /><br /><br />
47
- </div>
48
- </template>
49
-
50
- <script>
51
- import Toast from "../shared/Toast.vue";
52
- import Mensagem from "../shared/Mensagem.vue";
53
- import Pesquisa from "../shared/Pesquisa.vue";
54
- import Carregando from "../shared/Carregando.vue";
55
- import FiltroVertical from "../shared/FiltroVertical";
56
-
57
- import { mapState, mapGetters, mapMutations } from "vuex";
58
-
59
- export default {
60
- name: "Painel",
61
- components: {
62
- Carregando,
63
- FiltroVertical,
64
- Pesquisa,
65
- Mensagem,
66
- Toast,
67
- },
68
- props: {
69
- modulo: String,
70
- titulo: String,
71
- mostrarFiltroVertical: Boolean,
72
- mostrarPesquisa: Boolean,
73
- mostrarBotoes: Boolean,
74
- },
75
- data() {
76
- return {
77
- rotaAtual: this.$route.name,
78
- };
79
- },
80
- created() {
81
- this.insereCarregando("painel");
82
- },
83
- updated() {
84
- this.rotaAtual = this.$route.name;
85
- },
86
- computed: {
87
- ...mapGetters("generic", ["carregando"]),
88
- ...mapState("generic", ["modal"]),
89
- },
90
- methods: {
91
- ...mapMutations("generic", ["insereCarregando"]),
92
- voltar() {
93
- window.history.back();
94
- },
95
- },
96
- };
97
- </script>
98
- <style scoped>
99
- .c-container {
100
- margin: auto;
101
- padding-left: 110px;
102
- max-width: 1400px;
103
- }
104
-
105
- .div-titulo {
106
- margin-top: 15px;
107
- }
108
-
109
- .modulo {
110
- font-size: 16px;
111
- font-weight: 400;
112
- }
113
-
114
- .titulo {
115
- font-size: 18px;
116
- font-weight: 400;
117
- line-height: 34px;
118
- color: #577696;
119
- }
120
-
121
- .icone{
122
- opacity: 0.8;
123
- font-size: 20px;
124
- }
125
-
126
-
127
- .c-voltar {
128
- margin-top: 20px;
129
- margin-right: 12px;
130
- font-size: 16px;
131
- cursor: pointer;
132
- color: #8ca1b7;
133
- }
134
-
135
- .c-voltar:hover {
136
- color: #8ca1b7;
137
- }
138
-
139
- .painel {
140
- padding: 25px;
141
- }
142
- </style>
@@ -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,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,73 +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 === "checkbox") return this.converteCheckbox(campo, valor, tipo, label);
13
- if (query.operator === "=") return `${campo} eq ${valor}`;
14
- if (query.operator === "!=") return `${campo} ne ${valor}`;
15
- if (query.operator === "<") return `${campo} lt ${valor}`;
16
- if (query.operator === "<=") return `${campo} le ${valor}`;
17
- if (query.operator === ">") return `${campo} gt ${valor}`;
18
- if (query.operator === ">=") return `${campo} ge ${valor}`;
19
- }
20
- convertePeriodo(valor) {
21
- let inicio = this.converteData(valor[0]);
22
- let fim = this.converteData(valor[1]);
23
- return `data ge ${inicio} and data le ${fim}`;
24
- }
25
- converteCheckbox(campo, valor, tipo, label) {
26
- let consulta = "";
27
- let sequencia = 0;
28
- var tamanho = valor.length;
29
- let self = this;
30
- valor.forEach(function (value) {
31
- if (tipo == "campo") {
32
- consulta += `${campo} eq ${value}`;
33
- if (sequencia + 1 != tamanho) consulta += ` or `;
34
- }
35
- if (tipo == "resumo") {
36
- let nome = self.converteNome(value);
37
- consulta += `${campo} with ${value} as ${nome}${label}`;
38
- if (sequencia + 1 != tamanho) consulta += `,`;
39
- }
40
- sequencia++;
41
- });
42
-
43
- if (tamanho > 1 && tipo == "campo") return `(${consulta})`;
44
- return `${consulta}`;
45
- }
46
- converteData(data) {
47
- let str = data.replace("/", "").replace("/", "");
48
-
49
- let date = {
50
- dia: str.substr(0, 2),
51
- mes: str.substr(2, 2),
52
- ano: str.substr(4, 4),
53
- };
54
-
55
- var iso = date.ano + "-" + date.mes + "-" + date.dia;
56
-
57
- /*
58
- iso += date.dia + "T";
59
- iso += "00:00:00.000Z";
60
- iso += d.getHours().toString().padStart(2, "0") + ":";
61
- iso += d.getMinutes().toString().padStart(2, "0") + ":";
62
- iso += d.getSeconds().toString().padStart(2, "0");
63
- */
64
-
65
- return iso;
66
- }
67
- converteNome(value) {
68
- if (value === "sum") return "soma";
69
- if (value === "average") return "media";
70
- if (value === "max") return "maximo";
71
- if (value === "minimo") return "minimo";
72
- }
73
- }