@nixweb/nixloc-ui 0.0.284 → 0.0.285
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/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<div class="div-filter">
|
|
10
10
|
<div class="side-by-side">
|
|
11
11
|
<div class="div-filter">
|
|
12
|
-
<Button _key="btnSearchReport" :disabled="loading || !
|
|
12
|
+
<Button _key="btnSearchReport" :disabled="loading || !isValid" type="primary"
|
|
13
13
|
title="Buscar" classIcon="fas fa-file-search" size="medium" :clicked="getAll" />
|
|
14
14
|
</div>
|
|
15
15
|
</div>
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
<ProgressBar :text="`Carregando ${liveTotalRecords} registros de ${totalRecords}`"
|
|
27
27
|
:value="liveTotalRecords" :max="totalRecords" size="medium" />
|
|
28
28
|
</div>
|
|
29
|
-
<div v-if="!
|
|
29
|
+
<div v-if="!isValid">
|
|
30
30
|
<Alert type="info">
|
|
31
31
|
<span>
|
|
32
32
|
É necessário informar o filtro <b>{{ fieldsRequired }}</b>, clique no botão <b> <i
|
|
@@ -120,8 +120,13 @@ export default {
|
|
|
120
120
|
liveTotalRecords() {
|
|
121
121
|
return this.data.length;
|
|
122
122
|
},
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
isValid() {
|
|
124
|
+
var hasRequired = this.filters.some(item => item.required);
|
|
125
|
+
if (hasRequired) {
|
|
126
|
+
return this.stringFilter.some(item => item.required == true && item.value !== "");
|
|
127
|
+
} else {
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
125
130
|
},
|
|
126
131
|
fieldsRequired() {
|
|
127
132
|
let title = "";
|
|
@@ -136,53 +141,55 @@ export default {
|
|
|
136
141
|
...mapMutations("generic", ["removeLoading"]),
|
|
137
142
|
...mapActions("generic", ["getApi"]),
|
|
138
143
|
getAll() {
|
|
139
|
-
this.
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
144
|
+
if (this.isValid) {
|
|
145
|
+
this.removeLoading(["btnSearchReport"]);
|
|
146
|
+
this.loading = true;
|
|
147
|
+
let params = {
|
|
148
|
+
url: this.urlGet,
|
|
149
|
+
obj:
|
|
150
|
+
{
|
|
151
|
+
stringFilter: JSON.stringify(this.stringFilter),
|
|
152
|
+
fieldOrder: this.ordering.field,
|
|
153
|
+
ordering: this.ordering.ordering,
|
|
154
|
+
currentPage: this.currentPage,
|
|
155
|
+
totalPerPage: this.totalPerPage,
|
|
156
|
+
noPaginated: true
|
|
157
|
+
}
|
|
158
|
+
};
|
|
153
159
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
160
|
+
this.getApi(params).then((response) => {
|
|
161
|
+
let self = this;
|
|
162
|
+
this.totalization = response.content.totalization;
|
|
163
|
+
this.totalRecords = response.content.totalRecords;
|
|
158
164
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
165
|
+
if (this.pagination.length == 0) {
|
|
166
|
+
this.currentPage = 1;
|
|
167
|
+
this.data = [];
|
|
168
|
+
}
|
|
163
169
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
170
|
+
if (this.pagination.length == 0) {
|
|
171
|
+
var pagination = response.content.totalRecords / this.totalPerPage;
|
|
172
|
+
var arr = Math.ceil(pagination);
|
|
173
|
+
for (var i = 1; i <= arr; i++) {
|
|
174
|
+
self.pagination.push(i);
|
|
175
|
+
}
|
|
176
|
+
} else {
|
|
177
|
+
this.pagination.pop();
|
|
169
178
|
}
|
|
170
|
-
} else {
|
|
171
|
-
this.pagination.pop();
|
|
172
|
-
}
|
|
173
179
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
180
|
+
response.content.data.forEach(item => {
|
|
181
|
+
self.data.push(item);
|
|
182
|
+
});
|
|
177
183
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
184
|
+
this.show = true;
|
|
185
|
+
setTimeout(function () {
|
|
186
|
+
self.loading = false;
|
|
181
187
|
|
|
182
|
-
|
|
188
|
+
}, 500);
|
|
183
189
|
|
|
184
|
-
|
|
185
|
-
|
|
190
|
+
this.verifyIfPagination();
|
|
191
|
+
});
|
|
192
|
+
}
|
|
186
193
|
},
|
|
187
194
|
verifyIfPagination() {
|
|
188
195
|
if (this.pagination.length > 0) {
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
v-model="item.value" />
|
|
35
35
|
</div>
|
|
36
36
|
</div>
|
|
37
|
-
<InputText v-if="item.type == 'text'" :title="item.title"
|
|
37
|
+
<InputText v-if="item.type == 'text' || item.type == 'patrimony'" :title="item.title"
|
|
38
|
+
v-model="item.value" />
|
|
38
39
|
</b-col>
|
|
39
40
|
<b-col sm="1">
|
|
40
41
|
<div class="icon-remove" @click="removeItem(item.field)">
|