@nixweb/nixloc-ui 0.0.127 → 0.0.128

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 (88) hide show
  1. package/package.json +79 -79
  2. package/src/App.vue +13 -13
  3. package/src/component/forms/Button.vue +170 -170
  4. package/src/component/forms/CheckboxGroup.vue +72 -66
  5. package/src/component/forms/CheckboxSimple.vue +46 -42
  6. package/src/component/forms/Color.vue +38 -38
  7. package/src/component/forms/DateTime.vue +167 -163
  8. package/src/component/forms/Dropdown.vue +218 -224
  9. package/src/component/forms/EditorHtml.vue +126 -126
  10. package/src/component/forms/FileUpload.vue +185 -185
  11. package/src/component/forms/ImageUpload.vue +12 -4
  12. package/src/component/forms/IncrementDecrement.vue +101 -0
  13. package/src/component/forms/InputDecimal.vue +142 -138
  14. package/src/component/forms/InputNumber.vue +154 -154
  15. package/src/component/forms/InputPassword.vue +135 -135
  16. package/src/component/forms/InputText.vue +162 -157
  17. package/src/component/forms/Modal.vue +65 -65
  18. package/src/component/forms/RadioGroup.vue +50 -50
  19. package/src/component/forms/Select.vue +349 -340
  20. package/src/component/forms/SelectStatic.vue +127 -127
  21. package/src/component/forms/Slider.vue +18 -18
  22. package/src/component/forms/TextArea.vue +126 -126
  23. package/src/component/layout/Alert.vue +92 -92
  24. package/src/component/layout/Badge.vue +103 -103
  25. package/src/component/layout/FixedBar.vue +100 -68
  26. package/src/component/layout/Header.vue +38 -35
  27. package/src/component/layout/LoadingFullPage.vue +27 -27
  28. package/src/component/layout/Menu.vue +210 -215
  29. package/src/component/layout/Molded.vue +28 -27
  30. package/src/component/layout/Panel.vue +140 -140
  31. package/src/component/layout/Popover.vue +126 -126
  32. package/src/component/layout/ScrollBar.vue +42 -42
  33. package/src/component/layout/Tab.vue +135 -0
  34. package/src/component/layout/Wizard.vue +211 -211
  35. package/src/component/rental/DisplayPeriodRent.vue +81 -0
  36. package/src/component/rental/DisplayTotalization.vue +47 -0
  37. package/src/component/shared/Collapse.vue +131 -131
  38. package/src/component/shared/DocumentPreview.vue +1 -1
  39. package/src/component/shared/DocumentPublic.vue +34 -0
  40. package/src/component/shared/ExportPDF.vue +116 -116
  41. package/src/component/shared/HeaderReport.vue +1 -1
  42. package/src/component/shared/HorizontalFilter.vue +59 -59
  43. package/src/component/shared/Loading.vue +107 -107
  44. package/src/component/shared/LoadingMoreButton.vue +23 -23
  45. package/src/component/shared/Messages.vue +81 -81
  46. package/src/component/shared/PDFViewer.vue +22 -22
  47. package/src/component/shared/Pagination.vue +52 -52
  48. package/src/component/shared/ProgressBar.vue +22 -22
  49. package/src/component/shared/QueryButton.vue +66 -66
  50. package/src/component/shared/{BodyReport.vue → Report.vue} +8 -7
  51. package/src/component/shared/SaveCancel.vue +6 -1
  52. package/src/component/shared/Search.vue +154 -154
  53. package/src/component/shared/SelectOption.vue +18 -9
  54. package/src/component/shared/Table.vue +163 -254
  55. package/src/component/shared/TableButton.vue +36 -36
  56. package/src/component/shared/TableDraggable.vue +127 -0
  57. package/src/component/shared/TableItem.vue +177 -0
  58. package/src/component/shared/TableTotalization.vue +47 -47
  59. package/src/component/shared/Tip.vue +42 -42
  60. package/src/component/shared/Toast.vue +54 -54
  61. package/src/component/shared/TotalizationReport.vue +59 -0
  62. package/src/component/shared/VerticalFilter.vue +97 -97
  63. package/src/component/shared/query-builder/AddRule.vue +181 -181
  64. package/src/component/shared/query-builder/ConvertToOdata.js +3 -9
  65. package/src/component/shared/query-builder/DynamicComponent.vue +5 -1
  66. package/src/component/shared/query-builder/DynamicComponentList.vue +73 -62
  67. package/src/component/shared/query-builder/QueryBuilder.vue +69 -69
  68. package/src/component/shared/query-builder/utilities.js +21 -21
  69. package/src/component/template/ListViewWithDataHandler.vue +260 -238
  70. package/src/component/template/ReportCreateUpdate.vue +9 -2
  71. package/src/component/template/ViewTemplateConfiguration.vue +64 -63
  72. package/src/component/template/ViewTemplateDocumentView.vue +1 -0
  73. package/src/component/template/ViewTemplateReportPreview.vue +56 -12
  74. package/src/component/template/ViewTemplateWithSalveCancel.vue +32 -32
  75. package/src/component/template/ViewTemplateWithTable.vue +56 -56
  76. package/src/component/value-objects/Contact.vue +7 -0
  77. package/src/component/value-objects/Person.vue +15 -0
  78. package/src/config/axios.js +9 -9
  79. package/src/config/dicas.js +14 -14
  80. package/src/config/router.js +13 -13
  81. package/src/config/token.js +14 -14
  82. package/src/main.js +23 -23
  83. package/src/store/modules/generic.js +512 -494
  84. package/src/store/modules/report.js +37 -19
  85. package/src/store/modules/user.js +3 -0
  86. package/src/store/modules/validation.js +38 -38
  87. package/src/store/store.js +13 -13
  88. package/src/component/shared/query-builder/Totalization.vue +0 -38
