@nixweb/nixloc-ui 0.0.157 → 0.0.158

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.157",
3
+ "version": "0.0.158",
4
4
  "description": "Componentes UI",
5
5
  "author": "Fábio Ávila <fabio@nixweb.com.br>",
6
6
  "private": false,
@@ -9,73 +9,120 @@
9
9
  >
10
10
  <div slot="content-main">
11
11
  <br />
12
- <div class="div-loading" v-show="loading">
13
- <span
14
- >Aguarde, estamos carregando os dados, isso pode levar alguns
15
- minutos...
16
- </span>
17
- <Loading type="line" :center="false" />
18
- </div>
19
- <Molded v-show="!loading">
20
- <div v-show="!fileName">
21
- <div class="import-icon">
22
- <i class="fas fa-file-import"></i>
23
- </div>
24
- <slot></slot>
25
- <Alert type="info">
26
- <span>
27
- Selecione o arquivo no formato <b> .xlsx </b> baseado na
28
- planilha modelo e aguarde até carregar os dados para
29
- conferência. </span
30
- ><br />
31
- <span>
32
- Até <b> 1000 </b> itens por planilha ou <b> 1MB </b> no arquivo.
33
- </span>
34
- </Alert>
35
- <div class="div-file">
36
- <FileUpload
37
- title="Carregar arquivo"
38
- classIcon="fa-sharp fa-solid fa-upload"
39
- :container="container"
40
- accepted=".xlsx"
41
- allowed=".xlsx"
42
- :disabled="true"
43
- urlPost="/api/v1/adm/file-upload/upload"
44
- urlRemove="/api/v1/adm/file-upload/delete"
45
- :onLoad="successUploadFile"
46
- :nameDataBase="fileName"
47
- v-model="fileName"
48
- />
49
- </div>
50
- </div>
51
- <div v-show="fileName && !loading">
52
- <div class="import-icon">
53
- <i class="fas fa-file-import"></i>
54
- </div>
55
- <span>
56
- Efetue o <b> mapeamento </b> dos campos e clique em iniciar
57
- validação.</span
58
- >
59
- <br />
60
- <div class="div-btn">
61
- <Button
62
- _key="btnBack"
63
- type="info"
64
- title="voltar"
65
- classIcon="fa-solid fa-circle-arrow-left"
66
- size="small"
67
- :clicked="back"
68
- />
69
- <Button
70
- v-if="!isValid"
71
- _key="btnValidate"
72
- type="primary"
73
- title="Iniciar Validação"
74
- :disabled="false"
75
- classIcon="fa-solid fa-arrow-right-arrow-left"
76
- size="small"
77
- :clicked="validate"
78
- />
12
+ <div v-show="!success">
13
+ <b-tabs>
14
+ <b-tab title="Importar">
15
+ <div class="div-loading" v-show="loading">
16
+ <span
17
+ >Aguarde, estamos carregando os dados, isso pode levar alguns
18
+ minutos...
19
+ </span>
20
+ <Loading type="line" :center="false" />
21
+ </div>
22
+ <div v-show="!loading">
23
+ <div v-show="!fileName">
24
+ <div class="import-icon">
25
+ <i class="fas fa-file-import"></i>
26
+ </div>
27
+ <slot></slot>
28
+ <Alert type="info">
29
+ <span>
30
+ Selecione o arquivo no formato <b> .xlsx </b> baseado na
31
+ planilha modelo e aguarde até carregar os dados para
32
+ conferência. </span
33
+ ><br />
34
+ <span>
35
+ Até <b> 1000 </b> itens por planilha ou <b> 1MB </b> no
36
+ arquivo.
37
+ </span>
38
+ </Alert>
39
+ <div class="div-file">
40
+ <FileUpload
41
+ title="Carregar arquivo"
42
+ classIcon="fa-sharp fa-solid fa-upload"
43
+ :container="container"
44
+ accepted=".xlsx"
45
+ allowed=".xlsx"
46
+ :disabled="true"
47
+ urlPost="/api/v1/adm/file-upload/upload"
48
+ urlRemove="/api/v1/adm/file-upload/delete"
49
+ :onLoad="successUploadFile"
50
+ :nameDataBase="fileName"
51
+ v-model="fileName"
52
+ />
53
+ </div>
54
+ </div>
55
+ <div v-show="fileName && !loading">
56
+ <div class="import-icon">
57
+ <i class="fas fa-file-import"></i>
58
+ </div>
59
+ <span>
60
+ Efetue o <b> mapeamento </b> dos campos e clique em iniciar
61
+ validação.</span
62
+ >
63
+ <br />
64
+ <div class="div-btn">
65
+ <Button
66
+ _key="btnBack"
67
+ type="info"
68
+ title="voltar"
69
+ classIcon="fa-solid fa-circle-arrow-left"
70
+ size="small"
71
+ :clicked="back"
72
+ />
73
+ <Button
74
+ v-if="!isValid"
75
+ _key="btnValidate"
76
+ type="primary"
77
+ title="Iniciar Validação"
78
+ :disabled="false"
79
+ classIcon="fa-solid fa-arrow-right-arrow-left"
80
+ size="small"
81
+ :clicked="validate"
82
+ />
83
+ <Button
84
+ v-if="listError.length > 0"
85
+ _key="btnListError"
86
+ type="danger"
87
+ title="Erro(s)"
88
+ classIcon="fa-sharp fa-solid fa-triangle-exclamation"
89
+ size="small"
90
+ :clicked="openListError"
91
+ />
92
+ <Button
93
+ v-if="isValid"
94
+ _key="btnImport"
95
+ type="success"
96
+ title="Importar"
97
+ classIcon="fa-solid fa-file-import"
98
+ size="small"
99
+ :clicked="startImport"
100
+ />
101
+ </div>
102
+ <br />
103
+ <Alert type="danger" v-if="listError.length > 0">
104
+ <span>
105
+ Atenção, foram identificados
106
+ <b>{{ listError.length }}</b> erro(s), corrija-os!
107
+ </span>
108
+ </Alert>
109
+ <Alert type="info">
110
+ <span>
111
+ Total de <b> {{ totalRecords }} </b> registro(s), para o
112
+ mapeamento serão carregados somente os
113
+ <b> 10 </b> primeiros (se houver).
114
+ </span>
115
+ </Alert>
116
+ <TableImport
117
+ v-if="fileName"
118
+ :select="select"
119
+ :headerTable="headerTable"
120
+ :data="data"
121
+ />
122
+ </div>
123
+ </div>
124
+ </b-tab>
125
+ <b-tab title="Histórico">
79
126
  <Button
