@nixweb/nixloc-ui 0.0.300 → 0.0.301

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.
Files changed (158) hide show
  1. package/package.json +1 -1
  2. package/src/App.vue +13 -0
  3. package/src/component/forms/Button.vue +163 -0
  4. package/src/component/forms/ButtonFilter.vue +75 -0
  5. package/src/component/forms/ButtonGroup.vue +67 -0
  6. package/src/component/forms/ButtonSub.vue +98 -0
  7. package/src/component/forms/ButtonToggle.vue +77 -0
  8. package/src/component/forms/CheckboxGroup.vue +69 -0
  9. package/src/component/forms/CheckboxServer.vue +192 -0
  10. package/src/component/forms/CheckboxSimple.vue +60 -0
  11. package/src/component/forms/Color.vue +38 -0
  12. package/src/component/forms/DateTime.vue +170 -0
  13. package/src/component/forms/DateYearMonth.vue +193 -0
  14. package/src/component/forms/Dropdown.vue +236 -0
  15. package/src/component/forms/EditorHtml.vue +132 -0
  16. package/src/component/forms/FileUpload.vue +170 -0
  17. package/src/component/forms/ImageUpload.vue +214 -0
  18. package/src/component/forms/IncrementDecrement.vue +148 -0
  19. package/src/component/forms/InputAddressGoogle.vue +171 -0
  20. package/src/component/forms/InputCallToAction.vue +135 -0
  21. package/src/component/forms/InputDecimal.vue +153 -0
  22. package/src/component/forms/InputDecimalDiscount.vue +78 -0
  23. package/src/component/forms/InputNumber.vue +160 -0
  24. package/src/component/forms/InputPassword.vue +148 -0
  25. package/src/component/forms/InputTag.vue +125 -0
  26. package/src/component/forms/InputText.vue +174 -0
  27. package/src/component/forms/InputTextEdit.vue +69 -0
  28. package/src/component/forms/InputWhatsApp.vue +48 -0
  29. package/src/component/forms/Modal.vue +57 -0
  30. package/src/component/forms/RadioGroup.vue +91 -0
  31. package/src/component/forms/Select.vue +378 -0
  32. package/src/component/forms/SelectStatic.vue +198 -0
  33. package/src/component/forms/SideBar.vue +100 -0
  34. package/src/component/forms/Slider.vue +18 -0
  35. package/src/component/forms/TextArea.vue +138 -0
  36. package/src/component/forms/Toggle.vue +72 -0
  37. package/src/component/layout/Account.vue +131 -0
  38. package/src/component/layout/Alert.vue +88 -0
  39. package/src/component/layout/Badge.vue +111 -0
  40. package/src/component/layout/BarFloating.vue +68 -0
  41. package/src/component/layout/FixedBar.vue +103 -0
  42. package/src/component/layout/Gantt.vue +128 -0
  43. package/src/component/layout/Header.vue +56 -0
  44. package/src/component/layout/HideShow.vue +62 -0
  45. package/src/component/layout/IconMolded.vue +59 -0
  46. package/src/component/layout/LoadingFullPage.vue +27 -0
  47. package/src/component/layout/Menu.vue +287 -0
  48. package/src/component/layout/Molded.vue +30 -0
  49. package/src/component/layout/NewAccount.vue +136 -0
  50. package/src/component/layout/NewHeader.vue +60 -0
  51. package/src/component/layout/NewIconMolded.vue +71 -0
  52. package/src/component/layout/NewMenu.vue +456 -0
  53. package/src/component/layout/Panel.vue +185 -0
  54. package/src/component/layout/Popover.vue +126 -0
  55. package/src/component/layout/ScrollBar.vue +57 -0
  56. package/src/component/layout/Tab.vue +135 -0
  57. package/src/component/layout/Tag.vue +97 -0
  58. package/src/component/layout/Wizard.vue +211 -0
  59. package/src/component/rental/DisplayCalculatePeriod.vue +49 -0
  60. package/src/component/rental/DisplayPeriodRent.vue +55 -0
  61. package/src/component/rental/DisplayTotalization.vue +86 -0
  62. package/src/component/report/Fields.vue +109 -0
  63. package/src/component/report/Report.vue +314 -0
  64. package/src/component/report/ReportTable.vue +112 -0
  65. package/src/component/report/Totalization.vue +34 -0
  66. package/src/component/shared/CodeEditor.vue +128 -0
  67. package/src/component/shared/Collapse.vue +131 -0
  68. package/src/component/shared/Confirmation.vue +74 -0
  69. package/src/component/shared/DocumentEditor.vue +99 -0
  70. package/src/component/shared/DocumentPreview.vue +81 -0
  71. package/src/component/shared/DocumentPublic.vue +33 -0
  72. package/src/component/shared/ExportExcel.vue +56 -0
  73. package/src/component/shared/ExportPDF.vue +116 -0
  74. package/src/component/shared/FullCalendar.vue +174 -0
  75. package/src/component/shared/HeaderReport.vue +47 -0
  76. package/src/component/shared/HorizontalFilter.vue +64 -0
  77. package/src/component/shared/ListNotifications.vue +70 -0
  78. package/src/component/shared/Loading.vue +107 -0
  79. package/src/component/shared/LoadingCard.vue +65 -0
  80. package/src/component/shared/LoadingMoreButton.vue +23 -0
  81. package/src/component/shared/Messages.vue +109 -0
  82. package/src/component/shared/PDFViewer.vue +24 -0
  83. package/src/component/shared/Pagination.vue +108 -0
  84. package/src/component/shared/ParameterLegend.vue +169 -0
  85. package/src/component/shared/ProgressBar.vue +25 -0
  86. package/src/component/shared/QueryButton.vue +66 -0
  87. package/src/component/shared/Report.vue +200 -0
  88. package/src/component/shared/SaveCancel.vue +99 -0
  89. package/src/component/shared/Search.vue +174 -0
  90. package/src/component/shared/SelectOption.vue +162 -0
  91. package/src/component/shared/Table.vue +174 -0
  92. package/src/component/shared/TableButton.vue +36 -0
  93. package/src/component/shared/TableDraggable.vue +117 -0
  94. package/src/component/shared/TableImport.vue +93 -0
  95. package/src/component/shared/TableItem.vue +214 -0
  96. package/src/component/shared/TableTotalPerPage.vue +78 -0
  97. package/src/component/shared/TableTotalRecords.vue +44 -0
  98. package/src/component/shared/TableTotalization.vue +47 -0
  99. package/src/component/shared/TimeLine.vue +42 -0
  100. package/src/component/shared/Timer.vue +78 -0
  101. package/src/component/shared/Tip.vue +42 -0
  102. package/src/component/shared/Toast.vue +69 -0
  103. package/src/component/shared/ToggleTheme.vue +128 -0
  104. package/src/component/shared/TotalizationReport.vue +86 -0
  105. package/src/component/shared/VerticalFilter.vue +97 -0
  106. package/src/component/shared/automation/ActivitiesList.vue +44 -0
  107. package/src/component/shared/automation/AddRule.vue +61 -0
  108. package/src/component/shared/automation/AutomationBuilder.vue +27 -0
  109. package/src/component/shared/automation/DynamicComponentList.vue +86 -0
  110. package/src/component/shared/automation/SelectRule.vue +98 -0
  111. package/src/component/shared/automation/components/BillingByRent.vue +98 -0
  112. package/src/component/shared/automation/components/SendEmail.vue +94 -0
  113. package/src/component/shared/file-manager/FileManager.vue +391 -0
  114. package/src/component/shared/filter-builder/FilterBuilder.vue +221 -0
  115. package/src/component/shared/filter-builder/FilterQuery.vue +94 -0
  116. package/src/component/shared/query-builder/AddRule.vue +203 -0
  117. package/src/component/shared/query-builder/ConvertToOdata.js +86 -0
  118. package/src/component/shared/query-builder/DynamicComponent.vue +161 -0
  119. package/src/component/shared/query-builder/DynamicComponentList.vue +70 -0
  120. package/src/component/shared/query-builder/Fields.vue +93 -0
  121. package/src/component/shared/query-builder/QueryBuilder.vue +69 -0
  122. package/src/component/shared/query-builder/Rules.vue +68 -0
  123. package/src/component/shared/query-builder/SelectRule.vue +97 -0
  124. package/src/component/shared/query-builder/Tags.vue +59 -0
  125. package/src/component/shared/query-builder/utilities.js +22 -0
  126. package/src/component/signature/Payment.vue +161 -0
  127. package/src/component/signature/Warning.vue +76 -0
  128. package/src/component/template/ListViewWithDataHandler.vue +429 -0
  129. package/src/component/template/ReportCreateUpdate.vue +110 -0
  130. package/src/component/template/ViewTemplateConfiguration.vue +64 -0
  131. package/src/component/template/ViewTemplateDocumentView.vue +213 -0
  132. package/src/component/template/ViewTemplateImportFile.vue +347 -0
  133. package/src/component/template/ViewTemplateReportList.vue +217 -0
  134. package/src/component/template/ViewTemplateReportPreview.vue +432 -0
  135. package/src/component/template/ViewTemplateSelectOption.vue +46 -0
  136. package/src/component/template/ViewTemplateWithSalveCancel.vue +32 -0
  137. package/src/component/template/ViewTemplateWithTable.vue +62 -0
  138. package/src/component/template/model/Report.js +6 -0
  139. package/src/component/training/Course.vue +344 -0
  140. package/src/component/training/CourseView.vue +190 -0
  141. package/src/component/value-objects/Address.js +11 -0
  142. package/src/component/value-objects/Address.vue +157 -0
  143. package/src/component/value-objects/Contact.js +7 -0
  144. package/src/component/value-objects/Contact.vue +106 -0
  145. package/src/component/value-objects/Person.js +10 -0
  146. package/src/component/value-objects/Person.vue +129 -0
  147. package/src/config/axios.js +9 -0
  148. package/src/config/dicas.js +15 -0
  149. package/src/config/router.js +14 -0
  150. package/src/config/token.js +15 -0
  151. package/src/main.js +23 -0
  152. package/src/store/modules/automation.js +31 -0
  153. package/src/store/modules/generic.js +816 -0
  154. package/src/store/modules/report.js +278 -0
  155. package/src/store/modules/user.js +67 -0
  156. package/src/store/modules/util.js +26 -0
  157. package/src/store/modules/validation.js +39 -0
  158. package/src/store/store.js +14 -0
