@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
|
@@ -3,92 +3,81 @@ import ConvertToOdata from "@nixweb/nixloc-ui/src/component/shared/query-builder
|
|
|
3
3
|
export default {
|
|
4
4
|
namespaced: true,
|
|
5
5
|
state: {
|
|
6
|
-
report: {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
report: { id: "", fields: [], rules: [], },
|
|
7
|
+
selectedFields: {},
|
|
8
|
+
selectedRules: [],
|
|
9
|
+
finalQueryFormatOData: {
|
|
10
|
+
fields: [], totalization: [],
|
|
9
11
|
},
|
|
10
|
-
query_builder: { rules: [] },
|
|
11
|
-
optionTable: {
|
|
12
|
-
initialValue: [],
|
|
13
|
-
options: []
|
|
14
|
-
},
|
|
15
|
-
optionsInitValue: [],
|
|
16
|
-
queryOData: {
|
|
17
|
-
fields: [],
|
|
18
|
-
totalization: [],
|
|
19
|
-
},
|
|
20
|
-
selectedField: [],
|
|
21
|
-
campoOrdenado: {},
|
|
22
|
-
query: [],
|
|
23
|
-
totalization: [],
|
|
24
12
|
tags: []
|
|
25
13
|
},
|
|
26
14
|
getters: {
|
|
27
15
|
headerTable: (state) => {
|
|
28
16
|
let list = [];
|
|
29
17
|
state.report.fields.forEach(function (field) {
|
|
30
|
-
if (field.
|
|
18
|
+
if (field.selected) list.push(field);
|
|
31
19
|
});
|
|
32
20
|
return list;
|
|
33
21
|
},
|
|
34
|
-
|
|
35
|
-
//
|
|
36
|
-
|
|
37
|
-
initialValue: [],
|
|
38
|
-
options: []
|
|
39
|
-
};
|
|
22
|
+
fields: (state) => {
|
|
23
|
+
// esse getter serve somente para carregar informações no component Fields
|
|
24
|
+
var fields = { selected: [], options: [], sort: { content: "", id: "asc" }, orderBy: "" };
|
|
40
25
|
|
|
41
|
-
|
|
26
|
+
state.report.fields.forEach(function (value) {
|
|
27
|
+
let option = { text: value.title, value: value.field };
|
|
28
|
+
fields.options.push(option);
|
|
42
29
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
30
|
+
// se o relatório for o padrão, carrega as info default
|
|
31
|
+
if (state.report.id == undefined) {
|
|
32
|
+
if (value.selected)
|
|
33
|
+
fields.selected.push(value.field);
|
|
46
34
|
|
|
47
|
-
|
|
48
|
-
|
|
35
|
+
if (value.orderBy) {
|
|
36
|
+
fields.sort = { content: value.title, id: value.field };
|
|
37
|
+
fields.orderBy = value.orderBy;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
fields.selected = state.selectedFields.selected;
|
|
42
|
+
fields.sort = state.selectedFields.sort;
|
|
43
|
+
fields.orderBy = state.selectedFields.orderBy;
|
|
44
|
+
}
|
|
49
45
|
|
|
50
|
-
if (hasInitValue > 0)
|
|
51
|
-
state.optionTable.initialValue = state.optionsInitValue;
|
|
52
46
|
});
|
|
53
|
-
|
|
54
|
-
return state.optionTable;
|
|
55
|
-
},
|
|
56
|
-
requiredRules: (state) => {
|
|
57
|
-
var filter = state.report.rules.filter(item => item.isRequired == true);
|
|
58
|
-
return filter;
|
|
59
|
-
},
|
|
60
|
-
regraObrigatoriaJaAdicionada: (state) => (rule) => {
|
|
61
|
-
return false;
|
|
62
|
-
},
|
|
63
|
-
selectedRules: (state) => {
|
|
64
|
-
let rules = [];
|
|
65
|
-
state.report.rules.forEach(function (rule) {
|
|
66
|
-
if (rule.value != null && rule.value != "" && rule.value != undefined)
|
|
67
|
-
rules.push(rule);
|
|
68
|
-
});
|
|
69
|
-
return rules;
|
|
70
|
-
},
|
|
71
|
-
hasSelectedField: (state) => (field, value) => {
|
|
72
|
-
var hasField = value.find((item) => {
|
|
73
|
-
if (field == value) return true;
|
|
74
|
-
});
|
|
75
|
-
return hasField;
|
|
47
|
+
return fields;
|
|
76
48
|
},
|
|
77
49
|
oDataOrderBy: (state) => {
|
|
78
|
-
let orderBy =
|
|
79
|
-
|
|
50
|
+
let orderBy = "";
|
|
51
|
+
if (state.selectedFields.sort != undefined)
|
|
52
|
+
orderBy = `$orderby=${state.selectedFields.sort.id} ${state.selectedFields.orderBy}`;
|
|
53
|
+
return orderBy;
|
|
80
54
|
},
|
|
81
55
|
oDataSelect: (state) => {
|
|
56
|
+
let selectedFields = [];
|
|
57
|
+
|
|
58
|
+
// verifica os campos obrigatórios por default "requiredOData"
|
|
59
|
+
state.report.fields.forEach(value => {
|
|
60
|
+
if (value.requiredOData)
|
|
61
|
+
selectedFields.push(value.field);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// verifica os campos selecionados pelo usuário
|
|
65
|
+
if (state.selectedFields.selected != undefined) {
|
|
66
|
+
state.selectedFields.selected.forEach(function (field) {
|
|
67
|
+
selectedFields.push(field);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
82
71
|
let query = "";
|
|
83
72
|
let indexQuery = 0;
|
|
84
73
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
74
|
+
// remove itens duplicados e monta a query select
|
|
75
|
+
[...new Set(selectedFields)].forEach(field => {
|
|
76
|
+
if (indexQuery == 0) query += `$select=${field}`;
|
|
77
|
+
if (indexQuery > 0) query += `,${field}`;
|
|
78
|
+
indexQuery++;
|
|
91
79
|
});
|
|
80
|
+
|
|
92
81
|
return query;
|
|
93
82
|
},
|
|
94
83
|
oDataFilter: (state) => {
|
|
@@ -96,21 +85,24 @@ export default {
|
|
|
96
85
|
let totalization = "";
|
|
97
86
|
let indexQuery = 0;
|
|
98
87
|
let indexTotalization = 0;
|
|
99
|
-
var
|
|
88
|
+
var sizeFields = state.finalQueryFormatOData.fields.length;
|
|
89
|
+
var sizeTotalization = state.finalQueryFormatOData.totalization.length;
|
|
100
90
|
var andOr = [];
|
|
101
91
|
|
|
102
|
-
|
|
92
|
+
|
|
93
|
+
state.finalQueryFormatOData.fields.forEach(function (rule) {
|
|
94
|
+
|
|
103
95
|
if (rule.type == "field") {
|
|
104
|
-
if (indexQuery == 0 &&
|
|
96
|
+
if (indexQuery == 0 && sizeFields > 0) query += `$filter=${rule.formatOdata}`;
|
|
105
97
|
|
|
106
|
-
if (indexQuery > 0 &&
|
|
98
|
+
if (indexQuery > 0 && sizeFields > 0) {
|
|
107
99
|
query += ` ${rule.andOr} ${rule.formatOdata}`;
|
|
108
100
|
andOr.push(rule.andOr);
|
|
109
101
|
}
|
|
110
102
|
indexQuery++;
|
|
111
103
|
|
|
112
|
-
|
|
113
|
-
|
|
104
|
+
// verifica no array se o último item é o "and", se sim será necessário inserir "(" depois do filter = e ")" antes do "and"
|
|
105
|
+
// para que o oData consiga efetuar a query corretamente
|
|
114
106
|
if (andOr[andOr.length - 1] == "and") {
|
|
115
107
|
|
|
116
108
|
let initIndex = query.indexOf("=");
|
|
@@ -127,27 +119,36 @@ export default {
|
|
|
127
119
|
indexTotalization++;
|
|
128
120
|
}
|
|
129
121
|
});
|
|
122
|
+
|
|
123
|
+
state.finalQueryFormatOData.totalization.forEach(function (rule) {
|
|
124
|
+
|
|
125
|
+
if (indexTotalization == 0 && sizeTotalization > 0) totalization = `${rule.formatOdata}`;
|
|
126
|
+
if (indexTotalization > 0 && sizeTotalization > 0) totalization = `,${rule.formatOdata}`;
|
|
127
|
+
indexTotalization++;
|
|
128
|
+
});
|
|
129
|
+
|
|
130
130
|
return { query, totalization };
|
|
131
131
|
},
|
|
132
132
|
tags: (state) => {
|
|
133
|
-
|
|
134
133
|
state.tags = [];
|
|
135
134
|
let description = "";
|
|
136
135
|
|
|
137
|
-
state.
|
|
138
|
-
|
|
136
|
+
state.finalQueryFormatOData.fields.forEach(function (rule) {
|
|
137
|
+
description = "";
|
|
138
|
+
|
|
139
|
+
if (rule.typeField == "dateTime") {
|
|
139
140
|
description = `${rule.value[0]} - ${rule.value[1]}`;
|
|
140
141
|
}
|
|
141
142
|
|
|
142
|
-
if (rule.
|
|
143
|
+
if (rule.typeField == "select") {
|
|
143
144
|
description = rule.value.content;
|
|
144
145
|
}
|
|
145
146
|
|
|
146
|
-
if (rule.
|
|
147
|
+
if (rule.typeField == "text" || rule.typeField == "numeric") {
|
|
147
148
|
description = `${rule.operator} "${rule.value}"`;
|
|
148
149
|
}
|
|
149
150
|
|
|
150
|
-
if (rule.
|
|
151
|
+
if (rule.typeField == "checkbox") {
|
|
151
152
|
rule.options.forEach(function (option) {
|
|
152
153
|
rule.value.forEach(function (value) {
|
|
153
154
|
if (option.value == value) {
|
|
@@ -159,88 +160,116 @@ export default {
|
|
|
159
160
|
|
|
160
161
|
let tag = { id: rule.id, title: rule.title, value: description };
|
|
161
162
|
state.tags.push(tag);
|
|
163
|
+
|
|
162
164
|
});
|
|
163
165
|
return state.tags;
|
|
164
|
-
|
|
166
|
+
|
|
167
|
+
},
|
|
168
|
+
rulesIsValid: (state) => {
|
|
169
|
+
let isValid = false;
|
|
170
|
+
let rulesRequired = state.report.rules.filter(x => x.isRequired);
|
|
171
|
+
let rulesRequiredSelected = state.selectedRules.filter(x => x.isRequired);
|
|
172
|
+
|
|
173
|
+
if (rulesRequired.length == rulesRequiredSelected.length)
|
|
174
|
+
isValid = true;
|
|
175
|
+
|
|
176
|
+
return isValid;
|
|
177
|
+
},
|
|
178
|
+
rulesRequired: (state) => {
|
|
179
|
+
return state.report.rules.filter(x => x.isRequired);
|
|
180
|
+
},
|
|
165
181
|
},
|
|
166
182
|
mutations: {
|
|
167
|
-
|
|
168
|
-
state.
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
state.report.
|
|
183
|
+
updateSelectedFields: (state, selectedFields) => {
|
|
184
|
+
state.selectedFields = selectedFields;
|
|
185
|
+
// após selecionar o campo, atualiza tambem quais campos deverão aparecer no report
|
|
186
|
+
// se foi selecionado é marcado como selected = true
|
|
187
|
+
state.report.fields.forEach(function (value) {
|
|
188
|
+
var hasSelected = selectedFields.selected.find((selected) => {
|
|
189
|
+
if (value.field == selected) return true;
|
|
190
|
+
});
|
|
191
|
+
if (value.field === hasSelected) {
|
|
192
|
+
value.selected = true;
|
|
193
|
+
} else {
|
|
194
|
+
value.selected = false;
|
|
195
|
+
}
|
|
196
|
+
});
|
|
172
197
|
},
|
|
173
198
|
addSelectedRules: (state, selectedRule) => {
|
|
174
|
-
state.
|
|
199
|
+
state.selectedRules.push(selectedRule);
|
|
175
200
|
},
|
|
176
201
|
removeSelectedRule: (state, id) => {
|
|
177
|
-
var filter = state.
|
|
202
|
+
var filter = state.selectedRules.filter((item) => {
|
|
178
203
|
return id != item.id;
|
|
179
204
|
})
|
|
180
|
-
state.
|
|
181
|
-
},
|
|
182
|
-
updateSelectedField: (state, value) => {
|
|
183
|
-
state.selectedField = value;
|
|
184
|
-
},
|
|
185
|
-
updateOptionsInitValue: (state, value) => {
|
|
186
|
-
state.optionsInitValue = value;
|
|
187
|
-
},
|
|
188
|
-
atualizaFiltroSelecionado: (state, value) => {
|
|
189
|
-
state.filtroSelecionado = value;
|
|
205
|
+
state.selectedRules = filter;
|
|
190
206
|
},
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
});
|
|
198
|
-
state.filtroSelecionado.children = filter;
|
|
199
|
-
},
|
|
200
|
-
convertRulesToOdata: (state, rules) => {
|
|
201
|
-
state.queryOData = {
|
|
202
|
-
fields: [],
|
|
203
|
-
totalization: [],
|
|
204
|
-
};
|
|
207
|
+
mountFinalQueryFormatOData: (state, selectedRules) => {
|
|
208
|
+
// aqui faz a conversão das regras selecionadas no padrão do query-builder para o formato oData carregando no objeto finalQueryFormatOData
|
|
209
|
+
// para ser consumido nos getters oDataSelect e oDataFilter
|
|
210
|
+
|
|
211
|
+
state.finalQueryFormatOData = { fields: [], totalization: [] };
|
|
212
|
+
var convertToOdata = new ConvertToOdata();
|
|
205
213
|
|
|
206
|
-
|
|
214
|
+
selectedRules.forEach(function (rule) {
|
|
207
215
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
let obj = {
|
|
211
|
-
title: value.como.title,
|
|
212
|
-
value: value.como.value,
|
|
213
|
-
classCss: key.query.classCss,
|
|
214
|
-
type: value.como.type,
|
|
215
|
-
};
|
|
216
|
-
state.totalization.push(obj);
|
|
217
|
-
});
|
|
218
|
-
}*/
|
|
216
|
+
if (rule.value != null && rule.value != "" && rule.value != undefined && rule.type == "totalization") {
|
|
217
|
+
let formatOdata = convertToOdata.convertRule(rule);
|
|
219
218
|
|
|
219
|
+
rule.value.forEach(value => {
|
|
220
|
+
// adiciona no array somente a opção da regra selecionada
|
|
221
|
+
var ruleSelected = rule.options.filter(x => x.value == value);
|
|
222
|
+
|
|
223
|
+
let ruleOdata = {
|
|
224
|
+
title: ruleSelected[0].aggregate.title,
|
|
225
|
+
value: ruleSelected[0].aggregate.value,
|
|
226
|
+
classCss: ruleSelected[0].aggregate.classCss,
|
|
227
|
+
type: ruleSelected[0].aggregate.type,
|
|
228
|
+
formatOdata: formatOdata,
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
state.finalQueryFormatOData.totalization.push(ruleOdata);
|
|
232
|
+
});
|
|
233
|
+
}
|
|
220
234
|
|
|
221
|
-
if (rule.value != null && rule.value != "" && rule.value != undefined) {
|
|
235
|
+
if (rule.value != null && rule.value != "" && rule.value != undefined && rule.type == "field") {
|
|
222
236
|
|
|
223
|
-
let
|
|
224
|
-
let formatOdata = convertToOdata.ConvertToOdata(rule);
|
|
237
|
+
let formatOdata = convertToOdata.convertRule(rule);
|
|
225
238
|
|
|
226
239
|
let ruleOdata = {
|
|
227
240
|
id: rule.id,
|
|
228
241
|
title: rule.title,
|
|
229
242
|
type: rule.type,
|
|
230
|
-
|
|
243
|
+
typeField: rule.typeField,
|
|
231
244
|
options: rule.options,
|
|
232
245
|
operator: rule.operator,
|
|
233
|
-
|
|
246
|
+
selected: rule.selected,
|
|
234
247
|
isRequired: rule.isRequired,
|
|
235
248
|
formatOdata: formatOdata,
|
|
236
249
|
andOr: rule.andOr,
|
|
237
250
|
value: rule.value,
|
|
238
251
|
};
|
|
239
252
|
|
|
240
|
-
state.
|
|
253
|
+
state.finalQueryFormatOData.fields.push(ruleOdata);
|
|
241
254
|
}
|
|
242
255
|
});
|
|
243
|
-
}
|
|
244
|
-
|
|
256
|
+
},
|
|
245
257
|
},
|
|
258
|
+
actions: {
|
|
259
|
+
addReport: async function (context, report) {
|
|
260
|
+
context.state.report = report;
|
|
261
|
+
context.state.selectedFields = context.getters.fields;
|
|
262
|
+
},
|
|
263
|
+
addInitialReportCustom: async function (context, report) {
|
|
264
|
+
context.state.selectedFields = report.selectedFields;
|
|
265
|
+
context.state.selectedRules = report.selectedRules;
|
|
266
|
+
context.commit('mountFinalQueryFormatOData', report.selectedRules);
|
|
267
|
+
context.commit('updateSelectedFields', report.selectedFields);
|
|
268
|
+
},
|
|
269
|
+
removeInitialReportCustom: async function (context) {
|
|
270
|
+
context.state.selectedFields = {};
|
|
271
|
+
context.state.selectedRules = [];
|
|
272
|
+
context.state.finalQueryFormatOData.fields = [];
|
|
273
|
+
}
|
|
274
|
+
}
|
|
246
275
|
}
|
|
@@ -34,5 +34,11 @@ export default {
|
|
|
34
34
|
removeItemMenu: (state) => {
|
|
35
35
|
state.menu.items = [];
|
|
36
36
|
},
|
|
37
|
+
updateParameterRental: (state, parameterRental) => {
|
|
38
|
+
state.userLogged.parameterRental = parameterRental;
|
|
39
|
+
},
|
|
40
|
+
updateToken: (state, token) => {
|
|
41
|
+
state.userLogged.token = token;
|
|
42
|
+
}
|
|
37
43
|
},
|
|
38
44
|
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
namespaced: true,
|
|
3
|
-
state: {
|
|
4
|
-
formDirty: false,
|
|
5
|
-
validations: [],
|
|
6
|
-
resetForm: {
|
|
7
|
-
name: undefined,
|
|
8
|
-
dateTime: undefined
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
getters: {
|
|
12
|
-
isFormValid: (state) => (formName) => {
|
|
13
|
-
var hasNotification = state.validations.find(obj => {
|
|
14
|
-
return obj.formName === formName
|
|
15
|
-
})
|
|
16
|
-
if (hasNotification != undefined) return false;
|
|
17
|
-
return true;
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
mutations: {
|
|
21
|
-
addValidation: (state, obj) => {
|
|
22
|
-
state.validations.push(obj);
|
|
23
|
-
},
|
|
24
|
-
removeValidation: (state, obj) => {
|
|
25
|
-
let filter = state.validations.filter(v => v.key != obj.key);
|
|
26
|
-
state.validations = filter;
|
|
27
|
-
},
|
|
28
|
-
resetValidation: (state, formName) => {
|
|
29
|
-
state.resetForm.dateTime = new Date();
|
|
30
|
-
state.resetForm.name = formName;
|
|
31
|
-
},
|
|
32
|
-
updateFormDirty: (state, formDirty) => {
|
|
33
|
-
state.formDirty = formDirty;
|
|
34
|
-
},
|
|
35
|
-
removeFormDirty: (state) => {
|
|
36
|
-
state.formDirty = false;
|
|
37
|
-
}
|
|
38
|
-
},
|
|
1
|
+
export default {
|
|
2
|
+
namespaced: true,
|
|
3
|
+
state: {
|
|
4
|
+
formDirty: false,
|
|
5
|
+
validations: [],
|
|
6
|
+
resetForm: {
|
|
7
|
+
name: undefined,
|
|
8
|
+
dateTime: undefined
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
getters: {
|
|
12
|
+
isFormValid: (state) => (formName) => {
|
|
13
|
+
var hasNotification = state.validations.find(obj => {
|
|
14
|
+
return obj.formName === formName
|
|
15
|
+
})
|
|
16
|
+
if (hasNotification != undefined) return false;
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
mutations: {
|
|
21
|
+
addValidation: (state, obj) => {
|
|
22
|
+
state.validations.push(obj);
|
|
23
|
+
},
|
|
24
|
+
removeValidation: (state, obj) => {
|
|
25
|
+
let filter = state.validations.filter(v => v.key != obj.key);
|
|
26
|
+
state.validations = filter;
|
|
27
|
+
},
|
|
28
|
+
resetValidation: (state, formName) => {
|
|
29
|
+
state.resetForm.dateTime = new Date();
|
|
30
|
+
state.resetForm.name = formName;
|
|
31
|
+
},
|
|
32
|
+
updateFormDirty: (state, formDirty) => {
|
|
33
|
+
state.formDirty = formDirty;
|
|
34
|
+
},
|
|
35
|
+
removeFormDirty: (state) => {
|
|
36
|
+
state.formDirty = false;
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
39
|
}
|
package/src/store/store.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import Vue from 'vue';
|
|
2
|
-
import Vuex from 'vuex';
|
|
3
|
-
|
|
4
|
-
import user from './modules/user'
|
|
5
|
-
import generic from './modules/generic'
|
|
6
|
-
import validation from './modules/validation'
|
|
7
|
-
|
|
8
|
-
Vue.use(Vuex)
|
|
9
|
-
|
|
10
|
-
export default new Vuex.Store({
|
|
11
|
-
modules: {
|
|
12
|
-
generic, validation, user
|
|
13
|
-
}
|
|
1
|
+
import Vue from 'vue';
|
|
2
|
+
import Vuex from 'vuex';
|
|
3
|
+
|
|
4
|
+
import user from './modules/user'
|
|
5
|
+
import generic from './modules/generic'
|
|
6
|
+
import validation from './modules/validation'
|
|
7
|
+
|
|
8
|
+
Vue.use(Vuex)
|
|
9
|
+
|
|
10
|
+
export default new Vuex.Store({
|
|
11
|
+
modules: {
|
|
12
|
+
generic, validation, user
|
|
13
|
+
}
|
|
14
14
|
})
|