80
127
  v-if="listError.length > 0"
81
128
  _key="btnListError"
@@ -85,39 +132,36 @@
85
132
  size="small"
86
133
  :clicked="openListError"
87
134
  />
88
- <Button
89
- v-if="isValid"
90
- _key="btnImport"
91
- type="success"
92
- title="Importar"
93
- classIcon="fa-solid fa-file-import"
94
- size="small"
95
- :clicked="startImport"
96
- />
97
- </div>
98
- <br />
99
- <Alert type="danger" v-if="listError.length > 0">
100
- <span>
101
- Atenção, foram identificados
102
- <b>{{ listError.length }}</b> erro(s), corrija-os!
103
- </span>
104
- </Alert>
105
- <Alert type="info">
106
- <span>
107
- Total de <b> {{ totalRecords }} </b> registro(s), para o
108
- mapeamento serão carregados somente os <b> 10 </b> primeiros (se
109
- houver).
110
- </span>
111
- </Alert>
112
-
113
- <TableImport
114
- v-if="fileName"
115
- :select="select"
116
- :headerTable="headerTable"
117
- :data="data"
118
- />
135
+ <ViewTemplateConfiguration
136
+ :templateList="templateList"
137
+ :showSearch="false"
138
+ :showHorizontalFilter="false"
139
+ >
140
+ </ViewTemplateConfiguration>
141
+ </b-tab>
142
+ </b-tabs>
143
+ </div>
144
+ <div v-show="success">
145
+ <div class="div-molded text-center">
146
+ <Molded>
147
+ <div class="msg-success">Importação realizada com sucesso!</div>
148
+ <div class="icon-success">
149
+ <i class="fa-light fa-circle-check"></i>
150
+ </div>
151
+ <div>
152
+ <Button
153
+ _key="btnBack"
154
+ type="info"
155
+ title="voltar"
156
+ classIcon="fa-solid fa-circle-arrow-left"
157
+ size="small"
158
+ :clicked="back"
159
+ />
160
+ </div>
161
+ </Molded>
119
162
  </div>
120
- </Molded>
163
+ </div>
164
+ <br />
121
165
  </div>
122
166
  </Panel>
123
167
  <Modal
@@ -128,6 +172,23 @@
128
172
  >
129
173
  <ListNotifications :listError="listError" />
130
174
  </Modal>
175
+ <Modal
176
+ title="Você tem certeza?"
177
+ :width="500"
178
+ v-show="showModal('confirmDelete')"
179
+ >
180
+ <Alert type="warning">
181
+ <span>
182
+ Atenção, todos os registros relacionados também serão excluídos, esta
183
+ ação é irreversível!
184
+ </span>
185
+ </Alert>
186
+ <Confirmation
187
+ :isModal="false"
188
+ type="danger"
189
+ :confirmed="removeSelected"
190
+ />
191
+ </Modal>
131
192
  </div>
132
193
  </template>
133
194
 
