@nixweb/nixloc-ui 0.0.173 → 0.0.174
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/component/forms/DateTime.vue +7 -22
- package/src/component/forms/RadioGroup.vue +14 -2
- package/src/component/forms/Select.vue +30 -69
- package/src/component/forms/SelectStatic.vue +48 -21
- package/src/component/layout/Tag.vue +10 -4
- package/src/component/shared/SelectOption.vue +3 -0
- package/src/component/template/ListViewWithDataHandler.vue +60 -6
- package/src/component/template/ViewTemplateReportPreview.vue +1 -1
- package/src/component/template/ViewTemplateWithTable.vue +12 -1
- package/src/component/value-objects/Address.vue +20 -72
- package/src/store/modules/generic.js +13 -1
package/package.json
CHANGED
|
@@ -6,32 +6,15 @@
|
|
|
6
6
|
<Tip :field="field" :formName="formName" />
|
|
7
7
|
</label>
|
|
8
8
|
<div class="inner-addon right-addon">
|
|
9
|
-
<i
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
></i>
|
|
13
|
-
<date-picker
|
|
14
|
-
lang="pt-br"
|
|
15
|
-
:range="range"
|
|
16
|
-
@confirm="executeConfirm"
|
|
17
|
-
@change="executeConfirm"
|
|
18
|
-
@clear="close"
|
|
19
|
-
:confirm="confirm"
|
|
20
|
-
:confirm-text="confirmText"
|
|
21
|
-
:format="format"
|
|
22
|
-
value-type="format"
|
|
23
|
-
:time-picker-options="{
|
|
9
|
+
<i v-if="notifications.length > 0 && formDirty" class="required glyphicon fas fa-exclamation-triangle"></i>
|
|
10
|
+
<date-picker lang="pt-br" :range="range" @confirm="executeConfirm" @change="executeConfirm" @clear="close"
|
|
11
|
+
:confirm="confirm" :confirm-text="confirmText" :format="format" value-type="format" :time-picker-options="{
|
|
24
12
|
start: '07:00',
|
|
25
13
|
step: '00:30',
|
|
26
14
|
end: '23:30',
|
|
27
15
|
format: 'HH:mm',
|
|
28
|
-
}"
|
|
29
|
-
|
|
30
|
-
:placeholder="placeholder"
|
|
31
|
-
:type="type"
|
|
32
|
-
v-model="valueLocal"
|
|
33
|
-
:class="{ 'is-invalid': notifications.length > 0 && formDirty }"
|
|
34
|
-
></date-picker>
|
|
16
|
+
}" width="100%" :placeholder="placeholder" :type="type" v-model="valueLocal"
|
|
17
|
+
:class="{ 'is-invalid': notifications.length > 0 && formDirty }"></date-picker>
|
|
35
18
|
</div>
|
|
36
19
|
|
|
37
20
|
<div v-if="formDirty">
|
|
@@ -162,10 +145,12 @@ export default {
|
|
|
162
145
|
color: #0a0a0a;
|
|
163
146
|
letter-spacing: 0.5px !important;
|
|
164
147
|
}
|
|
148
|
+
|
|
165
149
|
.success {
|
|
166
150
|
color: #94aa2a;
|
|
167
151
|
font-size: 14px;
|
|
168
152
|
}
|
|
153
|
+
|
|
169
154
|
.invalid {
|
|
170
155
|
color: #f0134d;
|
|
171
156
|
font-size: 14px;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<script>
|
|
14
14
|
import Tip from "../shared/Tip.vue";
|
|
15
15
|
|
|
16
|
-
import { mapMutations } from "vuex";
|
|
16
|
+
import { mapMutations, mapGetters } from "vuex";
|
|
17
17
|
|
|
18
18
|
export default {
|
|
19
19
|
components: { Tip },
|
|
@@ -35,6 +35,9 @@ export default {
|
|
|
35
35
|
selected: this.value,
|
|
36
36
|
};
|
|
37
37
|
},
|
|
38
|
+
computed: {
|
|
39
|
+
...mapGetters("generic", ["event"]),
|
|
40
|
+
},
|
|
38
41
|
methods: {
|
|
39
42
|
...mapMutations("validation", ["updateFormDirty"]),
|
|
40
43
|
...mapMutations("generic", ["addFilter"]),
|
|
@@ -49,10 +52,19 @@ export default {
|
|
|
49
52
|
if (this.markFormDirty) this.updateFormDirty(true);
|
|
50
53
|
if (this.changed) this.changed();
|
|
51
54
|
if (this.fieldTarget) {
|
|
52
|
-
let obj = { fieldTarget: this.fieldTarget, value: this.selected };
|
|
55
|
+
let obj = { tag: `${this.title}: ${this.selected}`, fieldTarget: this.fieldTarget, value: this.selected };
|
|
53
56
|
this.addFilter(obj);
|
|
54
57
|
}
|
|
55
58
|
},
|
|
59
|
+
event: {
|
|
60
|
+
handler(event) {
|
|
61
|
+
if (event.name == "tagRemoved") {
|
|
62
|
+
if (this.fieldTarget == event.data)
|
|
63
|
+
this.$emit("input", "");
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
deep: true,
|
|
67
|
+
},
|
|
56
68
|
},
|
|
57
69
|
};
|
|
58
70
|
</script>
|
|
@@ -5,68 +5,27 @@
|
|
|
5
5
|
<span class="required" v-if="required">*</span>
|
|
6
6
|
<Tip :field="field" :formName="formName" />
|
|
7
7
|
</label>
|
|
8
|
-
<div
|
|
9
|
-
|
|
10
|
-
:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<multiselect
|
|
16
|
-
@open="onOpen"
|
|
17
|
-
@select="onSelected"
|
|
18
|
-
@search-change="onSearch"
|
|
19
|
-
:options="data"
|
|
20
|
-
v-model.trim="currentValue"
|
|
21
|
-
:custom-label="label"
|
|
22
|
-
placeholder
|
|
23
|
-
:disabled="disabled"
|
|
24
|
-
:showLabels="true"
|
|
25
|
-
:noResult="false"
|
|
26
|
-
:maxHeight="250"
|
|
27
|
-
ref="multiselect"
|
|
28
|
-
selectLabel
|
|
29
|
-
deselectLabel
|
|
30
|
-
selectedLabel
|
|
31
|
-
>
|
|
8
|
+
<div class="select" :class="{
|
|
9
|
+
'select-invalid': notifications.length > 0 && formDirty,
|
|
10
|
+
border: showBorder,
|
|
11
|
+
}">
|
|
12
|
+
<multiselect @open="onOpen" @select="onSelected" @search-change="onSearch" :options="data"
|
|
13
|
+
v-model.trim="currentValue" :custom-label="label" placeholder :disabled="disabled" :showLabels="true"
|
|
14
|
+
:noResult="false" :maxHeight="250" ref="multiselect" selectLabel deselectLabel selectedLabel>
|
|
32
15
|
<div slot="beforeList">
|
|
33
|
-
<vue-loading
|
|
34
|
-
|
|
35
|
-
type="bubbles"
|
|
36
|
-
color="#577696"
|
|
37
|
-
:size="{ width: '40px', height: '40px' }"
|
|
38
|
-
></vue-loading>
|
|
16
|
+
<vue-loading v-if="loading" type="bubbles" color="#577696"
|
|
17
|
+
:size="{ width: '40px', height: '40px' }"></vue-loading>
|
|
39
18
|
<div class="before-list" v-if="!loading">
|
|
40
|
-
<Button
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
title="Novo"
|
|
45
|
-
size="small"
|
|
46
|
-
:clicked="addNewRegister"
|
|
47
|
-
/>
|
|
48
|
-
<Button
|
|
49
|
-
key="cleanSelect"
|
|
50
|
-
type="warning"
|
|
51
|
-
classIcon="fas fa-broom"
|
|
52
|
-
size="small"
|
|
53
|
-
:clicked="cleanSelect"
|
|
54
|
-
/>
|
|
19
|
+
<Button v-if="showNewRegister" key="addNewRegister" type="primary" title="Novo" size="small"
|
|
20
|
+
:clicked="addNewRegister" />
|
|
21
|
+
<Button key="cleanSelect" title="Limpar" type="warning" classIcon="fas fa-broom" size="small"
|
|
22
|
+
:clicked="cleanSelect" />
|
|
55
23
|
</div>
|
|
56
24
|
</div>
|
|
57
|
-
<div
|
|
58
|
-
slot="afterList"
|
|
59
|
-
v-if="totalRecords > 20 && data.length < totalRecords"
|
|
60
|
-
>
|
|
25
|
+
<div slot="afterList" v-if="totalRecords > 20 && data.length < totalRecords">
|
|
61
26
|
<div class="after-list text-center">
|
|
62
|
-
<Button
|
|
63
|
-
|
|
64
|
-
type="info"
|
|
65
|
-
title="Carregar mais..."
|
|
66
|
-
classIcon="fas fa-redo-alt"
|
|
67
|
-
size="small"
|
|
68
|
-
:clicked="loadingMore"
|
|
69
|
-
/>
|
|
27
|
+
<Button key="loadingMore" type="info" title="Carregar mais..." classIcon="fas fa-redo-alt" size="small"
|
|
28
|
+
:clicked="loadingMore" />
|
|
70
29
|
</div>
|
|
71
30
|
</div>
|
|
72
31
|
<div slot="noOptions">Lista está vazia</div>
|
|
@@ -79,16 +38,8 @@
|
|
|
79
38
|
</div>
|
|
80
39
|
</div>
|
|
81
40
|
|
|
82
|
-
<vodal
|
|
83
|
-
|
|
84
|
-
:duration="50"
|
|
85
|
-
:show="showVodal(nameNewRegister)"
|
|
86
|
-
@hide="hide()"
|
|
87
|
-
:width="widthNewRegister"
|
|
88
|
-
:height="heightNewRegister"
|
|
89
|
-
:closeOnEsc="true"
|
|
90
|
-
:closeButton="true"
|
|
91
|
-
>
|
|
41
|
+
<vodal v-if="nameNewRegister" :duration="50" :show="showVodal(nameNewRegister)" @hide="hide()"
|
|
42
|
+
:width="widthNewRegister" :height="heightNewRegister" :closeOnEsc="true" :closeButton="true">
|
|
92
43
|
<Messages v-if="vodal.open" />
|
|
93
44
|
<div class="title-new-form">{{ titleNewRegister }}</div>
|
|
94
45
|
<hr class="hr" />
|
|
@@ -176,7 +127,7 @@ export default {
|
|
|
176
127
|
computed: {
|
|
177
128
|
...mapState("validation", ["resetForm", "vodal"]),
|
|
178
129
|
...mapState("generic", ["vodal"]),
|
|
179
|
-
...mapGetters("generic", ["showVodal"]),
|
|
130
|
+
...mapGetters("generic", ["showVodal", "event"]),
|
|
180
131
|
},
|
|
181
132
|
methods: {
|
|
182
133
|
...mapActions("generic", ["getApi"]),
|
|
@@ -200,7 +151,7 @@ export default {
|
|
|
200
151
|
this.$emit("input", value);
|
|
201
152
|
if (this.changed) this.changed();
|
|
202
153
|
if (this.fieldTarget) {
|
|
203
|
-
let obj = { fieldTarget: this.fieldTarget, value: value.id };
|
|
154
|
+
let obj = { tag: `${this.title}: ${value.content}`, fieldTarget: this.fieldTarget, value: value.id };
|
|
204
155
|
this.addFilter(obj);
|
|
205
156
|
}
|
|
206
157
|
},
|
|
@@ -267,6 +218,16 @@ export default {
|
|
|
267
218
|
},
|
|
268
219
|
},
|
|
269
220
|
watch: {
|
|
221
|
+
event: {
|
|
222
|
+
handler(event) {
|
|
223
|
+
|
|
224
|
+
if (event.name == "tagRemoved") {
|
|
225
|
+
if (this.fieldTarget == event.data) this.cleanSelect();
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
},
|
|
229
|
+
deep: true,
|
|
230
|
+
},
|
|
270
231
|
"value.id": function () {
|
|
271
232
|
this.validate();
|
|
272
233
|
this.formDirty = true;
|
|
@@ -1,25 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<label>
|
|
4
|
-
<span class="title">{{ title }}</span>
|
|
4
|
+
<span class="title">{{ title }} </span>
|
|
5
|
+
<span class="required" v-if="required">*</span>
|
|
5
6
|
</label>
|
|
6
7
|
<div class="select" :class="{ border: showBorder }">
|
|
7
|
-
<multiselect
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@search-change="onSearch"
|
|
11
|
-
:options="data"
|
|
12
|
-
v-model.trim="currentValue"
|
|
13
|
-
:custom-label="label"
|
|
14
|
-
:disabled="disabled"
|
|
15
|
-
placeholder
|
|
16
|
-
:showLabels="true"
|
|
17
|
-
:noResult="false"
|
|
18
|
-
ref="multiselect"
|
|
19
|
-
selectLabel
|
|
20
|
-
deselectLabel
|
|
21
|
-
selectedLabel
|
|
22
|
-
>
|
|
8
|
+
<multiselect @open="onOpen" @select="onSelected" @search-change="onSearch" :options="data"
|
|
9
|
+
v-model.trim="currentValue" :custom-label="label" :disabled="disabled" placeholder :showLabels="true"
|
|
10
|
+
:noResult="false" ref="multiselect" selectLabel deselectLabel selectedLabel>
|
|
23
11
|
</multiselect>
|
|
24
12
|
</div>
|
|
25
13
|
</div>
|
|
@@ -35,7 +23,9 @@ export default {
|
|
|
35
23
|
props: {
|
|
36
24
|
title: String,
|
|
37
25
|
formName: String,
|
|
26
|
+
field: String,
|
|
38
27
|
fieldTarget: String,
|
|
28
|
+
required: Boolean,
|
|
39
29
|
initialValue: Object,
|
|
40
30
|
disabled: {
|
|
41
31
|
type: Boolean,
|
|
@@ -63,8 +53,12 @@ export default {
|
|
|
63
53
|
data() {
|
|
64
54
|
return {
|
|
65
55
|
currentValue: this.initialValue,
|
|
56
|
+
notifications: [],
|
|
66
57
|
};
|
|
67
58
|
},
|
|
59
|
+
created() {
|
|
60
|
+
this.validate();
|
|
61
|
+
},
|
|
68
62
|
mounted() {
|
|
69
63
|
let el = this.$el.getElementsByClassName("multiselect")[0];
|
|
70
64
|
if (el) {
|
|
@@ -73,16 +67,20 @@ export default {
|
|
|
73
67
|
},
|
|
74
68
|
methods: {
|
|
75
69
|
...mapMutations("generic", ["addFilter", "removeLoading"]),
|
|
76
|
-
...mapMutations("validation", [
|
|
77
|
-
|
|
70
|
+
...mapMutations("validation", [
|
|
71
|
+
"addValidation",
|
|
72
|
+
"removeValidation",
|
|
73
|
+
"resetValidation",
|
|
74
|
+
"updateFormDirty",
|
|
75
|
+
]),
|
|
76
|
+
onOpen() { },
|
|
78
77
|
onSelected(value) {
|
|
79
78
|
this.$emit("input", value);
|
|
80
79
|
let obj = { fieldTarget: this.fieldTarget, value: value.id };
|
|
81
80
|
if (!this.onlyQuery) this.addFilter(obj);
|
|
82
|
-
|
|
83
81
|
if (this.markFormDirty) this.updateFormDirty(true);
|
|
84
82
|
},
|
|
85
|
-
onSearch(value) {},
|
|
83
|
+
onSearch(value) { },
|
|
86
84
|
label(value) {
|
|
87
85
|
return `${value.content}`;
|
|
88
86
|
},
|
|
@@ -98,11 +96,40 @@ export default {
|
|
|
98
96
|
this.addFilter(obj);
|
|
99
97
|
}
|
|
100
98
|
},
|
|
99
|
+
validate() {
|
|
100
|
+
this.notifications = [];
|
|
101
|
+
if (this.required && !this.value.id) {
|
|
102
|
+
var message = `${this.title} não pode ser vazio!`;
|
|
103
|
+
this.notifications.push(message);
|
|
104
|
+
}
|
|
105
|
+
},
|
|
101
106
|
},
|
|
102
107
|
watch: {
|
|
103
108
|
"value.id": function () {
|
|
109
|
+
this.validate();
|
|
110
|
+
this.formDirty = true;
|
|
111
|
+
if (this.markFormDirty) this.updateFormDirty(true);
|
|
104
112
|
this.currentValue = { id: this.value.id, content: this.value.content };
|
|
105
113
|
},
|
|
114
|
+
notifications() {
|
|
115
|
+
let self = this;
|
|
116
|
+
this.notifications.forEach(function (notification) {
|
|
117
|
+
let obj = {
|
|
118
|
+
key: self.field + "&" + self.formName,
|
|
119
|
+
formName: self.formName,
|
|
120
|
+
notification: notification,
|
|
121
|
+
};
|
|
122
|
+
self.addValidation(obj);
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
if (this.notifications.length == 0) {
|
|
126
|
+
let obj = {
|
|
127
|
+
key: self.field + "&" + self.formName,
|
|
128
|
+
formName: self.formName,
|
|
129
|
+
};
|
|
130
|
+
self.removeValidation(obj);
|
|
131
|
+
}
|
|
132
|
+
},
|
|
106
133
|
"initialValue.id": function () {
|
|
107
134
|
this.currentValue = { id: this.value.id, content: this.value.content };
|
|
108
135
|
},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="div-tag">
|
|
3
3
|
<div class="tag">
|
|
4
|
-
<span @click="execute()">{{ title }}
|
|
5
|
-
<i @click="remove()" class="icon fas fa-times-circle"></i>
|
|
4
|
+
<span @click="execute()">{{ title }} <span v-if="value">:</span> {{ value }}</span>
|
|
5
|
+
<i v-if="showButtonClose" @click="remove()" class="icon-tag fas fa-times-circle"></i>
|
|
6
6
|
</div>
|
|
7
7
|
</div>
|
|
8
8
|
</template>
|
|
@@ -13,10 +13,15 @@ import { mapMutations } from "vuex";
|
|
|
13
13
|
export default {
|
|
14
14
|
name: "Tag",
|
|
15
15
|
props: {
|
|
16
|
+
_key: String,
|
|
16
17
|
title: String,
|
|
17
18
|
value: String,
|
|
18
19
|
eventName: String,
|
|
19
20
|
eventData: Object,
|
|
21
|
+
showButtonClose: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: true
|
|
24
|
+
}
|
|
20
25
|
},
|
|
21
26
|
methods: {
|
|
22
27
|
...mapMutations("generic", ["addEvent"]),
|
|
@@ -30,7 +35,7 @@ export default {
|
|
|
30
35
|
remove() {
|
|
31
36
|
this.addEvent({
|
|
32
37
|
name: "tagRemoved",
|
|
33
|
-
data: this.eventData,
|
|
38
|
+
data: this.eventData ? this.eventData : this._key,
|
|
34
39
|
});
|
|
35
40
|
},
|
|
36
41
|
},
|
|
@@ -59,8 +64,9 @@ export default {
|
|
|
59
64
|
margin-right: 10px;
|
|
60
65
|
}
|
|
61
66
|
|
|
62
|
-
.icon {
|
|
67
|
+
.icon-tag {
|
|
63
68
|
color: #9e9e9e;
|
|
64
69
|
padding-left: 5px;
|
|
70
|
+
font-size: 20px;
|
|
65
71
|
}
|
|
66
72
|
</style>
|
|
@@ -25,9 +25,11 @@
|
|
|
25
25
|
</b-row>
|
|
26
26
|
<Loading type="line" :center="false" v-show="isLoading('loadingLine')" />
|
|
27
27
|
<div class="fixed-bar-options" v-show="selected.length > 0">
|
|
28
|
-
<div>
|
|
28
|
+
<div class="side-by-side">
|
|
29
29
|
<Button v-if="buttonRemove" key="remove" :title="`Remover ${selected.length}`" type="danger" size="small"
|
|
30
|
-
:clicked="
|
|
30
|
+
:clicked="confirmRemoved" />
|
|
31
|
+
</div>
|
|
32
|
+
<div class="side-by-side">
|
|
31
33
|
<slot name="content-buttons-table-header"></slot>
|
|
32
34
|
</div>
|
|
33
35
|
</div>
|
|
@@ -40,6 +42,14 @@
|
|
|
40
42
|
</div>
|
|
41
43
|
<br />
|
|
42
44
|
<Pagination _key="templateList" :totalRecords="content.totalRecords" />
|
|
45
|
+
<Modal title="Tem certeza que deseja remover?" :width="500" v-show="showModal('confirmRemoved')">
|
|
46
|
+
<Alert type="warning">
|
|
47
|
+
<span>
|
|
48
|
+
Atenção, todos os registros relacionados também serão excluídos/cancelados, esta ação é irreversível!
|
|
49
|
+
</span>
|
|
50
|
+
</Alert>
|
|
51
|
+
<Confirmation :isModal="false" title="Você tem certeza?" type="danger" :confirmed="removeSelected" />
|
|
52
|
+
</Modal>
|
|
43
53
|
</div>
|
|
44
54
|
</template>
|
|
45
55
|
|
|
@@ -52,6 +62,9 @@ import TableTotalRecords from "../shared/TableTotalRecords.vue";
|
|
|
52
62
|
import TableTotalization from "../shared/TableTotalization.vue";
|
|
53
63
|
import HorizontalFilter from "../shared/HorizontalFilter.vue";
|
|
54
64
|
import Loading from "../shared/Loading.vue";
|
|
65
|
+
import Confirmation from "@nixweb/nixloc-ui/src/component/shared/Confirmation.vue";
|
|
66
|
+
import Alert from "@nixweb/nixloc-ui/src/component/layout/Alert";
|
|
67
|
+
import Modal from "@nixweb/nixloc-ui/src/component/forms/Modal";
|
|
55
68
|
|
|
56
69
|
import { mapState, mapGetters, mapActions, mapMutations } from "vuex";
|
|
57
70
|
|
|
@@ -77,6 +90,9 @@ export default {
|
|
|
77
90
|
HorizontalFilter,
|
|
78
91
|
TableTotalization,
|
|
79
92
|
TableTotalRecords,
|
|
93
|
+
Confirmation,
|
|
94
|
+
Alert,
|
|
95
|
+
Modal,
|
|
80
96
|
Loading,
|
|
81
97
|
FixedBar,
|
|
82
98
|
Button,
|
|
@@ -121,8 +137,9 @@ export default {
|
|
|
121
137
|
"clearedSearch",
|
|
122
138
|
"totalPerPage",
|
|
123
139
|
"selectStatic",
|
|
140
|
+
"tags"
|
|
124
141
|
]),
|
|
125
|
-
...mapGetters("generic", ["pagination", "isLoading", "event"]),
|
|
142
|
+
...mapGetters("generic", ["pagination", "isLoading", "event", "showModal"]),
|
|
126
143
|
paginationKey: function () {
|
|
127
144
|
return this.pagination("templateList");
|
|
128
145
|
},
|
|
@@ -135,6 +152,10 @@ export default {
|
|
|
135
152
|
"addSelected",
|
|
136
153
|
"updatePagination",
|
|
137
154
|
"updateSearch",
|
|
155
|
+
"addTag",
|
|
156
|
+
"removeTag",
|
|
157
|
+
"openModal",
|
|
158
|
+
"hideModal"
|
|
138
159
|
]),
|
|
139
160
|
getAll() {
|
|
140
161
|
let obj = {
|
|
@@ -165,21 +186,40 @@ export default {
|
|
|
165
186
|
}
|
|
166
187
|
},
|
|
167
188
|
selectFilter(value) {
|
|
189
|
+
|
|
168
190
|
let fieldTarget = value.fieldTarget;
|
|
169
|
-
let obj = { key: fieldTarget, value: value.value };
|
|
170
|
-
this.paramsFilter.push(obj);
|
|
191
|
+
let obj = { tag: value.tag, key: fieldTarget, value: value.value };
|
|
171
192
|
|
|
193
|
+
if (obj.value != "")
|
|
194
|
+
this.paramsFilter.push(obj);
|
|
195
|
+
|
|
196
|
+
this.convertToObjectAndGetAll();
|
|
197
|
+
},
|
|
198
|
+
convertToObjectAndGetAll() {
|
|
172
199
|
var result = {};
|
|
173
200
|
for (var i = 0; i < this.paramsFilter.length; i++) {
|
|
174
201
|
let key = this.paramsFilter[i].key;
|
|
175
202
|
let value = this.paramsFilter[i].value;
|
|
203
|
+
let tag = this.paramsFilter[i].tag;
|
|
204
|
+
|
|
176
205
|
|
|
177
206
|
if (key == "period") {
|
|
178
207
|
result["start"] = value.start;
|
|
179
208
|
result["end"] = value.end;
|
|
209
|
+
|
|
180
210
|
} else {
|
|
181
211
|
result[key] = value;
|
|
182
212
|
}
|
|
213
|
+
|
|
214
|
+
result["tag"] = tag;
|
|
215
|
+
|
|
216
|
+
if (tag) {
|
|
217
|
+
this.removeTag(key); // para não duplicar
|
|
218
|
+
this.addTag({ tag: tag, key: key });
|
|
219
|
+
} else {
|
|
220
|
+
this.removeTag(key);
|
|
221
|
+
}
|
|
222
|
+
|
|
183
223
|
}
|
|
184
224
|
|
|
185
225
|
this.dynamicFilter = result;
|
|
@@ -191,13 +231,18 @@ export default {
|
|
|
191
231
|
|
|
192
232
|
this.getAll();
|
|
193
233
|
},
|
|
234
|
+
confirmRemoved() {
|
|
235
|
+
this.removeLoading(["remove"]);
|
|
236
|
+
this.openModal("confirmRemoved");
|
|
237
|
+
},
|
|
194
238
|
removeSelected() {
|
|
195
239
|
let params = {
|
|
196
240
|
url: this.templateList.urlDeleteAllApi,
|
|
197
241
|
selected: this.selected,
|
|
198
242
|
};
|
|
199
243
|
this.deleteAllApi(params).then(() => {
|
|
200
|
-
this.
|
|
244
|
+
this.hideModal("confirmRemoved");
|
|
245
|
+
this.removeLoading(["confirm"]);
|
|
201
246
|
this.addSelected([]);
|
|
202
247
|
});
|
|
203
248
|
},
|
|
@@ -209,6 +254,15 @@ export default {
|
|
|
209
254
|
event: {
|
|
210
255
|
handler(event) {
|
|
211
256
|
if (event.name == "tableDragAndDrop") this.orderAll(event.data);
|
|
257
|
+
|
|
258
|
+
if (event.name == "tagRemoved") {
|
|
259
|
+
|
|
260
|
+
this.removeTag(event.data);
|
|
261
|
+
let filter = this.paramsFilter.filter(x => x.key != event.data);
|
|
262
|
+
this.paramsFilter = filter;
|
|
263
|
+
|
|
264
|
+
this.convertToObjectAndGetAll();
|
|
265
|
+
}
|
|
212
266
|
},
|
|
213
267
|
deep: true,
|
|
214
268
|
},
|
|
@@ -379,7 +379,7 @@ export default {
|
|
|
379
379
|
: "$apply=";
|
|
380
380
|
let baseUrl = `${
|
|
381
381
|
this.templateList.urlGetApi
|
|
382
|
-
}?${query}aggregate(${this.oDataFilter.totalization.replace(",", "")})
|
|
382
|
+
}?${query}aggregate(${this.oDataFilter.totalization.replace(",", "")})`;
|
|
383
383
|
return baseUrl;
|
|
384
384
|
},
|
|
385
385
|
liveTotalRecords() {
|
|
@@ -10,6 +10,11 @@
|
|
|
10
10
|
</div>
|
|
11
11
|
<div slot="content-main">
|
|
12
12
|
<slot name="content-between-search-table"></slot>
|
|
13
|
+
<div class="div-tag">
|
|
14
|
+
<div class="side-by-side" v-for="tag in tags">
|
|
15
|
+
<Tag :_key="tag.key" :title="tag.tag" />
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
13
18
|
<Molded>
|
|
14
19
|
<ListViewWithDataHandler :templateList="templateList" :propsParam="propsParam" :buttonRemove="buttonRemove">
|
|
15
20
|
<div slot="content-buttons-table-header">
|
|
@@ -31,12 +36,15 @@
|
|
|
31
36
|
<script>
|
|
32
37
|
import Panel from "@nixweb/nixloc-ui/src/component/layout/Panel.vue";
|
|
33
38
|
import Molded from "@nixweb/nixloc-ui/src/component/layout/Molded";
|
|
39
|
+
import Tag from "@nixweb/nixloc-ui/src/component/layout/Tag.vue";
|
|
34
40
|
|
|
35
41
|
import ListViewWithDataHandler from "@nixweb/nixloc-ui/src/component/template/ListViewWithDataHandler.vue";
|
|
36
42
|
|
|
43
|
+
import { mapState } from "vuex";
|
|
44
|
+
|
|
37
45
|
export default {
|
|
38
46
|
name: "TemplateView",
|
|
39
|
-
components: { Panel, Molded, ListViewWithDataHandler },
|
|
47
|
+
components: { Panel, Molded, Tag, ListViewWithDataHandler },
|
|
40
48
|
props: {
|
|
41
49
|
panel: Object,
|
|
42
50
|
templateList: Object,
|
|
@@ -46,5 +54,8 @@ export default {
|
|
|
46
54
|
default: true,
|
|
47
55
|
},
|
|
48
56
|
},
|
|
57
|
+
computed: {
|
|
58
|
+
...mapState("generic", ["tags"]),
|
|
59
|
+
},
|
|
49
60
|
};
|
|
50
61
|
</script>
|
|
@@ -2,92 +2,40 @@
|
|
|
2
2
|
<div>
|
|
3
3
|
<b-row>
|
|
4
4
|
<b-col xs="12" sm="12" md="12" lg="3" xl="3">
|
|
5
|
-
<InputText
|
|
6
|
-
|
|
7
|
-
field="zipCode"
|
|
8
|
-
:formName="formName"
|
|
9
|
-
:mask="'#####-###'"
|
|
10
|
-
:maxLength="9"
|
|
11
|
-
:required="required"
|
|
12
|
-
:markFormDirty="markFormDirty"
|
|
13
|
-
v-model="address.zipCode"
|
|
14
|
-
>
|
|
5
|
+
<InputText title="CEP" field="zipCode" :formName="formName" :mask="'#####-###'" :maxLength="9"
|
|
6
|
+
:required="required" :markFormDirty="markFormDirty" v-model="address.zipCode">
|
|
15
7
|
<div class="glyphicon margin-button">
|
|
16
|
-
<Button
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
size="small"
|
|
21
|
-
:disabled="address.zipCode.length < 9"
|
|
22
|
-
:clicked="searchZipCode"
|
|
23
|
-
/></div
|
|
24
|
-
></InputText>
|
|
8
|
+
<Button _key="searchZipCode" type="success" classIcon="fas fa-search" size="small"
|
|
9
|
+
:disabled="address.zipCode.length < 9" :clicked="searchZipCode" />
|
|
10
|
+
</div>
|
|
11
|
+
</InputText>
|
|
25
12
|
</b-col>
|
|
26
13
|
<b-col xs="12" sm="12" md="12" lg="5" xl="5">
|
|
27
|
-
<InputText
|
|
28
|
-
|
|
29
|
-
field="street"
|
|
30
|
-
:formName="formName"
|
|
31
|
-
:maxLength="150"
|
|
32
|
-
:required="required"
|
|
33
|
-
:markFormDirty="markFormDirty"
|
|
34
|
-
v-model="address.street"
|
|
35
|
-
/>
|
|
14
|
+
<InputText title="Endereço" field="street" :formName="formName" :maxLength="150" :required="required"
|
|
15
|
+
:markFormDirty="markFormDirty" v-model="address.street" />
|
|
36
16
|
</b-col>
|
|
37
17
|
<b-col xs="12" sm="12" md="12" lg="2" xl="2">
|
|
38
|
-
<InputText
|
|
39
|
-
|
|
40
|
-
field="number"
|
|
41
|
-
:formName="formName"
|
|
42
|
-
:maxLength="20"
|
|
43
|
-
:markFormDirty="markFormDirty"
|
|
44
|
-
v-model="address.number"
|
|
45
|
-
/>
|
|
18
|
+
<InputText title="Número" field="number" :formName="formName" :maxLength="20" :markFormDirty="markFormDirty"
|
|
19
|
+
v-model="address.number" />
|
|
46
20
|
</b-col>
|
|
47
21
|
<b-col xs="12" sm="12" md="12" lg="2" xl="2">
|
|
48
|
-
<InputText
|
|
49
|
-
|
|
50
|
-
field="complement"
|
|
51
|
-
:formName="formName"
|
|
52
|
-
:maxLength="50"
|
|
53
|
-
:markFormDirty="markFormDirty"
|
|
54
|
-
v-model="address.complement"
|
|
55
|
-
/>
|
|
22
|
+
<InputText title="Complemento" field="complement" :formName="formName" :maxLength="50"
|
|
23
|
+
:markFormDirty="markFormDirty" v-model="address.complement" />
|
|
56
24
|
</b-col>
|
|
57
25
|
<br />
|
|
58
26
|
</b-row>
|
|
59
27
|
<b-row>
|
|
60
28
|
<b-col xs="12" sm="12" md="12" lg="5" xl="5">
|
|
61
|
-
<InputText
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
:
|
|
66
|
-
:required="required"
|
|
67
|
-
:markFormDirty="markFormDirty"
|
|
68
|
-
v-model="address.province"
|
|
69
|
-
/> </b-col
|
|
70
|
-
><b-col xs="12" sm="12" md="12" lg="5" xl="5">
|
|
71
|
-
<InputText
|
|
72
|
-
title="Cidade"
|
|
73
|
-
field="city"
|
|
74
|
-
:formName="formName"
|
|
75
|
-
:maxLength="100"
|
|
76
|
-
:required="required"
|
|
77
|
-
:markFormDirty="markFormDirty"
|
|
78
|
-
v-model="address.city"
|
|
79
|
-
/>
|
|
29
|
+
<InputText title="Bairro" field="province" :formName="formName" :maxLength="100" :required="required"
|
|
30
|
+
:markFormDirty="markFormDirty" v-model="address.province" />
|
|
31
|
+
</b-col><b-col xs="12" sm="12" md="12" lg="5" xl="5">
|
|
32
|
+
<InputText title="Cidade" field="city" :formName="formName" :maxLength="100" :required="required"
|
|
33
|
+
:markFormDirty="markFormDirty" v-model="address.city" />
|
|
80
34
|
</b-col>
|
|
81
35
|
<b-col xs="12" sm="12" md="12" lg="2" xl="2">
|
|
82
|
-
<SelectStatic
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
:required="required"
|
|
86
|
-
:markFormDirty="markFormDirty"
|
|
87
|
-
v-model="address.state"
|
|
88
|
-
:data="states"
|
|
89
|
-
/> </b-col
|
|
90
|
-
></b-row>
|
|
36
|
+
<SelectStatic title="UF" :formName="formName" field="uf" fieldTarget="uf" :required="required"
|
|
37
|
+
:markFormDirty="markFormDirty" v-model="address.state" :data="states" />
|
|
38
|
+
</b-col></b-row>
|
|
91
39
|
</div>
|
|
92
40
|
</template>
|
|
93
41
|
|
|
@@ -33,7 +33,8 @@ export default {
|
|
|
33
33
|
ids: undefined,
|
|
34
34
|
search: { content: "", filter: { content: "Contém", id: "contains" } },
|
|
35
35
|
documentHtml: "",
|
|
36
|
-
selectStatic: { dateTime: undefined, fieldTarget: undefined, value: undefined },
|
|
36
|
+
selectStatic: { dateTime: undefined, tag: undefined, fieldTarget: undefined, value: undefined },
|
|
37
|
+
tags: [],
|
|
37
38
|
executedSearch: false,
|
|
38
39
|
clearedSearch: false,
|
|
39
40
|
methodExecutedApi: undefined,
|
|
@@ -310,10 +311,21 @@ export default {
|
|
|
310
311
|
addFilter: (state, obj) => {
|
|
311
312
|
setTimeout(function () {
|
|
312
313
|
state.selectStatic.dateTime = new Date();
|
|
314
|
+
state.selectStatic.tag = obj.tag;
|
|
313
315
|
state.selectStatic.fieldTarget = obj.fieldTarget;
|
|
314
316
|
state.selectStatic.value = obj.value;
|
|
315
317
|
}, 100);
|
|
316
318
|
},
|
|
319
|
+
addTag: (state, tag) => {
|
|
320
|
+
state.tags.push(tag);
|
|
321
|
+
},
|
|
322
|
+
removeTag: (state, key) => {
|
|
323
|
+
let filter = state.tags.filter(x => x.key != key);
|
|
324
|
+
state.tags = filter;
|
|
325
|
+
},
|
|
326
|
+
cleanTags: (state) => {
|
|
327
|
+
state.tags = []
|
|
328
|
+
},
|
|
317
329
|
},
|
|
318
330
|
actions: {
|
|
319
331
|
postApi: async function (context, params) {
|