@nixweb/nixloc-ui 0.0.124 → 0.0.127

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 (72) hide show
  1. package/docs/src/component/template/ViewTemplateReportPreview.drawio +210 -0
  2. package/package.json +3 -1
  3. package/src/component/forms/Button.vue +7 -6
  4. package/src/component/forms/CheckboxGroup.vue +7 -4
  5. package/src/component/forms/CheckboxSimple.vue +17 -2
  6. package/src/component/forms/DateTime.vue +15 -29
  7. package/src/component/forms/EditorHtml.vue +8 -5
  8. package/src/component/forms/FileUpload.vue +7 -11
  9. package/src/component/forms/ImageUpload.vue +222 -0
  10. package/src/component/forms/InputDecimal.vue +10 -9
  11. package/src/component/forms/InputNumber.vue +20 -15
  12. package/src/component/forms/InputPassword.vue +1 -1
  13. package/src/component/forms/InputText.vue +3 -3
  14. package/src/component/forms/Modal.vue +9 -4
  15. package/src/component/forms/Select.vue +12 -9
  16. package/src/component/forms/SelectStatic.vue +8 -1
  17. package/src/component/layout/Menu.vue +4 -3
  18. package/src/component/layout/Panel.vue +0 -2
  19. package/src/component/layout/{Scrollbar.vue → ScrollBar.vue} +4 -5
  20. package/src/component/layout/Tag.vue +3 -3
  21. package/src/component/layout/Wizard.vue +11 -13
  22. package/src/component/shared/BodyReport.vue +186 -0
  23. package/src/component/shared/Confirmation.vue +2 -2
  24. package/src/component/shared/DocumentEditor.vue +1 -1
  25. package/src/component/shared/ExportExcel.vue +1 -8
  26. package/src/component/shared/{HeaderPrint.vue → HeaderReport.vue} +3 -3
  27. package/src/component/shared/HorizontalFilter.vue +1 -1
  28. package/src/component/shared/Loading.vue +1 -1
  29. package/src/component/shared/Messages.vue +2 -4
  30. package/src/component/shared/Pagination.vue +4 -5
  31. package/src/component/shared/{LegendaParametro.vue → ParameterLegend.vue} +25 -29
  32. package/src/component/shared/ProgressBar.vue +2 -1
  33. package/src/component/shared/SaveCancel.vue +20 -4
  34. package/src/component/shared/Search.vue +16 -16
  35. package/src/component/shared/SelectOption.vue +137 -0
  36. package/src/component/shared/Table.vue +33 -22
  37. package/src/component/shared/TableButton.vue +3 -3
  38. package/src/component/shared/TableTotalRecords.vue +9 -10
  39. package/src/component/shared/Toast.vue +2 -2
  40. package/src/component/shared/VerticalFilter.vue +2 -50
  41. package/src/component/shared/query-builder/AddRule.vue +49 -55
  42. package/src/component/shared/query-builder/ConvertToOdata.js +39 -42
  43. package/src/component/shared/query-builder/DynamicComponent.vue +16 -15
  44. package/src/component/shared/query-builder/DynamicComponentList.vue +62 -0
  45. package/src/component/shared/query-builder/Fields.vue +32 -66
  46. package/src/component/shared/query-builder/QueryBuilder.vue +12 -12
  47. package/src/component/shared/query-builder/Rules.vue +2 -14
  48. package/src/component/shared/query-builder/SelectRule.vue +15 -15
  49. package/src/component/shared/query-builder/Tags.vue +24 -8
  50. package/src/component/template/{ListViewWithHandlerData.vue → ListViewWithDataHandler.vue} +30 -23
  51. package/src/component/template/{AddEditReport.vue → ReportCreateUpdate.vue} +31 -20
  52. package/src/component/template/ViewTemplateConfiguration.vue +6 -12
  53. package/src/component/template/ViewTemplateDocumentView.vue +21 -25
  54. package/src/component/template/ViewTemplateReportList.vue +39 -57
  55. package/src/component/template/ViewTemplateReportPreview.vue +238 -354
  56. package/src/component/template/ViewTemplateReportPreviewCOPIASEGURANCA.vue +497 -0
  57. package/src/component/template/ViewTemplateSelectOption.vue +60 -0
  58. package/src/component/template/ViewTemplateWithTable.vue +21 -14
  59. package/src/component/template/model/Report.js +2 -2
  60. package/src/component/value-objects/Address.js +11 -0
  61. package/src/component/value-objects/{Endereco.vue → Address.vue} +39 -40
  62. package/src/component/value-objects/{DadosContato.js → Contact.js} +2 -2
  63. package/src/component/value-objects/{DadosContato.vue → Contact.vue} +17 -17
  64. package/src/component/value-objects/Person.js +10 -0
  65. package/src/component/value-objects/{DadosPessoa.vue → Person.vue} +35 -35
  66. package/src/store/modules/generic.js +17 -11
  67. package/src/store/modules/report.js +124 -113
  68. package/src/store/modules/user.js +3 -0
  69. package/docs/src/component/template/ModeloRelatorioView.drawio +0 -160
  70. package/src/component/shared/query-builder/ListDynamicComponent.vue +0 -42
  71. package/src/component/value-objects/DadosPessoa.js +0 -10
  72. package/src/component/value-objects/Endereco.js +0 -11
