@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,314 @@
1
+ <template>
2
+ <div class="main">
3
+ <Panel :module="module" layout="large" :title="name" :showVerticalFilter="false" :showSearch="false"
4
+ :showButtons="false">
5
+ <div slot="content-main">
6
+ <br>
7
+ <div class="div-btn">
8
+ <Molded>
9
+ <div class="div-filter">
10
+ <div class="side-by-side">
11
+ <div class="div-filter">
12
+ <Button _key="btnSearchReport" :disabled="loading || !isValid" type="primary"
13
+ :title="loading ? 'Aguarde...' : 'Buscar'" classIcon="fas fa-file-search"
14
+ size="medium" :clicked="executeSearch" />
15
+ </div>
16
+ </div>
17
+ <div class="side-by-side">
18
+ <Fields :data="header" v-model="ordering" />
19
+ </div>
20
+ <div class="side-by-side div-filter-query">
21
+ <FilterQuery :filters="filters" v-model="stringFilter" />
22
+ </div>
23
+ </div>
24
+ </Molded>
25
+ </div>
26
+ <div v-if="!cancel">
27
+ <div v-if="liveTotalRecords != totalRecords">
28
+ <ProgressBar :text="`Carregando ${liveTotalRecords} registros de ${totalRecords}`"
29
+ :value="liveTotalRecords" :max="totalRecords" size="medium" />
30
+ <div class="text-center cancel" @click="stop">
31
+ <i class="fa-solid fa-ban"></i> Cancelar
32
+ </div>
33
+ </div>
34
+ </div>
35
+
36
+ <div v-if="!isValid">
37
+ <Alert type="info">
38
+ <span>
39
+ É necessário informar o filtro <div class="badge badge-default">
40
+ {{ fieldsRequired }}
41
+ </div>, clique no botão <b> <i class="div-icon-btn fa-sharp fa-solid fa-filters"
42
+ aria-hidden="true"></i> Filtros
43
+ </b>para
44
+ adicionar.
45
+ </span>
46
+ </Alert>
47
+ </div>
48
+ <div v-if="show" class="preview">
49
+ <div class="toolbar">
50
+ <div class="icon-toolbar" v-print="'#printMe'">
51
+ <i class="fas fa-print"></i>
52
+ </div>
53
+ <div class="icon-toolbar icon-excel">
54
+ <ExportExcel :nameFile="name" :header="dataConditional" :data="data" />
55
+ </div>
56
+ </div>
57
+ <ScrollBar :minHeight="400" :maxHeight="820">
58
+ <br />
59
+ <div id="printMe" :style="'min-height:' + minHeight + 'px'" class="a4 footer">
60
+ <HeaderReport :title="name" />
61
+ <div>
62
+ <span>Total de <b> {{ totalRecords }}</b> registro(s) </span>
63
+ </div>
64
+ <ReportTable :header="dataConditional" :data="data" />
65
+ <Totalization :totalization="totalization" />
66
+ </div>
67
+ </ScrollBar>
68
+ </div>
69
+ </div>
70
+ </Panel>
71
+ <br>
72
+ <br>
73
+ </div>
74
+ </template>
75
+
76
+ <script>
77
+
78
+ import Molded from "@nixweb/nixloc-ui/src/component/layout/Molded";
79
+ import ScrollBar from "@nixweb/nixloc-ui/src/component/layout/ScrollBar.vue";
80
+ import Loading from "@nixweb/nixloc-ui/src/component/shared/Loading.vue";
81
+ import HeaderReport from "../shared/HeaderReport.vue";
82
+ import ExportExcel from "@nixweb/nixloc-ui/src/component/shared/ExportExcel";
83
+ import ReportTable from "@nixweb/nixloc-ui/src/component/report/ReportTable.vue";
84
+ import Totalization from "@nixweb/nixloc-ui/src/component/report/Totalization.vue";
85
+ import FilterQuery from '@nixweb/nixloc-ui/src/component/shared/filter-builder/FilterQuery.vue'
86
+ import ProgressBar from "@nixweb/nixloc-ui/src/component/shared/ProgressBar";
87
+ import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
88
+ import Fields from "@nixweb/nixloc-ui/src/component/report/Fields.vue";
89
+ import Panel from "@nixweb/nixloc-ui/src/component/layout/Panel.vue";
90
+ import Alert from "@nixweb/nixloc-ui/src/component/layout/Alert";
91
+
92
+ import print from "vue-print-nb";
93
+
94
+ import { mapMutations, mapActions, mapGetters } from "vuex";
95
+
96
+
97
+ export default {
98
+ directives: {
99
+ print,
100
+ },
101
+ props: ["name", "module", "urlGet", "header", "filters", "minHeight"],
102
+ components: { ScrollBar, HeaderReport, Alert, ExportExcel, ReportTable, Molded, FilterQuery, Button, Fields, Panel, Loading, Totalization, ProgressBar },
103
+ data() {
104
+ return {
105
+ loading: false,
106
+ show: false,
107
+ data: [],
108
+ totalization: [],
109
+ ordering: {},
110
+ stringFilter: [],
111
+ totalRecords: 0,
112
+ currentPage: 1,
113
+ totalPerPage: 50,
114
+ pagination: [],
115
+ cancel: false,
116
+ }
117
+ },
118
+ mounted() {
119
+ this.removeLoading(["panel"]);
120
+ },
121
+ computed: {
122
+ ...mapGetters("generic", ["event"]),
123
+ dataConditional() {
124
+ return this.header.filter(item => item.show);
125
+ },
126
+ liveTotalRecords() {
127
+ return this.data.length;
128
+ },
129
+ isValid() {
130
+ var hasRequired = this.filters.some(item => item.required);
131
+ if (hasRequired) {
132
+ return this.stringFilter.some(item => item.required == true && item.value !== "");
133
+ } else {
134
+ return true;
135
+ }
136
+ },
137
+ fieldsRequired() {
138
+ let title = "";
139
+ var filter = this.filters.filter(item => item.required);
140
+ filter.forEach(item => {
141
+ title += item.title + ' ou '
142
+ });
143
+ return title.replace(/ ou\s*$/, '');
144
+ }
145
+ },
146
+ methods: {
147
+ ...mapMutations("generic", ["removeLoading"]),
148
+ ...mapActions("generic", ["getApi"]),
149
+ executeSearch() {
150
+ this.cancel = false;
151
+ this.data = [];
152
+ this.pagination = [];
153
+ this.totalization = [];
154
+ this.getAll();
155
+ },
156
+ getAll() {
157
+ if (this.isValid && !this.cancel) {
158
+ this.removeLoading(["btnSearchReport"]);
159
+ this.loading = true;
160
+ this.cancel = false;
161
+
162
+ let params = {
163
+ url: this.urlGet,
164
+ obj:
165
+ {
166
+ stringFilter: JSON.stringify(this.stringFilter),
167
+ fieldOrder: this.ordering.field,
168
+ ordering: this.ordering.ordering,
169
+ currentPage: this.currentPage,
170
+ totalPerPage: this.totalPerPage,
171
+ noPaginated: true
172
+ }
173
+ };
174
+
175
+ this.getApi(params).then((response) => {
176
+ let self = this;
177
+ this.totalization = response.content.totalization;
178
+ this.totalRecords = response.content.totalRecords;
179
+
180
+ if (this.pagination.length == 0) {
181
+ this.currentPage = 1;
182
+ this.data = [];
183
+ }
184
+
185
+ if (this.pagination.length == 0) {
186
+ var pagination = response.content.totalRecords / this.totalPerPage;
187
+ var arr = Math.ceil(pagination);
188
+ for (var i = 1; i <= arr; i++) {
189
+ self.pagination.push(i);
190
+ }
191
+ } else {
192
+ this.pagination.pop();
193
+ }
194
+
195
+ response.content.data.forEach(item => {
196
+ self.data.push(item);
197
+ });
198
+
199
+ this.show = true;
200
+ setTimeout(function () {
201
+ self.loading = false;
202
+ }, 500);
203
+
204
+ this.verifyIfPagination();
205
+ });
206
+ }
207
+ },
208
+ verifyIfPagination() {
209
+ if (this.pagination.length > 0) {
210
+ this.currentPage++;
211
+
212
+ let self = this;
213
+ setTimeout(function () {
214
+ self.getAll();
215
+ }, 500);
216
+ } else {
217
+ this.currentPage = 1;
218
+ }
219
+ },
220
+ stop() {
221
+ this.cancel = true;
222
+ this.loading = false;
223
+ }
224
+ },
225
+ watch: {
226
+ event: {
227
+ handler(event) {
228
+ if (this.show) {
229
+ if (event.name == "stringFilter" || event.name == "orderedFilter") {
230
+ let self = this;
231
+ setTimeout(function () {
232
+ // self.getAll();
233
+ }, 500);
234
+ }
235
+ }
236
+ },
237
+ deep: true,
238
+ },
239
+ },
240
+ };
241
+ </script>
242
+
243
+ <style scoped>
244
+ .main {
245
+ margin-bottom: 30px;
246
+
247
+ }
248
+
249
+ .title {
250
+ font-size: 12px;
251
+ font-weight: normal;
252
+ }
253
+
254
+ .div-btn {
255
+ margin-bottom: 30px;
256
+ }
257
+
258
+ .preview {
259
+ background-color: #fafafa;
260
+ padding-bottom: 20px;
261
+ border: 1px solid #e4e6ec;
262
+ height: 100%;
263
+ }
264
+
265
+ .toolbar {
266
+ height: 40px;
267
+ border-bottom: 1px hsl(0, 0%, 82.7%) solid;
268
+ overflow: hidden;
269
+ }
270
+
271
+ .icon-toolbar {
272
+ width: 20px;
273
+ font-size: 18px;
274
+ margin-left: 10px;
275
+ margin-top: 2px;
276
+ cursor: pointer;
277
+ display: inline-block;
278
+ }
279
+
280
+ .a4 {
281
+ max-width: 1200px;
282
+ padding: 20px;
283
+ border-radius: var(--ck-border-radius);
284
+ background: white;
285
+ box-shadow: 0 0 5px hsl(0deg 0% 0% / 10%);
286
+ margin: 0 auto;
287
+ }
288
+
289
+ .div-filter {
290
+ margin-bottom: -12px;
291
+ }
292
+
293
+ .div-filter-query {
294
+ margin-top: 10px;
295
+ }
296
+
297
+ .footer {
298
+ margin-bottom: 10px;
299
+ }
300
+
301
+ .icon-excel {
302
+ color: green;
303
+ }
304
+
305
+ .cancel {
306
+ color: red;
307
+ cursor: pointer;
308
+ }
309
+
310
+ .badge-default {
311
+ background-color: #eeeeee;
312
+ font-size: 13px !important;
313
+ }
314
+ </style>
@@ -0,0 +1,112 @@
1
+ <template>
2
+ <div>
3
+ <table class="table table-responsive-md">
4
+ <thead>
5
+ <tr>
6
+ <th v-for="(obj, ind) in header" :key="ind">
7
+ <div class="title-margem" :class="obj.classCssTitle" :style="obj.styleHeader">
8
+ <i class="fas fa-search" v-if="obj.iconSearch"></i>
9
+ <span class="title-header"> {{ obj.title }}</span>
10
+ </div>
11
+ </th>
12
+ </tr>
13
+ </thead>
14
+ <tbody>
15
+ <tr class="div-row" v-for="(row, index) in data" :key="index" :style="row.rowCss">
16
+ <td v-for="(obj, ind) in header" :key="ind">
17
+ <div :style="obj.styleBody" @click="sendEvent(obj.eventName, row)"
18
+ :class="convertClass(row[obj.fieldComparison], obj.classCssBody)">
19
+ {{ row[obj.field] }}
20
+ </div>
21
+ </td>
22
+ </tr>
23
+ </tbody>
24
+ <tbody v-show="data.length == 0">
25
+ <tr>
26
+ <td colspan="12">
27
+ <span>Nenhum registro encontrado!</span>
28
+ </td>
29
+ </tr>
30
+ </tbody>
31
+ </table>
32
+ </div>
33
+
34
+ </template>
35
+ <script>
36
+
37
+ import { mapMutations } from "vuex";
38
+
39
+ export default {
40
+ name: "ReportTable",
41
+ props: ["header", "data"],
42
+ methods: {
43
+ ...mapMutations("generic", ["addEvent"]),
44
+ convertClass(fieldComparison, classCssBody) {
45
+ if (Array.isArray(classCssBody)) {
46
+ let ret = [];
47
+ classCssBody.forEach(function (value) {
48
+ let classCss = value.classCss;
49
+ let condition = value.fieldComparison == fieldComparison;
50
+ let obj = { [classCss]: condition };
51
+ ret.push(obj);
52
+ });
53
+ return ret;
54
+ } else {
55
+ return classCssBody;
56
+ }
57
+ },
58
+ sendEvent(eventName, data) {
59
+ if (eventName) this.addEvent({ name: eventName, data: data });
60
+ }
61
+ },
62
+ }
63
+
64
+ </script>
65
+ <style scoped>
66
+ table tbody tr td {
67
+ max-width: 350px;
68
+ }
69
+
70
+ .table thead tr {
71
+ border-top: 1px solid black;
72
+ border-bottom: 1px solid black;
73
+ }
74
+
75
+ .table th,
76
+ .table td {
77
+ height: 10px !important;
78
+ padding-left: 0px !important;
79
+ padding-top: 0px !important;
80
+ padding-bottom: 0px !important;
81
+ padding-right: 5px !important;
82
+ border-bottom: 0px !important;
83
+ border-top: 0px !important;
84
+ font-size: 13px !important;
85
+ }
86
+
87
+ .title-header {
88
+ font-size: 12px;
89
+ color: #757d8c;
90
+ font-weight: 400;
91
+ text-transform: uppercase;
92
+ }
93
+
94
+ .table-number {
95
+ font-size: 12px;
96
+ font-weight: bold;
97
+ }
98
+
99
+ .table-main {
100
+ color: #757d8c;
101
+ max-width: 200px;
102
+ }
103
+
104
+ .table-currency {
105
+ font-size: 12px;
106
+ min-width: 100px;
107
+ }
108
+
109
+ .div-row {
110
+ border-bottom: 1px solid #D3D3D3;
111
+ }
112
+ </style>
@@ -0,0 +1,34 @@
1
+ <template>
2
+ <div>
3
+ <hr class="hr-report" />
4
+ <div class="text-right" v-for="item in totalization" :key="item.title">
5
+ <b-row>
6
+ <b-col sm="10">
7
+ <span>
8
+ <span class="title-report-header">
9
+ {{ item.title }} ..................
10
+ </span>
11
+ </span>
12
+ </b-col>
13
+ <b-col sm="2">
14
+ {{ item.value }}
15
+ </b-col>
16
+ </b-row>
17
+ </div>
18
+ </div>
19
+ </template>
20
+
21
+ <script>
22
+ export default {
23
+ name: "Totalization",
24
+ props: ["totalization"],
25
+
26
+ }
27
+
28
+ </script>
29
+ <style scoped>
30
+ .hr-report {
31
+ background: black !important;
32
+ height: 0px !important;
33
+ }
34
+ </style>
@@ -0,0 +1,128 @@
1
+ <template>
2
+ <div>
3
+ <div class="div-download title" @click="download">
4
+ <i class="fa-solid fa-download icon-download"></i>
5
+ <span class="title-download">Baixar</span>
6
+ </div>
7
+ <AceEditor v-model="code" lang="html" @init="editorInit" theme="monokai" width="100%" height="400px" :options="{
8
+ enableBasicAutocompletion: true,
9
+ enableLiveAutocompletion: true,
10
+ fontSize: 15,
11
+ highlightActiveLine: true,
12
+ enableSnippets: false,
13
+ showLineNumbers: true,
14
+ tabSize: 2,
15
+ showPrintMargin: false,
16
+ showGutter: true,
17
+ }" />
18
+ <div v-if="!editMode" class="apply">
19
+ <b-row>
20
+ <b-col class="text-right">
21
+ <Button key="applyCode" type="primary" title="Aplicar" classIcon="far fa-code" size="small"
22
+ :clicked="apply" />
23
+ </b-col>
24
+ </b-row>
25
+ </div>
26
+ </div>
27
+ </template>
28
+
29
+ <script>
30
+ import AceEditor from "vuejs-ace-editor";
31
+ import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
32
+
33
+ import { mapMutations, mapState } from "vuex";
34
+
35
+ export default {
36
+ name: "CodeEditor",
37
+ props: {
38
+ editMode: Boolean
39
+ },
40
+ components: {
41
+ AceEditor,
42
+ Button,
43
+ },
44
+ data() {
45
+ return {
46
+ code: "",
47
+ };
48
+ },
49
+ mounted() {
50
+ this.code = this.editMode ? this.documentHtmlFinal : this.documentHtml;
51
+ },
52
+ computed: {
53
+ ...mapState("generic", ["documentHtml", "documentHtmlFinal"]),
54
+ },
55
+ methods: {
56
+ ...mapMutations("generic", [
57
+ "updateDocumentHtml",
58
+ "updateDocumentHtmlFinal",
59
+ "hideModal",
60
+ "removeLoading",
61
+ ]),
62
+ apply() {
63
+ this.updateDocumentHtml(this.code);
64
+ this.hideModal("code");
65
+ this.removeLoading(["applyCode"]);
66
+ },
67
+ editorInit: function () {
68
+ require("brace/ext/language_tools"); //language extension prerequsite...
69
+ require("brace/mode/html");
70
+ require("brace/mode/javascript"); //language
71
+ require("brace/mode/less");
72
+ require("brace/theme/monokai");
73
+ require("brace/snippets/javascript"); //snippet
74
+ },
75
+ download() {
76
+ const blob = new Blob([this.code], { type: 'text/plain' });
77
+ const link = document.createElement('a');
78
+ link.href = URL.createObjectURL(blob);
79
+ link.download = 'arquivo.txt';
80
+ link.click();
81
+ URL.revokeObjectURL(link.href);
82
+ }
83
+ },
84
+ watch: {
85
+ code: {
86
+ handler(code) {
87
+ this.updateDocumentHtmlFinal(this.code);
88
+ },
89
+ deep: true,
90
+ },
91
+ documentHtml: {
92
+ handler(documentHtml) {
93
+ this.code = documentHtml;
94
+ },
95
+ deep: true,
96
+ },
97
+ documentHtmlFinal: {
98
+ handler(documentHtmlFinal) {
99
+ this.code = documentHtmlFinal;
100
+ },
101
+ deep: true,
102
+ },
103
+ },
104
+ };
105
+ </script>
106
+ <style scoped>
107
+ .apply {
108
+ margin-top: 10px;
109
+ }
110
+
111
+ .div-download {
112
+ cursor: pointer;
113
+ margin-bottom: 5px;
114
+ }
115
+
116
+ .title-download {
117
+ margin-left: 6px;
118
+ font-size: 14px;
119
+ }
120
+
121
+ .title-download:hover {
122
+ text-decoration: underline;
123
+ }
124
+
125
+ .icon-download {
126
+ font-size: 18px;
127
+ }
128
+ </style>