@nixweb/nixloc-ui 0.0.285 → 0.0.287

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.285",
3
+ "version": "0.0.287",
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;
@@ -65,7 +65,7 @@ export default {
65
65
  display: flex;
66
66
  font-size: 13px;
67
67
  height: 32px;
68
- margin: 4px 8px 4px 0;
68
+ margin: 4px -9px 4px 0;
69
69
  outline: none;
70
70
  padding: 0 6px 0 16px;
71
71
  position: relative;
@@ -62,8 +62,10 @@ export default {
62
62
  }
63
63
  },
64
64
  created() {
65
- this.initialValue = { content: this.data[0].title, id: this.data[0].fieldOrderBy };
66
- this.$emit("input", { ordering: this.ordering, field: this.data[0].fieldOrderBy });
65
+ const targetObject = this.data.find(item => item.initialOrderBy === true);
66
+
67
+ this.initialValue = { content: targetObject.title, id: targetObject.fieldOrderBy };
68
+ this.$emit("input", { ordering: this.ordering, field: targetObject.fieldOrderBy });
67
69
  },
68
70
  computed: {
69
71
  ...mapGetters("generic", ["showModal"]),
@@ -10,13 +10,14 @@
10
10
  <div class="side-by-side">
11
11
  <div class="div-filter">
12
12
  <Button _key="btnSearchReport" :disabled="loading || !isValid" type="primary"
13
- title="Buscar" classIcon="fas fa-file-search" size="medium" :clicked="getAll" />
13
+ title="Buscar" classIcon="fas fa-file-search" size="medium"
14
+ :clicked="executeSearch" />
14
15
  </div>
15
16
  </div>
16
17
  <div class="side-by-side">
17
18
  <Fields :data="header" v-model="ordering" />
18
19
  </div>
19
- <div class="side-by-side">
20
+ <div class="side-by-side div-filter-query">
20
21
  <FilterQuery :filters="filters" v-model="stringFilter" />
21
22
  </div>
22
23
  </div>
@@ -25,6 +26,9 @@
25
26
  <div v-if="liveTotalRecords != totalRecords">
26
27
  <ProgressBar :text="`Carregando ${liveTotalRecords} registros de ${totalRecords}`"
27
28
  :value="liveTotalRecords" :max="totalRecords" size="medium" />
29
+ <div class="text-center cancel" @click="stop">
30
+ <i class="fa-solid fa-ban"></i> Cancelar
31
+ </div>
28
32
  </div>
29
33
  <div v-if="!isValid">
30
34
  <Alert type="info">
@@ -106,7 +110,8 @@ export default {
106
110
  totalRecords: 0,
107
111
  currentPage: 1,
108
112
  totalPerPage: 50,
109
- pagination: []
113
+ pagination: [],
114
+ cancel: false,
110
115
  }
111
116
  },
112
117
  mounted() {
@@ -140,10 +145,18 @@ export default {
140
145
  methods: {
141
146
  ...mapMutations("generic", ["removeLoading"]),
142
147
  ...mapActions("generic", ["getApi"]),
148
+ executeSearch() {
149
+ this.cancel = false;
150
+ this.data = [];
151
+ this.totalization = [];
152
+ this.getAll();
153
+ },
143
154
  getAll() {
144
- if (this.isValid) {
155
+ if (this.isValid && !this.cancel) {
145
156
  this.removeLoading(["btnSearchReport"]);
146
157
  this.loading = true;
158
+ this.cancel = false;
159
+
147
160
  let params = {
148
161
  url: this.urlGet,
149
162
  obj:
@@ -184,7 +197,6 @@ export default {
184
197
  this.show = true;
185
198
  setTimeout(function () {
186
199
  self.loading = false;
187
-
188
200
  }, 500);
189
201
 
190
202
  this.verifyIfPagination();
@@ -202,6 +214,10 @@ export default {
202
214
  } else {
203
215
  this.currentPage = 1;
204
216
  }
217
+ },
218
+ stop() {
219
+ this.cancel = true;
220
+ this.loading = false;
205
221
  }
206
222
  },
207
223
  watch: {
@@ -266,6 +282,10 @@ export default {
266
282
  margin-bottom: -12px;
267
283
  }
268
284
 
285
+ .div-filter-query {
286
+ margin-top: 10px;
287
+ }
288
+
269
289
  .footer {
270
290
  margin-bottom: 10px;
271
291
  }
@@ -273,4 +293,9 @@ export default {
273
293
  .icon-excel {
274
294
  color: green;
275
295
  }
296
+
297
+ .cancel {
298
+ color: red;
299
+ cursor: pointer;
300
+ }
276
301
  </style>
@@ -12,7 +12,7 @@
12
12
  </tr>
13
13
  </thead>
14
14
  <tbody>
15
- <tr v-for="(row, index) in data" :key="index" :style="row.rowCss">
15
+ <tr class="div-row" v-for="(row, index) in data" :key="index" :style="row.rowCss">
16
16
  <td v-for="(obj, ind) in header" :key="ind">
17
17
  <div :style="obj.styleBody" @click="sendEvent(obj.eventName, row)"
18
18
  :class="convertClass(row[obj.fieldComparison], obj.classCssBody)">
@@ -105,4 +105,8 @@ table tbody tr td {
105
105
  font-size: 12px;
106
106
  min-width: 100px;
107
107
  }
108
+
109
+ .div-row {
110
+ border-bottom: 1px solid #D3D3D3;
111
+ }
108
112
  </style>
@@ -82,7 +82,8 @@ export default {
82
82
  ...mapState("generic", ["search", "executedSearch", "clearedSearch"]),
83
83
  },
84
84
  mounted() {
85
- this.getAll();
85
+ //this.getAll();
86
+ this.removeLoading(["panel"]);
86
87
  this.allReports = JSON.parse(JSON.stringify(this.reports)); // remove observable
87
88
  },
88
89
  methods: {