@nixweb/nixloc-ui 0.0.284 → 0.0.286

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nixweb/nixloc-ui",
3
- "version": "0.0.284",
3
+ "version": "0.0.286",
4
4
  "description": "Componentes UI",
5
5
  "author": "Fábio Ávila <fabio@nixweb.com.br>",
6
6
  "private": false,
@@ -12,8 +12,8 @@
12
12
  danger: type === 'danger',
13
13
  disabled: disabled,
14
14
  }" :disabled="disabled" @click="execute()">
15
- <i class="div-icon-btn" :class="classIcon" v-if="!isLoading(this._key) && classIcon"></i>
16
- <span class="title-btn" v-if="!isLoading(this._key)">{{ title }}</span>
15
+ <i :class="classIcon" v-if="!isLoading(this._key) && classIcon"></i>
16
+ <span class="title-btn" v-if="!isLoading(this._key) && title">{{ title }}</span>
17
17
  <vue-loading v-if="isLoading(this._key)" type="bubbles" color="#fff"
18
18
  :size="{ width: '26px', height: '26px' }"></vue-loading>
19
19
  </button>
@@ -64,9 +64,6 @@ export default {
64
64
  margin-left: 5px;
65
65
  }
66
66
 
67
- .div-icon-btn {
68
- margin-right: 0px;
69
- }
70
67
 
71
68
  .title-btn {
72
69
  margin-left: 3px;
@@ -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 || !isRequired" type="primary"
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="!isRequired">
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
- isRequired() {
124
- return this.stringFilter.some(item => item.required && item.value !== "");
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.removeLoading(["btnSearchReport"]);
140
- this.loading = true;
141
- let params = {
142
- url: this.urlGet,
143
- obj:
144
- {
145
- stringFilter: JSON.stringify(this.stringFilter),
146
- fieldOrder: this.ordering.field,
147
- ordering: this.ordering.ordering,
148
- currentPage: this.currentPage,
149
- totalPerPage: this.totalPerPage,
150
- noPaginated: true
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
- this.getApi(params).then((response) => {
155
- let self = this;
156
- this.totalization = response.content.totalization;
157
- this.totalRecords = response.content.totalRecords;
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
- if (this.pagination.length == 0) {
160
- this.currentPage = 1;
161
- this.data = [];
162
- }
165
+ if (this.pagination.length == 0) {
166
+ this.currentPage = 1;
167
+ this.data = [];
168
+ }
163
169
 
164
- if (this.pagination.length == 0) {
165
- var pagination = response.content.totalRecords / this.totalPerPage;
166
- var arr = Math.ceil(pagination);
167
- for (var i = 1; i <= arr; i++) {
168
- self.pagination.push(i);
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
- response.content.data.forEach(item => {
175
- self.data.push(item);
176
- });
180
+ response.content.data.forEach(item => {
181
+ self.data.push(item);
182
+ });
177
183
 
178
- this.show = true;
179
- setTimeout(function () {
180
- self.loading = false;
184
+ this.show = true;
185
+ setTimeout(function () {
186
+ self.loading = false;
181
187
 
182
- }, 500);
188
+ }, 500);
183
189
 
184
- this.verifyIfPagination();
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" v-model="item.value" />
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)">