@nixweb/nixloc-ui 0.0.124 → 0.0.127
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 +3 -1
- package/src/component/forms/Button.vue +7 -6
- package/src/component/forms/CheckboxGroup.vue +7 -4
- package/src/component/forms/CheckboxSimple.vue +17 -2
- package/src/component/forms/DateTime.vue +15 -29
- package/src/component/forms/EditorHtml.vue +8 -5
- package/src/component/forms/FileUpload.vue +7 -11
- package/src/component/forms/ImageUpload.vue +222 -0
- package/src/component/forms/InputDecimal.vue +10 -9
- package/src/component/forms/InputNumber.vue +20 -15
- package/src/component/forms/InputPassword.vue +1 -1
- package/src/component/forms/InputText.vue +3 -3
- package/src/component/forms/Modal.vue +9 -4
- package/src/component/forms/Select.vue +12 -9
- package/src/component/forms/SelectStatic.vue +8 -1
- package/src/component/layout/Menu.vue +4 -3
- package/src/component/layout/Panel.vue +0 -2
- package/src/component/layout/{Scrollbar.vue → ScrollBar.vue} +4 -5
- package/src/component/layout/Tag.vue +3 -3
- package/src/component/layout/Wizard.vue +11 -13
- package/src/component/shared/BodyReport.vue +186 -0
- package/src/component/shared/Confirmation.vue +2 -2
- package/src/component/shared/DocumentEditor.vue +1 -1
- package/src/component/shared/ExportExcel.vue +1 -8
- package/src/component/shared/{HeaderPrint.vue → HeaderReport.vue} +3 -3
- package/src/component/shared/HorizontalFilter.vue +1 -1
- package/src/component/shared/Loading.vue +1 -1
- package/src/component/shared/Messages.vue +2 -4
- package/src/component/shared/Pagination.vue +4 -5
- package/src/component/shared/{LegendaParametro.vue → ParameterLegend.vue} +25 -29
- package/src/component/shared/ProgressBar.vue +2 -1
- package/src/component/shared/SaveCancel.vue +20 -4
- package/src/component/shared/Search.vue +16 -16
- package/src/component/shared/SelectOption.vue +137 -0
- package/src/component/shared/Table.vue +33 -22
- package/src/component/shared/TableButton.vue +3 -3
- package/src/component/shared/TableTotalRecords.vue +9 -10
- package/src/component/shared/Toast.vue +2 -2
- package/src/component/shared/VerticalFilter.vue +2 -50
- package/src/component/shared/query-builder/AddRule.vue +49 -55
- package/src/component/shared/query-builder/ConvertToOdata.js +39 -42
- package/src/component/shared/query-builder/DynamicComponent.vue +16 -15
- package/src/component/shared/query-builder/DynamicComponentList.vue +62 -0
- package/src/component/shared/query-builder/Fields.vue +32 -66
- package/src/component/shared/query-builder/QueryBuilder.vue +12 -12
- 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/template/{ListViewWithHandlerData.vue → ListViewWithDataHandler.vue} +30 -23
- package/src/component/template/{AddEditReport.vue → ReportCreateUpdate.vue} +31 -20
- package/src/component/template/ViewTemplateConfiguration.vue +6 -12
- package/src/component/template/ViewTemplateDocumentView.vue +21 -25
- package/src/component/template/ViewTemplateReportList.vue +39 -57
- package/src/component/template/ViewTemplateReportPreview.vue +238 -354
- package/src/component/template/ViewTemplateReportPreviewCOPIASEGURANCA.vue +497 -0
- package/src/component/template/ViewTemplateSelectOption.vue +60 -0
- package/src/component/template/ViewTemplateWithTable.vue +21 -14
- 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} +17 -17
- package/src/component/value-objects/Person.js +10 -0
- package/src/component/value-objects/{DadosPessoa.vue → Person.vue} +35 -35
- package/src/store/modules/generic.js +17 -11
- package/src/store/modules/report.js +124 -113
- package/src/store/modules/user.js +3 -0
- package/docs/src/component/template/ModeloRelatorioView.drawio +0 -160
- package/src/component/shared/query-builder/ListDynamicComponent.vue +0 -42
- 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
|
-
|
|
13
|
-
if (operator === "
|
|
14
|
-
if (operator === "
|
|
15
|
-
if (operator === "
|
|
16
|
-
if (operator === "
|
|
17
|
-
if (operator === "
|
|
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}')`;
|
|
8
|
+
|
|
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}`;
|
|
18
15
|
|
|
19
|
-
if (rule.
|
|
20
|
-
if (rule.
|
|
21
|
-
if (rule.
|
|
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) {
|
|
38
35
|
if (type == "field") {
|
|
39
|
-
query += `${
|
|
40
|
-
if (
|
|
36
|
+
query += `${name} eq ${value}`;
|
|
37
|
+
if (seq + 1 != size) query += ` or `;
|
|
41
38
|
}
|
|
42
39
|
if (type == "totalization") {
|
|
43
|
-
let
|
|
44
|
-
query += `${
|
|
45
|
-
if (
|
|
40
|
+
let convertName = self.convertName(value);
|
|
41
|
+
query += `${name} with ${value} as ${convertName}${title}`;
|
|
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,10 @@ export default class ConvertToOdata {
|
|
|
71
68
|
|
|
72
69
|
return iso;
|
|
73
70
|
}
|
|
74
|
-
|
|
75
|
-
if (
|
|
76
|
-
if (
|
|
77
|
-
if (
|
|
78
|
-
if (
|
|
71
|
+
convertName(value) {
|
|
72
|
+
if (value === "sum") return "soma";
|
|
73
|
+
if (value === "average") return "media";
|
|
74
|
+
if (value === "max") return "maximo";
|
|
75
|
+
if (value === "minimo") return "minimo";
|
|
79
76
|
}
|
|
80
77
|
}
|
|
@@ -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;
|
|
@@ -102,6 +103,6 @@ export default {
|
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
.div-select {
|
|
105
|
-
width:
|
|
106
|
+
width: 330px;
|
|
106
107
|
}
|
|
107
108
|
</style>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="component">
|
|
3
|
+
<component
|
|
4
|
+
:is="component()"
|
|
5
|
+
v-for="(rule, index) in selectedRules"
|
|
6
|
+
:key="index"
|
|
7
|
+
:rule="rule"
|
|
8
|
+
/>
|
|
9
|
+
<div v-if="selectedRules.length == 0">
|
|
10
|
+
<Alert type="info"> Selecione o filtro desejado e clique em +Adicionar</Alert>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
import Alert from "@nixweb/nixloc-ui/src/component/layout/Alert";
|
|
17
|
+
|
|
18
|
+
import { mapState, mapMutations } from "vuex";
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
components: {
|
|
22
|
+
Alert,
|
|
23
|
+
},
|
|
24
|
+
data() {
|
|
25
|
+
return {
|
|
26
|
+
dynamicComponent: null,
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
computed: {
|
|
30
|
+
...mapState("report", ["selectedRules"]),
|
|
31
|
+
},
|
|
32
|
+
mounted() {
|
|
33
|
+
this.dynamicComponent = this.$parent.$options.components["DynamicComponent"];
|
|
34
|
+
},
|
|
35
|
+
methods: {
|
|
36
|
+
...mapMutations("report", ["mountFinalQueryFormatOData"]),
|
|
37
|
+
component() {
|
|
38
|
+
return this.dynamicComponent;
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
watch: {
|
|
42
|
+
selectedRules: {
|
|
43
|
+
handler(value) {
|
|
44
|
+
this.mountFinalQueryFormatOData(value);
|
|
45
|
+
},
|
|
46
|
+
deep: true,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<style scoped>
|
|
53
|
+
.component {
|
|
54
|
+
min-height: 380px;
|
|
55
|
+
max-height: 380px;
|
|
56
|
+
overflow-y: visible;
|
|
57
|
+
overflow-x: hidden;
|
|
58
|
+
padding-left: 10px;
|
|
59
|
+
padding-right: 10px;
|
|
60
|
+
margin-top: 10px;
|
|
61
|
+
}
|
|
62
|
+
</style>
|
|
@@ -6,27 +6,27 @@
|
|
|
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>
|
|
15
15
|
</b-col>
|
|
16
16
|
<b-col sm="6">
|
|
17
|
-
<
|
|
17
|
+
<RadioGroup
|
|
18
18
|
:options="[
|
|
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>
|
|
@@ -34,86 +34,52 @@
|
|
|
34
34
|
</template>
|
|
35
35
|
<script>
|
|
36
36
|
import SelectStatic from "@nixweb/nixloc-ui/src/component/forms/SelectStatic";
|
|
37
|
-
import
|
|
37
|
+
import RadioGroup from "@nixweb/nixloc-ui/src/component/forms/RadioGroup";
|
|
38
38
|
import CheckboxGroup from "@nixweb/nixloc-ui/src/component/forms/CheckboxGroup";
|
|
39
39
|
import ScrollBar from "@nixweb/nixloc-ui/src/component/layout/ScrollBar.vue";
|
|
40
40
|
|
|
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
|
-
|
|
50
|
-
},
|
|
51
|
-
props: {
|
|
52
|
-
fields: Array,
|
|
49
|
+
RadioGroup,
|
|
53
50
|
},
|
|
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>
|
|
@@ -9,50 +9,50 @@
|
|
|
9
9
|
<script>
|
|
10
10
|
import AddRule from "./AddRule.vue";
|
|
11
11
|
|
|
12
|
+
import { mapState } from "vuex";
|
|
13
|
+
|
|
12
14
|
export default {
|
|
13
15
|
name: "QueryBuilder",
|
|
14
16
|
components: {
|
|
15
17
|
AddRule,
|
|
16
18
|
},
|
|
17
|
-
props: {
|
|
18
|
-
rules: Array,
|
|
19
|
-
},
|
|
20
19
|
data() {
|
|
21
20
|
return {
|
|
22
|
-
query: {},
|
|
23
21
|
typeRule: {
|
|
24
22
|
text: {
|
|
25
23
|
id: "text-field",
|
|
26
24
|
operators: ["igual", "diferente", "contem"],
|
|
27
|
-
|
|
25
|
+
typeField: "text",
|
|
28
26
|
},
|
|
29
27
|
numeric: {
|
|
30
28
|
id: "number-field",
|
|
31
|
-
operators: ["=", "!=", "<", "<=", ">", ">="]
|
|
32
|
-
|
|
29
|
+
/* operators: ["=", "!=", "<", "<=", ">", ">="],*/
|
|
30
|
+
operators: ["igual", "diferente", "menor", "menor ou igual", "maior", "maior ou igual"],
|
|
31
|
+
typeField: "number",
|
|
33
32
|
},
|
|
34
33
|
radio: {
|
|
35
34
|
id: "radio-field",
|
|
36
35
|
operators: [],
|
|
37
36
|
options: [],
|
|
38
|
-
|
|
37
|
+
typeField: "radio",
|
|
39
38
|
},
|
|
40
39
|
checkbox: {
|
|
41
40
|
id: "checkbox-field",
|
|
42
41
|
operators: ["checkbox"],
|
|
43
42
|
options: [],
|
|
44
|
-
|
|
43
|
+
typeField: "checkbox",
|
|
45
44
|
},
|
|
46
45
|
},
|
|
47
46
|
};
|
|
48
47
|
},
|
|
49
48
|
computed: {
|
|
49
|
+
...mapState("report", ["report"]),
|
|
50
50
|
mergeRules() {
|
|
51
51
|
var mergeRules = [];
|
|
52
52
|
var self = this;
|
|
53
|
-
self.rules.forEach(function (rule) {
|
|
54
|
-
if (typeof self.typeRule[rule.
|
|
55
|
-
mergeRules.push(Object.assign({}, self.typeRule[rule.
|
|
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
56
|
} else {
|
|
57
57
|
mergeRules.push(rule);
|
|
58
58
|
}
|
|
@@ -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
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
3
|
-
<div class="
|
|
4
|
-
{{
|
|
2
|
+
<div class="selected-filter" @blur="open = false">
|
|
3
|
+
<div class="selected" :class="{ open: open }" @click="open = !open">
|
|
4
|
+
{{ selected }}
|
|
5
5
|
</div>
|
|
6
|
-
<div class="items" :class="{ hide: !
|
|
6
|
+
<div class="items" :class="{ hide: !open }">
|
|
7
7
|
<div v-for="(options, i) of options" :key="i">
|
|
8
8
|
<div @click="select(options)">
|
|
9
9
|
<span :class="options.classCss">
|
|
@@ -18,28 +18,28 @@
|
|
|
18
18
|
|
|
19
19
|
<script>
|
|
20
20
|
export default {
|
|
21
|
-
props: ["options", "
|
|
21
|
+
props: ["options", "value"],
|
|
22
22
|
data() {
|
|
23
23
|
return {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
selected: "Selecione os filtros",
|
|
25
|
+
open: false,
|
|
26
26
|
};
|
|
27
27
|
},
|
|
28
28
|
mounted() {
|
|
29
|
-
this.$emit("input", this.
|
|
29
|
+
this.$emit("input", this.selected);
|
|
30
30
|
},
|
|
31
31
|
methods: {
|
|
32
32
|
select(options) {
|
|
33
33
|
this.$emit("input", options);
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
34
|
+
this.selected = options.title;
|
|
35
|
+
this.open = false;
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
38
|
};
|
|
39
39
|
</script>
|
|
40
40
|
|
|
41
41
|
<style scoped>
|
|
42
|
-
.
|
|
42
|
+
.selected-filter {
|
|
43
43
|
position: relative;
|
|
44
44
|
width: 100%;
|
|
45
45
|
text-align: left;
|
|
@@ -49,7 +49,7 @@ export default {
|
|
|
49
49
|
z-index: 1000;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
.
|
|
52
|
+
.selected-filter .selected {
|
|
53
53
|
background-color: white;
|
|
54
54
|
border-bottom: 1px solid #dbdee0;
|
|
55
55
|
color: black;
|
|
@@ -58,7 +58,7 @@ export default {
|
|
|
58
58
|
user-select: none;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
.
|
|
61
|
+
.selected-filter .selected:after {
|
|
62
62
|
position: absolute;
|
|
63
63
|
content: "";
|
|
64
64
|
top: 22px;
|
|
@@ -69,7 +69,7 @@ export default {
|
|
|
69
69
|
border-color: black transparent transparent transparent;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
.
|
|
72
|
+
.selected-filter .items {
|
|
73
73
|
color: black;
|
|
74
74
|
border-radius: 0px 0px 6px 6px;
|
|
75
75
|
overflow: hidden;
|
|
@@ -83,7 +83,7 @@ export default {
|
|
|
83
83
|
overflow-x: hidden;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
.
|
|
86
|
+
.selected-filter .items div {
|
|
87
87
|
color: black;
|
|
88
88
|
padding-left: 1em;
|
|
89
89
|
cursor: pointer;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<div class="side-by-side div-tag" v-for="tag in
|
|
3
|
+
<div class="side-by-side div-tag" v-for="tag in tagsLocal" :key="tag.id">
|
|
4
4
|
<Tag
|
|
5
5
|
:eventName="eventName"
|
|
6
6
|
:eventData="tag"
|
|
7
7
|
:title="tag.title"
|
|
8
|
-
:
|
|
8
|
+
:value="tag.value"
|
|
9
9
|
/>
|
|
10
10
|
</div>
|
|
11
11
|
</div>
|
|
@@ -22,27 +22,43 @@ export default {
|
|
|
22
22
|
props: {
|
|
23
23
|
eventName: String,
|
|
24
24
|
},
|
|
25
|
-
|
|
25
|
+
data() {
|
|
26
|
+
return {
|
|
27
|
+
tagsLocal: [],
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
created() {
|
|
31
|
+
let self = this;
|
|
32
|
+
setTimeout(function () {
|
|
33
|
+
self.tagsLocal = self.tags;
|
|
34
|
+
}, 100);
|
|
35
|
+
},
|
|
26
36
|
computed: {
|
|
27
37
|
...mapGetters("report", ["tags"]),
|
|
28
38
|
...mapGetters("generic", ["showModal", "event"]),
|
|
29
39
|
},
|
|
30
40
|
methods: {
|
|
31
|
-
...mapMutations("report", ["
|
|
41
|
+
...mapMutations("report", ["removeSelectedRule"]),
|
|
32
42
|
},
|
|
33
43
|
watch: {
|
|
34
44
|
event: {
|
|
35
45
|
handler(event) {
|
|
36
|
-
if (event.
|
|
37
|
-
var tags = this.
|
|
46
|
+
if (event.name == "tagRemoved") {
|
|
47
|
+
var tags = this.tagsLocal.filter((item) => {
|
|
38
48
|
return item.id != event.data.id;
|
|
39
49
|
});
|
|
40
|
-
this.
|
|
41
|
-
this.
|
|
50
|
+
this.tagsLocal = tags;
|
|
51
|
+
this.removeSelectedRule(event.data.id);
|
|
42
52
|
}
|
|
43
53
|
},
|
|
44
54
|
deep: true,
|
|
45
55
|
},
|
|
56
|
+
tags: {
|
|
57
|
+
handler(value) {
|
|
58
|
+
this.tagsLocal = value;
|
|
59
|
+
},
|
|
60
|
+
deep: true,
|
|
61
|
+
},
|
|
46
62
|
},
|
|
47
63
|
};
|
|
48
64
|
</script>
|