@@ -0,0 +1,347 @@
1
+ <template>
2
+ <div>
3
+ <Panel :module="panel.module" :title="panel.title" :showVerticalFilter="panel.showVerticalFilter"
4
+ :showSearch="panel.showSearch" :showButtons="panel.showButtons">
5
+ <div slot="content-main">
6
+ <br />
7
+ <div class="div-loading" v-show="loading">
8
+ <span>
9
+ {{ msg }}
10
+ </span>
11
+ <Loading type="line" :center="false" />
12
+ </div>
13
+ <div v-show="!success && !loading">
14
+ <b-tabs>
15
+ <b-tab title="Importar">
16
+ <div>
17
+ <div v-show="!fileName">
18
+ <Alert type="info">
19
+ <span>
20
+ Selecione o arquivo Excel no formato
21
+ <b> .xlsx </b> baseado na planilha
22
+ <a :href="urlTemplate" class="text-download">
23
+ <b>BAIXAR MODELO</b>
24
+ </a>
25
+ e aguarde até carregar os dados para conferência.
26
+ </span>
27
+ <br />
28
+ <span>
29
+ Até <b> 1000 </b> itens por planilha ou <b> 1MB </b> no
30
+ arquivo.
31
+ </span>
32
+ </Alert>
33
+ <br />
34
+ <slot></slot>
35
+ <div class="div-file">
36
+ <FileUpload title="Carregar .xlsx" classIcon="fa-solid fa-file-excel" :container="container"
37
+ accepted=".xlsx" allowed=".xlsx" :disabled="true" urlPost="/api/v1/adm/file-upload/upload"
38
+ urlRemove="/api/v1/adm/file-upload/delete" :onLoad="successUploadFile" :nameDataBase="fileName"
39
+ v-model="fileName" />
40
+ </div>
41
+ </div>
42
+ <div v-show="fileName && !loading">
43
+ <div class="import-icon">
44
+ <i class="fas fa-file-import"></i>
45
+ </div>
46
+ <span v-if="!isValid">
47
+ Efetue o <b> mapeamento </b> dos campos e clique em iniciar
48
+ validação.
49
+ </span>
50
+ <span v-else>
51
+ Dados <b> validado com sucesso, </b> clique em importar.
52
+ </span>
53
+ <br />
54
+ <div class="div-btn">
55
+ <Button _key="btnBack" type="info" title="voltar" classIcon="fa-solid fa-circle-arrow-left"
56
+ size="small" :clicked="back" />
57
+ <Button v-if="!isValid" _key="btnValidate" type="primary" title="Iniciar Validação" :disabled="false"
58
+ classIcon="fa-solid fa-arrow-right-arrow-left" size="small" :clicked="validate" />
59
+ <Button v-if="listError.length > 0" _key="btnListError" type="danger" title="Erro(s)"
60
+ classIcon="fa-sharp fa-solid fa-triangle-exclamation" size="small" :clicked="openListError" />
61
+ <Button v-if="isValid" _key="btnImport" type="success" title="Importar"
62
+ classIcon="fa-solid fa-file-import" size="small" :clicked="startImport" />
63
+ </div>
64
+ <br />
65
+ <Alert type="danger" v-if="listError.length > 0">
66
+ <span>
67
+ Atenção, foram identificados
68
+ <b>{{ listError.length }}</b> erro(s), corrija-os!
69
+ </span>
70
+ </Alert>
71
+ <Alert type="info">
72
+ <span>
73
+ Total de <b> {{ totalRecords }} </b> registro(s), para o
74
+ mapeamento serão carregados somente os
75
+ <b> 10 </b> primeiros (se houver).
76
+ </span>
77
+ </Alert>
78
+ <TableImport v-if="fileName" :select="select" :headerTable="headerTable" :data="data" />
79
+ </div>
80
+ </div>
81
+ </b-tab>
82
+ <b-tab title="Histórico">
83
+ <Button v-if="listError.length > 0" _key="btnListError" type="danger" title="Erro(s)"
84
+ classIcon="fa-sharp fa-solid fa-triangle-exclamation" size="small" :clicked="openListError" />
85
+ <ViewTemplateConfiguration :templateList="templateList" :showSearch="false" :showHorizontalFilter="false">
86
+ </ViewTemplateConfiguration>
87
+ </b-tab>
88
+ </b-tabs>
89
+ </div>
90
+ <div v-show="success">
91
+ <div class="div-molded text-center">
92
+ <Molded>
93
+ <div class="msg-success">Importação realizada com sucesso!</div>
94
+ <div class="icon-success">
95
+ <i class="fa-light fa-circle-check"></i>
96
+ </div>
97
+ <div>
98
+ <Button _key="btnBack" type="info" title="voltar" classIcon="fa-solid fa-circle-arrow-left" size="small"
99
+ :clicked="back" />
100
+ </div>
101
+ </Molded>
102
+ </div>
103
+ </div>
104
+ <br />
105
+ </div>
106
+ </Panel>
107
+ <Modal title="Erro(s)" :width="900" :height="750" v-show="showModal('listError')">
108
+ <ListNotifications :listError="listError" />
109
+ </Modal>
110
+ <Modal title="Você tem certeza?" :width="500" v-show="showModal('confirmDelete')">
111
+ <Alert type="warning">
112
+ <span>
113
+ Atenção, todos os registros relacionados também serão excluídos, esta
114
+ ação é irreversível!
115
+ </span>
116
+ </Alert>
117
+ <Confirmation :isModal="false" type="danger" :confirmed="removeSelected" />
118
+ </Modal>
119
+ </div>
120
+ </template>
121
+
122
+ <script>
123
+ import Panel from "@nixweb/nixloc-ui/src/component/layout/Panel.vue";
124
+ import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
125
+ import Molded from "@nixweb/nixloc-ui/src/component/layout/Molded";
126
+ import FileUpload from "@nixweb/nixloc-ui/src/component/forms/FileUpload";
127
+ import Loading from "@nixweb/nixloc-ui/src/component/shared/Loading.vue";
128
+ import Alert from "@nixweb/nixloc-ui/src/component/layout/Alert";
129
+ import Modal from "@nixweb/nixloc-ui/src/component/forms/Modal";
130
+ import Confirmation from "@nixweb/nixloc-ui/src/component/shared/Confirmation.vue";
131
+ import ViewTemplateConfiguration from "@nixweb/nixloc-ui/src/component/template/ViewTemplateConfiguration";
132
+
133
+ import TableImport from "@nixweb/nixloc-ui/src/component/shared/TableImport.vue";
134
+ import ListNotifications from "@nixweb/nixloc-ui/src/component/shared/ListNotifications.vue";
135
+
136
+ import { mapState, mapActions, mapMutations, mapGetters } from "vuex";
137
+
138
+ export default {
139
+ name: "ViewTemplateImportFileView",
140
+ components: {
141
+ Panel,
142
+ Button,
143
+ Molded,
144
+ FileUpload,
145
+ Loading,
146
+ ListNotifications,
147
+ ViewTemplateConfiguration,
148
+ TableImport,
149
+ Alert,
150
+ Modal,
151
+ Confirmation,
152
+ },
153
+ props: {
154
+ panel: Object,
155
+ templateList: Object,
156
+ select: Array,
157
+ container: String,
158
+ typeImport: Number,
159
+ urlMapping: String,
160
+ urlValidate: String,
161
+ urlImport: String,
162
+ urlTemplate: String,
163
+ },
164
+ data() {
165
+ return {
166
+ fileName: "",
167
+ loading: false,
168
+ headerTable: [],
169
+ data: [],
170
+ totalRecords: 0,
171
+ listError: [],
172
+ isValid: false,
173
+ idRemove: "",
174
+ success: false,
175
+ msg: "",
176
+ loadingImport: false,
177
+ };
178
+ },
179
+ computed: {
180
+ ...mapGetters("generic", ["showModal", "event"]),
181
+ },
182
+ methods: {
183
+ ...mapActions("generic", ["postApi", "deleteAllApi"]),
184
+ ...mapMutations("generic", ["openModal", "hideModal", "removeLoading"]),
185
+ successUploadFile() {
186
+ this.listError = [];
187
+ this.loading = true;
188
+ this.msg =
189
+ "Aguarde, estamos carregando os dados, isso pode levar alguns minutos...";
190
+ let self = this;
191
+ setTimeout(function () {
192
+ self.mapping(self.fileName);
193
+ }, 1000);
194
+ },
195
+ mapping(fileName) {
196
+ let params = {
197
+ url: this.urlMapping,
198
+ obj: {
199
+ fileName: fileName,
200
+ container: this.container,
201
+ typeImport: this.typeImport,
202
+ },
203
+ notNotifyToast: true,
204
+ };
205
+ this.postApi(params).then((response) => {
206
+ if (response.success) {
207
+ this.loading = false;
208
+ this.headerTable = response.content.headerTable;
209
+ this.data = response.content.data;
210
+ this.totalRecords = response.content.totalRecords;
211
+ }
212
+ });
213
+ },
214
+ validate() {
215
+ this.loading = true;
216
+ this.msg =
217
+ "Aguarde, estamos validando os dados, isso pode levar alguns minutos...";
218
+ this.isValid = false;
219
+ let params = {
220
+ url: this.urlValidate,
221
+ obj: {
222
+ fileName: this.fileName,
223
+ container: this.container,
224
+ typeImport: this.typeImport,
225
+ items: this.headerTable,
226
+ },
227
+ notNotifyToast: true,
228
+ };
229
+ this.postApi(params).then((response) => {
230
+ if (response.success) {
231
+ this.listError = response.content;
232
+ if (this.listError.length == 0) this.isValid = true;
233
+ }
234
+ this.removeLoading(["btnValidate"]);
235
+ let self = this;
236
+ setTimeout(function () {
237
+ self.loading = false;
238
+ }, 2000);
239
+ });
240
+ },
241
+ startImport() {
242
+ this.loading = true;
243
+ this.msg =
244
+ "Aguarde, estamos importando os dados, isso pode levar alguns minutos...";
245
+ let params = {
246
+ url: this.urlImport,
247
+ obj: {
248
+ fileName: this.fileName,
249
+ container: this.container,
250
+ typeImport: this.typeImport,
251
+ items: this.headerTable,
252
+ },
253
+ notNotifyToast: true,
254
+ };
255
+ this.postApi(params).then((response) => {
256
+ if (response.success) {
257
+ this.success = true;
258
+ this.isValid = false;
259
+ }
260
+ this.removeLoading(["btnImport"]);
261
+ this.loading = false;
262
+ });
263
+ },
264
+ removeSelected() {
265
+ let params = {
266
+ url: this.templateList.urlDeleteAllApi,
267
+ selected: [this.idRemove],
268
+ };
269
+ this.deleteAllApi(params).then((response) => {
270
+ if (response.success) {
271
+ this.listError = [];
272
+ this.hideModal();
273
+ } else {
274
+ this.listError = response.content;
275
+ if (this.listError.length == 0) this.isValid = true;
276
+ this.hideModal();
277
+ }
278
+ this.removeLoading(["confirm"]);
279
+ });
280
+ },
281
+ openListError() {
282
+ this.openModal("listError");
283
+ this.removeLoading(["btnListError"]);
284
+ },
285
+ back() {
286
+ this.fileName = "";
287
+ this.listError = [];
288
+ this.success = false;
289
+ this.isValid = false;
290
+ this.removeLoading(["btnBack"]);
291
+ },
292
+ },
293
+ watch: {
294
+ event: {
295
+ handler(event) {
296
+ if (event.name == "deleteHistoryImport") {
297
+ this.openModal("confirmDelete");
298
+ this.idRemove = this.event.data.id;
299
+ }
300
+ },
301
+ deep: true,
302
+ },
303
+ },
304
+ };
305
+ </script>
306
+
307
+ <style scoped>
308
+ .import-icon {
309
+ font-size: 30px;
310
+ opacity: 0.2;
311
+ color: #577696;
312
+ }
313
+
314
+ .div-file {
315
+ margin-top: 20px;
316
+ }
317
+
318
+ .div-btn {
319
+ margin-top: 10px;
320
+ margin-left: -8px;
321
+ }
322
+
323
+ .div-loading {
324
+ margin-top: 10px;
325
+ }
326
+
327
+ .div-molded {
328
+ width: 550px;
329
+ margin: auto;
330
+ }
331
+
332
+ .text-download {
333
+ color: #1990ff;
334
+ cursor: pointer;
335
+ }
336
+
337
+ .msg-success {
338
+ font-size: 18px;
339
+ }
340
+
341
+ .icon-success {
342
+ font-size: 55px;
343
+ color: #38a169;
344
+ margin-top: 10px;
345
+ margin-bottom: 15px;
346
+ }
347
+ </style>
@@ -0,0 +1,217 @@
1
+ <template>
2
+ <div>
3
+ <Panel :module="panel.module" :title="panel.title" :showVerticalFilter="panel.showVerticalFilter"
4
+ :showSearch="panel.showSearch" :showButtons="panel.showButtons">
5
+ <div slot="content-main">
6
+ <b-row>
7
+ <b-col xs="12" sm="12" md="12" lg="6" xl="6" v-if="allReports.saved.length > 0">
8
+ <div><i class="fas fa-file-alt icon-report-title icon-saved"></i> <span class="title">Personalizado</span>
9
+ </div>
10
+ <hr class="hr" />
11
+ <div class="div-molded" v-for="report in allReports.saved">
12
+ <div>
13
+ <Molded :borderRadius="12">
14
+ <b-row>
15
+ <b-col sm="1">
16
+ <i class="fas fa-file-alt icon-report"></i>
17
+ </b-col>
18
+ <b-col sm="10" @click="navegateTo(report)">
19
+ <div class="title-report">{{ report.name }}</div>
20
+ </b-col>
21
+ <b-col sm="1">
22
+ <Confirmation title="Deseja excluir?" type="danger" :data="report" :confirmed="confirmDelete">
23
+ <div class="text-right">
24
+ <i class="fas fa-times-circle icon-remove"></i>
25
+ </div>
26
+ </Confirmation>
27
+ </b-col>
28
+ </b-row>
29
+ </Molded>
30
+ </div>
31
+ </div>
32
+ </b-col>
33
+ <b-col xs="12" sm="12" md="12" lg="6" xl="6">
34
+ <div>
35
+ <i class="fas fa-file-chart-line icon-report-title icon-default"></i> <span class="title">Padrão</span>
36
+ </div>
37
+ <hr class="hr" />
38
+ <div class="div-molded" v-for="report in allReports.default">
39
+ <div>
40
+ <Molded :borderRadius="12">
41
+ <b-row>
42
+ <b-col sm="1">
43
+ <i class="fas fa-file-alt icon-report"></i>
44
+ </b-col>
45
+ <b-col sm="11" @click="navegateTo(report)">
46
+ <div class="title-report side-by-side">{{ report.name }}</div>
47
+ <div><span class="description-report">{{ report.description }}</span></div>
48
+ </b-col>
49
+ </b-row>
50
+ </Molded>
51
+ </div>
52
+ </div>
53
+ </b-col>
54
+ </b-row>
55
+ </div>
56
+ </Panel>
57
+ </div>
58
+ </template>
59
+
60
+ <script>
61
+ import Panel from "@nixweb/nixloc-ui/src/component/layout/Panel.vue";
62
+ import Molded from "@nixweb/nixloc-ui/src/component/layout/Molded";
63
+ import Confirmation from "@nixweb/nixloc-ui/src/component/shared/Confirmation";
64
+
65
+ import { _default, mapState, mapActions, mapMutations } from "vuex";
66
+
67
+ export default {
68
+ name: "TemplateReportListView",
69
+ components: { Panel, Molded, Confirmation },
70
+ props: {
71
+ panel: Object,
72
+ reports: Object,
73
+ },
74
+ data() {
75
+ return {
76
+ allReports: { saved: [] },
77
+ urlGetAll: "/api/v1/shared/report/get-all",
78
+ urlDelete: "/api/v1/shared/report/delete",
79
+ };
80
+ },
81
+ computed: {
82
+ ...mapState("generic", ["search", "executedSearch", "clearedSearch"]),
83
+ },
84
+ mounted() {
85
+ this.getAll();
86
+ //this.removeLoading(["panel"]);
87
+ this.allReports = JSON.parse(JSON.stringify(this.reports)); // remove observable
88
+ },
89
+ methods: {
90
+ ...mapMutations("generic", ["removeLoading"]),
91
+ ...mapActions("generic", ["getApi", "deleteAllApi"]),
92
+ getAll() {
93
+ let obj = { module: this.panel.module };
94
+ let params = { url: this.urlGetAll, obj: obj };
95
+ this.getApi(params).then((response) => {
96
+ this.allReports.saved = [];
97
+ let self = this;
98
+ response.content.data.forEach((item) => {
99
+ const query = JSON.parse(item.query);
100
+ let obj = {
101
+ id: item.id,
102
+ name: item.name,
103
+ routeName: query.routeName,
104
+ };
105
+ self.allReports.saved.push(obj);
106
+ });
107
+ this.removeLoading(["panel"]);
108
+ });
109
+ },
110
+ navegateTo(report) {
111
+ this.$router.push({
112
+ name: report.routeName,
113
+ params: { id: report.id, name: report.name },
114
+ });
115
+ },
116
+ confirmDelete(data) {
117
+ let selected = [];
118
+ selected.push(data.id);
119
+
120
+ let params = {
121
+ url: this.urlDelete,
122
+ selected: selected,
123
+ };
124
+
125
+ this.deleteAllApi(params).then((reponse) => {
126
+ if (reponse.success) this.getAll();
127
+ });
128
+ },
129
+ },
130
+ watch: {
131
+ executedSearch: function () {
132
+ let _default = [];
133
+ let saved = [];
134
+ let self = this;
135
+ setTimeout(function () {
136
+ self.allReports.default.forEach(function (item) {
137
+ if (self.search.filter.id == "equal") {
138
+ if (item.name == self.search.content) _default.push(item);
139
+ }
140
+
141
+ if (self.search.filter.id == "contains") {
142
+ if (item.name.includes(self.search.content)) _default.push(item);
143
+ }
144
+ });
145
+
146
+ self.allReports.saved.forEach(function (item) {
147
+ if (self.search.filter.content == "equal") {
148
+ if (item.name == self.search.content) saved.push(item);
149
+ }
150
+
151
+ if (self.search.filter.content == "contains") {
152
+ if (item.name.includes(self.search.content)) saved.push(item);
153
+ }
154
+ });
155
+
156
+ self.allReports.saved = saved;
157
+ self.allReports.default = _default;
158
+
159
+ self.removeLoading(["btnSearch", "btnClean"]);
160
+ }, 300);
161
+ },
162
+ clearedSearch: function () {
163
+ let self = this;
164
+ setTimeout(function () {
165
+ self.allReports = self.reports;
166
+ self.getAll();
167
+ self.removeLoading(["btnSearch", "btnClean"]);
168
+ }, 300);
169
+ },
170
+ },
171
+ };
172
+ </script>
173
+
174
+ <style scoped>
175
+ .icon-saved {
176
+ color: #94aa2a;
177
+ font-size: 20px;
178
+ }
179
+
180
+ .icon-default {
181
+ font-size: 20px;
182
+ }
183
+
184
+ .icon-remove {
185
+ color: red;
186
+ }
187
+
188
+ .icon-report {
189
+ font-size: 25px;
190
+ opacity: 0.2;
191
+ color: #577696;
192
+ }
193
+
194
+ .div-molded {
195
+ margin-bottom: 10px;
196
+ cursor: pointer;
197
+ }
198
+
199
+ .div-molded:hover {
200
+ background-color: #fafafc;
201
+ }
202
+
203
+ .description {
204
+ font-size: 13.5px;
205
+ color: rgb(117, 117, 117);
206
+ }
207
+
208
+ .hr {
209
+ background: #fafafc !important;
210
+ height: 1px !important;
211
+ }
212
+
213
+ .description-report {
214
+ font-size: 13px;
215
+ color: rgb(110, 110, 110);
216
+ }
217
+ </style>