@@ -2,14 +2,15 @@
2
2
  <div>
3
3
  <div :class="{ 'g-div-molded': showMolded }">
4
4
  <b-row>
5
- <b-col sm="12"
6
- ><div>
5
+ <b-col sm="12">
6
+ <div>
7
7
  <HorizontalFilter v-if="showHorizontalFilter">
8
8
  <div slot="content-filter-horizontal">
9
9
  <slot name="content-filter-horizontal"></slot>
10
10
  </div>
11
- </HorizontalFilter></div
12
- ></b-col>
11
+ </HorizontalFilter>
12
+ </div>
13
+ </b-col>
13
14
  </b-row>
14
15
  <b-row>
15
16
  <b-col sm="6">
@@ -19,6 +20,7 @@
19
20
  <TableTotalRecords :totalRecords="content.totalRecords" />
20
21
  </b-col>
21
22
  </b-row>
23
+ <Loading type="line" :center="false" v-show="isLoading('loadingLine')" />
22
24
  <FixedBar posicao="topo" v-show="selected.length > 0">
23
25
  <div>
24
26
  <Button
@@ -43,23 +45,24 @@
43
45
  </Table>
44
46
  </div>
45
47
  <br />
46
- <Pagination key="templateList" :totalRecords="content.totalRecords" />
48
+ <Pagination _key="templateList" :totalRecords="content.totalRecords" />
47
49
  </div>
48
50
  </template>
49
51
 
50
52
  <script>
51
- import Pagination from "../shared/Pagination.vue";
53
+ import Pagination from "@nixweb/nixloc-ui/src/component/shared/Pagination.vue";
52
54
  import Table from "../shared/Table.vue";
53
55
  import Button from "../forms/Button.vue";
54
56
  import FixedBar from "../layout/FixedBar.vue";
55
57
  import TableTotalRecords from "../shared/TableTotalRecords.vue";
56
58
  import TableTotalization from "../shared/TableTotalization.vue";
57
59
  import HorizontalFilter from "../shared/HorizontalFilter.vue";
60
+ import Loading from "../shared/Loading.vue";
58
61
 
59
62
  import { mapState, mapGetters, mapActions, mapMutations } from "vuex";
60
63
 
