@nixweb/nixloc-ui 0.0.125 → 0.0.128
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/docs/src/component/template/ViewTemplateReportPreview.drawio +210 -0
- package/package.json +79 -77
- package/src/App.vue +13 -13
- package/src/component/forms/Button.vue +170 -169
- package/src/component/forms/CheckboxGroup.vue +72 -63
- package/src/component/forms/CheckboxSimple.vue +46 -27
- package/src/component/forms/Color.vue +38 -38
- package/src/component/forms/DateTime.vue +167 -177
- package/src/component/forms/Dropdown.vue +218 -224
- package/src/component/forms/EditorHtml.vue +126 -123
- package/src/component/forms/FileUpload.vue +185 -189
- package/src/component/forms/ImageUpload.vue +230 -0
- package/src/component/forms/IncrementDecrement.vue +101 -0
- package/src/component/forms/InputDecimal.vue +142 -137
- package/src/component/forms/InputNumber.vue +154 -149
- package/src/component/forms/InputPassword.vue +135 -135
- package/src/component/forms/InputText.vue +162 -157
- package/src/component/forms/Modal.vue +65 -60
- package/src/component/forms/RadioGroup.vue +50 -50
- package/src/component/forms/Select.vue +349 -337
- package/src/component/forms/SelectStatic.vue +127 -120
- package/src/component/forms/Slider.vue +18 -18
- package/src/component/forms/TextArea.vue +126 -126
- package/src/component/layout/Alert.vue +92 -92
- package/src/component/layout/Badge.vue +103 -103
- package/src/component/layout/FixedBar.vue +100 -68
- package/src/component/layout/Header.vue +38 -35
- package/src/component/layout/LoadingFullPage.vue +27 -27
- package/src/component/layout/Menu.vue +210 -214
- package/src/component/layout/Molded.vue +28 -27
- package/src/component/layout/Panel.vue +140 -142
- package/src/component/layout/Popover.vue +126 -126
- package/src/component/layout/ScrollBar.vue +42 -43
- package/src/component/layout/Tab.vue +135 -0
- package/src/component/layout/Tag.vue +3 -3
- package/src/component/layout/Wizard.vue +211 -213
- package/src/component/rental/DisplayPeriodRent.vue +81 -0
- package/src/component/rental/DisplayTotalization.vue +47 -0
- package/src/component/shared/Collapse.vue +131 -131
- package/src/component/shared/Confirmation.vue +2 -2
- package/src/component/shared/DocumentEditor.vue +1 -1
- package/src/component/shared/DocumentPreview.vue +1 -1
- package/src/component/shared/DocumentPublic.vue +34 -0
- package/src/component/shared/ExportExcel.vue +1 -8
- package/src/component/shared/ExportPDF.vue +116 -116
- package/src/component/shared/{HeaderPrint.vue → HeaderReport.vue} +4 -4
- package/src/component/shared/HorizontalFilter.vue +59 -59
- package/src/component/shared/Loading.vue +107 -107
- package/src/component/shared/LoadingMoreButton.vue +23 -23
- package/src/component/shared/Messages.vue +81 -83
- package/src/component/shared/PDFViewer.vue +22 -22
- package/src/component/shared/Pagination.vue +52 -53
- package/src/component/shared/{LegendaParametro.vue → ParameterLegend.vue} +22 -26
- package/src/component/shared/ProgressBar.vue +22 -21
- package/src/component/shared/QueryButton.vue +66 -66
- package/src/component/shared/Report.vue +187 -0
- package/src/component/shared/SaveCancel.vue +26 -5
- package/src/component/shared/Search.vue +154 -154
- package/src/component/shared/SelectOption.vue +146 -0
- package/src/component/shared/Table.vue +163 -243
- package/src/component/shared/TableButton.vue +36 -36
- package/src/component/shared/TableDraggable.vue +127 -0
- package/src/component/shared/TableItem.vue +177 -0
- package/src/component/shared/TableTotalRecords.vue +9 -10
- package/src/component/shared/TableTotalization.vue +47 -47
- package/src/component/shared/Tip.vue +42 -42
- package/src/component/shared/Toast.vue +54 -54
- package/src/component/shared/TotalizationReport.vue +59 -0
- package/src/component/shared/VerticalFilter.vue +97 -145
- package/src/component/shared/query-builder/AddRule.vue +181 -187
- package/src/component/shared/query-builder/ConvertToOdata.js +34 -43
- package/src/component/shared/query-builder/DynamicComponent.vue +21 -16
- package/src/component/shared/query-builder/DynamicComponentList.vue +73 -0
- package/src/component/shared/query-builder/Fields.vue +29 -63
- package/src/component/shared/query-builder/QueryBuilder.vue +69 -69
- package/src/component/shared/query-builder/Rules.vue +2 -14
- package/src/component/shared/query-builder/SelectRule.vue +15 -15
- package/src/component/shared/query-builder/Tags.vue +24 -8
- package/src/component/shared/query-builder/utilities.js +21 -21
- package/src/component/template/{ListViewWithHandlerData.vue → ListViewWithDataHandler.vue} +260 -231
- package/src/component/template/{AddEditReport.vue → ReportCreateUpdate.vue} +40 -22
- package/src/component/template/ViewTemplateConfiguration.vue +64 -69
- package/src/component/template/ViewTemplateDocumentView.vue +22 -25
- package/src/component/template/ViewTemplateReportList.vue +39 -57
- package/src/component/template/ViewTemplateReportPreview.vue +270 -341
- package/src/component/template/ViewTemplateReportPreviewCOPIASEGURANCA.vue +497 -0
- package/src/component/template/ViewTemplateSelectOption.vue +60 -0
- package/src/component/template/ViewTemplateWithSalveCancel.vue +32 -32
- package/src/component/template/ViewTemplateWithTable.vue +56 -49
- package/src/component/template/model/Report.js +2 -2
- package/src/component/value-objects/Address.js +11 -0
- package/src/component/value-objects/{Endereco.vue → Address.vue} +39 -40
- package/src/component/value-objects/{DadosContato.js → Contact.js} +2 -2
- package/src/component/value-objects/{DadosContato.vue → Contact.vue} +24 -17
- package/src/component/value-objects/Person.js +10 -0
- package/src/component/value-objects/{DadosPessoa.vue → Person.vue} +50 -35
- package/src/config/axios.js +9 -9
- package/src/config/dicas.js +14 -14
- package/src/config/router.js +13 -13
- package/src/config/token.js +14 -14
- package/src/main.js +23 -23
- package/src/store/modules/generic.js +512 -488
- package/src/store/modules/report.js +156 -127
- package/src/store/modules/user.js +6 -0
- package/src/store/modules/validation.js +38 -38
- package/src/store/store.js +13 -13
- package/docs/src/component/template/ModeloRelatorioView.drawio +0 -160
- package/src/component/shared/query-builder/ListDynamicComponent.vue +0 -42
- package/src/component/shared/query-builder/Totalization.vue +0 -38
- package/src/component/value-objects/DadosPessoa.js +0 -10
- package/src/component/value-objects/Endereco.js +0 -11
|
@@ -1,68 +1,65 @@
|
|
|
1
1
|
export default class ConvertToOdata {
|
|
2
2
|
convertRule(rule) {
|
|
3
|
-
let nome = rule.nome;
|
|
4
|
-
let title = rule.title;
|
|
5
|
-
let valor = rule.valor;
|
|
6
|
-
let type = rule.type;
|
|
7
3
|
let operator = rule.operator;
|
|
8
4
|
|
|
9
|
-
if (operator === "igual") return `${
|
|
10
|
-
if (operator === "diferente") return `${
|
|
11
|
-
if (operator === "contem") return `contains(${
|
|
12
|
-
if (operator === "=") return `${nome} eq ${valor}`;
|
|
13
|
-
if (operator === "!=") return `${nome} ne ${valor}`;
|
|
14
|
-
if (operator === "<") return `${nome} lt ${valor}`;
|
|
15
|
-
if (operator === "<=") return `${nome} le ${valor}`;
|
|
16
|
-
if (operator === ">") return `${nome} gt ${valor}`;
|
|
17
|
-
if (operator === ">=") return `${nome} ge ${valor}`;
|
|
5
|
+
if (operator === "igual" && rule.typeField === "text") return `${rule.name} eq '${rule.value}'`;
|
|
6
|
+
if (operator === "diferente" && rule.typeField === "text") return `${rule.name} ne '${rule.value}'`;
|
|
7
|
+
if (operator === "contem") return `contains(${rule.name},'${rule.value}')`;
|
|
18
8
|
|
|
19
|
-
if (rule.
|
|
20
|
-
if (rule.
|
|
21
|
-
if (
|
|
9
|
+
if (operator === "igual" && rule.typeField === "numeric") return `${rule.name} eq ${rule.value}`;
|
|
10
|
+
if (operator === "diferente" && rule.typeField === "numeric") return `${rule.name} ne ${rule.value}`;
|
|
11
|
+
if (operator === "menor") return `${rule.name} lt ${rule.value}`;
|
|
12
|
+
if (operator === "menor ou igual") return `${rule.name} le ${rule.value}`;
|
|
13
|
+
if (operator === "maior") return `${rule.name} gt ${rule.value}`;
|
|
14
|
+
if (operator === "maior ou igual") return `${rule.name} ge ${rule.value}`;
|
|
15
|
+
|
|
16
|
+
if (rule.typeField === "dateTime") return this.convertDateTime(rule.name, rule.value);
|
|
17
|
+
if (rule.typeField === "select") return this.convertSelect(rule.name, rule.value);
|
|
18
|
+
if (rule.typeField === "checkbox") return this.convertCheckbox(rule.name, rule.title, rule.type, rule.value);
|
|
22
19
|
|
|
23
20
|
}
|
|
24
|
-
convertDateTime(
|
|
25
|
-
let
|
|
26
|
-
let
|
|
27
|
-
return
|
|
21
|
+
convertDateTime(name, value) {
|
|
22
|
+
let start = this.convertDate(value[0]);
|
|
23
|
+
let end = this.convertDate(value[1]);
|
|
24
|
+
return `${name} ge ${start} and ${name} le ${end}`;
|
|
28
25
|
}
|
|
29
|
-
convertSelect(
|
|
30
|
-
return `${
|
|
26
|
+
convertSelect(name, value) {
|
|
27
|
+
return `${name} eq '${value.id}'`;
|
|
31
28
|
}
|
|
32
|
-
convertCheckbox(
|
|
29
|
+
convertCheckbox(name, title, type, options) {
|
|
33
30
|
let query = "";
|
|
34
|
-
let
|
|
31
|
+
let seq = 0;
|
|
35
32
|
var size = options.length;
|
|
36
33
|
let self = this;
|
|
37
|
-
options.forEach(function (
|
|
34
|
+
options.forEach(function (value) {
|
|
35
|
+
|
|
38
36
|
if (type == "field") {
|
|
39
|
-
query += `${
|
|
40
|
-
if (
|
|
37
|
+
query += `${name} eq ${value}`;
|
|
38
|
+
if (seq + 1 != size) query += ` or `;
|
|
41
39
|
}
|
|
42
40
|
if (type == "totalization") {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (sequencia + 1 != size) query += `,`;
|
|
41
|
+
query += `${name} with ${value} as ${value}${name.charAt(0).toUpperCase() + name.slice(1)}`;
|
|
42
|
+
if (seq + 1 != size) query += `,`;
|
|
46
43
|
}
|
|
47
|
-
|
|
44
|
+
seq++;
|
|
48
45
|
});
|
|
49
46
|
|
|
50
47
|
if (size > 1 && type == "field") return `(${query})`;
|
|
51
48
|
return `${query}`;
|
|
52
49
|
}
|
|
53
|
-
|
|
50
|
+
convertDate(data) {
|
|
54
51
|
let str = data.replace("/", "").replace("/", "");
|
|
55
52
|
|
|
56
53
|
let date = {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
day: str.substr(0, 2),
|
|
55
|
+
month: str.substr(2, 2),
|
|
56
|
+
year: str.substr(4, 4),
|
|
60
57
|
};
|
|
61
58
|
|
|
62
|
-
var iso = date.
|
|
59
|
+
var iso = date.year + "-" + date.month + "-" + date.day;
|
|
63
60
|
|
|
64
61
|
/*
|
|
65
|
-
iso += date.
|
|
62
|
+
iso += date.day + "T";
|
|
66
63
|
iso += "00:00:00.000Z";
|
|
67
64
|
iso += d.getHours().toString().padStart(2, "0") + ":";
|
|
68
65
|
iso += d.getMinutes().toString().padStart(2, "0") + ":";
|
|
@@ -71,10 +68,4 @@ export default class ConvertToOdata {
|
|
|
71
68
|
|
|
72
69
|
return iso;
|
|
73
70
|
}
|
|
74
|
-
converteName(valor) {
|
|
75
|
-
if (valor === "sum") return "soma";
|
|
76
|
-
if (valor === "average") return "media";
|
|
77
|
-
if (valor === "max") return "maximo";
|
|
78
|
-
if (valor === "minimo") return "minimo";
|
|
79
|
-
}
|
|
80
71
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="vqb-rule card">
|
|
2
|
+
<div class="vqb-rule card move">
|
|
3
3
|
<div class="form-inline">
|
|
4
4
|
<label :class="rule.classCss" class="mr-5">
|
|
5
5
|
<i :class="rule.icon"></i>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
/>
|
|
16
16
|
</div>
|
|
17
17
|
<select
|
|
18
|
-
v-if="rule.
|
|
18
|
+
v-if="rule.typeField == 'text' || rule.typeField == 'numeric'"
|
|
19
19
|
v-model="rule.operator"
|
|
20
20
|
class="form-control mr-2"
|
|
21
21
|
>
|
|
@@ -24,30 +24,31 @@
|
|
|
24
24
|
</option>
|
|
25
25
|
</select>
|
|
26
26
|
<input
|
|
27
|
-
v-if="rule.
|
|
27
|
+
v-if="rule.typeField == 'text' || rule.typeField == 'numeric'"
|
|
28
28
|
class="form-control"
|
|
29
|
-
:type="rule.
|
|
29
|
+
:type="rule.typeField == 'text' ? 'text' : 'number'"
|
|
30
30
|
placeholder="Valor"
|
|
31
|
-
v-model="rule.
|
|
31
|
+
v-model="rule.value"
|
|
32
32
|
/>
|
|
33
33
|
<CheckboxGroup
|
|
34
|
-
v-if="rule.
|
|
34
|
+
v-if="rule.typeField == 'checkbox'"
|
|
35
35
|
:options="options"
|
|
36
|
-
|
|
36
|
+
:initialValue="rule.value"
|
|
37
|
+
v-model="rule.value"
|
|
37
38
|
/>
|
|
38
39
|
<DateTime
|
|
39
|
-
v-if="rule.
|
|
40
|
+
v-if="rule.typeField == 'dateTime'"
|
|
40
41
|
:format="rule.props.format"
|
|
41
42
|
:type="rule.props.type"
|
|
42
43
|
:range="rule.props.range"
|
|
43
|
-
v-model="rule.
|
|
44
|
+
v-model="rule.value"
|
|
44
45
|
/>
|
|
45
46
|
<Select
|
|
46
|
-
v-if="rule.
|
|
47
|
+
v-if="rule.typeField == 'select'"
|
|
47
48
|
:url="rule.props.url"
|
|
48
|
-
v-model="rule.
|
|
49
|
+
v-model="rule.value"
|
|
49
50
|
/>
|
|
50
|
-
<div @click="
|
|
51
|
+
<div @click="removeRule" class="ml-auto btn-remove">
|
|
51
52
|
<i class="fas fa-times"></i>
|
|
52
53
|
</div>
|
|
53
54
|
</div>
|
|
@@ -74,10 +75,10 @@ export default {
|
|
|
74
75
|
methods: {
|
|
75
76
|
...mapMutations("generic", ["addEvent"]),
|
|
76
77
|
...mapMutations("report", ["removeSelectedRule"]),
|
|
77
|
-
|
|
78
|
+
removeRule() {
|
|
78
79
|
this.removeSelectedRule(this.rule.id);
|
|
79
80
|
this.addEvent({
|
|
80
|
-
|
|
81
|
+
name: "selectedRuleRemoved",
|
|
81
82
|
data: { id: this.rule.id },
|
|
82
83
|
});
|
|
83
84
|
},
|
|
@@ -86,7 +87,7 @@ export default {
|
|
|
86
87
|
options() {
|
|
87
88
|
let options = [];
|
|
88
89
|
this.rule.options.forEach((item) => {
|
|
89
|
-
let option = { text: item.title, value: item.
|
|
90
|
+
let option = { text: item.title, value: item.value };
|
|
90
91
|
options.push(option);
|
|
91
92
|
});
|
|
92
93
|
return options;
|
|
@@ -95,6 +96,10 @@ export default {
|
|
|
95
96
|
};
|
|
96
97
|
</script>
|
|
97
98
|
<style scoped>
|
|
99
|
+
.move {
|
|
100
|
+
cursor: move;
|
|
101
|
+
}
|
|
102
|
+
|
|
98
103
|
.btn-remove {
|
|
99
104
|
font-size: 16px;
|
|
100
105
|
color: darkgray;
|
|
@@ -102,6 +107,6 @@ export default {
|
|
|
102
107
|
}
|
|
103
108
|
|
|
104
109
|
.div-select {
|
|
105
|
-
width:
|
|
110
|
+
width: 330px;
|
|
106
111
|
}
|
|
107
112
|
</style>
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
/>
|
|
14
|
+
</draggable>
|
|
15
|
+
<br />
|
|
16
|
+
<div v-if="selectedRules.length == 0">
|
|
17
|
+
<Alert type="info"> Selecione o filtro desejado e clique em +Adicionar</Alert>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script>
|
|
24
|
+
import Alert from "@nixweb/nixloc-ui/src/component/layout/Alert";
|
|
25
|
+
|
|
26
|
+
import draggable from "vuedraggable";
|
|
27
|
+
|
|
28
|
+
import { mapState, mapMutations } from "vuex";
|
|
29
|
+
|
|
30
|
+
export default {
|
|
31
|
+
components: {
|
|
32
|
+
Alert,
|
|
33
|
+
draggable,
|
|
34
|
+
},
|
|
35
|
+
data() {
|
|
36
|
+
return {
|
|
37
|
+
dynamicComponent: null,
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
computed: {
|
|
41
|
+
...mapState("report", ["selectedRules"]),
|
|
42
|
+
},
|
|
43
|
+
mounted() {
|
|
44
|
+
this.dynamicComponent = this.$parent.$options.components["DynamicComponent"];
|
|
45
|
+
},
|
|
46
|
+
methods: {
|
|
47
|
+
...mapMutations("report", ["mountFinalQueryFormatOData"]),
|
|
48
|
+
component() {
|
|
49
|
+
return this.dynamicComponent;
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
watch: {
|
|
53
|
+
selectedRules: {
|
|
54
|
+
handler(value) {
|
|
55
|
+
this.mountFinalQueryFormatOData(value);
|
|
56
|
+
},
|
|
57
|
+
deep: true,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<style scoped>
|
|
64
|
+
.component {
|
|
65
|
+
min-height: 380px;
|
|
66
|
+
max-height: 380px;
|
|
67
|
+
overflow-y: visible;
|
|
68
|
+
overflow-x: hidden;
|
|
69
|
+
padding-left: 10px;
|
|
70
|
+
padding-right: 10px;
|
|
71
|
+
margin-top: 10px;
|
|
72
|
+
}
|
|
73
|
+
</style>
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
<div class="div-options">
|
|
7
7
|
<CheckboxGroup
|
|
8
8
|
:stacked="true"
|
|
9
|
-
:initialValue="
|
|
10
|
-
:options="
|
|
11
|
-
v-model="
|
|
9
|
+
:initialValue="fieldsLocal.selected"
|
|
10
|
+
:options="fieldsLocal.options"
|
|
11
|
+
v-model="fieldsLocal.selected"
|
|
12
12
|
/>
|
|
13
13
|
</div>
|
|
14
14
|
</ScrollBar>
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
{ text: 'Crescente', value: 'asc' },
|
|
20
20
|
{ text: 'Decrescente', value: 'desc' },
|
|
21
21
|
]"
|
|
22
|
-
v-model="
|
|
22
|
+
v-model="fieldsLocal.orderBy"
|
|
23
23
|
/>
|
|
24
24
|
<SelectStatic
|
|
25
25
|
title="Ordenar"
|
|
26
|
-
fieldTarget="
|
|
27
|
-
:initialValue="
|
|
28
|
-
:data="
|
|
29
|
-
v-model="
|
|
26
|
+
fieldTarget="order"
|
|
27
|
+
:initialValue="{ content: fieldsLocal.sort.content, id: fieldsLocal.sort.id }"
|
|
28
|
+
:data="options"
|
|
29
|
+
v-model="fieldsLocal.sort"
|
|
30
30
|
/>
|
|
31
31
|
</b-col>
|
|
32
32
|
</b-row>
|
|
@@ -41,79 +41,45 @@ import ScrollBar from "@nixweb/nixloc-ui/src/component/layout/ScrollBar.vue";
|
|
|
41
41
|
import { mapMutations, mapGetters } from "vuex";
|
|
42
42
|
|
|
43
43
|
export default {
|
|
44
|
-
name: "
|
|
44
|
+
name: "Fields",
|
|
45
45
|
components: {
|
|
46
46
|
CheckboxGroup,
|
|
47
47
|
SelectStatic,
|
|
48
48
|
ScrollBar,
|
|
49
49
|
RadioGroup,
|
|
50
50
|
},
|
|
51
|
-
props: {
|
|
52
|
-
fields: Array,
|
|
53
|
-
},
|
|
54
51
|
data() {
|
|
55
52
|
return {
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
fieldsLocal: {
|
|
54
|
+
selected: [],
|
|
55
|
+
options: [],
|
|
56
|
+
sort: { content: "", id: "asc" },
|
|
57
|
+
orderBy: "",
|
|
58
|
+
},
|
|
58
59
|
};
|
|
59
60
|
},
|
|
60
61
|
created() {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
content: this.initialValue.content,
|
|
64
|
-
id: this.initialValue.id,
|
|
65
|
-
ordenar: this.ordenar,
|
|
66
|
-
};
|
|
67
|
-
this.atualizaCampoOrdenado(obj);
|
|
68
|
-
},
|
|
69
|
-
mounted() {
|
|
70
|
-
this.addFieldsReport(this.fields);
|
|
62
|
+
// converte getters para data local para que possa ser manipulado com o v-model
|
|
63
|
+
this.fieldsLocal = this.fields;
|
|
71
64
|
},
|
|
72
65
|
computed: {
|
|
73
|
-
...mapGetters("report", ["
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
this.updateSelectedField(value);
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
campoOrdenado: {
|
|
83
|
-
get() {
|
|
84
|
-
return this.$store.state.report.campoOrdenado;
|
|
85
|
-
},
|
|
86
|
-
set(value) {
|
|
87
|
-
let obj = { content: value.content, id: value.id, ordenar: this.ordenar };
|
|
88
|
-
this.atualizaCampoOrdenado(obj);
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
ordenacao() {
|
|
92
|
-
let ordenacao = [];
|
|
93
|
-
this.optionTable.options.forEach((option) => {
|
|
94
|
-
console.log(option);
|
|
95
|
-
/* let obj = { content: option.text, id: option.value };
|
|
96
|
-
ordenacao.push(obj);*/
|
|
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);
|
|
97
72
|
});
|
|
98
|
-
return
|
|
73
|
+
return options;
|
|
99
74
|
},
|
|
100
75
|
},
|
|
101
76
|
methods: {
|
|
102
|
-
...mapMutations("report", [
|
|
103
|
-
"addFieldsReport",
|
|
104
|
-
"updateSelectedField",
|
|
105
|
-
"atualizaCampoOrdenado",
|
|
106
|
-
]),
|
|
77
|
+
...mapMutations("report", ["updateSelectedFields"]),
|
|
107
78
|
},
|
|
108
79
|
watch: {
|
|
109
|
-
|
|
110
|
-
handler(
|
|
111
|
-
|
|
112
|
-
content: this.campoOrdenado.content,
|
|
113
|
-
id: this.campoOrdenado.id,
|
|
114
|
-
ordenar: this.ordenar,
|
|
115
|
-
};
|
|
116
|
-
this.atualizaCampoOrdenado(obj);
|
|
80
|
+
fieldsLocal: {
|
|
81
|
+
handler(fieldsLocal) {
|
|
82
|
+
this.updateSelectedFields(fieldsLocal);
|
|
117
83
|
},
|
|
118
84
|
deep: true,
|
|
119
85
|
},
|
|
@@ -122,6 +88,6 @@ export default {
|
|
|
122
88
|
</script>
|
|
123
89
|
<style scoped>
|
|
124
90
|
.div-options {
|
|
125
|
-
|
|
91
|
+
padding-left: 0px;
|
|
126
92
|
}
|
|
127
93
|
</style>
|
|
@@ -1,69 +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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
mergeRules() {
|
|
51
|
-
var mergeRules = [];
|
|
52
|
-
var self = this;
|
|
53
|
-
self.rules.forEach(function (rule) {
|
|
54
|
-
if (typeof self.typeRule[rule.
|
|
55
|
-
mergeRules.push(Object.assign({}, self.typeRule[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>
|
|
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>
|
|
@@ -1,29 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<
|
|
4
|
-
<QueryBuilder :rules="rules" />
|
|
5
|
-
</ScrollBar>
|
|
3
|
+
<QueryBuilder />
|
|
6
4
|
</div>
|
|
7
5
|
</template>
|
|
8
6
|
|
|
9
7
|
<script>
|
|
10
8
|
import QueryBuilder from "./QueryBuilder.vue";
|
|
11
|
-
import ScrollBar from "@nixweb/nixloc-ui/src/component/layout/ScrollBar.vue";
|
|
12
9
|
|
|
13
10
|
import { mapMutations } from "vuex";
|
|
14
11
|
|
|
15
12
|
export default {
|
|
16
13
|
name: "Rules",
|
|
17
|
-
components: {
|
|
18
|
-
props: {
|
|
19
|
-
rules: Array,
|
|
20
|
-
},
|
|
21
|
-
mounted() {
|
|
22
|
-
this.addRulesReport(this.rules);
|
|
23
|
-
},
|
|
24
|
-
methods: {
|
|
25
|
-
...mapMutations("report", ["addRulesReport"]),
|
|
26
|
-
},
|
|
14
|
+
components: { QueryBuilder },
|
|
27
15
|
};
|
|
28
16
|
</script>
|
|
29
17
|
|