@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,161 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="vqb-rule card move">
|
|
3
|
+
<div class="form-inline">
|
|
4
|
+
<label :class="rule.classCss" class="mr-5">
|
|
5
|
+
<i class="icon-query-builder" :class="rule.icon"></i>
|
|
6
|
+
<span class="title" style="margin-left: 10px">{{ rule.title }} </span>
|
|
7
|
+
</label>
|
|
8
|
+
<div style="margin-right: 20px">
|
|
9
|
+
<RadioGroup v-if="index > 0" :options="[
|
|
10
|
+
{ text: 'e', value: 'and' },
|
|
11
|
+
{ text: 'ou', value: 'or' },
|
|
12
|
+
]" v-model="rule.andOr" />
|
|
13
|
+
</div>
|
|
14
|
+
<select v-if="rule.typeField == 'text' || rule.typeField == 'numeric'" v-model="rule.operator"
|
|
15
|
+
class="select-query-builder form-control mr-2">
|
|
16
|
+
<option v-for="operator in rule.operators" :key="operator">
|
|
17
|
+
<span>{{ operator }}</span>
|
|
18
|
+
</option>
|
|
19
|
+
</select>
|
|
20
|
+
<input v-if="rule.typeField == 'text' || rule.typeField == 'numeric'" class="form-control"
|
|
21
|
+
:type="rule.typeField == 'text' ? 'text' : 'number'" placeholder="Valor" v-model="rule.value" />
|
|
22
|
+
<CheckboxGroup v-if="rule.typeField == 'checkbox'" :options="options" :initialValue="rule.value"
|
|
23
|
+
v-model="rule.value" />
|
|
24
|
+
<div v-if="rule.typeField == 'dateTime'">
|
|
25
|
+
<div class="side-by-side">
|
|
26
|
+
<DateTime :format="rule.props.format" :type="rule.props.type" :range="rule.props.range" v-model="rule.value" />
|
|
27
|
+
</div>
|
|
28
|
+
<div class="side-by-side margin">ou</div>
|
|
29
|
+
<div class="side-by-side margin">
|
|
30
|
+
<select @change="verifyCalculate" v-model="rule.value[2]" class="form-control mr-2">
|
|
31
|
+
<option v-for="period in optionsPeriodCustom" :key="period">
|
|
32
|
+
{{ period }}
|
|
33
|
+
</option>
|
|
34
|
+
</select>
|
|
35
|
+
</div>
|
|
36
|
+
<div v-if="rule.props.filterByField">
|
|
37
|
+
<RadioGroup v-if="rule.props.filterByField" :options="rule.props.filterByField" v-model="rule.name" />
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<Select v-if="rule.typeField == 'select'" :showNewRegister="false" :url="rule.props.url" v-model="rule.value" />
|
|
42
|
+
<div @click="removeRule" class="ml-auto btn-remove">
|
|
43
|
+
<i class="fas fa-times"></i>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<script>
|
|
50
|
+
import DateTime from "@nixweb/nixloc-ui/src/component/forms/DateTime";
|
|
51
|
+
import Select from "@nixweb/nixloc-ui/src/component/forms/Select";
|
|
52
|
+
import CheckboxGroup from "@nixweb/nixloc-ui/src/component/forms/CheckboxGroup";
|
|
53
|
+
import RadioGroup from "@nixweb/nixloc-ui/src/component/forms/RadioGroup.vue";
|
|
54
|
+
|
|
55
|
+
import { mapMutations, mapActions } from "vuex";
|
|
56
|
+
|
|
57
|
+
export default {
|
|
58
|
+
name: "DynamicComponent",
|
|
59
|
+
components: {
|
|
60
|
+
DateTime,
|
|
61
|
+
Select,
|
|
62
|
+
CheckboxGroup,
|
|
63
|
+
RadioGroup,
|
|
64
|
+
},
|
|
65
|
+
props: ["rule", "index"],
|
|
66
|
+
created() {
|
|
67
|
+
if (this.rule.typeField == "dateTime") {
|
|
68
|
+
if (this.rule.value == null) {
|
|
69
|
+
this.rule.value = ["", "", ""];
|
|
70
|
+
} else {
|
|
71
|
+
if (this.rule.value.length == 3) {
|
|
72
|
+
this.verifyCalculate();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
data() {
|
|
78
|
+
return {
|
|
79
|
+
urlCalculate: "/api/v1/rental/period-rent/calculate-period-query-builder",
|
|
80
|
+
optionsPeriodCustom: [
|
|
81
|
+
"hoje",
|
|
82
|
+
"próximos 7 dias",
|
|
83
|
+
"próximos 15 dias",
|
|
84
|
+
"próximos 30 dias",
|
|
85
|
+
"próximos 45 dias",
|
|
86
|
+
"últimos 7 dias",
|
|
87
|
+
"últimos 15 dias",
|
|
88
|
+
"últimos 30 dias",
|
|
89
|
+
"últimos 45 dias",
|
|
90
|
+
],
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
methods: {
|
|
94
|
+
...mapMutations("generic", ["addEvent"]),
|
|
95
|
+
...mapMutations("report", ["removeSelectedRule"]),
|
|
96
|
+
...mapActions("generic", ["postApi"]),
|
|
97
|
+
removeRule() {
|
|
98
|
+
this.removeSelectedRule(this.rule.id);
|
|
99
|
+
this.addEvent({
|
|
100
|
+
name: "selectedRuleRemoved",
|
|
101
|
+
data: { id: this.rule.id },
|
|
102
|
+
});
|
|
103
|
+
},
|
|
104
|
+
verifyCalculate() {
|
|
105
|
+
let title = this.rule.value[2];
|
|
106
|
+
if (title == "hoje") this.calculate(0, title);
|
|
107
|
+
if (title == "próximos 7 dias") this.calculate(7, title);
|
|
108
|
+
if (title == "próximos 15 dias") this.calculate(15, title);
|
|
109
|
+
if (title == "próximos 30 dias") this.calculate(30, title);
|
|
110
|
+
if (title == "próximos 45 dias") this.calculate(45, title);
|
|
111
|
+
if (title == "últimos 7 dias") this.calculate(-7, title);
|
|
112
|
+
if (title == "últimos 15 dias") this.calculate(-15, title);
|
|
113
|
+
if (title == "últimos 30 dias") this.calculate(-30, title);
|
|
114
|
+
if (title == "últimos 45 dias") this.calculate(-45, title);
|
|
115
|
+
},
|
|
116
|
+
calculate(days, title) {
|
|
117
|
+
let params = {
|
|
118
|
+
url: this.urlCalculate,
|
|
119
|
+
obj: { days: days },
|
|
120
|
+
notNotifyToast: true,
|
|
121
|
+
};
|
|
122
|
+
this.postApi(params).then((response) => {
|
|
123
|
+
this.rule.value = [];
|
|
124
|
+
this.rule.value[0] = response.content.start;
|
|
125
|
+
this.rule.value[1] = response.content.end;
|
|
126
|
+
this.rule.value[2] = title;
|
|
127
|
+
});
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
computed: {
|
|
131
|
+
options() {
|
|
132
|
+
let options = [];
|
|
133
|
+
this.rule.options.forEach((item) => {
|
|
134
|
+
let option = { text: item.title, value: item.value };
|
|
135
|
+
options.push(option);
|
|
136
|
+
});
|
|
137
|
+
return options;
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
</script>
|
|
142
|
+
<style scoped>
|
|
143
|
+
.move {
|
|
144
|
+
cursor: move;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.btn-remove {
|
|
148
|
+
font-size: 16px;
|
|
149
|
+
color: darkgray;
|
|
150
|
+
cursor: pointer;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.div-select {
|
|
154
|
+
width: 330px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.margin {
|
|
158
|
+
margin-left: 30px;
|
|
159
|
+
padding: 10px;
|
|
160
|
+
}
|
|
161
|
+
</style>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class="component">
|
|
4
|
+
<span v-if="selectedRules.length > 0">
|
|
5
|
+
<i class="fas fa-expand-arrows-alt"></i> Clique e arraste para ordenar
|
|
6
|
+
</span>
|
|
7
|
+
<draggable :list="selectedRules">
|
|
8
|
+
<component
|
|
9
|
+
:is="component()"
|
|
10
|
+
v-for="(rule, index) in selectedRules"
|
|
11
|
+
:key="index"
|
|
12
|
+
:rule="rule"
|
|
13
|
+
:index="index"
|
|
14
|
+
/>
|
|
15
|
+
</draggable>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
import Alert from "@nixweb/nixloc-ui/src/component/layout/Alert";
|
|
22
|
+
|
|
23
|
+
import draggable from "vuedraggable";
|
|
24
|
+
|
|
25
|
+
import { mapState, mapMutations } from "vuex";
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
components: {
|
|
29
|
+
Alert,
|
|
30
|
+
draggable,
|
|
31
|
+
},
|
|
32
|
+
data() {
|
|
33
|
+
return {
|
|
34
|
+
dynamicComponent: null,
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
computed: {
|
|
38
|
+
...mapState("report", ["selectedRules"]),
|
|
39
|
+
},
|
|
40
|
+
mounted() {
|
|
41
|
+
this.dynamicComponent =
|
|
42
|
+
this.$parent.$options.components["DynamicComponent"];
|
|
43
|
+
},
|
|
44
|
+
methods: {
|
|
45
|
+
...mapMutations("report", ["mountFinalQueryFormatOData"]),
|
|
46
|
+
component() {
|
|
47
|
+
return this.dynamicComponent;
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
watch: {
|
|
51
|
+
selectedRules: {
|
|
52
|
+
handler(value) {
|
|
53
|
+
this.mountFinalQueryFormatOData(value);
|
|
54
|
+
},
|
|
55
|
+
deep: true,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<style scoped>
|
|
62
|
+
.component {
|
|
63
|
+
padding-left: 10px;
|
|
64
|
+
padding-right: 10px;
|
|
65
|
+
margin-top: 10px;
|
|
66
|
+
max-width: 1100px;
|
|
67
|
+
margin: auto;
|
|
68
|
+
padding-top: 20px;
|
|
69
|
+
}
|
|
70
|
+
</style>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<b-row>
|
|
4
|
+
<b-col sm="6">
|
|
5
|
+
<ScrollBar :minHeight="200" :maxHeight="250">
|
|
6
|
+
<div class="div-options">
|
|
7
|
+
<CheckboxGroup
|
|
8
|
+
:stacked="true"
|
|
9
|
+
:initialValue="fieldsLocal.selected"
|
|
10
|
+
:options="fieldsLocal.options"
|
|
11
|
+
v-model="fieldsLocal.selected"
|
|
12
|
+
/>
|
|
13
|
+
</div>
|
|
14
|
+
</ScrollBar>
|
|
15
|
+
</b-col>
|
|
16
|
+
<b-col sm="6">
|
|
17
|
+
<RadioGroup
|
|
18
|
+
:options="[
|
|
19
|
+
{ text: 'Crescente', value: 'asc' },
|
|
20
|
+
{ text: 'Decrescente', value: 'desc' },
|
|
21
|
+
]"
|
|
22
|
+
v-model="fieldsLocal.orderBy"
|
|
23
|
+
/>
|
|
24
|
+
<SelectStatic
|
|
25
|
+
title="Ordenar"
|
|
26
|
+
fieldTarget="order"
|
|
27
|
+
:initialValue="{ content: fieldsLocal.sort.content, id: fieldsLocal.sort.id }"
|
|
28
|
+
:data="options"
|
|
29
|
+
v-model="fieldsLocal.sort"
|
|
30
|
+
/>
|
|
31
|
+
</b-col>
|
|
32
|
+
</b-row>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
<script>
|
|
36
|
+
import SelectStatic from "@nixweb/nixloc-ui/src/component/forms/SelectStatic";
|
|
37
|
+
import RadioGroup from "@nixweb/nixloc-ui/src/component/forms/RadioGroup";
|
|
38
|
+
import CheckboxGroup from "@nixweb/nixloc-ui/src/component/forms/CheckboxGroup";
|
|
39
|
+
import ScrollBar from "@nixweb/nixloc-ui/src/component/layout/ScrollBar.vue";
|
|
40
|
+
|
|
41
|
+
import { mapMutations, mapGetters } from "vuex";
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
name: "Fields",
|
|
45
|
+
components: {
|
|
46
|
+
CheckboxGroup,
|
|
47
|
+
SelectStatic,
|
|
48
|
+
ScrollBar,
|
|
49
|
+
RadioGroup,
|
|
50
|
+
},
|
|
51
|
+
data() {
|
|
52
|
+
return {
|
|
53
|
+
fieldsLocal: {
|
|
54
|
+
selected: [],
|
|
55
|
+
options: [],
|
|
56
|
+
sort: { content: "", id: "asc" },
|
|
57
|
+
orderBy: "",
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
},
|
|
61
|
+
created() {
|
|
62
|
+
// converte getters para data local para que possa ser manipulado com o v-model
|
|
63
|
+
this.fieldsLocal = this.fields;
|
|
64
|
+
},
|
|
65
|
+
computed: {
|
|
66
|
+
...mapGetters("report", ["fields"]),
|
|
67
|
+
options() {
|
|
68
|
+
let options = [];
|
|
69
|
+
this.fields.options.forEach((option) => {
|
|
70
|
+
let obj = { content: option.text, id: option.value };
|
|
71
|
+
options.push(obj);
|
|
72
|
+
});
|
|
73
|
+
return options;
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
methods: {
|
|
77
|
+
...mapMutations("report", ["updateSelectedFields"]),
|
|
78
|
+
},
|
|
79
|
+
watch: {
|
|
80
|
+
fieldsLocal: {
|
|
81
|
+
handler(fieldsLocal) {
|
|
82
|
+
this.updateSelectedFields(fieldsLocal);
|
|
83
|
+
},
|
|
84
|
+
deep: true,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
</script>
|
|
89
|
+
<style scoped>
|
|
90
|
+
.div-options {
|
|
91
|
+
padding-left: 0px;
|
|
92
|
+
}
|
|
93
|
+
</style>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="vue-query-builder">
|
|
3
|
+
<slot v-bind="vqbProps">
|
|
4
|
+
<AddRule v-bind="vqbProps" />
|
|
5
|
+
</slot>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
import AddRule from "./AddRule.vue";
|
|
11
|
+
|
|
12
|
+
import { mapState } from "vuex";
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
name: "QueryBuilder",
|
|
16
|
+
components: {
|
|
17
|
+
AddRule,
|
|
18
|
+
},
|
|
19
|
+
data() {
|
|
20
|
+
return {
|
|
21
|
+
typeRule: {
|
|
22
|
+
text: {
|
|
23
|
+
id: "text-field",
|
|
24
|
+
operators: ["igual", "diferente", "contem"],
|
|
25
|
+
typeField: "text",
|
|
26
|
+
},
|
|
27
|
+
numeric: {
|
|
28
|
+
id: "number-field",
|
|
29
|
+
/* operators: ["=", "!=", "<", "<=", ">", ">="],*/
|
|
30
|
+
operators: ["igual", "diferente", "menor", "menor ou igual", "maior", "maior ou igual"],
|
|
31
|
+
typeField: "number",
|
|
32
|
+
},
|
|
33
|
+
radio: {
|
|
34
|
+
id: "radio-field",
|
|
35
|
+
operators: [],
|
|
36
|
+
options: [],
|
|
37
|
+
typeField: "radio",
|
|
38
|
+
},
|
|
39
|
+
checkbox: {
|
|
40
|
+
id: "checkbox-field",
|
|
41
|
+
operators: ["checkbox"],
|
|
42
|
+
options: [],
|
|
43
|
+
typeField: "checkbox",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
computed: {
|
|
49
|
+
...mapState("report", ["report"]),
|
|
50
|
+
mergeRules() {
|
|
51
|
+
var mergeRules = [];
|
|
52
|
+
var self = this;
|
|
53
|
+
self.report.rules.forEach(function (rule) {
|
|
54
|
+
if (typeof self.typeRule[rule.typeField] !== "undefined") {
|
|
55
|
+
mergeRules.push(Object.assign({}, self.typeRule[rule.typeField], rule));
|
|
56
|
+
} else {
|
|
57
|
+
mergeRules.push(rule);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
return mergeRules;
|
|
61
|
+
},
|
|
62
|
+
vqbProps() {
|
|
63
|
+
return {
|
|
64
|
+
rules: this.mergeRules,
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
</script>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<QueryBuilder />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import QueryBuilder from "./QueryBuilder.vue";
|
|
9
|
+
|
|
10
|
+
import { mapMutations } from "vuex";
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
name: "Rules",
|
|
14
|
+
components: { QueryBuilder },
|
|
15
|
+
};
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<style>
|
|
19
|
+
.btn-secondary {
|
|
20
|
+
background-color: #4ab4e2 !important;
|
|
21
|
+
border: 0px !important;
|
|
22
|
+
font-size: 14px !important;
|
|
23
|
+
border-radius: 20px !important;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.vue-query-builder .vqb-group.depth-1 .vqb-rule,
|
|
27
|
+
.vue-query-builder .vqb-group.depth-2 {
|
|
28
|
+
border-left: 2px solid #577696 !important;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.vue-query-builder .vqb-rule {
|
|
32
|
+
background-color: #fafafc !important;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.form-i nline label {
|
|
36
|
+
font-size: 14px !important;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.card-header {
|
|
40
|
+
padding: 5px !important;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.card {
|
|
44
|
+
padding: 10px !important;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.vqb-rule {
|
|
48
|
+
margin-bottom: 10px !important;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.rule-actions {
|
|
52
|
+
margin-bottom: 10px !important;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.mr-2 {
|
|
56
|
+
font-size: 14px !important;
|
|
57
|
+
margin-left: 10px !important;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.form-inline .form-control {
|
|
61
|
+
min-width: 200px !important;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
option {
|
|
65
|
+
font-size: 14px !important;
|
|
66
|
+
padding: 5px !important;
|
|
67
|
+
}
|
|
68
|
+
</style>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="selected-filter" @blur="open = false">
|
|
3
|
+
<div class="selected" :class="{ open: open }" @click="open = !open">
|
|
4
|
+
<span class="title">{{ selected }}</span>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="items" :class="{ hide: !open }">
|
|
7
|
+
<div v-for="(options, i) of options" :key="i">
|
|
8
|
+
<div @click="select(options)">
|
|
9
|
+
<span :class="options.classCss">
|
|
10
|
+
<i class="icon-query-builder" :class="options.icon"></i>
|
|
11
|
+
<span class="title"> {{ options.title }}</span>
|
|
12
|
+
</span>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
export default {
|
|
21
|
+
props: ["options", "value"],
|
|
22
|
+
data() {
|
|
23
|
+
return {
|
|
24
|
+
selected: "Selecione os filtros",
|
|
25
|
+
open: false,
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
mounted() {
|
|
29
|
+
this.$emit("input", this.selected);
|
|
30
|
+
},
|
|
31
|
+
methods: {
|
|
32
|
+
select(options) {
|
|
33
|
+
this.$emit("input", options);
|
|
34
|
+
this.selected = options.title;
|
|
35
|
+
this.open = false;
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<style scoped>
|
|
42
|
+
.selected-filter {
|
|
43
|
+
position: relative;
|
|
44
|
+
width: 100%;
|
|
45
|
+
text-align: left;
|
|
46
|
+
outline: none;
|
|
47
|
+
height: 40px;
|
|
48
|
+
line-height: 40px;
|
|
49
|
+
z-index: 500;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.selected-filter .selected {
|
|
53
|
+
background-color: white;
|
|
54
|
+
border: 1px solid #DBDEE0;
|
|
55
|
+
border-radius: 6px;
|
|
56
|
+
color: #495057;
|
|
57
|
+
padding-left: 1em;
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
user-select: none;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.selected-filter .selected:after {
|
|
63
|
+
position: absolute;
|
|
64
|
+
content: "";
|
|
65
|
+
top: 19px;
|
|
66
|
+
right: 1em;
|
|
67
|
+
width: 0;
|
|
68
|
+
height: 0;
|
|
69
|
+
border: 5px solid transparent;
|
|
70
|
+
border-color: black transparent transparent transparent;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.selected-filter .items {
|
|
74
|
+
color: black;
|
|
75
|
+
border-radius: 0px 0px 6px 6px;
|
|
76
|
+
overflow: hidden;
|
|
77
|
+
position: absolute;
|
|
78
|
+
background-color: #fafafc;
|
|
79
|
+
left: 0;
|
|
80
|
+
right: 0;
|
|
81
|
+
z-index: 1;
|
|
82
|
+
height: 200px;
|
|
83
|
+
overflow-y: visible;
|
|
84
|
+
overflow-x: hidden;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.selected-filter .items div {
|
|
88
|
+
color: black;
|
|
89
|
+
padding-left: 1em;
|
|
90
|
+
cursor: pointer;
|
|
91
|
+
user-select: none;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.hide {
|
|
95
|
+
display: none;
|
|
96
|
+
}
|
|
97
|
+
</style>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class="side-by-side div-tag" v-for="tag in tagsLocal" :key="tag.id">
|
|
4
|
+
<Tag :eventName="eventName" :eventData="tag" :title="tag.title" :value="tag.value" />
|
|
5
|
+
</div>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
import Tag from "@nixweb/nixloc-ui/src/component/layout/Tag";
|
|
11
|
+
|
|
12
|
+
import { mapGetters, mapMutations } from "vuex";
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
name: "Tags",
|
|
16
|
+
components: { Tag },
|
|
17
|
+
props: {
|
|
18
|
+
eventName: String,
|
|
19
|
+
},
|
|
20
|
+
data() {
|
|
21
|
+
return {
|
|
22
|
+
tagsLocal: [],
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
created() {
|
|
26
|
+
let self = this;
|
|
27
|
+
setTimeout(function () {
|
|
28
|
+
self.tagsLocal = self.tags;
|
|
29
|
+
}, 100);
|
|
30
|
+
},
|
|
31
|
+
computed: {
|
|
32
|
+
...mapGetters("report", ["tags"]),
|
|
33
|
+
...mapGetters("generic", ["showModal", "event"]),
|
|
34
|
+
},
|
|
35
|
+
methods: {
|
|
36
|
+
...mapMutations("report", ["removeSelectedRule"]),
|
|
37
|
+
},
|
|
38
|
+
watch: {
|
|
39
|
+
event: {
|
|
40
|
+
handler(event) {
|
|
41
|
+
if (event.name == "tagRemoved") {
|
|
42
|
+
var tags = this.tagsLocal.filter((item) => {
|
|
43
|
+
return item.id != event.data.id;
|
|
44
|
+
});
|
|
45
|
+
this.tagsLocal = tags;
|
|
46
|
+
this.removeSelectedRule(event.data.id);
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
deep: true,
|
|
50
|
+
},
|
|
51
|
+
tags: {
|
|
52
|
+
handler(value) {
|
|
53
|
+
this.tagsLocal = value;
|
|
54
|
+
},
|
|
55
|
+
deep: true,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
</script>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a depply cloned object without reference.
|
|
3
|
+
* Copied from Vue MultiSelect and Vuex.
|
|
4
|
+
* @type {Object}
|
|
5
|
+
*/
|
|
6
|
+
const deepClone = function (obj) {
|
|
7
|
+
if (Array.isArray(obj)) {
|
|
8
|
+
return obj.map(deepClone)
|
|
9
|
+
} else if (obj && typeof obj === 'object') {
|
|
10
|
+
var cloned = {}
|
|
11
|
+
var keys = Object.keys(obj)
|
|
12
|
+
for (var i = 0, l = keys.length; i < l; i++) {
|
|
13
|
+
var key = keys[i]
|
|
14
|
+
cloned[key] = deepClone(obj[key])
|
|
15
|
+
}
|
|
16
|
+
return cloned
|
|
17
|
+
} else {
|
|
18
|
+
return obj
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default deepClone;
|