61
64
  export default {
62
- name: "ListViewWithHandlerData",
65
+ name: "ListViewWithDataHandler",
63
66
  props: {
64
67
  templateList: Object,
65
68
  propsParam: Object,
@@ -80,6 +83,7 @@ export default {
80
83
  HorizontalFilter,
81
84
  TableTotalization,
82
85
  TableTotalRecords,
86
+ Loading,
83
87
  FixedBar,
84
88
  Button,
85
89
  Table,
@@ -93,7 +97,7 @@ export default {
93
97
  },
94
98
  baseParams: {
95
99
  search: undefined,
96
- filter: "contem",
100
+ filter: "contains",
97
101
  currentPage: 1,
98
102
  totalPerPage: 10,
99
103
  },
@@ -111,7 +115,7 @@ export default {
111
115
  });
112
116
  },
113
117
  beforeDestroy() {
114
- let search = { content: "", filter: { content: "contem", id: "contem" } };
118
+ let search = { content: "", filter: { content: "Contém", id: "contains" } };
115
119
  this.updateSearch(search);
116
120
  },
117
121
  computed: {
@@ -124,7 +128,7 @@ export default {
124
128
  "totalPerPage",
125
129
  "selectStatic",
126
130
  ]),
127
- ...mapGetters("generic", ["pagination"]),
131
+ ...mapGetters("generic", ["pagination", "isLoading"]),
128
132
  paginationKey: function () {
129
133
  return this.pagination("templateList");
130
134
  },
@@ -142,12 +146,15 @@ export default {
142
146
  let params = { url: this.templateList.urlGetApi, obj: obj };
143
147
  this.getApi(params).then((response) => {
144
148
  this.content = response.content;
145
- this.removeLoading(["panel", "modeloSubView", "search", "clean"]);
149
+ let self = this;
150
+ setTimeout(function () {
151
+ self.removeLoading(["panel", "loadingLine", "btnSearch", "btnClean"]);
152
+ }, 350);
146
153
  });
147
154
  },
148
155
  removeSelected() {
149
156
  let params = {
150
- url: this.templateList.urlRemoverTodosApi,
157
+ url: this.templateList.urlDeleteAllApi,
151
158
  selected: this.selected,
152
159
  };
153
160
  this.deleteAllApi(params).then(() => {
@@ -155,7 +162,7 @@ export default {
155
162
  this.addSelected([]);
156
163
  });
157
164
  },
158
- limpaParams() {
165
+ cleanParams() {
159
166
  this.baseParams.currentPage = 1;
160
167
  },
161
168
  },
@@ -172,19 +179,19 @@ export default {
172
179
  },
173
180
  executedSearch: function () {
174
181
  this.baseParams.search = this.search.content;
175
- this.baseParams.filter = this.search.filter.id;
176
- this.limpaParams();
182
+ if (this.search.filter.id) this.baseParams.filter = this.search.filter.id;
183
+ this.cleanParams();
177
184
  this.getAll();
178
185
  },
179
186
  clearedSearch: function () {
180
187
  this.baseParams.search = "";
181
188
  this.baseParams.filter = "";
182
- this.limpaParams();
189
+ this.cleanParams();
183
190
  this.getAll();
184
191
  },
185
192
  paginationKey: {
186
193
  handler(value) {
187
- this.limpaParams();
194
+ this.cleanParams();
188
195
  this.baseParams.currentPage = value.currentPage;
189
196
  this.getAll();
190
197
  },
@@ -193,19 +200,19 @@ export default {
193
200
  selectStatic: {
194
201
  handler(value) {
195
202
  let fieldTarget = value.fieldTarget;
196
- let obj = { key: fieldTarget, valor: value.valor };
203
+ let obj = { key: fieldTarget, value: value.value };
197
204
  this.paramsFilter.push(obj);
198
205
 
199
206
  var result = {};
200
207
  for (var i = 0; i < this.paramsFilter.length; i++) {
201
208
  let key = this.paramsFilter[i].key;
202
- let valor = this.paramsFilter[i].valor;
209
+ let value = this.paramsFilter[i].value;
203
210
 
204
- if (key == "periodo") {
205
- result["inicio"] = valor.inicio;
206
- result["fim"] = valor.fim;
211
+ if (key == "period") {
212
+ result["start"] = value.inicio;
213
+ result["end"] = value.fim;
207
214
  } else {
208
- result[key] = valor;
215
+ result[key] = value;
209
216
  }
210
217
  }
211
218
 
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div>
3
3
  <b-row>
4
- <b-col sm="12"
5
- ><InputText
4
+ <b-col sm="12">
5
+ <InputText
6
6
  title="Nome"
7
7
  field="name"
8
8
  :formName="formName"
@@ -17,7 +17,7 @@
17
17
  <b-col sm="12">
18
18
  <div class="text-right">
19
19
  <Button
20
- key="save"
20
+ _key="btnSaveReport"
21
21
  type="success"
22
22
  title="Salvar"
23
23
  :disabled="!isFormValid(formName)"
@@ -34,41 +34,44 @@
34
34
  <script>
35
35
  import InputText from "@nixweb/nixloc-ui/src/component/forms/InputText";
36
36
  import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
37
+
37
38
  import Report from "@nixweb/nixloc-ui/src/component/template/model/Report.js";
38
39
 
39
40
  import { mapGetters, mapState, mapActions, mapMutations } from "vuex";
40
41
 
41
42
  export default {
42
- name: "AddEditReport",
43
+ name: "ReportCreateUpdate",
43
44
  components: { Button, InputText },
44
45
  props: {
45
46
  module: String,
46
47
  },
47
48
  data() {
48
49
  return {
49
- formName: "reportAddEditView",
50
+ formName: "reportCreateUpdate",
50
51
  report: new Report(),
51
- urlAdicionar: "/api/v1/shared/report/adicionar",
52
- urlModificar: "/api/v1/shared/report/modificar",
52
+ urlCreate: "/api/v1/shared/report/create",
53
+ urlUpdate: "/api/v1/shared/report/update",
53
54
  };
54
55
  },
55
56
  computed: {
56
57
  ...mapGetters("validation", ["isFormValid"]),
57
58
  ...mapGetters("generic", ["event"]),
58
- ...mapGetters("report", ["headerTable", "filtroSelecionado"]),
59
- ...mapState("report", ["selectedField", "campoOrdenado"]),
59
+ ...mapState("report", ["selectedFields", "selectedRules"]),
60
60
  },
61
61
  methods: {
62
62
  ...mapActions("generic", ["postApi", "putApi"]),
63
63
  ...mapMutations("generic", ["removeLoading", "removeEvent", "hideModal"]),
64
64
  ...mapMutations("validation", ["resetValidation"]),
65
65
  saveReport() {
66
- var personalizado = this.report.id ? "" : "Personalizado";
66
+ var custom = this.report.id ? "" : "Custom";
67
67
  const query = {
68
- routeName: `${this.$route.name}${personalizado}`,
69
- field: this.selectedField,
70
- ordenacao: this.campoOrdenado,
71
- filter: this.filtroSelecionado.children,
68
+ routeName: `${this.$route.name}${custom}`,
69
+ selectedFields: {
70
+ orderBy: this.selectedFields.orderBy,
71
+ selected: this.selectedFields.selected,
72
+ sort: this.selectedFields.sort,
73
+ },
74
+ selectedRules: this.selectedRules,
72
75
  };
73
76
  let obj = {
74
77
  id: this.report.id,
@@ -77,16 +80,23 @@ export default {
77
80
  query: JSON.stringify(query),
78
81
  };
79
82
  if (this.report.id) {
80
- let params = { url: this.urlModificar, obj: obj };
83
+ let params = { url: this.urlUpdate, obj: obj };
81
84
  this.putApi(params).then((response) => {
82
85
  if (response.success) this.hideModal();
83
- this.removeLoading(["save"]);
86
+ this.removeLoading(["btnSaveReport"]);
84
87
  });
85
88
  } else {
86
- let params = { url: this.urlAdicionar, obj: obj };
89
+ let params = { url: this.urlCreate, obj: obj };
87
90
  this.postApi(params).then((response) => {
88
- if (response.success) this.hideModal();
89
- this.removeLoading(["save"]);
91
+ if (response.success) {
92
+ const query = JSON.parse(response.content.query);
93
+ this.$router.replace({
94
+ name: query.routeName,
95
+ params: { id: response.content.id, name: response.content.name },
96
+ });
97
+ this.hideModal();
98
+ }
99
+ this.removeLoading(["btnSaveReport"]);
90
100
  });
91
101
  }
92
102
  },
@@ -94,9 +104,10 @@ export default {
94
104
  watch: {
95
105
  event: {
96
106
  handler(event) {
97
- if (event.name == "changeReport") {
107
+ if (event.name == "saveReport") {
98
108
  this.report.id = this.$route.params.id;
99
109
  if (this.report.id) this.report.name = this.$route.params.name;
110
+ this.saveReport();
100
111
  }
101
112
  },
102
113
  deep: true,
@@ -1,14 +1,12 @@
1
1
  <template>
2
2
  <div>
3
- <Loading :center="false" v-show="carregando('modeloSubView')" />
4
- <div v-show="!carregando('modeloSubView')">
3
+ <div>
5
4
  <slot name="content-buttons"></slot>
6
5
  <div v-if="showSearch">
7
6
  <Search />
8
7
  <br />
9
8
  </div>
10
-
11
- <ListViewWithHandlerData
9
+ <ListViewWithDataHandler
12
10
  :templateList="templateList"
13
11
  :propsParam="propsParam"
14
12
  :showMolded="false"
@@ -24,22 +22,21 @@
24
22
  <div slot="content-buttons-table">
25
23
  <slot name="content-buttons-table"></slot>
26
24
  </div>
27
- </ListViewWithHandlerData>
25
+ </ListViewWithDataHandler>
28
26
  </div>
29
27
  </div>
30
28
  </template>
31
29
 
32
30
  <script>
33
31
  import Search from "../shared/Search.vue";
34
- import Loading from "../shared/Loading.vue";
35
32
 
36
- import ListViewWithHandlerData from "@nixweb/nixloc-ui/src/component/template/ListViewWithHandlerData.vue";
33
+ import ListViewWithDataHandler from "@nixweb/nixloc-ui/src/component/template/ListViewWithDataHandler.vue";
37
34
 
38
35
  import { mapGetters, mapMutations } from "vuex";
39
36
 
40
37
  export default {
41
38
  name: "ViewTemplateConfiguration",
42
- components: { Search, Loading, ListViewWithHandlerData },
39
+ components: { Search, ListViewWithDataHandler },
43
40
  props: {
44
41
  templateList: Object,
45
42
  propsParam: Object,
@@ -56,11 +53,8 @@ export default {
56
53
  default: true,
57
54
  },
58
55
  },
59
- computed: {
60
- ...mapGetters("generic", ["carregando"]),
61
- },
62
56
  created() {
63
- this.addLoading("modeloSubView");
57
+ this.addLoading("loadingLine");
64
58
  },
65
59
  methods: {
66
60
  ...mapMutations("generic", ["addLoading"]),
@@ -15,7 +15,7 @@
15
15
  <b-col sm="6">
16
16
  <div class="side-by-side">
17
17
  <Button
18
- key="saveDocument"
18
+ _key="saveDocument"
19
19
  type="success"
20
20
  title="Salvar"
21
21
  classIcon="fas fa-save"
@@ -27,7 +27,7 @@
27
27
  <div class="side-by-side">
28
28
  <Button
29
29
  v-if="id"
30
- key="saveAs"
30
+ _key="saveAs"
31
31
  type="success"
32
32
  title="Fazer uma cópia"
33
33
  classIcon="fas fa-clone"
@@ -73,7 +73,7 @@
73
73
  <slot></slot>
74
74
  </Modal>
75
75
  <Modal title="Parâmetros" :width="1100" v-if="showModal('legenda')">
76
- <LegendaParametro v-if="modal.open" :legenda="legenda" />
76
+ <ParameterLegend v-if="modal.open" :legend="parameterLegend" />
77
77
  </Modal>
78
78
  <Modal title="Editor de Código" :width="900" v-if="showModal('code')">
79
79
  <CodeEditor v-if="modal.open" />
@@ -98,7 +98,10 @@
98
98
  <div>
99
99
  <div class="a4">
100
100
  <div id="printMe">
101
- <DocumentPreview :template="documentoPreview" :d="data" />
101
+ <DocumentPreview
102
+ :template="documentPreview"
103
+ :d="parameterExemple"
104
+ />
102
105
  </div>
103
106
  </div>
104
107
  </div>
@@ -116,11 +119,10 @@
116
119
 
117
120
  <script>
118
121
  import Panel from "@nixweb/nixloc-ui/src/component/layout/Panel";
119
-
120
122
  import DocumentEditor from "@nixweb/nixloc-ui/src/component/shared/DocumentEditor.vue";
121
123
  import DocumentPreview from "@nixweb/nixloc-ui/src/component/shared/DocumentPreview.vue";
122
124
  import CodeEditor from "@nixweb/nixloc-ui/src/component/shared/CodeEditor.vue";
123
- import LegendaParametro from "@nixweb/nixloc-ui/src/component/shared/LegendaParametro.vue";
125
+ import ParameterLegend from "@nixweb/nixloc-ui/src/component/shared/ParameterLegend.vue";
124
126
  import Molded from "@nixweb/nixloc-ui/src/component/layout/Molded";
125
127
  import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
126
128
  import Modal from "@nixweb/nixloc-ui/src/component/forms/Modal";
@@ -140,7 +142,7 @@ export default {
140
142
  DocumentEditor,
141
143
  DocumentPreview,
142
144
  CodeEditor,
143
- LegendaParametro,
145
+ ParameterLegend,
144
146
  Molded,
145
147
  Button,
146
148
  Modal,
@@ -148,8 +150,8 @@ export default {
148
150
  },
149
151
  props: {
150
152
  panel: Object,
151
- data: Object,
152
- legenda: Array,
153
+ parameterExemple: Object,
154
+ parameterLegend: Array,
153
155
  },
154
156
  data() {
155
157
  return {
@@ -159,36 +161,31 @@ export default {
159
161
  },
160
162
  computed: {
161
163
  ...mapState("generic", ["modal", "documentHtml"]),
162
- ...mapGetters("generic", ["showModal", "event", "documentoPreview"]),
164
+ ...mapGetters("generic", ["showModal", "event", "documentPreview"]),
163
165
  },
164
166
  methods: {
165
- ...mapMutations("generic", [
166
- "showModal",
167
- "hideModal",
168
- "removeLoading",
169
- "addEvent",
170
- ]),
167
+ ...mapMutations("generic", ["openModal", "hideModal", "removeLoading", "addEvent"]),
171
168
  saveDocument() {
172
169
  if (this.id) {
173
- this.addEvent({ nome: "saveDocument" });
170
+ this.addEvent({ name: "saveDocument" });
174
171
  } else {
175
- this.showModal("saveDocument");
172
+ this.openModal("saveDocument");
176
173
  this.removeLoading(["saveDocument"]);
177
174
  }
178
175
  },
179
176
  saveAs() {
180
- this.addEvent({ nome: "saveAs" });
177
+ this.addEvent({ name: "saveAs" });
181
178
  },
182
179
  showModalLegend() {
183
- this.showModal("legenda");
180
+ this.openModal("legenda");
184
181
  this.removeLoading(["showModalLegend"]);
185
182
  },
186
183
  showModalCode() {
187
- this.showModal("code");
184
+ this.openModal("code");
188
185
  this.removeLoading(["showModalCode"]);
189
186
  },
190
187
  showModalPreview() {
191
- this.showModal("preview");
188
+ this.openModal("preview");
192
189
  this.removeLoading(["showModalPreview"]);
193
190
  },
194
191
  print() {
@@ -198,8 +195,8 @@ export default {
198
195
  watch: {
199
196
  event: {
200
197
  handler(event) {
201
- if (event.nome == "documentoEditorModificado") this.isDisabled = true;
202
- if (event.nome == "documentEditorChanged") this.isDisabled = false;
198
+ if (event.name == "documentEditorModified") this.isDisabled = true;
199
+ if (event.name == "documentEditorChanged") this.isDisabled = false;
203
200
  },
204
201
  deep: true,
205
202
  },
@@ -223,5 +220,4 @@ export default {
223
220
  box-shadow: 0 0 5px hsl(0deg 0% 0% / 10%);
224
221
  margin: 0 auto;
225
222
  }
226
-
227
223
  </style>