@nixweb/nixloc-ui 1.9.0 → 1.11.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/@nixweb/nixloc-ui/package.json +88 -88
- 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/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/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/InputDecimal.vue +153 -153
- 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/InputText.vue +174 -174
- 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/Slider.vue +18 -18
- package/@nixweb/nixloc-ui/src/component/forms/TextArea.vue +138 -138
- 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/FixedBar.vue +103 -103
- package/@nixweb/nixloc-ui/src/component/layout/Header.vue +56 -56
- 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/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/Wizard.vue +211 -211
- package/@nixweb/nixloc-ui/src/component/shared/Collapse.vue +131 -131
- package/@nixweb/nixloc-ui/src/component/shared/ExportPDF.vue +116 -116
- package/@nixweb/nixloc-ui/src/component/shared/HorizontalFilter.vue +64 -64
- package/@nixweb/nixloc-ui/src/component/shared/Loading.vue +107 -107
- 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/ProgressBar.vue +25 -25
- package/@nixweb/nixloc-ui/src/component/shared/QueryButton.vue +66 -66
- package/@nixweb/nixloc-ui/src/component/shared/Search.vue +174 -174
- 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/TableTotalization.vue +47 -47
- 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/VerticalFilter.vue +97 -97
- package/@nixweb/nixloc-ui/src/component/shared/query-builder/AddRule.vue +203 -203
- package/@nixweb/nixloc-ui/src/component/shared/query-builder/DynamicComponentList.vue +70 -70
- package/@nixweb/nixloc-ui/src/component/shared/query-builder/QueryBuilder.vue +69 -69
- package/@nixweb/nixloc-ui/src/component/shared/query-builder/utilities.js +21 -21
- package/@nixweb/nixloc-ui/src/component/template/ListViewWithDataHandler.vue +429 -429
- package/@nixweb/nixloc-ui/src/component/template/ViewTemplateConfiguration.vue +64 -64
- 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/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/generic.js +815 -815
- package/@nixweb/nixloc-ui/src/store/modules/validation.js +38 -38
- package/@nixweb/nixloc-ui/src/store/store.js +13 -13
- package/package.json +1 -1
- package/src/component/training/CourseView.vue +16 -7
- package/src/component/value-objects/Address.vue +4 -2
|
@@ -1,203 +1,203 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<div class="vqb-group card">
|
|
4
|
-
<div class="vqb-group-body card-body">
|
|
5
|
-
<div class="rule-actions form-inline">
|
|
6
|
-
<div class="div-custom">
|
|
7
|
-
<b-row>
|
|
8
|
-
<b-col sm="6">
|
|
9
|
-
<SelectRule :options="rules" class="select" v-model="selectedRule" />
|
|
10
|
-
</b-col>
|
|
11
|
-
<b-col sm="3">
|
|
12
|
-
<div class="div-btn">
|
|
13
|
-
<i class="fa-solid fa-circle-plus" @click="add"></i>
|
|
14
|
-
</div>
|
|
15
|
-
</b-col>
|
|
16
|
-
</b-row>
|
|
17
|
-
<div class="div-and-or">
|
|
18
|
-
<b-row>
|
|
19
|
-
<b-col sm="3">
|
|
20
|
-
<RadioGroup :options="[
|
|
21
|
-
{ text: 'e', value: 'and' },
|
|
22
|
-
{ text: 'ou', value: 'or' },
|
|
23
|
-
]" v-model="andOr" />
|
|
24
|
-
</b-col>
|
|
25
|
-
</b-row>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
<DynamicComponentList />
|
|
32
|
-
</div>
|
|
33
|
-
</template>
|
|
34
|
-
|
|
35
|
-
<script>
|
|
36
|
-
import SelectRule from "./SelectRule.vue";
|
|
37
|
-
import DynamicComponent from "./DynamicComponent.vue";
|
|
38
|
-
import RadioGroup from "@nixweb/nixloc-ui/src/component/forms/RadioGroup.vue";
|
|
39
|
-
import DynamicComponentList from "@nixweb/nixloc-ui/src/component/shared/query-builder/DynamicComponentList.vue";
|
|
40
|
-
|
|
41
|
-
import { mapGetters, mapMutations } from "vuex";
|
|
42
|
-
|
|
43
|
-
export default {
|
|
44
|
-
name: "AddRule",
|
|
45
|
-
components: {
|
|
46
|
-
SelectRule,
|
|
47
|
-
DynamicComponent,
|
|
48
|
-
RadioGroup,
|
|
49
|
-
DynamicComponentList,
|
|
50
|
-
},
|
|
51
|
-
props: {
|
|
52
|
-
rules: Array,
|
|
53
|
-
},
|
|
54
|
-
data() {
|
|
55
|
-
return {
|
|
56
|
-
selectedRule: this.rules[0],
|
|
57
|
-
andOr: "and",
|
|
58
|
-
duplicate: [],
|
|
59
|
-
};
|
|
60
|
-
},
|
|
61
|
-
computed: {
|
|
62
|
-
...mapGetters("generic", ["event"]),
|
|
63
|
-
},
|
|
64
|
-
methods: {
|
|
65
|
-
...mapMutations("generic", ["addNotifications"]),
|
|
66
|
-
...mapMutations("report", ["addSelectedRules"]),
|
|
67
|
-
add() {
|
|
68
|
-
this.selectedRule.andOr = this.andOr;
|
|
69
|
-
this.addRule();
|
|
70
|
-
},
|
|
71
|
-
addRule() {
|
|
72
|
-
let obj = this.mountObject();
|
|
73
|
-
|
|
74
|
-
if (!this.verifyIfExist(obj.name)) {
|
|
75
|
-
this.addSelectedRules(obj);
|
|
76
|
-
if (obj.notDuplicate) this.duplicate.push(obj);
|
|
77
|
-
} else {
|
|
78
|
-
var error = {
|
|
79
|
-
property: "ERRO QUERY BUILDER",
|
|
80
|
-
message: `Não é possível adicionar o filter ${obj.title} 2 vezes!`,
|
|
81
|
-
};
|
|
82
|
-
this.addNotifications([error]);
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
mountObject() {
|
|
86
|
-
let obj = {
|
|
87
|
-
id: this.generateId(),
|
|
88
|
-
name: this.selectedRule.name,
|
|
89
|
-
title: this.selectedRule.title,
|
|
90
|
-
typeField: this.selectedRule.typeField,
|
|
91
|
-
type: this.selectedRule.type,
|
|
92
|
-
options: this.selectedRule.options,
|
|
93
|
-
props: this.selectedRule.props,
|
|
94
|
-
classCss: this.selectedRule.classCss,
|
|
95
|
-
icon: this.selectedRule.icon,
|
|
96
|
-
operators: this.selectedRule.operators,
|
|
97
|
-
operator: null,
|
|
98
|
-
andOr: this.selectedRule.andOr,
|
|
99
|
-
isRequired: this.selectedRule.isRequired,
|
|
100
|
-
notDuplicate: this.selectedRule.notDuplicate,
|
|
101
|
-
value: null,
|
|
102
|
-
};
|
|
103
|
-
return obj;
|
|
104
|
-
},
|
|
105
|
-
generateId() {
|
|
106
|
-
return Math.random()
|
|
107
|
-
.toString(36)
|
|
108
|
-
.replace(/[^a-z]+/g, "")
|
|
109
|
-
.substr(0, 5);
|
|
110
|
-
},
|
|
111
|
-
verifyIfExist(name) {
|
|
112
|
-
var hasRule = this.duplicate.find((rule) => {
|
|
113
|
-
return rule.name === name;
|
|
114
|
-
});
|
|
115
|
-
if (hasRule) return true;
|
|
116
|
-
return false;
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
watch: {
|
|
120
|
-
event: {
|
|
121
|
-
handler(event) {
|
|
122
|
-
// se a tag ou a rule que está selecionada foi removida, é necessário remove tambem do array "duplicate" para liberar e adicionar novamente.
|
|
123
|
-
if (event.name == "tagRemoved" || event.name == "selectedRuleRemoved") {
|
|
124
|
-
var duplicate = this.duplicate.filter((item) => {
|
|
125
|
-
return item.id != event.data.id;
|
|
126
|
-
});
|
|
127
|
-
this.duplicate = duplicate;
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
deep: true,
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
};
|
|
134
|
-
</script>
|
|
135
|
-
|
|
136
|
-
<style>
|
|
137
|
-
.card {
|
|
138
|
-
border: 1px solid #e8eaed !important;
|
|
139
|
-
background-color: white !important;
|
|
140
|
-
border-radius: 8px !important;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.card-body {
|
|
144
|
-
padding: 10px;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.title-option {
|
|
148
|
-
padding: 10px;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.div-custom {
|
|
152
|
-
width: 100%;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.vue-query-builder .vqb-group .rule-actions {
|
|
156
|
-
margin-bottom: 20px;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.vue-query-builder .vqb-rule {
|
|
160
|
-
margin-top: 15px;
|
|
161
|
-
margin-bottom: 15px;
|
|
162
|
-
background-color: #f5f5f5;
|
|
163
|
-
border-color: #ddd;
|
|
164
|
-
padding: 15px;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.vue-query-builder .vqb-group.depth-1 .vqb-rule,
|
|
168
|
-
.vue-query-builder .vqb-group.depth-2 {
|
|
169
|
-
border-left: 2px solid #8bc34a;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.vue-query-builder .vqb-group.depth-2 .vqb-rule,
|
|
173
|
-
.vue-query-builder .vqb-group.depth-3 {
|
|
174
|
-
border-left: 2px solid #00bcd4;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.vue-query-builder .vqb-group.depth-3 .vqb-rule,
|
|
178
|
-
.vue-query-builder .vqb-group.depth-4 {
|
|
179
|
-
border-left: 2px solid #ff5722;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.vue-query-builder .close {
|
|
183
|
-
opacity: 1;
|
|
184
|
-
color: rgb(150, 150, 150);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
.div-btn {
|
|
188
|
-
margin-top: -3px;
|
|
189
|
-
font-size: 25px;
|
|
190
|
-
color: #577696;
|
|
191
|
-
cursor: pointer;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
.div-and-or {
|
|
195
|
-
margin-top: 10px;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
@media (min-width: 768px) {
|
|
199
|
-
.vue-query-builder .vqb-rule.form-inline .form-group {
|
|
200
|
-
display: block;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class="vqb-group card">
|
|
4
|
+
<div class="vqb-group-body card-body">
|
|
5
|
+
<div class="rule-actions form-inline">
|
|
6
|
+
<div class="div-custom">
|
|
7
|
+
<b-row>
|
|
8
|
+
<b-col sm="6">
|
|
9
|
+
<SelectRule :options="rules" class="select" v-model="selectedRule" />
|
|
10
|
+
</b-col>
|
|
11
|
+
<b-col sm="3">
|
|
12
|
+
<div class="div-btn">
|
|
13
|
+
<i class="fa-solid fa-circle-plus" @click="add"></i>
|
|
14
|
+
</div>
|
|
15
|
+
</b-col>
|
|
16
|
+
</b-row>
|
|
17
|
+
<div class="div-and-or">
|
|
18
|
+
<b-row>
|
|
19
|
+
<b-col sm="3">
|
|
20
|
+
<RadioGroup :options="[
|
|
21
|
+
{ text: 'e', value: 'and' },
|
|
22
|
+
{ text: 'ou', value: 'or' },
|
|
23
|
+
]" v-model="andOr" />
|
|
24
|
+
</b-col>
|
|
25
|
+
</b-row>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
<DynamicComponentList />
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script>
|
|
36
|
+
import SelectRule from "./SelectRule.vue";
|
|
37
|
+
import DynamicComponent from "./DynamicComponent.vue";
|
|
38
|
+
import RadioGroup from "@nixweb/nixloc-ui/src/component/forms/RadioGroup.vue";
|
|
39
|
+
import DynamicComponentList from "@nixweb/nixloc-ui/src/component/shared/query-builder/DynamicComponentList.vue";
|
|
40
|
+
|
|
41
|
+
import { mapGetters, mapMutations } from "vuex";
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
name: "AddRule",
|
|
45
|
+
components: {
|
|
46
|
+
SelectRule,
|
|
47
|
+
DynamicComponent,
|
|
48
|
+
RadioGroup,
|
|
49
|
+
DynamicComponentList,
|
|
50
|
+
},
|
|
51
|
+
props: {
|
|
52
|
+
rules: Array,
|
|
53
|
+
},
|
|
54
|
+
data() {
|
|
55
|
+
return {
|
|
56
|
+
selectedRule: this.rules[0],
|
|
57
|
+
andOr: "and",
|
|
58
|
+
duplicate: [],
|
|
59
|
+
};
|
|
60
|
+
},
|
|
61
|
+
computed: {
|
|
62
|
+
...mapGetters("generic", ["event"]),
|
|
63
|
+
},
|
|
64
|
+
methods: {
|
|
65
|
+
...mapMutations("generic", ["addNotifications"]),
|
|
66
|
+
...mapMutations("report", ["addSelectedRules"]),
|
|
67
|
+
add() {
|
|
68
|
+
this.selectedRule.andOr = this.andOr;
|
|
69
|
+
this.addRule();
|
|
70
|
+
},
|
|
71
|
+
addRule() {
|
|
72
|
+
let obj = this.mountObject();
|
|
73
|
+
|
|
74
|
+
if (!this.verifyIfExist(obj.name)) {
|
|
75
|
+
this.addSelectedRules(obj);
|
|
76
|
+
if (obj.notDuplicate) this.duplicate.push(obj);
|
|
77
|
+
} else {
|
|
78
|
+
var error = {
|
|
79
|
+
property: "ERRO QUERY BUILDER",
|
|
80
|
+
message: `Não é possível adicionar o filter ${obj.title} 2 vezes!`,
|
|
81
|
+
};
|
|
82
|
+
this.addNotifications([error]);
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
mountObject() {
|
|
86
|
+
let obj = {
|
|
87
|
+
id: this.generateId(),
|
|
88
|
+
name: this.selectedRule.name,
|
|
89
|
+
title: this.selectedRule.title,
|
|
90
|
+
typeField: this.selectedRule.typeField,
|
|
91
|
+
type: this.selectedRule.type,
|
|
92
|
+
options: this.selectedRule.options,
|
|
93
|
+
props: this.selectedRule.props,
|
|
94
|
+
classCss: this.selectedRule.classCss,
|
|
95
|
+
icon: this.selectedRule.icon,
|
|
96
|
+
operators: this.selectedRule.operators,
|
|
97
|
+
operator: null,
|
|
98
|
+
andOr: this.selectedRule.andOr,
|
|
99
|
+
isRequired: this.selectedRule.isRequired,
|
|
100
|
+
notDuplicate: this.selectedRule.notDuplicate,
|
|
101
|
+
value: null,
|
|
102
|
+
};
|
|
103
|
+
return obj;
|
|
104
|
+
},
|
|
105
|
+
generateId() {
|
|
106
|
+
return Math.random()
|
|
107
|
+
.toString(36)
|
|
108
|
+
.replace(/[^a-z]+/g, "")
|
|
109
|
+
.substr(0, 5);
|
|
110
|
+
},
|
|
111
|
+
verifyIfExist(name) {
|
|
112
|
+
var hasRule = this.duplicate.find((rule) => {
|
|
113
|
+
return rule.name === name;
|
|
114
|
+
});
|
|
115
|
+
if (hasRule) return true;
|
|
116
|
+
return false;
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
watch: {
|
|
120
|
+
event: {
|
|
121
|
+
handler(event) {
|
|
122
|
+
// se a tag ou a rule que está selecionada foi removida, é necessário remove tambem do array "duplicate" para liberar e adicionar novamente.
|
|
123
|
+
if (event.name == "tagRemoved" || event.name == "selectedRuleRemoved") {
|
|
124
|
+
var duplicate = this.duplicate.filter((item) => {
|
|
125
|
+
return item.id != event.data.id;
|
|
126
|
+
});
|
|
127
|
+
this.duplicate = duplicate;
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
deep: true,
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
</script>
|
|
135
|
+
|
|
136
|
+
<style>
|
|
137
|
+
.card {
|
|
138
|
+
border: 1px solid #e8eaed !important;
|
|
139
|
+
background-color: white !important;
|
|
140
|
+
border-radius: 8px !important;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.card-body {
|
|
144
|
+
padding: 10px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.title-option {
|
|
148
|
+
padding: 10px;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.div-custom {
|
|
152
|
+
width: 100%;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.vue-query-builder .vqb-group .rule-actions {
|
|
156
|
+
margin-bottom: 20px;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.vue-query-builder .vqb-rule {
|
|
160
|
+
margin-top: 15px;
|
|
161
|
+
margin-bottom: 15px;
|
|
162
|
+
background-color: #f5f5f5;
|
|
163
|
+
border-color: #ddd;
|
|
164
|
+
padding: 15px;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.vue-query-builder .vqb-group.depth-1 .vqb-rule,
|
|
168
|
+
.vue-query-builder .vqb-group.depth-2 {
|
|
169
|
+
border-left: 2px solid #8bc34a;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.vue-query-builder .vqb-group.depth-2 .vqb-rule,
|
|
173
|
+
.vue-query-builder .vqb-group.depth-3 {
|
|
174
|
+
border-left: 2px solid #00bcd4;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.vue-query-builder .vqb-group.depth-3 .vqb-rule,
|
|
178
|
+
.vue-query-builder .vqb-group.depth-4 {
|
|
179
|
+
border-left: 2px solid #ff5722;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.vue-query-builder .close {
|
|
183
|
+
opacity: 1;
|
|
184
|
+
color: rgb(150, 150, 150);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.div-btn {
|
|
188
|
+
margin-top: -3px;
|
|
189
|
+
font-size: 25px;
|
|
190
|
+
color: #577696;
|
|
191
|
+
cursor: pointer;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.div-and-or {
|
|
195
|
+
margin-top: 10px;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
@media (min-width: 768px) {
|
|
199
|
+
.vue-query-builder .vqb-rule.form-inline .form-group {
|
|
200
|
+
display: block;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
</style>
|
|
@@ -1,70 +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>
|
|
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>
|
|
@@ -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
|
-
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
|
+
<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>
|