@@ -1,238 +1,260 @@
1
- <template>
2
- <div>
3
- <div :class="{ 'g-div-molded': showMolded }">
4
- <b-row>
5
- <b-col sm="12">
6
- <div>
7
- <HorizontalFilter v-if="showHorizontalFilter">
8
- <div slot="content-filter-horizontal">
9
- <slot name="content-filter-horizontal"></slot>
10
- </div>
11
- </HorizontalFilter>
12
- </div>
13
- </b-col>
14
- </b-row>
15
- <b-row>
16
- <b-col sm="6">
17
- <TableTotalization :totalization="content.totalization" />
18
- </b-col>
19
- <b-col sm="6">
20
- <TableTotalRecords :totalRecords="content.totalRecords" />
21
- </b-col>
22
- </b-row>
23
- <Loading type="line" :center="false" v-show="isLoading('loadingLine')" />
24
- <FixedBar posicao="topo" v-show="selected.length > 0">
25
- <div>
26
- <Button
27
- v-if="buttonRemove"
28
- key="remove"
29
- :title="`Remover ${selected.length}`"
30
- type="danger"
31
- size="small"
32
- :clicked="removeSelected"
33
- />
34
- <slot name="content-buttons-table-header"></slot>
35
- </div>
36
- </FixedBar>
37
- <Table
38
- :header="templateList.headerTable"
39
- :data="content.data"
40
- :showChecks="templateList.showChecks"
41
- >
42
- <div slot="content-buttons-table">
43
- <slot name="content-buttons-table"></slot>
44
- </div>
45
- </Table>
46
- </div>
47
- <br />
48
- <Pagination _key="templateList" :totalRecords="content.totalRecords" />
49
- </div>
50
- </template>
51
-
52
- <script>
53
- import Pagination from "@nixweb/nixloc-ui/src/component/shared/Pagination.vue";
54
- import Table from "../shared/Table.vue";
55
- import Button from "../forms/Button.vue";
56
- import FixedBar from "../layout/FixedBar.vue";
57
- import TableTotalRecords from "../shared/TableTotalRecords.vue";
58
- import TableTotalization from "../shared/TableTotalization.vue";
59
- import HorizontalFilter from "../shared/HorizontalFilter.vue";
60
- import Loading from "../shared/Loading.vue";
61
-
62
- import { mapState, mapGetters, mapActions, mapMutations } from "vuex";
63
-
64
- export default {
65
- name: "ListViewWithDataHandler",
66
- props: {
67
- templateList: Object,
68
- propsParam: Object,
69
- showMolded: {
70
- type: Boolean,
71
- default: true,
72
- },
73
- showHorizontalFilter: {
74
- type: Boolean,
75
- default: true,
76
- },
77
- buttonRemove: {
78
- type: Boolean,
79
- default: true,
80
- },
81
- },
82
- components: {
83
- HorizontalFilter,
84
- TableTotalization,
85
- TableTotalRecords,
86
- Loading,
87
- FixedBar,
88
- Button,
89
- Table,
90
- Pagination,
91
- },
92
- data() {
93
- return {
94
- content: {
95
- data: [],
96
- totalRecords: 0,
97
- },
98
- baseParams: {
99
- search: undefined,
100
- filter: "contains",
101
- currentPage: 1,
102
- totalPerPage: 10,
103
- },
104
- paramsFilter: [],
105
- dynamicFilter: {},
106
- };
107
- },
108
- created() {
109
- // o carregamento inicial getAll() é feito pela mudança no paginationKey
110
- },
111
- mounted() {
112
- this.updatePagination({
113
- key: "templateList",
114
- totalPerPage: this.baseParams.totalPerPage,
115
- });
116
- },
117
- beforeDestroy() {
118
- let search = { content: "", filter: { content: "Contém", id: "contains" } };
119
- this.updateSearch(search);
120
- },
121
- computed: {
122
- ...mapState("generic", [
123
- "selected",
124
- "methodExecutedApi",
125
- "search",
126
- "executedSearch",
127
- "clearedSearch",
128
- "totalPerPage",
129
- "selectStatic",
130
- ]),
131
- ...mapGetters("generic", ["pagination", "isLoading"]),
132
- paginationKey: function () {
133
- return this.pagination("templateList");
134
- },
135
- },
136
- methods: {
137
- ...mapActions("generic", ["getApi", "deleteAllApi"]),
138
- ...mapMutations("generic", [
139
- "removeLoading",
140
- "addSelected",
141
- "updatePagination",
142
- "updateSearch",
143
- ]),
144
- getAll() {
145
- let obj = { ...this.baseParams, ...this.dynamicFilter, ...this.propsParam };
146
- let params = { url: this.templateList.urlGetApi, obj: obj };
147
- this.getApi(params).then((response) => {
148
- this.content = response.content;
149
- let self = this;
150
- setTimeout(function () {
151
- self.removeLoading(["panel", "loadingLine", "btnSearch", "btnClean"]);
152
- }, 350);
153
- });
154
- },
155
- removeSelected() {
156
- let params = {
157
- url: this.templateList.urlDeleteAllApi,
158
- selected: this.selected,
159
- };
160
- this.deleteAllApi(params).then(() => {
161
- this.removeLoading(["remove"]);
162
- this.addSelected([]);
163
- });
164
- },
165
- cleanParams() {
166
- this.baseParams.currentPage = 1;
167
- },
168
- },
169
- watch: {
170
- methodExecutedApi: function (value) {
171
- if (
172
- value === "postApi" ||
173
- value === "putApi" ||
174
- value === "deleteAllApi" ||
175
- value === "deleteAllApiErro"
176
- ) {
177
- this.getAll();
178
- }
179
- },
180
- executedSearch: function () {
181
- this.baseParams.search = this.search.content;
182
- if (this.search.filter.id) this.baseParams.filter = this.search.filter.id;
183
- this.cleanParams();
184
- this.getAll();
185
- },
186
- clearedSearch: function () {
187
- this.baseParams.search = "";
188
- this.baseParams.filter = "";
189
- this.cleanParams();
190
- this.getAll();
191
- },
192
- paginationKey: {
193
- handler(value) {
194
- this.cleanParams();
195
- this.baseParams.currentPage = value.currentPage;
196
- this.getAll();
197
- },
198
- deep: true,
199
- },
200
- selectStatic: {
201
- handler(value) {
202
- let fieldTarget = value.fieldTarget;
203
- let obj = { key: fieldTarget, value: value.value };
204
- this.paramsFilter.push(obj);
205
-
206
- var result = {};
207
- for (var i = 0; i < this.paramsFilter.length; i++) {
208
- let key = this.paramsFilter[i].key;
209
- let value = this.paramsFilter[i].value;
210
-
211
- if (key == "period") {
212
- result["start"] = value.inicio;
213
- result["end"] = value.fim;
214
- } else {
215
- result[key] = value;
216
- }
217
- }
218
-
219
- this.dynamicFilter = result;
220
-
221
- this.updatePagination({
222
- key: "templateList",
223
- totalPerPage: this.dynamicFilter.totalPerPage,
224
- });
225
-
226
- this.getAll();
227
- },
228
- deep: true,
229
- },
230
- },
231
- };
232
- </script>
233
-
234
- <style scoped>
235
- .div-button-excluir {
236
- padding-bottom: 10px;
237
- }
238
- </style>
1
+ <template>
2
+ <div>
3
+ <div :class="{ 'g-div-molded': showMolded }">
4
+ <b-row>
5
+ <b-col sm="12">
6
+ <div>
7
+ <HorizontalFilter v-if="showHorizontalFilter">
8
+ <div slot="content-filter-horizontal">
9
+ <slot name="content-filter-horizontal"></slot>
10
+ </div>
11
+ </HorizontalFilter>
12
+ </div>
13
+ </b-col>
14
+ </b-row>
15
+ <b-row>
16
+ <b-col sm="6">
17
+ <div v-if="templateList.dragAndDrop">
18
+ <i class="fa-regular fa-maximize"></i> Clique e arraste para ordenar
19
+ </div>
20
+ <TableTotalization :totalization="content.totalization" />
21
+ </b-col>
22
+ <b-col sm="6">
23
+ <TableTotalRecords :totalRecords="content.totalRecords" />
24
+ </b-col>
25
+ </b-row>
26
+ <Loading type="line" :center="false" v-show="isLoading('loadingLine')" />
27
+ <FixedBar posicao="topo" v-show="selected.length > 0">
28
+ <div>
29
+ <Button
30
+ v-if="buttonRemove"
31
+ key="remove"
32
+ :title="`Remover ${selected.length}`"
33
+ type="danger"
34
+ size="small"
35
+ :clicked="removeSelected"
36
+ />
37
+ <slot name="content-buttons-table-header"></slot>
38
+ </div>
39
+ </FixedBar>
40
+ <Table
41
+ :header="templateList.headerTable"
42
+ :data="content.data"
43
+ :showChecks="templateList.showChecks"
44
+ :dragAndDrop="templateList.dragAndDrop"
45
+ >
46
+ <div slot="content-buttons-table">
47
+ <slot name="content-buttons-table"></slot>
48
+ </div>
49
+ </Table>
50
+ </div>
51
+ <br />
52
+ <Pagination _key="templateList" :totalRecords="content.totalRecords" />
53
+ </div>
54
+ </template>
55
+
56
+ <script>
57
+ import Pagination from "@nixweb/nixloc-ui/src/component/shared/Pagination.vue";
58
+ import Table from "../shared/Table.vue";
59
+ import Button from "../forms/Button.vue";
60
+ import FixedBar from "../layout/FixedBar.vue";
61
+ import TableTotalRecords from "../shared/TableTotalRecords.vue";
62
+ import TableTotalization from "../shared/TableTotalization.vue";
63
+ import HorizontalFilter from "../shared/HorizontalFilter.vue";
64
+ import Loading from "../shared/Loading.vue";
65
+
66
+ import { mapState, mapGetters, mapActions, mapMutations } from "vuex";
67
+
68
+ export default {
69
+ name: "ListViewWithDataHandler",
70
+ props: {
71
+ templateList: Object,
72
+ propsParam: Object,
73
+ showMolded: {
74
+ type: Boolean,
75
+ default: true,
76
+ },
77
+ showHorizontalFilter: {
78
+ type: Boolean,
79
+ default: true,
80
+ },
81
+ buttonRemove: {
82
+ type: Boolean,
83
+ default: true,
84
+ },
85
+ },
86
+ components: {
87
+ HorizontalFilter,
88
+ TableTotalization,
89
+ TableTotalRecords,
90
+ Loading,
91
+ FixedBar,
92
+ Button,
93
+ Table,
94
+ Pagination,
95
+ },
96
+ data() {
97
+ return {
98
+ content: {
99
+ data: [],
100
+ totalRecords: 0,
101
+ },
102
+ baseParams: {
103
+ search: undefined,
104
+ filter: "contains",
105
+ currentPage: 1,
106
+ totalPerPage: 10,
107
+ },
108
+ paramsFilter: [],
109
+ dynamicFilter: {},
110
+ };
111
+ },
112
+ created() {
113
+ // o carregamento inicial getAll() é feito pela mudança no paginationKey
114
+ },
115
+ mounted() {
116
+ this.updatePagination({
117
+ key: "templateList",
118
+ totalPerPage: this.baseParams.totalPerPage,
119
+ });
120
+ },
121
+ beforeDestroy() {
122
+ let search = { content: "", filter: { content: "Contém", id: "contains" } };
123
+ this.updateSearch(search);
124
+ },
125
+ computed: {
126
+ ...mapState("generic", [
127
+ "selected",
128
+ "methodExecutedApi",
129
+ "search",
130
+ "executedSearch",
131
+ "clearedSearch",
132
+ "totalPerPage",
133
+ "selectStatic",
134
+ ]),
135
+ ...mapGetters("generic", ["pagination", "isLoading", "event"]),
136
+ paginationKey: function () {
137
+ return this.pagination("templateList");
138
+ },
139
+ },
140
+ methods: {
141
+ ...mapActions("generic", ["getApi", "orderAllApi", "deleteAllApi"]),
142
+ ...mapMutations("generic", [
143
+ "addLoading",
144
+ "removeLoading",
145
+ "addSelected",
146
+ "updatePagination",
147
+ "updateSearch",
148
+ ]),
149
+ getAll() {
150
+ let obj = { ...this.baseParams, ...this.dynamicFilter, ...this.propsParam };
151
+ let params = { url: this.templateList.urlGetApi, obj: obj };
152
+ this.getApi(params).then((response) => {
153
+ this.content = response.content;
154
+ let self = this;
155
+ setTimeout(function () {
156
+ self.removeLoading(["panel", "loadingLine", "btnSearch", "btnClean"]);
157
+ }, 350);
158
+ });
159
+ },
160
+ orderAll(data) {
161
+ let obj = { listIds: data.listIds };
162
+
163
+ let params = {
164
+ url: this.templateList.urlOrderAllApi,
165
+ obj: obj,
166
+ notNotifyToast: true,
167
+ };
168
+
169
+ this.orderAllApi(params).then((response) => {});
170
+ },
171
+ removeSelected() {
172
+ let params = {
173
+ url: this.templateList.urlDeleteAllApi,
174
+ selected: this.selected,
175
+ };
176
+ this.deleteAllApi(params).then(() => {
177
+ this.removeLoading(["remove"]);
178
+ this.addSelected([]);
179
+ });
180
+ },
181
+ cleanParams() {
182
+ this.baseParams.currentPage = 1;
183
+ },
184
+ },
185
+ watch: {
186
+ event: {
187
+ handler(event) {
188
+ if (event.name == "tableDragAndDrop") this.orderAll(event.data);
189
+ },
190
+ deep: true,
191
+ },
192
+ methodExecutedApi: function (value) {
193
+ if (
194
+ value === "postApi" ||
195
+ value === "putApi" ||
196
+ value === "deleteAllApi" ||
197
+ value === "deleteAllApiErro"
198
+ ) {
199
+ this.getAll();
200
+ }
201
+ },
202
+ executedSearch: function () {
203
+ this.baseParams.search = this.search.content;
204
+ if (this.search.filter.id) this.baseParams.filter = this.search.filter.id;
205
+ this.cleanParams();
206
+ this.getAll();
207
+ },
208
+ clearedSearch: function () {
209
+ this.baseParams.search = "";
210
+ this.baseParams.filter = "";
211
+ this.cleanParams();
212
+ this.getAll();
213
+ },
214
+ paginationKey: {
215
+ handler(value) {
216
+ this.cleanParams();
217
+ this.baseParams.currentPage = value.currentPage;
218
+ this.getAll();
219
+ },
220
+ deep: true,
221
+ },
222
+ selectStatic: {
223
+ handler(value) {
224
+ let fieldTarget = value.fieldTarget;
225
+ let obj = { key: fieldTarget, value: value.value };
226
+ this.paramsFilter.push(obj);
227
+
228
+ var result = {};
229
+ for (var i = 0; i < this.paramsFilter.length; i++) {
230
+ let key = this.paramsFilter[i].key;
231
+ let value = this.paramsFilter[i].value;
232
+
233
+ if (key == "period") {
234
+ result["start"] = value.inicio;
235
+ result["end"] = value.fim;
236
+ } else {
237
+ result[key] = value;
238
+ }
239
+ }
240
+
241
+ this.dynamicFilter = result;
242
+
243
+ this.updatePagination({
244
+ key: "templateList",
245
+ totalPerPage: this.dynamicFilter.totalPerPage,
246
+ });
247
+
248
+ this.getAll();
249
+ },
250
+ deep: true,
251
+ },
252
+ },
253
+ };
254
+ </script>
255
+
256
+ <style scoped>
257
+ .div-button-excluir {
258
+ padding-bottom: 10px;
259
+ }
260
+ </style>
@@ -60,7 +60,7 @@ export default {
60
60
  },