@@ -139,6 +200,8 @@ import FileUpload from "@nixweb/nixloc-ui/src/component/forms/FileUpload";
139
200
  import Loading from "@nixweb/nixloc-ui/src/component/shared/Loading.vue";
140
201
  import Alert from "@nixweb/nixloc-ui/src/component/layout/Alert";
141
202
  import Modal from "@nixweb/nixloc-ui/src/component/forms/Modal";
203
+ import Confirmation from "@nixweb/nixloc-ui/src/component/shared/Confirmation.vue";
204
+ import ViewTemplateConfiguration from "@nixweb/nixloc-ui/src/component/template/ViewTemplateConfiguration";
142
205
 
143
206
  import TableImport from "@nixweb/nixloc-ui/src/component/shared/TableImport.vue";
144
207
  import ListNotifications from "@nixweb/nixloc-ui/src/component/shared/ListNotifications.vue";
@@ -154,12 +217,15 @@ export default {
154
217
  FileUpload,
155
218
  Loading,
156
219
  ListNotifications,
220
+ ViewTemplateConfiguration,
157
221
  TableImport,
158
222
  Alert,
159
223
  Modal,
224
+ Confirmation,
160
225
  },
161
226
  props: {
162
227
  panel: Object,
228
+ templateList: Object,
163
229
  select: Array,
164
230
  container: String,
165
231
  typeImport: Number,
@@ -176,14 +242,16 @@ export default {
176
242
  totalRecords: 0,
177
243
  listError: [],
178
244
  isValid: false,
245
+ idRemove: "",
246
+ success: false,
179
247
  };
180
248
  },
181
249
  computed: {
182
- ...mapGetters("generic", ["showModal"]),
250
+ ...mapGetters("generic", ["showModal", "event"]),
183
251
  },
184
252
  methods: {
185
- ...mapActions("generic", ["postApi"]),
186
- ...mapMutations("generic", ["openModal", "removeLoading"]),
253
+ ...mapActions("generic", ["postApi", "deleteAllApi"]),
254
+ ...mapMutations("generic", ["openModal", "hideModal", "removeLoading"]),
187
255
  successUploadFile() {
188
256
  this.loading = true;
189
257
  let self = this;
@@ -242,11 +310,29 @@ export default {
242
310
  };
243
311
  this.postApi(params).then((response) => {
244
312
  if (response.success) {
245
- alert();
313
+ this.success = true;
314
+ this.removeLoading(["btnImport"]);
246
315
  }
247
316
  this.removeLoading(["btnValidate"]);
248
317
  });
249
318
  },
319
+ removeSelected() {
320
+ let params = {
321
+ url: this.templateList.urlDeleteAllApi,
322
+ selected: [this.idRemove],
323
+ };
324
+ this.deleteAllApi(params).then((response) => {
325
+ if (response.success) {
326
+ this.listError = [];
327
+ this.hideModal();
328
+ } else {
329
+ this.listError = response.content;
330
+ if (this.listError.length == 0) this.isValid = true;
331
+ this.hideModal();
332
+ }
333
+ this.removeLoading(["confirm"]);
334
+ });
335
+ },
250
336
  openListError() {
251
337
  this.openModal("listError");
252
338
  this.removeLoading(["btnListError"]);
@@ -254,9 +340,21 @@ export default {
254
340
  back() {
255
341
  this.fileName = "";
256
342
  this.listError = [];
343
+ this.success = false;
257
344
  this.removeLoading(["btnBack"]);
258
345
  },
259
346
  },
347
+ watch: {
348
+ event: {
349
+ handler(event) {
350
+ if (event.name == "deleteHistoryImport") {
351
+ this.openModal("confirmDelete");
352
+ this.idRemove = this.event.data.id;
353
+ }
354
+ },
355
+ deep: true,
356
+ },
357
+ },
260
358
  };
261
359
  </script>
262
360
 
@@ -279,4 +377,20 @@ export default {
279
377
  .div-loading {
280
378
  margin-top: 10px;
281
379
  }
380
+
381
+ .div-molded {
382
+ width: 550px;
383
+ margin: auto;
384
+ }
385
+
386
+ .msg-success {
387
+ font-size: 18px;
388
+ }
389
+
390
+ .icon-success {
391
+ font-size: 55px;
392
+ color: #38a169;
393
+ margin-top: 10px;
394
+ margin-bottom: 15px;
395
+ }
282
396
  </style>
@@ -171,6 +171,7 @@ export default {
171
171
  .replaceAll("t.pagamentoLocacao", "")
172
172
  .replaceAll("t.periodoLocacao", "")
173
173
  .replaceAll("t.produtoLocacao", "")
174
+ .replaceAll("t.produtoFatura", "")
174
175
  .replaceAll("t.produtoAgrupado", "")
175
176
  .replaceAll("t.produtoMovimentacao", "")
176
177
  .replaceAll("t.enderecoCliente", "")