@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.
- package/package.json +1 -1
- package/src/App.vue +13 -0
- package/src/component/forms/Button.vue +163 -0
- package/src/component/forms/ButtonFilter.vue +75 -0
- package/src/component/forms/ButtonGroup.vue +67 -0
- package/src/component/forms/ButtonSub.vue +98 -0
- package/src/component/forms/ButtonToggle.vue +77 -0
- package/src/component/forms/CheckboxGroup.vue +69 -0
- package/src/component/forms/CheckboxServer.vue +192 -0
- package/src/component/forms/CheckboxSimple.vue +60 -0
- package/src/component/forms/Color.vue +38 -0
- package/src/component/forms/DateTime.vue +170 -0
- package/src/component/forms/DateYearMonth.vue +193 -0
- package/src/component/forms/Dropdown.vue +236 -0
- package/src/component/forms/EditorHtml.vue +132 -0
- package/src/component/forms/FileUpload.vue +170 -0
- package/src/component/forms/ImageUpload.vue +214 -0
- package/src/component/forms/IncrementDecrement.vue +148 -0
- package/src/component/forms/InputAddressGoogle.vue +171 -0
- package/src/component/forms/InputCallToAction.vue +135 -0
- package/src/component/forms/InputDecimal.vue +153 -0
- package/src/component/forms/InputDecimalDiscount.vue +78 -0
- package/src/component/forms/InputNumber.vue +160 -0
- package/src/component/forms/InputPassword.vue +148 -0
- package/src/component/forms/InputTag.vue +125 -0
- package/src/component/forms/InputText.vue +174 -0
- package/src/component/forms/InputTextEdit.vue +69 -0
- package/src/component/forms/InputWhatsApp.vue +48 -0
- package/src/component/forms/Modal.vue +57 -0
- package/src/component/forms/RadioGroup.vue +91 -0
- package/src/component/forms/Select.vue +378 -0
- package/src/component/forms/SelectStatic.vue +198 -0
- package/src/component/forms/SideBar.vue +100 -0
- package/src/component/forms/Slider.vue +18 -0
- package/src/component/forms/TextArea.vue +138 -0
- package/src/component/forms/Toggle.vue +72 -0
- package/src/component/layout/Account.vue +131 -0
- package/src/component/layout/Alert.vue +88 -0
- package/src/component/layout/Badge.vue +111 -0
- package/src/component/layout/BarFloating.vue +68 -0
- package/src/component/layout/FixedBar.vue +103 -0
- package/src/component/layout/Gantt.vue +128 -0
- package/src/component/layout/Header.vue +56 -0
- package/src/component/layout/HideShow.vue +62 -0
- package/src/component/layout/IconMolded.vue +59 -0
- package/src/component/layout/LoadingFullPage.vue +27 -0
- package/src/component/layout/Menu.vue +287 -0
- package/src/component/layout/Molded.vue +30 -0
- package/src/component/layout/NewAccount.vue +136 -0
- package/src/component/layout/NewHeader.vue +60 -0
- package/src/component/layout/NewIconMolded.vue +71 -0
- package/src/component/layout/NewMenu.vue +456 -0
- package/src/component/layout/Panel.vue +185 -0
- package/src/component/layout/Popover.vue +126 -0
- package/src/component/layout/ScrollBar.vue +57 -0
- package/src/component/layout/Tab.vue +135 -0
- package/src/component/layout/Tag.vue +97 -0
- package/src/component/layout/Wizard.vue +211 -0
- package/src/component/rental/DisplayCalculatePeriod.vue +49 -0
- package/src/component/rental/DisplayPeriodRent.vue +55 -0
- package/src/component/rental/DisplayTotalization.vue +86 -0
- package/src/component/report/Fields.vue +109 -0
- package/src/component/report/Report.vue +314 -0
- package/src/component/report/ReportTable.vue +112 -0
- package/src/component/report/Totalization.vue +34 -0
- package/src/component/shared/CodeEditor.vue +128 -0
- package/src/component/shared/Collapse.vue +131 -0
- package/src/component/shared/Confirmation.vue +74 -0
- package/src/component/shared/DocumentEditor.vue +99 -0
- package/src/component/shared/DocumentPreview.vue +81 -0
- package/src/component/shared/DocumentPublic.vue +33 -0
- package/src/component/shared/ExportExcel.vue +56 -0
- package/src/component/shared/ExportPDF.vue +116 -0
- package/src/component/shared/FullCalendar.vue +174 -0
- package/src/component/shared/HeaderReport.vue +47 -0
- package/src/component/shared/HorizontalFilter.vue +64 -0
- package/src/component/shared/ListNotifications.vue +70 -0
- package/src/component/shared/Loading.vue +107 -0
- package/src/component/shared/LoadingCard.vue +65 -0
- package/src/component/shared/LoadingMoreButton.vue +23 -0
- package/src/component/shared/Messages.vue +109 -0
- package/src/component/shared/PDFViewer.vue +24 -0
- package/src/component/shared/Pagination.vue +108 -0
- package/src/component/shared/ParameterLegend.vue +169 -0
- package/src/component/shared/ProgressBar.vue +25 -0
- package/src/component/shared/QueryButton.vue +66 -0
- package/src/component/shared/Report.vue +200 -0
- package/src/component/shared/SaveCancel.vue +99 -0
- package/src/component/shared/Search.vue +174 -0
- package/src/component/shared/SelectOption.vue +162 -0
- package/src/component/shared/Table.vue +174 -0
- package/src/component/shared/TableButton.vue +36 -0
- package/src/component/shared/TableDraggable.vue +117 -0
- package/src/component/shared/TableImport.vue +93 -0
- package/src/component/shared/TableItem.vue +214 -0
- package/src/component/shared/TableTotalPerPage.vue +78 -0
- package/src/component/shared/TableTotalRecords.vue +44 -0
- package/src/component/shared/TableTotalization.vue +47 -0
- package/src/component/shared/TimeLine.vue +42 -0
- package/src/component/shared/Timer.vue +78 -0
- package/src/component/shared/Tip.vue +42 -0
- package/src/component/shared/Toast.vue +69 -0
- package/src/component/shared/ToggleTheme.vue +128 -0
- package/src/component/shared/TotalizationReport.vue +86 -0
- package/src/component/shared/VerticalFilter.vue +97 -0
- package/src/component/shared/automation/ActivitiesList.vue +44 -0
- package/src/component/shared/automation/AddRule.vue +61 -0
- package/src/component/shared/automation/AutomationBuilder.vue +27 -0
- package/src/component/shared/automation/DynamicComponentList.vue +86 -0
- package/src/component/shared/automation/SelectRule.vue +98 -0
- package/src/component/shared/automation/components/BillingByRent.vue +98 -0
- package/src/component/shared/automation/components/SendEmail.vue +94 -0
- package/src/component/shared/file-manager/FileManager.vue +391 -0
- package/src/component/shared/filter-builder/FilterBuilder.vue +221 -0
- package/src/component/shared/filter-builder/FilterQuery.vue +94 -0
- package/src/component/shared/query-builder/AddRule.vue +203 -0
- package/src/component/shared/query-builder/ConvertToOdata.js +86 -0
- package/src/component/shared/query-builder/DynamicComponent.vue +161 -0
- package/src/component/shared/query-builder/DynamicComponentList.vue +70 -0
- package/src/component/shared/query-builder/Fields.vue +93 -0
- package/src/component/shared/query-builder/QueryBuilder.vue +69 -0
- package/src/component/shared/query-builder/Rules.vue +68 -0
- package/src/component/shared/query-builder/SelectRule.vue +97 -0
- package/src/component/shared/query-builder/Tags.vue +59 -0
- package/src/component/shared/query-builder/utilities.js +22 -0
- package/src/component/signature/Payment.vue +161 -0
- package/src/component/signature/Warning.vue +76 -0
- package/src/component/template/ListViewWithDataHandler.vue +429 -0
- package/src/component/template/ReportCreateUpdate.vue +110 -0
- package/src/component/template/ViewTemplateConfiguration.vue +64 -0
- package/src/component/template/ViewTemplateDocumentView.vue +213 -0
- package/src/component/template/ViewTemplateImportFile.vue +347 -0
- package/src/component/template/ViewTemplateReportList.vue +217 -0
- package/src/component/template/ViewTemplateReportPreview.vue +432 -0
- package/src/component/template/ViewTemplateSelectOption.vue +46 -0
- package/src/component/template/ViewTemplateWithSalveCancel.vue +32 -0
- package/src/component/template/ViewTemplateWithTable.vue +62 -0
- package/src/component/template/model/Report.js +6 -0
- package/src/component/training/Course.vue +344 -0
- package/src/component/training/CourseView.vue +190 -0
- package/src/component/value-objects/Address.js +11 -0
- package/src/component/value-objects/Address.vue +157 -0
- package/src/component/value-objects/Contact.js +7 -0
- package/src/component/value-objects/Contact.vue +106 -0
- package/src/component/value-objects/Person.js +10 -0
- package/src/component/value-objects/Person.vue +129 -0
- package/src/config/axios.js +9 -0
- package/src/config/dicas.js +15 -0
- package/src/config/router.js +14 -0
- package/src/config/token.js +15 -0
- package/src/main.js +23 -0
- package/src/store/modules/automation.js +31 -0
- package/src/store/modules/generic.js +816 -0
- package/src/store/modules/report.js +278 -0
- package/src/store/modules/user.js +67 -0
- package/src/store/modules/util.js +26 -0
- package/src/store/modules/validation.js +39 -0
- package/src/store/store.js +14 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class="line-arrow" v-if="type == 'arrow'">
|
|
4
|
+
<div class="arrow" @click="show" v-if="!showCollapse">
|
|
5
|
+
<b-row>
|
|
6
|
+
<b-col sm="6" class="text-left">
|
|
7
|
+
<span class="title">{{ title }}</span>
|
|
8
|
+
</b-col>
|
|
9
|
+
<b-col sm="6" class="text-right">
|
|
10
|
+
<i class="far fa-plus"></i>
|
|
11
|
+
</b-col>
|
|
12
|
+
</b-row>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="arrow" @click="hide" v-if="showCollapse">
|
|
15
|
+
<b-row>
|
|
16
|
+
<b-col sm="6" class="text-left">
|
|
17
|
+
<span class="title">{{ title }}</span>
|
|
18
|
+
</b-col>
|
|
19
|
+
<b-col sm="6" class="text-right">
|
|
20
|
+
<i class="far fa-minus"></i>
|
|
21
|
+
</b-col>
|
|
22
|
+
</b-row>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
<b-collapse id="collapse-4" v-model="showCollapse" class="mt-2">
|
|
26
|
+
<slot></slot>
|
|
27
|
+
</b-collapse>
|
|
28
|
+
<div v-if="type == 'button'">
|
|
29
|
+
<b-row>
|
|
30
|
+
<b-col sm="12">
|
|
31
|
+
<div class="text-center">
|
|
32
|
+
<Button
|
|
33
|
+
v-if="!showCollapse"
|
|
34
|
+
:title="buttonShow.title"
|
|
35
|
+
:classIcon="buttonShow.icon"
|
|
36
|
+
:type="buttonShow.type"
|
|
37
|
+
size="small"
|
|
38
|
+
:clicked="show"
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
</b-col>
|
|
42
|
+
</b-row>
|
|
43
|
+
<b-row>
|
|
44
|
+
<b-col>
|
|
45
|
+
<div class="text-center">
|
|
46
|
+
<Button
|
|
47
|
+
v-if="showCollapse"
|
|
48
|
+
key="hideCollapse"
|
|
49
|
+
:title="buttonHide.title"
|
|
50
|
+
:classIcon="buttonHide.icon"
|
|
51
|
+
:type="buttonHide.type"
|
|
52
|
+
size="small"
|
|
53
|
+
:clicked="hide"
|
|
54
|
+
/>
|
|
55
|
+
</div>
|
|
56
|
+
</b-col>
|
|
57
|
+
</b-row>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</template>
|
|
61
|
+
|
|
62
|
+
<script>
|
|
63
|
+
import Button from "../forms/Button.vue";
|
|
64
|
+
|
|
65
|
+
import { mapMutations } from "vuex";
|
|
66
|
+
|
|
67
|
+
export default {
|
|
68
|
+
components: { Button },
|
|
69
|
+
name: "Collapse",
|
|
70
|
+
props: {
|
|
71
|
+
buttonShow: Object,
|
|
72
|
+
buttonHide: Object,
|
|
73
|
+
type: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: "button",
|
|
76
|
+
},
|
|
77
|
+
title: String,
|
|
78
|
+
startOpen: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
default: false,
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
data() {
|
|
84
|
+
return {
|
|
85
|
+
showCollapse: false,
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
created() {
|
|
89
|
+
this.showCollapse = this.startOpen;
|
|
90
|
+
},
|
|
91
|
+
methods: {
|
|
92
|
+
...mapMutations("generic", ["removeLoading"]),
|
|
93
|
+
show() {
|
|
94
|
+
let self = this;
|
|
95
|
+
setTimeout(function () {
|
|
96
|
+
self.showCollapse = true;
|
|
97
|
+
}, 200);
|
|
98
|
+
this.removeLoadingButton();
|
|
99
|
+
},
|
|
100
|
+
hide() {
|
|
101
|
+
let self = this;
|
|
102
|
+
setTimeout(function () {
|
|
103
|
+
self.showCollapse = false;
|
|
104
|
+
}, 200);
|
|
105
|
+
this.removeLoadingButton();
|
|
106
|
+
},
|
|
107
|
+
removeLoadingButton() {
|
|
108
|
+
this.removeLoading(["showCollapse", "hideCollapse"]);
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
</script>
|
|
113
|
+
<style scoped>
|
|
114
|
+
.arrow {
|
|
115
|
+
font-size: 14px;
|
|
116
|
+
color: #577696;
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
margin-bottom: 10px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.title {
|
|
122
|
+
font-size: 16px;
|
|
123
|
+
margin-left: 5px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.line-arrow {
|
|
127
|
+
border-top: solid 1px #dbdfe9;
|
|
128
|
+
margin-top: 10px;
|
|
129
|
+
padding-top: 10px;
|
|
130
|
+
}
|
|
131
|
+
</style>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div @click="execute()">
|
|
4
|
+
<slot></slot>
|
|
5
|
+
</div>
|
|
6
|
+
<Modal v-if="isModal" :title="title" :width="450" :height="250" v-show="showModal(`confirmation${data.id}`)">
|
|
7
|
+
<b-col sm="12">
|
|
8
|
+
<div class="div-button text-center">
|
|
9
|
+
<Button key="notConfirm" type="edit" title="cancel" :disabled="disabled" size="small" :clicked="cancel" />
|
|
10
|
+
<Button key="confirm" :type="type" title="Sim, confirmar" size="medium" :disabled="disabled"
|
|
11
|
+
:clicked="confirm" />
|
|
12
|
+
</div>
|
|
13
|
+
</b-col>
|
|
14
|
+
</Modal>
|
|
15
|
+
<div v-else class="div-button text-center">
|
|
16
|
+
<Button _key="notConfirm" type="edit" title="cancel" size="small" :disabled="disabled" :clicked="cancel" />
|
|
17
|
+
<Button _key="confirm" :type="type" title="Sim, confirmar" size="medium" :disabled="disabled" :clicked="confirm" />
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
|
|
24
|
+
import Modal from "@nixweb/nixloc-ui/src/component/forms/Modal";
|
|
25
|
+
|
|
26
|
+
import { mapGetters, mapMutations } from "vuex";
|
|
27
|
+
|
|
28
|
+
export default {
|
|
29
|
+
name: "Confirmation",
|
|
30
|
+
components: {
|
|
31
|
+
Button,
|
|
32
|
+
Modal,
|
|
33
|
+
},
|
|
34
|
+
props: {
|
|
35
|
+
title: String,
|
|
36
|
+
type: String,
|
|
37
|
+
data: Object,
|
|
38
|
+
isModal: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: true,
|
|
41
|
+
},
|
|
42
|
+
disabled: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false,
|
|
45
|
+
},
|
|
46
|
+
confirmed: Function,
|
|
47
|
+
},
|
|
48
|
+
methods: {
|
|
49
|
+
...mapMutations("generic", ["openModal", "hideModal", "removeLoading"]),
|
|
50
|
+
execute() {
|
|
51
|
+
this.openModal(`confirmation${this.data.id}`);
|
|
52
|
+
},
|
|
53
|
+
confirm() {
|
|
54
|
+
let self = this;
|
|
55
|
+
setTimeout(function () {
|
|
56
|
+
if (self.confirmed) self.confirmed(self.data);
|
|
57
|
+
}, 200);
|
|
58
|
+
},
|
|
59
|
+
cancel() {
|
|
60
|
+
this.removeLoading(["notConfirm"]);
|
|
61
|
+
this.hideModal();
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
computed: {
|
|
65
|
+
...mapGetters("generic", ["showModal", "event"]),
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
</script>
|
|
69
|
+
<style scoped>
|
|
70
|
+
.div-button {
|
|
71
|
+
padding-top: 20px;
|
|
72
|
+
height: 100px;
|
|
73
|
+
}
|
|
74
|
+
</style>
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class="form-group">
|
|
4
|
+
<div>
|
|
5
|
+
<div class="document-editor__toolbar"></div>
|
|
6
|
+
<div class="document-editor__editable-container">
|
|
7
|
+
<div id="template-dev">
|
|
8
|
+
<ckeditor :editor="editor" v-model="computedDocumentHtml" @ready="onReady" @focus="changed"></ckeditor>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
<br />
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
import CKEditor from "ckeditor5-custom-build/build/ckeditor";
|
|
19
|
+
import { mapState, mapMutations } from "vuex";
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
name: "DocumentEditor",
|
|
23
|
+
props: ["editMode"],
|
|
24
|
+
components: {
|
|
25
|
+
CKEditor,
|
|
26
|
+
},
|
|
27
|
+
data() {
|
|
28
|
+
return {
|
|
29
|
+
editor: CKEditor,
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
computed: {
|
|
33
|
+
...mapState("generic", ["documentHtml", "documentHtmlFinal"]),
|
|
34
|
+
computedDocumentHtml: {
|
|
35
|
+
get() {
|
|
36
|
+
if (this.editMode) {
|
|
37
|
+
return this.documentHtmlFinal
|
|
38
|
+
} else {
|
|
39
|
+
return this.documentHtml;
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
set(newValue) {
|
|
43
|
+
if (this.editMode) {
|
|
44
|
+
this.updateDocumentHtmlFinal(newValue);
|
|
45
|
+
} else {
|
|
46
|
+
this.updateDocumentHtml(newValue);
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
methods: {
|
|
52
|
+
...mapMutations("generic", ["updateDocumentHtmlFinal", "updateDocumentHtml", "addEvent"]),
|
|
53
|
+
onReady(editor) {
|
|
54
|
+
const toolbarContainer = document.querySelector(".document-editor__toolbar");
|
|
55
|
+
toolbarContainer.appendChild(editor.ui.view.toolbar.element);
|
|
56
|
+
},
|
|
57
|
+
changed() {
|
|
58
|
+
this.addEvent({ name: "documentEditorChanged" });
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<style scoped>
|
|
65
|
+
/* Estilos do seu componente */
|
|
66
|
+
.document-editor {
|
|
67
|
+
border-radius: var(--ck-border-radius);
|
|
68
|
+
max-height: 700px;
|
|
69
|
+
display: flex;
|
|
70
|
+
flex-flow: column nowrap;
|
|
71
|
+
margin: auto !important;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.document-editor__toolbar {
|
|
75
|
+
z-index: 1 !important;
|
|
76
|
+
min-width: 1100px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.document-editor__editable-container {
|
|
80
|
+
padding: 10px;
|
|
81
|
+
border: 1px solid #e4e6ec;
|
|
82
|
+
background: var(--ck-color-base-foreground);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.document-editor__editable-container .ck-editor__editable {
|
|
86
|
+
width: 26cm;
|
|
87
|
+
height: 700px;
|
|
88
|
+
padding: 20px;
|
|
89
|
+
border: 1px hsl(0, 0%, 82.7%) solid;
|
|
90
|
+
border-radius: var(--ck-border-radius);
|
|
91
|
+
background: white;
|
|
92
|
+
box-shadow: 0 0 5px hsla(0, 0%, 0%, 0.1);
|
|
93
|
+
margin: 0 auto;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.document-editor .ck-content {
|
|
97
|
+
font: 16px/1.6 "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
98
|
+
}
|
|
99
|
+
</style>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div ref='preview'>
|
|
4
|
+
<v-runtime-template :template="`<div>${template}</div>`" />
|
|
5
|
+
</div>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
import VRuntimeTemplate from "v-runtime-template";
|
|
11
|
+
|
|
12
|
+
import { mapGetters, mapMutations } from "vuex";
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
name: "DocumentPreview",
|
|
16
|
+
components: {
|
|
17
|
+
VRuntimeTemplate,
|
|
18
|
+
},
|
|
19
|
+
props: {
|
|
20
|
+
template: String,
|
|
21
|
+
d: Object,
|
|
22
|
+
},
|
|
23
|
+
methods: {
|
|
24
|
+
...mapMutations("generic", ["updateDocumentHtmlFinal"]),
|
|
25
|
+
periodo(grupo, campo) {
|
|
26
|
+
var item = this.d.itensLocacao.find(item => item.grupo == grupo);
|
|
27
|
+
const campoMap = {
|
|
28
|
+
"dataEntrega": item.dataEntrega,
|
|
29
|
+
"horaEntrega": item.horaEntrega,
|
|
30
|
+
"dataInicio": item.dataInicio,
|
|
31
|
+
"horaInicio": item.horaInicio,
|
|
32
|
+
"dataFim": item.dataFim,
|
|
33
|
+
"horaFim": item.horaFim,
|
|
34
|
+
"dataRetirada": item.dataRetirada,
|
|
35
|
+
"horaRetirada": item.horaRetirada,
|
|
36
|
+
"ano": item.ano,
|
|
37
|
+
"mes": item.mes,
|
|
38
|
+
"dia": item.dia,
|
|
39
|
+
"hora": item.hora,
|
|
40
|
+
"minuto": item.minuto
|
|
41
|
+
};
|
|
42
|
+
return campoMap[campo];
|
|
43
|
+
},
|
|
44
|
+
somaGrupo(grupo) {
|
|
45
|
+
let sum = [];
|
|
46
|
+
this.d.itensLocacao.forEach((item) => {
|
|
47
|
+
if (item.grupo === grupo) {
|
|
48
|
+
sum.push(item.totalValue);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return sum.reduce((a, b) => a + b, 0);
|
|
52
|
+
},
|
|
53
|
+
convertToNumber(value) {
|
|
54
|
+
return parseFloat(value.replace("R$", "").replace(",", "."));
|
|
55
|
+
},
|
|
56
|
+
getPreviewContent() {
|
|
57
|
+
const previewDiv = this.$refs.preview;
|
|
58
|
+
this.updateDocumentHtmlFinal(previewDiv.innerHTML);
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
computed: {
|
|
62
|
+
...mapGetters("generic", ["groupBy", "event"]),
|
|
63
|
+
produtoAgrupado() {
|
|
64
|
+
var group = this.groupBy({ array: this.d.itensLocacao, key: "grupo" });
|
|
65
|
+
return group;
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
watch: {
|
|
69
|
+
event: {
|
|
70
|
+
handler(event) {
|
|
71
|
+
if (event.name == "updateDocumentHtml") {
|
|
72
|
+
this.getPreviewContent();
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
deep: true,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
};
|
|
81
|
+
</script>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="main">
|
|
3
|
+
<div class="content">
|
|
4
|
+
<DocumentPreview :template="template" :d="d" />
|
|
5
|
+
</div>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
<script>
|
|
9
|
+
import DocumentPreview from "@nixweb/nixloc-ui/src/component/shared/DocumentPreview.vue";
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
name: "DocumentPublic",
|
|
13
|
+
components: {
|
|
14
|
+
DocumentPreview,
|
|
15
|
+
},
|
|
16
|
+
props: {
|
|
17
|
+
template: String,
|
|
18
|
+
d: Object,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<style scoped>
|
|
24
|
+
.main {
|
|
25
|
+
background-color: white;
|
|
26
|
+
min-height: 900px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.content {
|
|
30
|
+
width: 1042px;
|
|
31
|
+
margin: auto;
|
|
32
|
+
}
|
|
33
|
+
</style>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<download-excel :fields="column" :data="data" :before-finish="exportFinished" worksheet="Planilha"
|
|
4
|
+
:name="`${nameFile}.xls`">
|
|
5
|
+
<i class="fas fa-file-excel"></i>
|
|
6
|
+
</download-excel>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
|
|
12
|
+
|
|
13
|
+
import { mapMutations } from "vuex";
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
name: "ExportExcel",
|
|
17
|
+
props: {
|
|
18
|
+
header: Array,
|
|
19
|
+
data: Array,
|
|
20
|
+
nameFile: String
|
|
21
|
+
},
|
|
22
|
+
components: {
|
|
23
|
+
Button,
|
|
24
|
+
},
|
|
25
|
+
data() {
|
|
26
|
+
return {
|
|
27
|
+
json_meta: [
|
|
28
|
+
[
|
|
29
|
+
{
|
|
30
|
+
key: "charset",
|
|
31
|
+
value: "utf-8",
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
methods: {
|
|
38
|
+
...mapMutations("generic", ["removeLoading"]),
|
|
39
|
+
exportFinished() {
|
|
40
|
+
this.removeLoading(["exportExcel"]);
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
computed: {
|
|
44
|
+
column() {
|
|
45
|
+
var object = this.header.reduce(
|
|
46
|
+
(obj, item) => Object.assign(obj, { [item.title]: item.field }),
|
|
47
|
+
{}
|
|
48
|
+
);
|
|
49
|
+
return object;
|
|
50
|
+
},
|
|
51
|
+
fileName() {
|
|
52
|
+
return this.nameFile;
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
</script>
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div v-show="carregando" class="full-width">
|
|
4
|
+
<Loading
|
|
5
|
+
:center="true"
|
|
6
|
+
:width="70"
|
|
7
|
+
:height="70"
|
|
8
|
+
message="Por favor aguarde, estamos gerando a impressão..."
|
|
9
|
+
/>
|
|
10
|
+
</div>
|
|
11
|
+
<vue-html2pdf
|
|
12
|
+
:show-layout="false"
|
|
13
|
+
:float-layout="false"
|
|
14
|
+
:enable-download="false"
|
|
15
|
+
:preview-modal="true"
|
|
16
|
+
:paginate-elements-by-height="1400"
|
|
17
|
+
:filename="fileName"
|
|
18
|
+
:pdf-quality="2"
|
|
19
|
+
:manual-pagination="false"
|
|
20
|
+
:pdf-format="tamanhoPagina"
|
|
21
|
+
:pdf-orientation="orientacao"
|
|
22
|
+
pdf-content-width="100%"
|
|
23
|
+
@progress="onProgress($event)"
|
|
24
|
+
@hasStartedGeneration="hasStartedGeneration()"
|
|
25
|
+
@hasGenerated="hasGenerated($event)"
|
|
26
|
+
ref="html2Pdf"
|
|
27
|
+
:html-to-pdf-options="htmlToPdfOptions"
|
|
28
|
+
>
|
|
29
|
+
<section slot="pdf-content">
|
|
30
|
+
<section class="pdf-item">
|
|
31
|
+
<ScrollBar :height="alturaBarraRolagem">
|
|
32
|
+
<div id="height">
|
|
33
|
+
<slot></slot>
|
|
34
|
+
</div>
|
|
35
|
+
</ScrollBar>
|
|
36
|
+
</section>
|
|
37
|
+
</section>
|
|
38
|
+
</vue-html2pdf>
|
|
39
|
+
<br />
|
|
40
|
+
<b-row
|
|
41
|
+
><b-col sm="12" class="text-right">
|
|
42
|
+
<button @click="gerarRelatorio()">gerar</button></b-col
|
|
43
|
+
></b-row
|
|
44
|
+
>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script>
|
|
49
|
+
import Loading from "./Loading.vue";
|
|
50
|
+
import ScrollBar from "../layout/Scrollbar.vue";
|
|
51
|
+
import VueHtml2pdf from "vue-html2pdf";
|
|
52
|
+
|
|
53
|
+
export default {
|
|
54
|
+
name: "ExportPDF",
|
|
55
|
+
components: { VueHtml2pdf, ScrollBar, Loading },
|
|
56
|
+
props: {
|
|
57
|
+
title: String,
|
|
58
|
+
fileName: String,
|
|
59
|
+
tamanhoPagina: String,
|
|
60
|
+
orientacao: String,
|
|
61
|
+
larguraImpressao: Number,
|
|
62
|
+
},
|
|
63
|
+
data() {
|
|
64
|
+
return {
|
|
65
|
+
alturaBarraRolagem: 450,
|
|
66
|
+
carregando: false,
|
|
67
|
+
htmlToPdfOptions: {
|
|
68
|
+
margin: [5, 3, 5, 3],
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
methods: {
|
|
73
|
+
onProgress(event) {
|
|
74
|
+
if (event == 100) {
|
|
75
|
+
this.alturaBarraRolagem = 450;
|
|
76
|
+
this.carregando = false;
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
hasStartedGeneration() {
|
|
80
|
+
console.log("começou");
|
|
81
|
+
},
|
|
82
|
+
hasDownloaded() {
|
|
83
|
+
console.log("finalizou");
|
|
84
|
+
},
|
|
85
|
+
gerarRelatorio() {
|
|
86
|
+
const listElm = document.querySelector("#height");
|
|
87
|
+
this.alturaBarraRolagem = listElm.scrollHeight;
|
|
88
|
+
this.carregando = true;
|
|
89
|
+
let self = this;
|
|
90
|
+
setTimeout(function () {
|
|
91
|
+
self.$refs.html2Pdf.generatePdf();
|
|
92
|
+
}, 1000);
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
</script>
|
|
97
|
+
|
|
98
|
+
<style scoped>
|
|
99
|
+
.button {
|
|
100
|
+
margin-bottom: 20px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.title {
|
|
104
|
+
font-size: 20px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.full-width {
|
|
108
|
+
position: fixed;
|
|
109
|
+
width: 100%;
|
|
110
|
+
height: 100%;
|
|
111
|
+
left: 0;
|
|
112
|
+
top: 0;
|
|
113
|
+
background: white;
|
|
114
|
+
z-index: 99999;
|
|
115
|
+
}
|
|
116
|
+
</style>
|