61
61
  methods: {
62
62
  ...mapActions("generic", ["postApi", "putApi"]),
63
- ...mapMutations("generic", ["removeLoading", "removeEvent", "hideModal"]),
63
+ ...mapMutations("generic", ["removeLoading", "addEvent", "hideModal"]),
64
64
  ...mapMutations("validation", ["resetValidation"]),
65
65
  saveReport() {
66
66
  var custom = this.report.id ? "" : "Custom";
@@ -82,7 +82,10 @@ export default {
82
82
  if (this.report.id) {
83
83
  let params = { url: this.urlUpdate, obj: obj };
84
84
  this.putApi(params).then((response) => {
85
- if (response.success) this.hideModal();
85
+ if (response.success) {
86
+ this.sendEvent();
87
+ this.hideModal();
88
+ }
86
89
  this.removeLoading(["btnSaveReport"]);
87
90
  });
88
91
  } else {
@@ -94,12 +97,16 @@ export default {
94
97
  name: query.routeName,
95
98
  params: { id: response.content.id, name: response.content.name },
96
99
  });
100
+ this.sendEvent();
97
101
  this.hideModal();
98
102
  }
99
103
  this.removeLoading(["btnSaveReport"]);
100
104
  });
101
105
  }
102
106
  },
107
+ sendEvent() {
108
+ this.addEvent({ name: "savedReport" });
109
+ },
103
110
  },
104
111
  watch: {
105
112
  event: {