@nixweb/nixloc-ui 0.0.125 → 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.
- package/docs/src/component/template/ViewTemplateReportPreview.drawio +210 -0
- package/package.json +79 -77
- package/src/App.vue +13 -13
- package/src/component/forms/Button.vue +170 -169
- package/src/component/forms/CheckboxGroup.vue +72 -63
- package/src/component/forms/CheckboxSimple.vue +46 -27
- package/src/component/forms/Color.vue +38 -38
- package/src/component/forms/DateTime.vue +167 -177
- package/src/component/forms/Dropdown.vue +218 -224
- package/src/component/forms/EditorHtml.vue +126 -123
- package/src/component/forms/FileUpload.vue +185 -189
- package/src/component/forms/ImageUpload.vue +230 -0
- package/src/component/forms/IncrementDecrement.vue +101 -0
- package/src/component/forms/InputDecimal.vue +142 -137
- package/src/component/forms/InputNumber.vue +154 -149
- package/src/component/forms/InputPassword.vue +135 -135
- package/src/component/forms/InputText.vue +162 -157
- package/src/component/forms/Modal.vue +65 -60
- package/src/component/forms/RadioGroup.vue +50 -50
- package/src/component/forms/Select.vue +349 -337
- package/src/component/forms/SelectStatic.vue +127 -120
- package/src/component/forms/Slider.vue +18 -18
- package/src/component/forms/TextArea.vue +126 -126
- package/src/component/layout/Alert.vue +92 -92
- package/src/component/layout/Badge.vue +103 -103
- package/src/component/layout/FixedBar.vue +100 -68
- package/src/component/layout/Header.vue +38 -35
- package/src/component/layout/LoadingFullPage.vue +27 -27
- package/src/component/layout/Menu.vue +210 -214
- package/src/component/layout/Molded.vue +28 -27
- package/src/component/layout/Panel.vue +140 -142
- package/src/component/layout/Popover.vue +126 -126
- package/src/component/layout/ScrollBar.vue +42 -43
- package/src/component/layout/Tab.vue +135 -0
- package/src/component/layout/Tag.vue +3 -3
- package/src/component/layout/Wizard.vue +211 -213
- package/src/component/rental/DisplayPeriodRent.vue +81 -0
- package/src/component/rental/DisplayTotalization.vue +47 -0
- package/src/component/shared/Collapse.vue +131 -131
- package/src/component/shared/Confirmation.vue +2 -2
- package/src/component/shared/DocumentEditor.vue +1 -1
- package/src/component/shared/DocumentPreview.vue +1 -1
- package/src/component/shared/DocumentPublic.vue +34 -0
- package/src/component/shared/ExportExcel.vue +1 -8
- package/src/component/shared/ExportPDF.vue +116 -116
- package/src/component/shared/{HeaderPrint.vue → HeaderReport.vue} +4 -4
- package/src/component/shared/HorizontalFilter.vue +59 -59
- package/src/component/shared/Loading.vue +107 -107
- package/src/component/shared/LoadingMoreButton.vue +23 -23
- package/src/component/shared/Messages.vue +81 -83
- package/src/component/shared/PDFViewer.vue +22 -22
- package/src/component/shared/Pagination.vue +52 -53
- package/src/component/shared/{LegendaParametro.vue → ParameterLegend.vue} +22 -26
- package/src/component/shared/ProgressBar.vue +22 -21
- package/src/component/shared/QueryButton.vue +66 -66
- package/src/component/shared/Report.vue +187 -0
- package/src/component/shared/SaveCancel.vue +26 -5
- package/src/component/shared/Search.vue +154 -154
- package/src/component/shared/SelectOption.vue +146 -0
- package/src/component/shared/Table.vue +163 -243
- package/src/component/shared/TableButton.vue +36 -36
- package/src/component/shared/TableDraggable.vue +127 -0
- package/src/component/shared/TableItem.vue +177 -0
- package/src/component/shared/TableTotalRecords.vue +9 -10
- package/src/component/shared/TableTotalization.vue +47 -47
- package/src/component/shared/Tip.vue +42 -42
- package/src/component/shared/Toast.vue +54 -54
- package/src/component/shared/TotalizationReport.vue +59 -0
- package/src/component/shared/VerticalFilter.vue +97 -145
- package/src/component/shared/query-builder/AddRule.vue +181 -187
- package/src/component/shared/query-builder/ConvertToOdata.js +34 -43
- package/src/component/shared/query-builder/DynamicComponent.vue +21 -16
- package/src/component/shared/query-builder/DynamicComponentList.vue +73 -0
- package/src/component/shared/query-builder/Fields.vue +29 -63
- package/src/component/shared/query-builder/QueryBuilder.vue +69 -69
- package/src/component/shared/query-builder/Rules.vue +2 -14
- package/src/component/shared/query-builder/SelectRule.vue +15 -15
- package/src/component/shared/query-builder/Tags.vue +24 -8
- package/src/component/shared/query-builder/utilities.js +21 -21
- package/src/component/template/{ListViewWithHandlerData.vue → ListViewWithDataHandler.vue} +260 -231
- package/src/component/template/{AddEditReport.vue → ReportCreateUpdate.vue} +40 -22
- package/src/component/template/ViewTemplateConfiguration.vue +64 -69
- package/src/component/template/ViewTemplateDocumentView.vue +22 -25
- package/src/component/template/ViewTemplateReportList.vue +39 -57
- package/src/component/template/ViewTemplateReportPreview.vue +270 -341
- package/src/component/template/ViewTemplateReportPreviewCOPIASEGURANCA.vue +497 -0
- package/src/component/template/ViewTemplateSelectOption.vue +60 -0
- package/src/component/template/ViewTemplateWithSalveCancel.vue +32 -32
- package/src/component/template/ViewTemplateWithTable.vue +56 -49
- package/src/component/template/model/Report.js +2 -2
- package/src/component/value-objects/Address.js +11 -0
- package/src/component/value-objects/{Endereco.vue → Address.vue} +39 -40
- package/src/component/value-objects/{DadosContato.js → Contact.js} +2 -2
- package/src/component/value-objects/{DadosContato.vue → Contact.vue} +24 -17
- package/src/component/value-objects/Person.js +10 -0
- package/src/component/value-objects/{DadosPessoa.vue → Person.vue} +50 -35
- package/src/config/axios.js +9 -9
- package/src/config/dicas.js +14 -14
- package/src/config/router.js +13 -13
- package/src/config/token.js +14 -14
- package/src/main.js +23 -23
- package/src/store/modules/generic.js +512 -488
- package/src/store/modules/report.js +156 -127
- package/src/store/modules/user.js +6 -0
- package/src/store/modules/validation.js +38 -38
- package/src/store/store.js +13 -13
- package/docs/src/component/template/ModeloRelatorioView.drawio +0 -160
- package/src/component/shared/query-builder/ListDynamicComponent.vue +0 -42
- package/src/component/shared/query-builder/Totalization.vue +0 -38
- package/src/component/value-objects/DadosPessoa.js +0 -10
- package/src/component/value-objects/Endereco.js +0 -11
|
@@ -1,231 +1,260 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<div :class="{ 'g-div-molded': showMolded }">
|
|
4
|
-
<b-row>
|
|
5
|
-
<b-col sm="12"
|
|
6
|
-
|
|
7
|
-
<HorizontalFilter v-if="showHorizontalFilter">
|
|
8
|
-
<div slot="content-filter-horizontal">
|
|
9
|
-
<slot name="content-filter-horizontal"></slot>
|
|
10
|
-
</div>
|
|
11
|
-
</HorizontalFilter
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
import
|
|
58
|
-
|
|
59
|
-
import
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
"
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
this
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
) {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
this.
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
this.
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
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>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<b-row>
|
|
4
|
-
<b-col sm="12"
|
|
5
|
-
|
|
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
|
-
|
|
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: "
|
|
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: "
|
|
50
|
+
formName: "reportCreateUpdate",
|
|
50
51
|
report: new Report(),
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
...
|
|
59
|
-
...mapState("report", ["selectedField", "campoOrdenado"]),
|
|
59
|
+
...mapState("report", ["selectedFields", "selectedRules"]),
|
|
60
60
|
},
|
|
61
61
|
methods: {
|
|
62
62
|
...mapActions("generic", ["postApi", "putApi"]),
|
|
63
|
-
...mapMutations("generic", ["removeLoading", "
|
|
63
|
+
...mapMutations("generic", ["removeLoading", "addEvent", "hideModal"]),
|
|
64
64
|
...mapMutations("validation", ["resetValidation"]),
|
|
65
65
|
saveReport() {
|
|
66
|
-
var
|
|
66
|
+
var custom = this.report.id ? "" : "Custom";
|
|
67
67
|
const query = {
|
|
68
|
-
routeName: `${this.$route.name}${
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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,26 +80,41 @@ export default {
|
|
|
77
80
|
query: JSON.stringify(query),
|
|
78
81
|
};
|
|
79
82
|
if (this.report.id) {
|
|
80
|
-
let params = { url: this.
|
|
83
|
+
let params = { url: this.urlUpdate, obj: obj };
|
|
81
84
|
this.putApi(params).then((response) => {
|
|
82
|
-
if (response.success)
|
|
83
|
-
|
|
85
|
+
if (response.success) {
|
|
86
|
+
this.sendEvent();
|
|
87
|
+
this.hideModal();
|
|
88
|
+
}
|
|
89
|
+
this.removeLoading(["btnSaveReport"]);
|
|
84
90
|
});
|
|
85
91
|
} else {
|
|
86
|
-
let params = { url: this.
|
|
92
|
+
let params = { url: this.urlCreate, obj: obj };
|
|
87
93
|
this.postApi(params).then((response) => {
|
|
88
|
-
if (response.success)
|
|
89
|
-
|
|
94
|
+
if (response.success) {
|
|
95
|
+
const query = JSON.parse(response.content.query);
|
|
96
|
+
this.$router.replace({
|
|
97
|
+
name: query.routeName,
|
|
98
|
+
params: { id: response.content.id, name: response.content.name },
|
|
99
|
+
});
|
|
100
|
+
this.sendEvent();
|
|
101
|
+
this.hideModal();
|
|
102
|
+
}
|
|
103
|
+
this.removeLoading(["btnSaveReport"]);
|
|
90
104
|
});
|
|
91
105
|
}
|
|
92
106
|
},
|
|
107
|
+
sendEvent() {
|
|
108
|
+
this.addEvent({ name: "savedReport" });
|
|
109
|
+
},
|
|
93
110
|
},
|
|
94
111
|
watch: {
|
|
95
112
|
event: {
|
|
96
113
|
handler(event) {
|
|
97
|
-
if (event.name == "
|
|
114
|
+
if (event.name == "saveReport") {
|
|
98
115
|
this.report.id = this.$route.params.id;
|
|
99
116
|
if (this.report.id) this.report.name = this.$route.params.name;
|
|
117
|
+
this.saveReport();
|
|
100
118
|
}
|
|
101
119
|
},
|
|
102
120
|
deep: true,
|