@nixweb/nixloc-ui 1.17.0 → 1.19.0
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/.github/workflows/publish-npm.yml +32 -32
- package/@nixweb/nixloc-ui/.github/workflows/publish-npm.yml +32 -32
- package/@nixweb/nixloc-ui/README.md +24 -24
- package/@nixweb/nixloc-ui/babel.config.js +5 -5
- package/@nixweb/nixloc-ui/config/dev.env.js +8 -8
- package/@nixweb/nixloc-ui/config/index.js +69 -69
- package/@nixweb/nixloc-ui/config/prod.env.js +5 -5
- package/@nixweb/nixloc-ui/docs/src/component/template/ViewTemplateReportPreview.drawio +209 -209
- package/@nixweb/nixloc-ui/docs/src/store/modulos/relatorio.drawio +36 -36
- package/@nixweb/nixloc-ui/package.json +88 -88
- package/@nixweb/nixloc-ui/public/index.html +19 -19
- package/@nixweb/nixloc-ui/public/styles/app.css +52 -52
- package/@nixweb/nixloc-ui/src/App.vue +13 -13
- package/@nixweb/nixloc-ui/src/component/forms/Button.vue +163 -163
- package/@nixweb/nixloc-ui/src/component/forms/ButtonFilter.vue +74 -74
- package/@nixweb/nixloc-ui/src/component/forms/ButtonGroup.vue +66 -66
- package/@nixweb/nixloc-ui/src/component/forms/ButtonSub.vue +97 -97
- package/@nixweb/nixloc-ui/src/component/forms/ButtonToggle.vue +76 -76
- package/@nixweb/nixloc-ui/src/component/forms/CheckboxGroup.vue +69 -69
- package/@nixweb/nixloc-ui/src/component/forms/CheckboxServer.vue +192 -192
- package/@nixweb/nixloc-ui/src/component/forms/CheckboxSimple.vue +60 -60
- package/@nixweb/nixloc-ui/src/component/forms/Color.vue +38 -38
- package/@nixweb/nixloc-ui/src/component/forms/DateTime.vue +170 -170
- package/@nixweb/nixloc-ui/src/component/forms/DateYearMonth.vue +193 -193
- package/@nixweb/nixloc-ui/src/component/forms/Dropdown.vue +236 -236
- package/@nixweb/nixloc-ui/src/component/forms/EditorHtml.vue +132 -132
- package/@nixweb/nixloc-ui/src/component/forms/FileUpload.vue +170 -170
- package/@nixweb/nixloc-ui/src/component/forms/ImageUpload.vue +214 -214
- package/@nixweb/nixloc-ui/src/component/forms/IncrementDecrement.vue +148 -148
- package/@nixweb/nixloc-ui/src/component/forms/InputAddressGoogle.vue +171 -171
- package/@nixweb/nixloc-ui/src/component/forms/InputCallToAction.vue +135 -135
- package/@nixweb/nixloc-ui/src/component/forms/InputDecimal.vue +153 -153
- package/@nixweb/nixloc-ui/src/component/forms/InputDecimalDiscount.vue +77 -77
- package/@nixweb/nixloc-ui/src/component/forms/InputNumber.vue +160 -160
- package/@nixweb/nixloc-ui/src/component/forms/InputPassword.vue +148 -148
- package/@nixweb/nixloc-ui/src/component/forms/InputTag.vue +124 -124
- package/@nixweb/nixloc-ui/src/component/forms/InputText.vue +174 -174
- package/@nixweb/nixloc-ui/src/component/forms/InputTextEdit.vue +69 -69
- package/@nixweb/nixloc-ui/src/component/forms/InputWhatsApp.vue +47 -47
- package/@nixweb/nixloc-ui/src/component/forms/Modal.vue +57 -57
- package/@nixweb/nixloc-ui/src/component/forms/RadioGroup.vue +91 -91
- package/@nixweb/nixloc-ui/src/component/forms/Select.vue +378 -378
- package/@nixweb/nixloc-ui/src/component/forms/SelectStatic.vue +198 -198
- package/@nixweb/nixloc-ui/src/component/forms/SideBar.vue +99 -99
- package/@nixweb/nixloc-ui/src/component/forms/Slider.vue +18 -18
- package/@nixweb/nixloc-ui/src/component/forms/TextArea.vue +138 -138
- package/@nixweb/nixloc-ui/src/component/forms/Toggle.vue +72 -72
- package/@nixweb/nixloc-ui/src/component/layout/Account.vue +131 -131
- package/@nixweb/nixloc-ui/src/component/layout/Alert.vue +88 -88
- package/@nixweb/nixloc-ui/src/component/layout/Badge.vue +111 -111
- package/@nixweb/nixloc-ui/src/component/layout/BarFloating.vue +67 -67
- package/@nixweb/nixloc-ui/src/component/layout/FixedBar.vue +103 -103
- package/@nixweb/nixloc-ui/src/component/layout/Gantt.vue +128 -128
- package/@nixweb/nixloc-ui/src/component/layout/Header.vue +56 -56
- package/@nixweb/nixloc-ui/src/component/layout/HideShow.vue +61 -61
- package/@nixweb/nixloc-ui/src/component/layout/IconMolded.vue +58 -58
- package/@nixweb/nixloc-ui/src/component/layout/LoadingFullPage.vue +27 -27
- package/@nixweb/nixloc-ui/src/component/layout/Menu.vue +287 -287
- package/@nixweb/nixloc-ui/src/component/layout/Molded.vue +30 -30
- package/@nixweb/nixloc-ui/src/component/layout/NewAccount.vue +136 -136
- package/@nixweb/nixloc-ui/src/component/layout/NewHeader.vue +59 -59
- package/@nixweb/nixloc-ui/src/component/layout/NewIconMolded.vue +70 -70
- package/@nixweb/nixloc-ui/src/component/layout/NewMenu.vue +455 -455
- package/@nixweb/nixloc-ui/src/component/layout/Panel.vue +185 -185
- package/@nixweb/nixloc-ui/src/component/layout/Popover.vue +126 -126
- package/@nixweb/nixloc-ui/src/component/layout/ScrollBar.vue +57 -57
- package/@nixweb/nixloc-ui/src/component/layout/Tab.vue +135 -135
- package/@nixweb/nixloc-ui/src/component/layout/Tag.vue +97 -97
- package/@nixweb/nixloc-ui/src/component/layout/Wizard.vue +211 -211
- package/@nixweb/nixloc-ui/src/component/rental/DisplayCalculatePeriod.vue +48 -48
- package/@nixweb/nixloc-ui/src/component/rental/DisplayPeriodRent.vue +55 -55
- package/@nixweb/nixloc-ui/src/component/rental/DisplayTotalization.vue +86 -86
- package/@nixweb/nixloc-ui/src/component/report/Fields.vue +108 -108
- package/@nixweb/nixloc-ui/src/component/report/Report.vue +313 -313
- package/@nixweb/nixloc-ui/src/component/report/ReportTable.vue +111 -111
- package/@nixweb/nixloc-ui/src/component/report/Totalization.vue +33 -33
- package/@nixweb/nixloc-ui/src/component/shared/CodeEditor.vue +128 -128
- package/@nixweb/nixloc-ui/src/component/shared/Collapse.vue +131 -131
- package/@nixweb/nixloc-ui/src/component/shared/Confirmation.vue +74 -74
- package/@nixweb/nixloc-ui/src/component/shared/DocumentEditor.vue +99 -99
- package/@nixweb/nixloc-ui/src/component/shared/DocumentPreview.vue +81 -81
- package/@nixweb/nixloc-ui/src/component/shared/DocumentPublic.vue +33 -33
- package/@nixweb/nixloc-ui/src/component/shared/ExportExcel.vue +56 -56
- package/@nixweb/nixloc-ui/src/component/shared/ExportPDF.vue +116 -116
- package/@nixweb/nixloc-ui/src/component/shared/FullCalendar.vue +173 -173
- package/@nixweb/nixloc-ui/src/component/shared/HeaderReport.vue +47 -47
- package/@nixweb/nixloc-ui/src/component/shared/HorizontalFilter.vue +64 -64
- package/@nixweb/nixloc-ui/src/component/shared/ListNotifications.vue +70 -70
- package/@nixweb/nixloc-ui/src/component/shared/Loading.vue +107 -107
- package/@nixweb/nixloc-ui/src/component/shared/LoadingCard.vue +64 -64
- package/@nixweb/nixloc-ui/src/component/shared/LoadingMoreButton.vue +23 -23
- package/@nixweb/nixloc-ui/src/component/shared/Messages.vue +109 -109
- package/@nixweb/nixloc-ui/src/component/shared/PDFViewer.vue +24 -24
- package/@nixweb/nixloc-ui/src/component/shared/Pagination.vue +108 -108
- package/@nixweb/nixloc-ui/src/component/shared/ParameterLegend.vue +169 -169
- package/@nixweb/nixloc-ui/src/component/shared/ProgressBar.vue +25 -25
- package/@nixweb/nixloc-ui/src/component/shared/QueryButton.vue +66 -66
- package/@nixweb/nixloc-ui/src/component/shared/Report.vue +200 -200
- package/@nixweb/nixloc-ui/src/component/shared/SaveCancel.vue +99 -99
- package/@nixweb/nixloc-ui/src/component/shared/Search.vue +174 -174
- package/@nixweb/nixloc-ui/src/component/shared/SelectOption.vue +162 -162
- package/@nixweb/nixloc-ui/src/component/shared/Table.vue +174 -174
- package/@nixweb/nixloc-ui/src/component/shared/TableButton.vue +36 -36
- package/@nixweb/nixloc-ui/src/component/shared/TableDraggable.vue +117 -117
- package/@nixweb/nixloc-ui/src/component/shared/TableImport.vue +93 -93
- package/@nixweb/nixloc-ui/src/component/shared/TableItem.vue +214 -214
- package/@nixweb/nixloc-ui/src/component/shared/TableTotalPerPage.vue +77 -77
- package/@nixweb/nixloc-ui/src/component/shared/TableTotalRecords.vue +44 -44
- package/@nixweb/nixloc-ui/src/component/shared/TableTotalization.vue +47 -47
- package/@nixweb/nixloc-ui/src/component/shared/TimeLine.vue +41 -41
- package/@nixweb/nixloc-ui/src/component/shared/Timer.vue +77 -77
- package/@nixweb/nixloc-ui/src/component/shared/Tip.vue +42 -42
- package/@nixweb/nixloc-ui/src/component/shared/Toast.vue +69 -69
- package/@nixweb/nixloc-ui/src/component/shared/ToggleTheme.vue +127 -127
- package/@nixweb/nixloc-ui/src/component/shared/TotalizationReport.vue +86 -86
- package/@nixweb/nixloc-ui/src/component/shared/VerticalFilter.vue +97 -97
- package/@nixweb/nixloc-ui/src/component/shared/automation/ActivitiesList.vue +43 -43
- package/@nixweb/nixloc-ui/src/component/shared/automation/AddRule.vue +60 -60
- package/@nixweb/nixloc-ui/src/component/shared/automation/AutomationBuilder.vue +26 -26
- package/@nixweb/nixloc-ui/src/component/shared/automation/DynamicComponentList.vue +85 -85
- package/@nixweb/nixloc-ui/src/component/shared/automation/SelectRule.vue +97 -97
- package/@nixweb/nixloc-ui/src/component/shared/automation/components/BillingByRent.vue +97 -97
- package/@nixweb/nixloc-ui/src/component/shared/automation/components/SendEmail.vue +93 -93
- package/@nixweb/nixloc-ui/src/component/shared/file-manager/FileManager.vue +390 -390
- package/@nixweb/nixloc-ui/src/component/shared/filter-builder/FilterBuilder.vue +220 -220
- package/@nixweb/nixloc-ui/src/component/shared/filter-builder/FilterQuery.vue +94 -94
- package/@nixweb/nixloc-ui/src/component/shared/query-builder/AddRule.vue +203 -203
- package/@nixweb/nixloc-ui/src/component/shared/query-builder/ConvertToOdata.js +86 -86
- package/@nixweb/nixloc-ui/src/component/shared/query-builder/DynamicComponent.vue +161 -161
- package/@nixweb/nixloc-ui/src/component/shared/query-builder/DynamicComponentList.vue +70 -70
- package/@nixweb/nixloc-ui/src/component/shared/query-builder/Fields.vue +93 -93
- package/@nixweb/nixloc-ui/src/component/shared/query-builder/QueryBuilder.vue +69 -69
- package/@nixweb/nixloc-ui/src/component/shared/query-builder/Rules.vue +68 -68
- package/@nixweb/nixloc-ui/src/component/shared/query-builder/SelectRule.vue +97 -97
- package/@nixweb/nixloc-ui/src/component/shared/query-builder/Tags.vue +59 -59
- package/@nixweb/nixloc-ui/src/component/shared/query-builder/utilities.js +21 -21
- package/@nixweb/nixloc-ui/src/component/signature/Payment.vue +160 -160
- package/@nixweb/nixloc-ui/src/component/signature/Warning.vue +75 -75
- package/@nixweb/nixloc-ui/src/component/template/ListViewWithDataHandler.vue +429 -429
- package/@nixweb/nixloc-ui/src/component/template/ReportCreateUpdate.vue +110 -110
- package/@nixweb/nixloc-ui/src/component/template/ViewTemplateConfiguration.vue +64 -64
- package/@nixweb/nixloc-ui/src/component/template/ViewTemplateDocumentView.vue +213 -213
- package/@nixweb/nixloc-ui/src/component/template/ViewTemplateImportFile.vue +347 -347
- package/@nixweb/nixloc-ui/src/component/template/ViewTemplateReportList.vue +217 -217
- package/@nixweb/nixloc-ui/src/component/template/ViewTemplateReportPreview.vue +432 -432
- package/@nixweb/nixloc-ui/src/component/template/ViewTemplateSelectOption.vue +46 -46
- package/@nixweb/nixloc-ui/src/component/template/ViewTemplateWithSalveCancel.vue +32 -32
- package/@nixweb/nixloc-ui/src/component/template/ViewTemplateWithTable.vue +62 -62
- package/@nixweb/nixloc-ui/src/component/template/model/Report.js +5 -5
- package/@nixweb/nixloc-ui/src/component/training/Course.vue +343 -343
- package/@nixweb/nixloc-ui/src/component/training/CourseView.vue +189 -189
- package/@nixweb/nixloc-ui/src/component/value-objects/Address.js +10 -10
- package/@nixweb/nixloc-ui/src/component/value-objects/Address.vue +157 -157
- package/@nixweb/nixloc-ui/src/component/value-objects/Contact.js +6 -6
- package/@nixweb/nixloc-ui/src/component/value-objects/Contact.vue +106 -106
- package/@nixweb/nixloc-ui/src/component/value-objects/Person.js +10 -10
- package/@nixweb/nixloc-ui/src/component/value-objects/Person.vue +129 -129
- package/@nixweb/nixloc-ui/src/config/axios.js +9 -9
- package/@nixweb/nixloc-ui/src/config/dicas.js +14 -14
- package/@nixweb/nixloc-ui/src/config/router.js +13 -13
- package/@nixweb/nixloc-ui/src/config/token.js +14 -14
- package/@nixweb/nixloc-ui/src/main.js +23 -23
- package/@nixweb/nixloc-ui/src/store/modules/automation.js +30 -30
- package/@nixweb/nixloc-ui/src/store/modules/generic.js +815 -815
- package/@nixweb/nixloc-ui/src/store/modules/report.js +277 -277
- package/@nixweb/nixloc-ui/src/store/modules/user.js +66 -66
- package/@nixweb/nixloc-ui/src/store/modules/util.js +25 -25
- package/@nixweb/nixloc-ui/src/store/modules/validation.js +38 -38
- package/@nixweb/nixloc-ui/src/store/store.js +13 -13
- package/README.md +24 -24
- package/babel.config.js +5 -5
- package/config/dev.env.js +8 -8
- package/config/index.js +69 -69
- package/config/prod.env.js +5 -5
- package/docs/src/component/template/ViewTemplateReportPreview.drawio +209 -209
- package/docs/src/store/modulos/relatorio.drawio +36 -36
- package/package.json +88 -88
- package/public/index.html +19 -19
- package/public/styles/app.css +52 -52
- package/src/component/forms/ButtonFilter.vue +104 -104
- package/src/component/forms/ButtonGroup.vue +66 -66
- package/src/component/forms/ButtonGroupInline.vue +210 -210
- package/src/component/forms/ButtonSub.vue +97 -97
- package/src/component/forms/ButtonToggle.vue +76 -76
- package/src/component/forms/DateYearMonth.vue +192 -192
- package/src/component/forms/ImageUpload.vue +214 -214
- package/src/component/forms/IncrementDecrement.vue +151 -151
- package/src/component/forms/InputAddressGoogle.vue +171 -171
- package/src/component/forms/InputCallToAction.vue +135 -135
- package/src/component/forms/InputDecimalDiscount.vue +146 -146
- package/src/component/forms/InputTag.vue +124 -124
- package/src/component/forms/InputTextEdit.vue +69 -69
- package/src/component/forms/InputWhatsApp.vue +47 -47
- package/src/component/forms/SideBar.vue +99 -99
- package/src/component/forms/Toggle.vue +72 -72
- package/src/component/layout/Account.vue +131 -131
- package/src/component/layout/AnimatedPhrase.vue +68 -68
- package/src/component/layout/BarFloating.vue +67 -67
- package/src/component/layout/BottomActionsBar.vue +205 -205
- package/src/component/layout/ColorPicker.vue +175 -175
- package/src/component/layout/Gantt.vue +128 -128
- package/src/component/layout/HideShow.vue +61 -61
- package/src/component/layout/IconMolded.vue +58 -58
- package/src/component/layout/IconPicker.vue +161 -161
- package/src/component/layout/NewAccount.vue +136 -136
- package/src/component/layout/NewHeader.vue +59 -59
- package/src/component/layout/NewIconMolded.vue +70 -70
- package/src/component/layout/NewMenu.vue +472 -472
- package/src/component/layout/ScrollBar.vue +21 -8
- package/src/component/layout/Tab.vue +259 -259
- package/src/component/layout/Tag.vue +97 -97
- package/src/component/layout/Tooltip.vue +155 -155
- package/src/component/layout/Zoom.vue +111 -111
- package/src/component/rental/DisplayCalculatePeriod.vue +48 -48
- package/src/component/rental/DisplayPeriodRent.vue +55 -55
- package/src/component/rental/DisplayTotalization.vue +86 -86
- package/src/component/report/Fields.vue +108 -108
- package/src/component/report/Report.vue +377 -377
- package/src/component/report/ReportTable.vue +111 -111
- package/src/component/report/Totalization.vue +33 -33
- package/src/component/shared/CodeEditor.vue +128 -128
- package/src/component/shared/Confirmation.vue +74 -74
- package/src/component/shared/DocumentEditor.vue +99 -99
- package/src/component/shared/DocumentPreview.vue +105 -105
- package/src/component/shared/DocumentPublic.vue +33 -33
- package/src/component/shared/ExportExcel.vue +56 -56
- package/src/component/shared/FullCalendar.vue +175 -175
- package/src/component/shared/HeaderReport.vue +47 -47
- package/src/component/shared/ListNotifications.vue +70 -70
- package/src/component/shared/Loading.vue +4 -1
- package/src/component/shared/LoadingCard.vue +64 -64
- package/src/component/shared/ParameterLegend.vue +169 -169
- package/src/component/shared/Report.vue +250 -250
- package/src/component/shared/SaveCancel.vue +117 -99
- package/src/component/shared/SelectOption.vue +162 -162
- package/src/component/shared/TableDraggable.vue +117 -117
- package/src/component/shared/TableImport.vue +93 -93
- package/src/component/shared/TableItem.vue +228 -228
- package/src/component/shared/TableTotalPerPage.vue +114 -114
- package/src/component/shared/TableTotalRecords.vue +44 -44
- package/src/component/shared/TimeLine.vue +41 -41
- package/src/component/shared/Timer.vue +77 -77
- package/src/component/shared/ToggleTheme.vue +127 -127
- package/src/component/shared/TotalizationReport.vue +86 -86
- package/src/component/shared/actions/ActionButtons.vue +53 -53
- package/src/component/shared/actions/ActionErrorContent.vue +103 -103
- package/src/component/shared/actions/ActionFooter.vue +99 -93
- package/src/component/shared/actions/ActionHeader.vue +110 -110
- package/src/component/shared/actions/ActionItemList.vue +143 -143
- package/src/component/shared/actions/ActionsOptions.vue +209 -209
- package/src/component/shared/actions/ActionsSelected.vue +262 -262
- package/src/component/shared/automation/ActivitiesList.vue +43 -43
- package/src/component/shared/automation/AddRule.vue +60 -60
- package/src/component/shared/automation/AutomationBuilder.vue +26 -26
- package/src/component/shared/automation/DynamicComponentList.vue +85 -85
- package/src/component/shared/automation/SelectRule.vue +97 -97
- package/src/component/shared/automation/components/BillingByRent.vue +97 -97
- package/src/component/shared/automation/components/SendEmail.vue +93 -93
- package/src/component/shared/file-manager/FileManager.vue +390 -390
- package/src/component/shared/filter-builder/FilterBuilder.vue +220 -220
- package/src/component/shared/filter-builder/FilterQuery.vue +95 -95
- package/src/component/shared/query-builder/ConvertToOdata.js +86 -86
- package/src/component/shared/query-builder/DynamicComponent.vue +161 -161
- package/src/component/shared/query-builder/Fields.vue +93 -93
- package/src/component/shared/query-builder/Rules.vue +68 -68
- package/src/component/shared/query-builder/SelectRule.vue +97 -97
- package/src/component/shared/query-builder/Tags.vue +59 -59
- package/src/component/signature/Payment.vue +160 -160
- package/src/component/signature/Warning.vue +75 -75
- package/src/component/template/ReportCreateUpdate.vue +110 -110
- package/src/component/template/ViewTemplateDocumentView.vue +213 -213
- package/src/component/template/ViewTemplateImportFile.vue +347 -347
- package/src/component/template/ViewTemplateReportList.vue +240 -240
- package/src/component/template/ViewTemplateReportPreview.vue +521 -521
- package/src/component/template/ViewTemplateSelectOption.vue +46 -46
- package/src/component/template/model/Report.js +5 -5
- package/src/component/training/Course.vue +343 -343
- package/src/component/training/CourseView.vue +198 -198
- package/src/component/value-objects/Address.js +10 -10
- package/src/component/value-objects/Address.vue +173 -173
- package/src/component/value-objects/Contact.js +6 -6
- package/src/component/value-objects/Contact.vue +106 -106
- package/src/component/value-objects/Person.js +10 -10
- package/src/component/value-objects/Person.vue +130 -130
- package/src/store/modules/automation.js +30 -30
- package/src/store/modules/report.js +277 -277
- package/src/store/modules/user.js +69 -69
- package/src/store/modules/util.js +25 -25
|
@@ -1,432 +1,432 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<Panel :module="panel.module" layout="large" :title="panel.title" :showVerticalFilter="panel.showVerticalFilter"
|
|
4
|
-
:showSearch="panel.showSearch" :showButtons="panel.showButtons">
|
|
5
|
-
<div slot="content-main">
|
|
6
|
-
<br />
|
|
7
|
-
<Loading type="line" :center="false" v-show="loadingSearch" />
|
|
8
|
-
<div v-show="!showFilter">
|
|
9
|
-
<div class="div-progress" v-if="liveTotalRecords != baseParams.totalRecords && !loadingSearch && !cancel">
|
|
10
|
-
<ProgressBar :text="`Carregando ${liveTotalRecords} registros de ${baseParams.totalRecords}`"
|
|
11
|
-
:value="liveTotalRecords" :max="baseParams.totalRecords" size="medium" />
|
|
12
|
-
<div class="text-center cancel" @click="stop">
|
|
13
|
-
<i class="fa-solid fa-ban"></i> Cancelar
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
<Molded>
|
|
17
|
-
<b-row>
|
|
18
|
-
<b-col sm="6">
|
|
19
|
-
<div class="side-by-side">
|
|
20
|
-
<Button _key="btnSearchReport" type="primary" title="Buscar" classIcon="fas fa-file-search"
|
|
21
|
-
:disabled="btnSearchDisabled || !rulesIsValid" size="medium" :clicked="getAll" />
|
|
22
|
-
</div>
|
|
23
|
-
<div class="side-by-side">
|
|
24
|
-
<Button _key="btnSaveReport" type="success" title="Salvar" classIcon="fas fa-save" size="small"
|
|
25
|
-
:disabled="isLoading || btnSaveDisabled || !rulesIsValid"
|
|
26
|
-
:params="{ name: 'save', title: 'Salvar', width: 550 }" :clicked="executeOpenModal" />
|
|
27
|
-
</div>
|
|
28
|
-
</b-col>
|
|
29
|
-
<b-col class="text-right" sm="6">
|
|
30
|
-
<div class="side-by-side">
|
|
31
|
-
<Button _key="btnExecuteOpenModal" type="info" title="Campos" classIcon="fas fa-database" size="small"
|
|
32
|
-
:disabled="isLoading" :params="{ name: 'fields', title: 'Campos', width: 550 }"
|
|
33
|
-
:clicked="executeOpenModal" />
|
|
34
|
-
</div>
|
|
35
|
-
<div class="side-by-side">
|
|
36
|
-
<Button _key="btnExecuteOpenModal" type="info" title="Filtros" classIcon="fas fa-filter" size="small"
|
|
37
|
-
:disabled="isLoading" :params="{ name: 'rules', title: 'Filtros', width: 900 }"
|
|
38
|
-
:clicked="executeShowFilter" />
|
|
39
|
-
</div>
|
|
40
|
-
</b-col>
|
|
41
|
-
</b-row>
|
|
42
|
-
</Molded>
|
|
43
|
-
<div class="div-tags">
|
|
44
|
-
<Tags eventName="tagReport" />
|
|
45
|
-
</div>
|
|
46
|
-
<div class="div-required" v-show="!rulesIsValid">
|
|
47
|
-
<Alert type="info" v-for="rule in rulesRequired" :key="rule.id">
|
|
48
|
-
É necessário informar o filtro
|
|
49
|
-
<span class="filter-required">{{ rule.title }}</span>, clique no botão "Filtros" para adicionar.
|
|
50
|
-
</Alert>
|
|
51
|
-
</div>
|
|
52
|
-
<div class="body-report" v-show="showBodyReport && rulesIsValid">
|
|
53
|
-
<Report :minHeight="700" :header="content.headerTable" :data="content.data"
|
|
54
|
-
:totalization="content.totalization" />
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
<div v-show="showFilter">
|
|
58
|
-
<Rules />
|
|
59
|
-
<br />
|
|
60
|
-
<div class="text-center">
|
|
61
|
-
<Button _key="btnCancelFilter" type="info" classIcon="fa-solid fa-arrow-left" size="small"
|
|
62
|
-
:clicked="executeHideFilter" />
|
|
63
|
-
<Button _key="btnApplyFilter" type="primary" title="Aplicar" classIcon="fas fa-filter" size="small"
|
|
64
|
-
:clicked="executeHideFilter" />
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
</Panel>
|
|
69
|
-
|
|
70
|
-
<Modal :title="modalOptions.title" :width="modalOptions.width" v-show="showModal('templateReport')">
|
|
71
|
-
<ReportCreateUpdate :module="panel.module" v-show="modalOptions.name == 'save'" />
|
|
72
|
-
<Fields v-if="modalOptions.name == 'fields'" />
|
|
73
|
-
<div class="text-right btn-apply" v-show="modalOptions.name == 'fields' || modalOptions.name == 'rules'">
|
|
74
|
-
<Button _key="btnApplyFieldsAndRules" type="primary" title="Aplicar" classIcon="fas fa-filter" size="small"
|
|
75
|
-
:clicked="applyFieldsAndRules" />
|
|
76
|
-
</div>
|
|
77
|
-
</Modal>
|
|
78
|
-
</div>
|
|
79
|
-
</template>
|
|
80
|
-
|
|
81
|
-
<script>
|
|
82
|
-
import Panel from "@nixweb/nixloc-ui/src/component/layout/Panel.vue";
|
|
83
|
-
import Molded from "@nixweb/nixloc-ui/src/component/layout/Molded";
|
|
84
|
-
import ProgressBar from "@nixweb/nixloc-ui/src/component/shared/ProgressBar";
|
|
85
|
-
import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
|
|
86
|
-
import Modal from "@nixweb/nixloc-ui/src/component/forms/Modal";
|
|
87
|
-
import Alert from "@nixweb/nixloc-ui/src/component/layout/Alert";
|
|
88
|
-
import Tags from "@nixweb/nixloc-ui/src/component/shared/query-builder/Tags.vue";
|
|
89
|
-
import Loading from "@nixweb/nixloc-ui/src/component/shared/Loading.vue";
|
|
90
|
-
import Report from "../shared/Report.vue";
|
|
91
|
-
|
|
92
|
-
import ReportCreateUpdate from "@nixweb/nixloc-ui/src/component/template/ReportCreateUpdate.vue";
|
|
93
|
-
import Fields from "@nixweb/nixloc-ui/src/component/shared/query-builder/Fields.vue";
|
|
94
|
-
import Rules from "@nixweb/nixloc-ui/src/component/shared/query-builder/Rules.vue";
|
|
95
|
-
|
|
96
|
-
import { mapState, mapGetters, mapActions, mapMutations } from "vuex";
|
|
97
|
-
|
|
98
|
-
export default {
|
|
99
|
-
name: "TemplateReportView",
|
|
100
|
-
props: {
|
|
101
|
-
panel: Object,
|
|
102
|
-
templateList: Object,
|
|
103
|
-
templateReport: Object,
|
|
104
|
-
},
|
|
105
|
-
components: {
|
|
106
|
-
Panel,
|
|
107
|
-
Molded,
|
|
108
|
-
ProgressBar,
|
|
109
|
-
Button,
|
|
110
|
-
Modal,
|
|
111
|
-
Alert,
|
|
112
|
-
Tags,
|
|
113
|
-
Loading,
|
|
114
|
-
Report,
|
|
115
|
-
ReportCreateUpdate,
|
|
116
|
-
Fields,
|
|
117
|
-
Rules,
|
|
118
|
-
},
|
|
119
|
-
data() {
|
|
120
|
-
return {
|
|
121
|
-
id: this.$route.params.id,
|
|
122
|
-
urlGetById: "api/v1/shared/report/get-by-id",
|
|
123
|
-
content: {
|
|
124
|
-
headerTable: [],
|
|
125
|
-
data: [],
|
|
126
|
-
totalPages: [],
|
|
127
|
-
totalization: {},
|
|
128
|
-
noDataReturned: false,
|
|
129
|
-
},
|
|
130
|
-
baseParams: {
|
|
131
|
-
currentPage: 0,
|
|
132
|
-
totalPerPage: 100,
|
|
133
|
-
totalPage: 0,
|
|
134
|
-
totalRecords: 0,
|
|
135
|
-
},
|
|
136
|
-
modalOptions: {
|
|
137
|
-
name: "",
|
|
138
|
-
title: "",
|
|
139
|
-
width: 0,
|
|
140
|
-
},
|
|
141
|
-
btnSearchDisabled: false,
|
|
142
|
-
loadingSearch: false,
|
|
143
|
-
btnSaveDisabled: true,
|
|
144
|
-
isLoading: false,
|
|
145
|
-
showBodyReport: false,
|
|
146
|
-
showFilter: false,
|
|
147
|
-
cancel: false,
|
|
148
|
-
};
|
|
149
|
-
},
|
|
150
|
-
mounted() {
|
|
151
|
-
this.addReport({
|
|
152
|
-
id: this.id,
|
|
153
|
-
fields: this.templateReport.fields,
|
|
154
|
-
rules: this.templateReport.rules,
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
this.clearTotalization();
|
|
158
|
-
|
|
159
|
-
if (this.id) this.getById();
|
|
160
|
-
|
|
161
|
-
if (!this.id) this.removeLoadingWithTime();
|
|
162
|
-
},
|
|
163
|
-
beforeDestroy() {
|
|
164
|
-
this.removeInitialReportCustom();
|
|
165
|
-
},
|
|
166
|
-
methods: {
|
|
167
|
-
...mapActions("generic", ["getApi", "getApiOdata"]),
|
|
168
|
-
...mapActions("report", [
|
|
169
|
-
"addReport",
|
|
170
|
-
"addInitialReportCustom",
|
|
171
|
-
"removeInitialReportCustom",
|
|
172
|
-
|
|
173
|
-
]),
|
|
174
|
-
...mapMutations("generic", [
|
|
175
|
-
"addEvent",
|
|
176
|
-
"openModal",
|
|
177
|
-
"hideModal",
|
|
178
|
-
"removeLoading",
|
|
179
|
-
]),
|
|
180
|
-
...mapMutations("report", [
|
|
181
|
-
"clearTotalization"
|
|
182
|
-
]),
|
|
183
|
-
getById() {
|
|
184
|
-
let params = { url: this.urlGetById, obj: { id: this.id } };
|
|
185
|
-
this.getApi(params).then((response) => {
|
|
186
|
-
const query = JSON.parse(response.content.query);
|
|
187
|
-
let report = {
|
|
188
|
-
selectedFields: query.selectedFields,
|
|
189
|
-
selectedRules: query.selectedRules,
|
|
190
|
-
};
|
|
191
|
-
this.addInitialReportCustom(report);
|
|
192
|
-
this.removeLoadingWithTime();
|
|
193
|
-
});
|
|
194
|
-
},
|
|
195
|
-
getAll() {
|
|
196
|
-
this.btnSearchDisabled = true;
|
|
197
|
-
this.loadingSearch = true;
|
|
198
|
-
this.cancel = false;
|
|
199
|
-
|
|
200
|
-
if (this.rulesIsValid) {
|
|
201
|
-
this.getTotalRecords();
|
|
202
|
-
this.removeLoading(["btnSearchReport"]);
|
|
203
|
-
|
|
204
|
-
if (this.oDataFilter.totalization) this.totalization();
|
|
205
|
-
if (!this.oDataFilter.totalization) this.content.totalization = {};
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
getTotalRecords() {
|
|
209
|
-
let paramsQuery = { url: this.urlQuery };
|
|
210
|
-
this.resetData();
|
|
211
|
-
this.getApiOdata(paramsQuery).then((response) => {
|
|
212
|
-
|
|
213
|
-
this.isLoading = true;
|
|
214
|
-
let totalRecords = response["@odata.count"];
|
|
215
|
-
this.loadingSearch = false;
|
|
216
|
-
|
|
217
|
-
if (totalRecords == 0) this.noDataReturned = true;
|
|
218
|
-
|
|
219
|
-
this.baseParams.totalRecords = totalRecords;
|
|
220
|
-
this.baseParams.totalPage = Math.ceil(
|
|
221
|
-
totalRecords / this.baseParams.totalPerPage
|
|
222
|
-
);
|
|
223
|
-
|
|
224
|
-
if (this.baseParams.totalPage <= 1)
|
|
225
|
-
this.loadingOnlyIfOnePage(response.value);
|
|
226
|
-
if (this.baseParams.totalPage > 1) this.loadingOnlyIfManyPages();
|
|
227
|
-
|
|
228
|
-
this.content.headerTable = this.headerTable;
|
|
229
|
-
this.showBodyReport = true;
|
|
230
|
-
});
|
|
231
|
-
},
|
|
232
|
-
totalization() {
|
|
233
|
-
let params = { url: this.urlTotalization };
|
|
234
|
-
this.getApiOdata(params).then((response) => {
|
|
235
|
-
const result = Object.entries(response[0]);
|
|
236
|
-
this.content.totalization = result;
|
|
237
|
-
});
|
|
238
|
-
},
|
|
239
|
-
loadingOnlyIfOnePage(data) {
|
|
240
|
-
this.content.data = data;
|
|
241
|
-
this.btnSearchDisabled = true;
|
|
242
|
-
let self = this;
|
|
243
|
-
setTimeout(function () {
|
|
244
|
-
self.isLoading = false;
|
|
245
|
-
}, 100);
|
|
246
|
-
},
|
|
247
|
-
loadingOnlyIfManyPages() {
|
|
248
|
-
let seq = 0;
|
|
249
|
-
while (seq <= this.baseParams.totalPage - 1) {
|
|
250
|
-
this.content.totalPages.push(seq);
|
|
251
|
-
seq++;
|
|
252
|
-
}
|
|
253
|
-
},
|
|
254
|
-
getAllManyPages() {
|
|
255
|
-
let paramsQuery = { url: this.urlQuery };
|
|
256
|
-
this.getApiOdata(paramsQuery).then((response) => {
|
|
257
|
-
let self = this;
|
|
258
|
-
response.value.forEach(function (obj) {
|
|
259
|
-
self.content.data.push(obj);
|
|
260
|
-
});
|
|
261
|
-
this.content.totalPages.pop();
|
|
262
|
-
this.baseParams.currentPage++;
|
|
263
|
-
});
|
|
264
|
-
},
|
|
265
|
-
resetData() {
|
|
266
|
-
this.isLoading = false;
|
|
267
|
-
this.content.data = [];
|
|
268
|
-
this.content.totalPages = [];
|
|
269
|
-
this.baseParams.currentPage = 0;
|
|
270
|
-
this.baseParams.totalRecords = 0;
|
|
271
|
-
this.noDataReturned = false;
|
|
272
|
-
},
|
|
273
|
-
executeOpenModal(params) {
|
|
274
|
-
if (this.id && params.name == "save") {
|
|
275
|
-
this.addEvent({ name: "saveReport" });
|
|
276
|
-
} else {
|
|
277
|
-
this.modalOptions = params;
|
|
278
|
-
this.openModal("templateReport");
|
|
279
|
-
this.removeLoading(["btnExecuteOpenModal", "btnSaveReport"]);
|
|
280
|
-
}
|
|
281
|
-
},
|
|
282
|
-
executeShowFilter() {
|
|
283
|
-
this.showFilter = true;
|
|
284
|
-
this.removeLoading(["btnExecuteOpenModal", "btnSaveReport"]);
|
|
285
|
-
},
|
|
286
|
-
executeHideFilter() {
|
|
287
|
-
this.showFilter = false;
|
|
288
|
-
this.removeLoading(["btnCancelFilter", "btnApplyFilter"]);
|
|
289
|
-
},
|
|
290
|
-
applyFieldsAndRules() {
|
|
291
|
-
this.hideModal("templateReport");
|
|
292
|
-
this.removeLoading(["btnApplyFieldsAndRules"]);
|
|
293
|
-
},
|
|
294
|
-
removeLoadingWithTime() {
|
|
295
|
-
let self = this;
|
|
296
|
-
setTimeout(function () {
|
|
297
|
-
self.btnSaveDisabled = true;
|
|
298
|
-
self.removeLoading(["panel"]);
|
|
299
|
-
}, 350);
|
|
300
|
-
},
|
|
301
|
-
stop() {
|
|
302
|
-
this.cancel = true;
|
|
303
|
-
this.btnSearchDisabled = false;
|
|
304
|
-
this.btnSaveDisabled = false;
|
|
305
|
-
this.isLoading = false;
|
|
306
|
-
}
|
|
307
|
-
},
|
|
308
|
-
computed: {
|
|
309
|
-
...mapGetters("generic", ["showModal", "event"]),
|
|
310
|
-
...mapGetters("report", [
|
|
311
|
-
"headerTable",
|
|
312
|
-
"oDataFilter",
|
|
313
|
-
"oDataSelect",
|
|
314
|
-
"oDataOrderBy",
|
|
315
|
-
"rulesIsValid",
|
|
316
|
-
"rulesRequired",
|
|
317
|
-
]),
|
|
318
|
-
...mapState("report", ["report"]),
|
|
319
|
-
urlQuery() {
|
|
320
|
-
let skip = this.baseParams.currentPage * this.baseParams.totalPerPage;
|
|
321
|
-
let baseUrl = `${this.templateList.urlGetApi}?${this.oDataSelect}&${this.oDataOrderBy}&${this.oDataFilter.query}&$skip=${skip}&$top=${this.baseParams.totalPerPage}&$count=true`;
|
|
322
|
-
return baseUrl.replace("&&", "&");
|
|
323
|
-
},
|
|
324
|
-
urlTotalization() {
|
|
325
|
-
let query = this.oDataFilter.query
|
|
326
|
-
? `$apply=filter(${this.oDataFilter.query.replace("$filter=", "")})/`
|
|
327
|
-
: "$apply=";
|
|
328
|
-
let baseUrl = `${this.templateList.urlGetApi
|
|
329
|
-
}?${query}aggregate(${this.oDataFilter.totalization.replace(",", "")})`;
|
|
330
|
-
return baseUrl;
|
|
331
|
-
},
|
|
332
|
-
liveTotalRecords() {
|
|
333
|
-
return this.content.data.length;
|
|
334
|
-
},
|
|
335
|
-
},
|
|
336
|
-
watch: {
|
|
337
|
-
event: {
|
|
338
|
-
handler(event) {
|
|
339
|
-
if (event.name == "savedReport") this.btnSaveDisabled = true;
|
|
340
|
-
},
|
|
341
|
-
deep: true,
|
|
342
|
-
},
|
|
343
|
-
"content.totalPages": {
|
|
344
|
-
handler(totalPages) {
|
|
345
|
-
if (totalPages.length > 0 && !this.cancel) {
|
|
346
|
-
let self = this;
|
|
347
|
-
setTimeout(function () {
|
|
348
|
-
self.getAllManyPages();
|
|
349
|
-
}, 1000);
|
|
350
|
-
}
|
|
351
|
-
if (totalPages.length == 1) this.isLoading = false;
|
|
352
|
-
},
|
|
353
|
-
deep: true,
|
|
354
|
-
},
|
|
355
|
-
oDataFilter: {
|
|
356
|
-
handler() {
|
|
357
|
-
this.btnSearchDisabled = false;
|
|
358
|
-
this.btnSaveDisabled = false;
|
|
359
|
-
this.showBodyReport = false;
|
|
360
|
-
this.resetData();
|
|
361
|
-
},
|
|
362
|
-
deep: true,
|
|
363
|
-
},
|
|
364
|
-
oDataSelect: {
|
|
365
|
-
handler() {
|
|
366
|
-
this.btnSearchDisabled = false;
|
|
367
|
-
this.btnSaveDisabled = false;
|
|
368
|
-
},
|
|
369
|
-
deep: true,
|
|
370
|
-
},
|
|
371
|
-
oDataOrderBy: {
|
|
372
|
-
handler() {
|
|
373
|
-
this.btnSearchDisabled = false;
|
|
374
|
-
this.btnSaveDisabled = false;
|
|
375
|
-
},
|
|
376
|
-
deep: true,
|
|
377
|
-
},
|
|
378
|
-
},
|
|
379
|
-
};
|
|
380
|
-
</script>
|
|
381
|
-
|
|
382
|
-
<style scoped>
|
|
383
|
-
.div-button {
|
|
384
|
-
padding-bottom: 15px;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
.div-progress {
|
|
388
|
-
margin-bottom: 10px;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
.div-sem-data {
|
|
392
|
-
margin-top: 20px;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
.div-table {
|
|
396
|
-
margin-top: 20px;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
.div-separacao {
|
|
400
|
-
margin-left: 10px;
|
|
401
|
-
margin-right: 5px;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
.div-Totalization {
|
|
405
|
-
margin-top: 20px;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
.div-tags {
|
|
409
|
-
margin-top: 15px;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
.div-required {
|
|
413
|
-
margin-top: 20px;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
.filter-required {
|
|
417
|
-
font-weight: 500;
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
.btn-apply {
|
|
421
|
-
margin-top: 10px;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
.body-report {
|
|
425
|
-
margin-top: 30px;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
.cancel {
|
|
429
|
-
color: red;
|
|
430
|
-
cursor: pointer;
|
|
431
|
-
}
|
|
432
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<Panel :module="panel.module" layout="large" :title="panel.title" :showVerticalFilter="panel.showVerticalFilter"
|
|
4
|
+
:showSearch="panel.showSearch" :showButtons="panel.showButtons">
|
|
5
|
+
<div slot="content-main">
|
|
6
|
+
<br />
|
|
7
|
+
<Loading type="line" :center="false" v-show="loadingSearch" />
|
|
8
|
+
<div v-show="!showFilter">
|
|
9
|
+
<div class="div-progress" v-if="liveTotalRecords != baseParams.totalRecords && !loadingSearch && !cancel">
|
|
10
|
+
<ProgressBar :text="`Carregando ${liveTotalRecords} registros de ${baseParams.totalRecords}`"
|
|
11
|
+
:value="liveTotalRecords" :max="baseParams.totalRecords" size="medium" />
|
|
12
|
+
<div class="text-center cancel" @click="stop">
|
|
13
|
+
<i class="fa-solid fa-ban"></i> Cancelar
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
<Molded>
|
|
17
|
+
<b-row>
|
|
18
|
+
<b-col sm="6">
|
|
19
|
+
<div class="side-by-side">
|
|
20
|
+
<Button _key="btnSearchReport" type="primary" title="Buscar" classIcon="fas fa-file-search"
|
|
21
|
+
:disabled="btnSearchDisabled || !rulesIsValid" size="medium" :clicked="getAll" />
|
|
22
|
+
</div>
|
|
23
|
+
<div class="side-by-side">
|
|
24
|
+
<Button _key="btnSaveReport" type="success" title="Salvar" classIcon="fas fa-save" size="small"
|
|
25
|
+
:disabled="isLoading || btnSaveDisabled || !rulesIsValid"
|
|
26
|
+
:params="{ name: 'save', title: 'Salvar', width: 550 }" :clicked="executeOpenModal" />
|
|
27
|
+
</div>
|
|
28
|
+
</b-col>
|
|
29
|
+
<b-col class="text-right" sm="6">
|
|
30
|
+
<div class="side-by-side">
|
|
31
|
+
<Button _key="btnExecuteOpenModal" type="info" title="Campos" classIcon="fas fa-database" size="small"
|
|
32
|
+
:disabled="isLoading" :params="{ name: 'fields', title: 'Campos', width: 550 }"
|
|
33
|
+
:clicked="executeOpenModal" />
|
|
34
|
+
</div>
|
|
35
|
+
<div class="side-by-side">
|
|
36
|
+
<Button _key="btnExecuteOpenModal" type="info" title="Filtros" classIcon="fas fa-filter" size="small"
|
|
37
|
+
:disabled="isLoading" :params="{ name: 'rules', title: 'Filtros', width: 900 }"
|
|
38
|
+
:clicked="executeShowFilter" />
|
|
39
|
+
</div>
|
|
40
|
+
</b-col>
|
|
41
|
+
</b-row>
|
|
42
|
+
</Molded>
|
|
43
|
+
<div class="div-tags">
|
|
44
|
+
<Tags eventName="tagReport" />
|
|
45
|
+
</div>
|
|
46
|
+
<div class="div-required" v-show="!rulesIsValid">
|
|
47
|
+
<Alert type="info" v-for="rule in rulesRequired" :key="rule.id">
|
|
48
|
+
É necessário informar o filtro
|
|
49
|
+
<span class="filter-required">{{ rule.title }}</span>, clique no botão "Filtros" para adicionar.
|
|
50
|
+
</Alert>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="body-report" v-show="showBodyReport && rulesIsValid">
|
|
53
|
+
<Report :minHeight="700" :header="content.headerTable" :data="content.data"
|
|
54
|
+
:totalization="content.totalization" />
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
<div v-show="showFilter">
|
|
58
|
+
<Rules />
|
|
59
|
+
<br />
|
|
60
|
+
<div class="text-center">
|
|
61
|
+
<Button _key="btnCancelFilter" type="info" classIcon="fa-solid fa-arrow-left" size="small"
|
|
62
|
+
:clicked="executeHideFilter" />
|
|
63
|
+
<Button _key="btnApplyFilter" type="primary" title="Aplicar" classIcon="fas fa-filter" size="small"
|
|
64
|
+
:clicked="executeHideFilter" />
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</Panel>
|
|
69
|
+
|
|
70
|
+
<Modal :title="modalOptions.title" :width="modalOptions.width" v-show="showModal('templateReport')">
|
|
71
|
+
<ReportCreateUpdate :module="panel.module" v-show="modalOptions.name == 'save'" />
|
|
72
|
+
<Fields v-if="modalOptions.name == 'fields'" />
|
|
73
|
+
<div class="text-right btn-apply" v-show="modalOptions.name == 'fields' || modalOptions.name == 'rules'">
|
|
74
|
+
<Button _key="btnApplyFieldsAndRules" type="primary" title="Aplicar" classIcon="fas fa-filter" size="small"
|
|
75
|
+
:clicked="applyFieldsAndRules" />
|
|
76
|
+
</div>
|
|
77
|
+
</Modal>
|
|
78
|
+
</div>
|
|
79
|
+
</template>
|
|
80
|
+
|
|
81
|
+
<script>
|
|
82
|
+
import Panel from "@nixweb/nixloc-ui/src/component/layout/Panel.vue";
|
|
83
|
+
import Molded from "@nixweb/nixloc-ui/src/component/layout/Molded";
|
|
84
|
+
import ProgressBar from "@nixweb/nixloc-ui/src/component/shared/ProgressBar";
|
|
85
|
+
import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
|
|
86
|
+
import Modal from "@nixweb/nixloc-ui/src/component/forms/Modal";
|
|
87
|
+
import Alert from "@nixweb/nixloc-ui/src/component/layout/Alert";
|
|
88
|
+
import Tags from "@nixweb/nixloc-ui/src/component/shared/query-builder/Tags.vue";
|
|
89
|
+
import Loading from "@nixweb/nixloc-ui/src/component/shared/Loading.vue";
|
|
90
|
+
import Report from "../shared/Report.vue";
|
|
91
|
+
|
|
92
|
+
import ReportCreateUpdate from "@nixweb/nixloc-ui/src/component/template/ReportCreateUpdate.vue";
|
|
93
|
+
import Fields from "@nixweb/nixloc-ui/src/component/shared/query-builder/Fields.vue";
|
|
94
|
+
import Rules from "@nixweb/nixloc-ui/src/component/shared/query-builder/Rules.vue";
|
|
95
|
+
|
|
96
|
+
import { mapState, mapGetters, mapActions, mapMutations } from "vuex";
|
|
97
|
+
|
|
98
|
+
export default {
|
|
99
|
+
name: "TemplateReportView",
|
|
100
|
+
props: {
|
|
101
|
+
panel: Object,
|
|
102
|
+
templateList: Object,
|
|
103
|
+
templateReport: Object,
|
|
104
|
+
},
|
|
105
|
+
components: {
|
|
106
|
+
Panel,
|
|
107
|
+
Molded,
|
|
108
|
+
ProgressBar,
|
|
109
|
+
Button,
|
|
110
|
+
Modal,
|
|
111
|
+
Alert,
|
|
112
|
+
Tags,
|
|
113
|
+
Loading,
|
|
114
|
+
Report,
|
|
115
|
+
ReportCreateUpdate,
|
|
116
|
+
Fields,
|
|
117
|
+
Rules,
|
|
118
|
+
},
|
|
119
|
+
data() {
|
|
120
|
+
return {
|
|
121
|
+
id: this.$route.params.id,
|
|
122
|
+
urlGetById: "api/v1/shared/report/get-by-id",
|
|
123
|
+
content: {
|
|
124
|
+
headerTable: [],
|
|
125
|
+
data: [],
|
|
126
|
+
totalPages: [],
|
|
127
|
+
totalization: {},
|
|
128
|
+
noDataReturned: false,
|
|
129
|
+
},
|
|
130
|
+
baseParams: {
|
|
131
|
+
currentPage: 0,
|
|
132
|
+
totalPerPage: 100,
|
|
133
|
+
totalPage: 0,
|
|
134
|
+
totalRecords: 0,
|
|
135
|
+
},
|
|
136
|
+
modalOptions: {
|
|
137
|
+
name: "",
|
|
138
|
+
title: "",
|
|
139
|
+
width: 0,
|
|
140
|
+
},
|
|
141
|
+
btnSearchDisabled: false,
|
|
142
|
+
loadingSearch: false,
|
|
143
|
+
btnSaveDisabled: true,
|
|
144
|
+
isLoading: false,
|
|
145
|
+
showBodyReport: false,
|
|
146
|
+
showFilter: false,
|
|
147
|
+
cancel: false,
|
|
148
|
+
};
|
|
149
|
+
},
|
|
150
|
+
mounted() {
|
|
151
|
+
this.addReport({
|
|
152
|
+
id: this.id,
|
|
153
|
+
fields: this.templateReport.fields,
|
|
154
|
+
rules: this.templateReport.rules,
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
this.clearTotalization();
|
|
158
|
+
|
|
159
|
+
if (this.id) this.getById();
|
|
160
|
+
|
|
161
|
+
if (!this.id) this.removeLoadingWithTime();
|
|
162
|
+
},
|
|
163
|
+
beforeDestroy() {
|
|
164
|
+
this.removeInitialReportCustom();
|
|
165
|
+
},
|
|
166
|
+
methods: {
|
|
167
|
+
...mapActions("generic", ["getApi", "getApiOdata"]),
|
|
168
|
+
...mapActions("report", [
|
|
169
|
+
"addReport",
|
|
170
|
+
"addInitialReportCustom",
|
|
171
|
+
"removeInitialReportCustom",
|
|
172
|
+
|
|
173
|
+
]),
|
|
174
|
+
...mapMutations("generic", [
|
|
175
|
+
"addEvent",
|
|
176
|
+
"openModal",
|
|
177
|
+
"hideModal",
|
|
178
|
+
"removeLoading",
|
|
179
|
+
]),
|
|
180
|
+
...mapMutations("report", [
|
|
181
|
+
"clearTotalization"
|
|
182
|
+
]),
|
|
183
|
+
getById() {
|
|
184
|
+
let params = { url: this.urlGetById, obj: { id: this.id } };
|
|
185
|
+
this.getApi(params).then((response) => {
|
|
186
|
+
const query = JSON.parse(response.content.query);
|
|
187
|
+
let report = {
|
|
188
|
+
selectedFields: query.selectedFields,
|
|
189
|
+
selectedRules: query.selectedRules,
|
|
190
|
+
};
|
|
191
|
+
this.addInitialReportCustom(report);
|
|
192
|
+
this.removeLoadingWithTime();
|
|
193
|
+
});
|
|
194
|
+
},
|
|
195
|
+
getAll() {
|
|
196
|
+
this.btnSearchDisabled = true;
|
|
197
|
+
this.loadingSearch = true;
|
|
198
|
+
this.cancel = false;
|
|
199
|
+
|
|
200
|
+
if (this.rulesIsValid) {
|
|
201
|
+
this.getTotalRecords();
|
|
202
|
+
this.removeLoading(["btnSearchReport"]);
|
|
203
|
+
|
|
204
|
+
if (this.oDataFilter.totalization) this.totalization();
|
|
205
|
+
if (!this.oDataFilter.totalization) this.content.totalization = {};
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
getTotalRecords() {
|
|
209
|
+
let paramsQuery = { url: this.urlQuery };
|
|
210
|
+
this.resetData();
|
|
211
|
+
this.getApiOdata(paramsQuery).then((response) => {
|
|
212
|
+
|
|
213
|
+
this.isLoading = true;
|
|
214
|
+
let totalRecords = response["@odata.count"];
|
|
215
|
+
this.loadingSearch = false;
|
|
216
|
+
|
|
217
|
+
if (totalRecords == 0) this.noDataReturned = true;
|
|
218
|
+
|
|
219
|
+
this.baseParams.totalRecords = totalRecords;
|
|
220
|
+
this.baseParams.totalPage = Math.ceil(
|
|
221
|
+
totalRecords / this.baseParams.totalPerPage
|
|
222
|
+
);
|
|
223
|
+
|
|
224
|
+
if (this.baseParams.totalPage <= 1)
|
|
225
|
+
this.loadingOnlyIfOnePage(response.value);
|
|
226
|
+
if (this.baseParams.totalPage > 1) this.loadingOnlyIfManyPages();
|
|
227
|
+
|
|
228
|
+
this.content.headerTable = this.headerTable;
|
|
229
|
+
this.showBodyReport = true;
|
|
230
|
+
});
|
|
231
|
+
},
|
|
232
|
+
totalization() {
|
|
233
|
+
let params = { url: this.urlTotalization };
|
|
234
|
+
this.getApiOdata(params).then((response) => {
|
|
235
|
+
const result = Object.entries(response[0]);
|
|
236
|
+
this.content.totalization = result;
|
|
237
|
+
});
|
|
238
|
+
},
|
|
239
|
+
loadingOnlyIfOnePage(data) {
|
|
240
|
+
this.content.data = data;
|
|
241
|
+
this.btnSearchDisabled = true;
|
|
242
|
+
let self = this;
|
|
243
|
+
setTimeout(function () {
|
|
244
|
+
self.isLoading = false;
|
|
245
|
+
}, 100);
|
|
246
|
+
},
|
|
247
|
+
loadingOnlyIfManyPages() {
|
|
248
|
+
let seq = 0;
|
|
249
|
+
while (seq <= this.baseParams.totalPage - 1) {
|
|
250
|
+
this.content.totalPages.push(seq);
|
|
251
|
+
seq++;
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
getAllManyPages() {
|
|
255
|
+
let paramsQuery = { url: this.urlQuery };
|
|
256
|
+
this.getApiOdata(paramsQuery).then((response) => {
|
|
257
|
+
let self = this;
|
|
258
|
+
response.value.forEach(function (obj) {
|
|
259
|
+
self.content.data.push(obj);
|
|
260
|
+
});
|
|
261
|
+
this.content.totalPages.pop();
|
|
262
|
+
this.baseParams.currentPage++;
|
|
263
|
+
});
|
|
264
|
+
},
|
|
265
|
+
resetData() {
|
|
266
|
+
this.isLoading = false;
|
|
267
|
+
this.content.data = [];
|
|
268
|
+
this.content.totalPages = [];
|
|
269
|
+
this.baseParams.currentPage = 0;
|
|
270
|
+
this.baseParams.totalRecords = 0;
|
|
271
|
+
this.noDataReturned = false;
|
|
272
|
+
},
|
|
273
|
+
executeOpenModal(params) {
|
|
274
|
+
if (this.id && params.name == "save") {
|
|
275
|
+
this.addEvent({ name: "saveReport" });
|
|
276
|
+
} else {
|
|
277
|
+
this.modalOptions = params;
|
|
278
|
+
this.openModal("templateReport");
|
|
279
|
+
this.removeLoading(["btnExecuteOpenModal", "btnSaveReport"]);
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
executeShowFilter() {
|
|
283
|
+
this.showFilter = true;
|
|
284
|
+
this.removeLoading(["btnExecuteOpenModal", "btnSaveReport"]);
|
|
285
|
+
},
|
|
286
|
+
executeHideFilter() {
|
|
287
|
+
this.showFilter = false;
|
|
288
|
+
this.removeLoading(["btnCancelFilter", "btnApplyFilter"]);
|
|
289
|
+
},
|
|
290
|
+
applyFieldsAndRules() {
|
|
291
|
+
this.hideModal("templateReport");
|
|
292
|
+
this.removeLoading(["btnApplyFieldsAndRules"]);
|
|
293
|
+
},
|
|
294
|
+
removeLoadingWithTime() {
|
|
295
|
+
let self = this;
|
|
296
|
+
setTimeout(function () {
|
|
297
|
+
self.btnSaveDisabled = true;
|
|
298
|
+
self.removeLoading(["panel"]);
|
|
299
|
+
}, 350);
|
|
300
|
+
},
|
|
301
|
+
stop() {
|
|
302
|
+
this.cancel = true;
|
|
303
|
+
this.btnSearchDisabled = false;
|
|
304
|
+
this.btnSaveDisabled = false;
|
|
305
|
+
this.isLoading = false;
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
computed: {
|
|
309
|
+
...mapGetters("generic", ["showModal", "event"]),
|
|
310
|
+
...mapGetters("report", [
|
|
311
|
+
"headerTable",
|
|
312
|
+
"oDataFilter",
|
|
313
|
+
"oDataSelect",
|
|
314
|
+
"oDataOrderBy",
|
|
315
|
+
"rulesIsValid",
|
|
316
|
+
"rulesRequired",
|
|
317
|
+
]),
|
|
318
|
+
...mapState("report", ["report"]),
|
|
319
|
+
urlQuery() {
|
|
320
|
+
let skip = this.baseParams.currentPage * this.baseParams.totalPerPage;
|
|
321
|
+
let baseUrl = `${this.templateList.urlGetApi}?${this.oDataSelect}&${this.oDataOrderBy}&${this.oDataFilter.query}&$skip=${skip}&$top=${this.baseParams.totalPerPage}&$count=true`;
|
|
322
|
+
return baseUrl.replace("&&", "&");
|
|
323
|
+
},
|
|
324
|
+
urlTotalization() {
|
|
325
|
+
let query = this.oDataFilter.query
|
|
326
|
+
? `$apply=filter(${this.oDataFilter.query.replace("$filter=", "")})/`
|
|
327
|
+
: "$apply=";
|
|
328
|
+
let baseUrl = `${this.templateList.urlGetApi
|
|
329
|
+
}?${query}aggregate(${this.oDataFilter.totalization.replace(",", "")})`;
|
|
330
|
+
return baseUrl;
|
|
331
|
+
},
|
|
332
|
+
liveTotalRecords() {
|
|
333
|
+
return this.content.data.length;
|
|
334
|
+
},
|
|
335
|
+
},
|
|
336
|
+
watch: {
|
|
337
|
+
event: {
|
|
338
|
+
handler(event) {
|
|
339
|
+
if (event.name == "savedReport") this.btnSaveDisabled = true;
|
|
340
|
+
},
|
|
341
|
+
deep: true,
|
|
342
|
+
},
|
|
343
|
+
"content.totalPages": {
|
|
344
|
+
handler(totalPages) {
|
|
345
|
+
if (totalPages.length > 0 && !this.cancel) {
|
|
346
|
+
let self = this;
|
|
347
|
+
setTimeout(function () {
|
|
348
|
+
self.getAllManyPages();
|
|
349
|
+
}, 1000);
|
|
350
|
+
}
|
|
351
|
+
if (totalPages.length == 1) this.isLoading = false;
|
|
352
|
+
},
|
|
353
|
+
deep: true,
|
|
354
|
+
},
|
|
355
|
+
oDataFilter: {
|
|
356
|
+
handler() {
|
|
357
|
+
this.btnSearchDisabled = false;
|
|
358
|
+
this.btnSaveDisabled = false;
|
|
359
|
+
this.showBodyReport = false;
|
|
360
|
+
this.resetData();
|
|
361
|
+
},
|
|
362
|
+
deep: true,
|
|
363
|
+
},
|
|
364
|
+
oDataSelect: {
|
|
365
|
+
handler() {
|
|
366
|
+
this.btnSearchDisabled = false;
|
|
367
|
+
this.btnSaveDisabled = false;
|
|
368
|
+
},
|
|
369
|
+
deep: true,
|
|
370
|
+
},
|
|
371
|
+
oDataOrderBy: {
|
|
372
|
+
handler() {
|
|
373
|
+
this.btnSearchDisabled = false;
|
|
374
|
+
this.btnSaveDisabled = false;
|
|
375
|
+
},
|
|
376
|
+
deep: true,
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
};
|
|
380
|
+
</script>
|
|
381
|
+
|
|
382
|
+
<style scoped>
|
|
383
|
+
.div-button {
|
|
384
|
+
padding-bottom: 15px;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.div-progress {
|
|
388
|
+
margin-bottom: 10px;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.div-sem-data {
|
|
392
|
+
margin-top: 20px;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.div-table {
|
|
396
|
+
margin-top: 20px;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.div-separacao {
|
|
400
|
+
margin-left: 10px;
|
|
401
|
+
margin-right: 5px;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.div-Totalization {
|
|
405
|
+
margin-top: 20px;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
.div-tags {
|
|
409
|
+
margin-top: 15px;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.div-required {
|
|
413
|
+
margin-top: 20px;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.filter-required {
|
|
417
|
+
font-weight: 500;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.btn-apply {
|
|
421
|
+
margin-top: 10px;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.body-report {
|
|
425
|
+
margin-top: 30px;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.cancel {
|
|
429
|
+
color: red;
|
|
430
|
+
cursor: pointer;
|
|
431
|
+
}
|
|
432
|
+
</style>
|