@nixweb/nixloc-ui 0.0.131 → 0.0.133
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 +2 -1
- package/src/component/forms/Button.vue +8 -1
- package/src/component/forms/CheckboxSimple.vue +7 -1
- package/src/component/forms/InputAddressGoogle.vue +175 -0
- package/src/component/forms/InputText.vue +1 -0
- package/src/component/layout/Panel.vue +1 -1
- package/src/component/shared/DocumentEditor.vue +19 -11
- package/src/component/shared/DocumentPreview.vue +5 -5
- package/src/component/shared/FullCalendar.vue +10 -1
- package/src/component/shared/ParameterLegend.vue +24 -17
- package/src/component/shared/TableButton.vue +2 -2
- package/src/component/shared/TableDraggable.vue +2 -1
- package/src/component/shared/TableItem.vue +5 -1
- package/src/component/template/ListViewWithDataHandler.vue +14 -8
- package/src/component/template/ViewTemplateDocumentView.vue +32 -4
- package/src/store/modules/generic.js +51 -22
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nixweb/nixloc-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.133",
|
|
4
4
|
"description": "Componentes UI",
|
|
5
5
|
"author": "Fábio Ávila <fabio@nixweb.com.br>",
|
|
6
6
|
"private": false,
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"vue": "^2.6.11",
|
|
30
30
|
"vue-color": "^2.7.0",
|
|
31
31
|
"vue-currency-filter": "^3.3.0",
|
|
32
|
+
"vue2-google-maps": "^0.10.7",
|
|
32
33
|
"vue-html2pdf": "^1.8.0",
|
|
33
34
|
"vue-image-crop-upload": "^3.0.3",
|
|
34
35
|
"vue-js-toggle-button": "^1.3.0",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="c-div-button">
|
|
3
3
|
<button
|
|
4
|
+
:style="'background-color:' + backroundColor + ';color:' + color"
|
|
4
5
|
class="button"
|
|
5
6
|
:class="{
|
|
6
7
|
small: size === 'small',
|
|
@@ -17,7 +18,11 @@
|
|
|
17
18
|
:disabled="disabled"
|
|
18
19
|
@click="execute()"
|
|
19
20
|
>
|
|
20
|
-
<i
|
|
21
|
+
<i
|
|
22
|
+
class="title"
|
|
23
|
+
:class="classIcon"
|
|
24
|
+
v-if="!isLoading(this._key) && classIcon"
|
|
25
|
+
></i>
|
|
21
26
|
<span v-if="!isLoading(this._key)">{{ title }}</span>
|
|
22
27
|
<vue-loading
|
|
23
28
|
v-if="isLoading(this._key)"
|
|
@@ -39,6 +44,8 @@ export default {
|
|
|
39
44
|
title: String,
|
|
40
45
|
type: String,
|
|
41
46
|
size: String,
|
|
47
|
+
color: String,
|
|
48
|
+
backroundColor: String,
|
|
42
49
|
eventName: String,
|
|
43
50
|
eventData: Object,
|
|
44
51
|
classIcon: String,
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<b-form-checkbox
|
|
3
|
+
<b-form-checkbox
|
|
4
|
+
v-model="valueLocal"
|
|
5
|
+
:value="true"
|
|
6
|
+
:unchecked-value="false"
|
|
7
|
+
>
|
|
4
8
|
{{ title }}
|
|
5
9
|
<Tip :field="field" :formName="formName" />
|
|
6
10
|
</b-form-checkbox>
|
|
@@ -20,6 +24,7 @@ export default {
|
|
|
20
24
|
formName: String,
|
|
21
25
|
field: String,
|
|
22
26
|
value: Boolean,
|
|
27
|
+
changed: Function,
|
|
23
28
|
markFormDirty: {
|
|
24
29
|
type: Boolean,
|
|
25
30
|
default: true,
|
|
@@ -40,6 +45,7 @@ export default {
|
|
|
40
45
|
valueLocal() {
|
|
41
46
|
this.$emit("input", this.valueLocal);
|
|
42
47
|
if (this.markFormDirty) this.updateFormDirty(true);
|
|
48
|
+
if (this.changed) this.changed();
|
|
43
49
|
},
|
|
44
50
|
},
|
|
45
51
|
};
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="form-group">
|
|
3
|
+
<label>
|
|
4
|
+
<i class="title class-icon-title" :class="classIconTitle"></i>
|
|
5
|
+
<i class="fa-sharp fa-solid fa-location-dot icon-location"></i>
|
|
6
|
+
<span class="title" :style="'color: ' + titleColor"> {{ title }} </span>
|
|
7
|
+
<span class="required" v-if="required">*</span>
|
|
8
|
+
<Tip :field="field" :formName="formName" />
|
|
9
|
+
</label>
|
|
10
|
+
<div class="inner-addon right-addon">
|
|
11
|
+
<div
|
|
12
|
+
class="required glyphicon"
|
|
13
|
+
v-if="notifications.length > 0 && formDirty"
|
|
14
|
+
>
|
|
15
|
+
<i class="fas fa-exclamation-triangle"></i>
|
|
16
|
+
</div>
|
|
17
|
+
<slot v-else></slot>
|
|
18
|
+
<gmap-autocomplete
|
|
19
|
+
@place_changed="setPlace"
|
|
20
|
+
class="form-control"
|
|
21
|
+
v-bind:value="value"
|
|
22
|
+
>
|
|
23
|
+
</gmap-autocomplete>
|
|
24
|
+
</div>
|
|
25
|
+
<div v-if="formDirty">
|
|
26
|
+
<div v-for="message in notifications" :key="message">
|
|
27
|
+
<span class="invalid">{{ message }}</span>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script>
|
|
34
|
+
import Tip from "../shared/Tip.vue";
|
|
35
|
+
import { mapState, mapMutations } from "vuex";
|
|
36
|
+
|
|
37
|
+
export default {
|
|
38
|
+
components: { Tip },
|
|
39
|
+
name: "InputText",
|
|
40
|
+
props: [
|
|
41
|
+
"title",
|
|
42
|
+
"classIconTitle",
|
|
43
|
+
"field",
|
|
44
|
+
"placeholder",
|
|
45
|
+
"disabled",
|
|
46
|
+
"titleColor",
|
|
47
|
+
"mask",
|
|
48
|
+
"_style",
|
|
49
|
+
"formName",
|
|
50
|
+
"required",
|
|
51
|
+
"maxLength",
|
|
52
|
+
"value",
|
|
53
|
+
"enter",
|
|
54
|
+
"cleaned",
|
|
55
|
+
"exited",
|
|
56
|
+
"markFormDirty",
|
|
57
|
+
],
|
|
58
|
+
data() {
|
|
59
|
+
return {
|
|
60
|
+
notifications: [],
|
|
61
|
+
formDirty: false,
|
|
62
|
+
withoutMask: {
|
|
63
|
+
mask: "*".repeat(255),
|
|
64
|
+
tokens: {
|
|
65
|
+
"*": { pattern: /./ },
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
created() {
|
|
71
|
+
this.validate();
|
|
72
|
+
},
|
|
73
|
+
methods: {
|
|
74
|
+
...mapMutations("validation", [
|
|
75
|
+
"addValidation",
|
|
76
|
+
"removeValidation",
|
|
77
|
+
"updateFormDirty",
|
|
78
|
+
]),
|
|
79
|
+
validate() {
|
|
80
|
+
this.notifications = [];
|
|
81
|
+
|
|
82
|
+
if (this.required && this.value.length == 0) {
|
|
83
|
+
var message = `${this.title} não pode ser vazio!`;
|
|
84
|
+
this.notifications.push(message);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (this.maxLength > 0) {
|
|
88
|
+
if (this.value.length > this.maxLength) {
|
|
89
|
+
var message = `Máximo de ${this.maxLength} caracteres!`;
|
|
90
|
+
this.notifications.push(message);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
pressedEnter() {
|
|
95
|
+
if (this.enter) this.enter();
|
|
96
|
+
},
|
|
97
|
+
outField() {
|
|
98
|
+
if (this.exited) this.exited();
|
|
99
|
+
},
|
|
100
|
+
cleanedField() {
|
|
101
|
+
if (this.value.length == 0) {
|
|
102
|
+
if (this.cleaned) this.cleaned();
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
setPlace(place) {
|
|
106
|
+
this.currentPlace = place;
|
|
107
|
+
this.$emit("input", this.currentPlace.formatted_address);
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
computed: {
|
|
111
|
+
...mapState("validation", ["resetForm", "validations"]),
|
|
112
|
+
},
|
|
113
|
+
watch: {
|
|
114
|
+
value() {
|
|
115
|
+
this.validate();
|
|
116
|
+
this.formDirty = true;
|
|
117
|
+
// inverti a validação devido não colocar o default como true no props
|
|
118
|
+
var _value = this.markFormDirty == undefined ? true : this.markFormDirty;
|
|
119
|
+
if (_value) this.updateFormDirty(true);
|
|
120
|
+
},
|
|
121
|
+
notifications() {
|
|
122
|
+
let self = this;
|
|
123
|
+
this.notifications.forEach(function (notification) {
|
|
124
|
+
let obj = {
|
|
125
|
+
key: self.field + "&" + self.formName,
|
|
126
|
+
formName: self.formName,
|
|
127
|
+
notification: notification,
|
|
128
|
+
};
|
|
129
|
+
self.addValidation(obj);
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
if (this.notifications.length == 0) {
|
|
133
|
+
let obj = {
|
|
134
|
+
key: self.field + "&" + self.formName,
|
|
135
|
+
formName: self.formName,
|
|
136
|
+
};
|
|
137
|
+
self.removeValidation(obj);
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
resetForm: {
|
|
141
|
+
handler(form) {
|
|
142
|
+
if (form.name == this.formName) this.formDirty = false;
|
|
143
|
+
},
|
|
144
|
+
deep: true,
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
</script>
|
|
149
|
+
|
|
150
|
+
<style scoped>
|
|
151
|
+
.title {
|
|
152
|
+
font-size: 14px !important;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.icon-location {
|
|
156
|
+
color: #0251a0;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.class-icon-title {
|
|
160
|
+
margin-right: 5px;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.success {
|
|
164
|
+
color: #94aa2a;
|
|
165
|
+
font-size: 14px;
|
|
166
|
+
}
|
|
167
|
+
.invalid {
|
|
168
|
+
color: #f0134d;
|
|
169
|
+
font-size: 14px;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.margin-button {
|
|
173
|
+
margin-top: -3px;
|
|
174
|
+
}
|
|
175
|
+
</style>
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
<i class="title class-icon-title" :class="classIconTitle"></i>
|
|
5
5
|
<span class="title" :style="'color: ' + titleColor">{{ title }} </span>
|
|
6
6
|
<span class="required" v-if="required">*</span>
|
|
7
|
+
<Tip :field="field" :formName="formName" />
|
|
7
8
|
</label>
|
|
8
9
|
<div class="inner-addon right-addon">
|
|
9
10
|
<div
|
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
<div>
|
|
5
5
|
<div class="document-editor__toolbar"></div>
|
|
6
6
|
<div class="document-editor__editable-container">
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
<div id="template-dev">
|
|
8
|
+
<ckeditor
|
|
9
|
+
:editor="editor"
|
|
10
|
+
v-model="documentHtml"
|
|
11
|
+
@ready="onReady"
|
|
12
|
+
@focus="changed"
|
|
13
|
+
></ckeditor>
|
|
14
|
+
</div>
|
|
13
15
|
</div>
|
|
14
16
|
</div>
|
|
15
17
|
</div>
|
|
@@ -46,7 +48,9 @@ export default {
|
|
|
46
48
|
methods: {
|
|
47
49
|
...mapMutations("generic", ["updateDocumentHtml", "addEvent"]),
|
|
48
50
|
onReady(editor) {
|
|
49
|
-
const toolbarContainer = document.querySelector(
|
|
51
|
+
const toolbarContainer = document.querySelector(
|
|
52
|
+
".document-editor__toolbar"
|
|
53
|
+
);
|
|
50
54
|
toolbarContainer.appendChild(editor.ui.view.toolbar.element);
|
|
51
55
|
},
|
|
52
56
|
changed() {
|
|
@@ -78,12 +82,11 @@ export default {
|
|
|
78
82
|
padding: 10px;
|
|
79
83
|
border: 1px solid #e4e6ec;
|
|
80
84
|
background: var(--ck-color-base-foreground);
|
|
81
|
-
overflow-y: scroll;
|
|
82
85
|
}
|
|
83
86
|
|
|
84
87
|
.document-editor__editable-container .ck-editor__editable {
|
|
85
88
|
width: 22cm;
|
|
86
|
-
|
|
89
|
+
height: 700px;
|
|
87
90
|
padding: 20px;
|
|
88
91
|
border: 1px hsl(0, 0%, 82.7%) solid;
|
|
89
92
|
border-radius: var(--ck-border-radius);
|
|
@@ -98,7 +101,9 @@ export default {
|
|
|
98
101
|
}
|
|
99
102
|
|
|
100
103
|
.document-editor .ck-heading-dropdown .ck-list .ck-button__label {
|
|
101
|
-
line-height: calc(
|
|
104
|
+
line-height: calc(
|
|
105
|
+
1.7 * var(--ck-line-height-base) * var(--ck-font-size-base)
|
|
106
|
+
);
|
|
102
107
|
min-width: 6em;
|
|
103
108
|
}
|
|
104
109
|
|
|
@@ -130,7 +135,10 @@ export default {
|
|
|
130
135
|
color: hsl(203, 100%, 50%);
|
|
131
136
|
}
|
|
132
137
|
|
|
133
|
-
.document-editor
|
|
138
|
+
.document-editor
|
|
139
|
+
.ck-heading-dropdown
|
|
140
|
+
.ck-heading_heading2.ck-on
|
|
141
|
+
.ck-button__label {
|
|
134
142
|
color: var(--ck-color-list-button-on-text);
|
|
135
143
|
}
|
|
136
144
|
|
|
@@ -16,12 +16,11 @@ export default {
|
|
|
16
16
|
template: String,
|
|
17
17
|
d: Object,
|
|
18
18
|
},
|
|
19
|
-
|
|
20
19
|
methods: {
|
|
21
|
-
|
|
20
|
+
somaGrupo(grupo) {
|
|
22
21
|
let total = "";
|
|
23
|
-
this.d.
|
|
24
|
-
if (x.
|
|
22
|
+
this.d.itensLocacao.forEach((x) => {
|
|
23
|
+
if (x.grupo === grupo) return (total = x.valorTotal);
|
|
25
24
|
});
|
|
26
25
|
return total;
|
|
27
26
|
},
|
|
@@ -29,7 +28,8 @@ export default {
|
|
|
29
28
|
computed: {
|
|
30
29
|
...mapGetters("generic", ["groupBy"]),
|
|
31
30
|
produtoAgrupado() {
|
|
32
|
-
|
|
31
|
+
var group = this.groupBy({ array: this.d.itensLocacao, key: "grupo" });
|
|
32
|
+
return group;
|
|
33
33
|
},
|
|
34
34
|
},
|
|
35
35
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<Loading type="line" :center="false" v-show="loading" />
|
|
4
|
-
<FullCalendar
|
|
4
|
+
<FullCalendar :options="calendarOptions" />
|
|
5
5
|
</div>
|
|
6
6
|
</template>
|
|
7
7
|
|
|
@@ -137,6 +137,11 @@ export default {
|
|
|
137
137
|
cursor: pointer !important;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
+
.fc-event-time {
|
|
141
|
+
color: black !important;
|
|
142
|
+
font-weight: normal !important;
|
|
143
|
+
}
|
|
144
|
+
|
|
140
145
|
.fc-list-day-side-text {
|
|
141
146
|
color: black !important;
|
|
142
147
|
}
|
|
@@ -153,6 +158,10 @@ export default {
|
|
|
153
158
|
color: black !important;
|
|
154
159
|
}
|
|
155
160
|
|
|
161
|
+
.fc-list-event-title {
|
|
162
|
+
cursor: pointer !important;
|
|
163
|
+
}
|
|
164
|
+
|
|
156
165
|
.fc-button-primary:hover {
|
|
157
166
|
background: #3e90b3 !important;
|
|
158
167
|
}
|
|
@@ -6,25 +6,25 @@
|
|
|
6
6
|
<table class="table table-responsive-xs">
|
|
7
7
|
<thead>
|
|
8
8
|
<tr>
|
|
9
|
-
<th><span class="title-header">Parâmetro</span></th>
|
|
10
9
|
<th><span class="title-header">Descrição</span></th>
|
|
11
10
|
<th><span class="title-header">Exemplo</span></th>
|
|
11
|
+
<th><span class="title-header">Parâmetro</span></th>
|
|
12
12
|
</tr>
|
|
13
13
|
</thead>
|
|
14
14
|
<tbody v-for="(legendLocal, groupName) in grouped">
|
|
15
15
|
<td class="group text-center" colspan="8">
|
|
16
|
-
<div>{{ groupName
|
|
16
|
+
<div>{{ groupName }}</div>
|
|
17
17
|
</td>
|
|
18
18
|
<tr v-for="item in legendLocal">
|
|
19
|
-
<td class="
|
|
20
|
-
<span> {{ item.parameter }}</span>
|
|
21
|
-
</td>
|
|
22
|
-
<td>
|
|
19
|
+
<td class="description">
|
|
23
20
|
<span> {{ item.description }}</span>
|
|
24
21
|
</td>
|
|
25
22
|
<td>
|
|
26
23
|
<span class="exemplo"> {{ item.example }}</span>
|
|
27
24
|
</td>
|
|
25
|
+
<td class="parametro">
|
|
26
|
+
<span> {{ item.parameter }}</span>
|
|
27
|
+
</td>
|
|
28
28
|
</tr>
|
|
29
29
|
</tbody>
|
|
30
30
|
</table>
|
|
@@ -70,23 +70,26 @@ export default {
|
|
|
70
70
|
let legend = [];
|
|
71
71
|
let self = this;
|
|
72
72
|
setTimeout(function () {
|
|
73
|
-
self.
|
|
74
|
-
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
73
|
+
if (self.search.content) {
|
|
74
|
+
self.legend.forEach(function (item) {
|
|
75
|
+
if (self.search.filter.content == "equal") {
|
|
76
|
+
if (item.description == self.search.content) legend.push(item);
|
|
77
|
+
}
|
|
78
|
+
if (self.search.filter.content == "contains") {
|
|
79
|
+
if (item.description.includes(self.search.content))
|
|
80
|
+
legend.push(item);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
self.legendLocal = legend;
|
|
84
|
+
}
|
|
85
|
+
self.removeLoading(["btnSearch", "btnClean"]);
|
|
83
86
|
}, 300);
|
|
84
87
|
},
|
|
85
88
|
clearedSearch: function () {
|
|
86
89
|
let self = this;
|
|
87
90
|
setTimeout(function () {
|
|
88
91
|
self.legendLocal = self.legend;
|
|
89
|
-
self.removeLoading(["
|
|
92
|
+
self.removeLoading(["btnSearch", "btnClean"]);
|
|
90
93
|
}, 300);
|
|
91
94
|
},
|
|
92
95
|
},
|
|
@@ -116,6 +119,10 @@ export default {
|
|
|
116
119
|
font-weight: 500;
|
|
117
120
|
}
|
|
118
121
|
|
|
122
|
+
.description {
|
|
123
|
+
width: 350px;
|
|
124
|
+
}
|
|
125
|
+
|
|
119
126
|
.div-warning {
|
|
120
127
|
margin-bottom: 20px;
|
|
121
128
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<Button
|
|
4
|
-
v-if="obj.
|
|
4
|
+
v-if="obj.typeButton == 'default'"
|
|
5
5
|
:key="row.id"
|
|
6
6
|
:title="obj.button.title"
|
|
7
7
|
:type="obj.button.type"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
:eventData="row"
|
|
12
12
|
/>
|
|
13
13
|
<Dropdown
|
|
14
|
-
v-if="obj.
|
|
14
|
+
v-if="obj.typeButton == 'botaodropdown'"
|
|
15
15
|
:title="obj.button.title"
|
|
16
16
|
:type="obj.button.type"
|
|
17
17
|
:size="obj.button.size"
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
:clicked="checkMove"
|
|
17
17
|
/>
|
|
18
18
|
</div>
|
|
19
|
-
<i class="fa-regular fa-maximize icon-order"></i> Clique e arraste para
|
|
19
|
+
<i class="fa-regular fa-maximize icon-order"></i> Clique e arraste para
|
|
20
|
+
ordenar
|
|
20
21
|
<table class="table table-responsive-xs">
|
|
21
22
|
<thead>
|
|
22
23
|
<tr>
|
|
@@ -6,7 +6,11 @@
|
|
|
6
6
|
@click="navegateTo(obj, row)"
|
|
7
7
|
:class="convertClass(row[obj.fieldComparison], obj.classCssBody)"
|
|
8
8
|
>
|
|
9
|
-
<DisplayPeriodRent
|
|
9
|
+
<DisplayPeriodRent
|
|
10
|
+
:periodRent="row[obj.field]"
|
|
11
|
+
:fontSize="14"
|
|
12
|
+
:showDeliveryDevolution="true"
|
|
13
|
+
/>
|
|
10
14
|
</div>
|
|
11
15
|
<div
|
|
12
16
|
v-if="obj.type === 'text'"
|
|
@@ -147,7 +147,11 @@ export default {
|
|
|
147
147
|
"updateSearch",
|
|
148
148
|
]),
|
|
149
149
|
getAll() {
|
|
150
|
-
let obj = {
|
|
150
|
+
let obj = {
|
|
151
|
+
...this.baseParams,
|
|
152
|
+
...this.dynamicFilter,
|
|
153
|
+
...this.propsParam,
|
|
154
|
+
};
|
|
151
155
|
let params = { url: this.templateList.urlGetApi, obj: obj };
|
|
152
156
|
this.getApi(params).then((response) => {
|
|
153
157
|
this.content = response.content;
|
|
@@ -158,15 +162,17 @@ export default {
|
|
|
158
162
|
});
|
|
159
163
|
},
|
|
160
164
|
orderAll(data) {
|
|
161
|
-
|
|
165
|
+
if (this.templateList.urlOrderAllApi) {
|
|
166
|
+
let obj = { listIds: data.listIds };
|
|
162
167
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
+
let params = {
|
|
169
|
+
url: this.templateList.urlOrderAllApi,
|
|
170
|
+
obj: obj,
|
|
171
|
+
notNotifyToast: true,
|
|
172
|
+
};
|
|
168
173
|
|
|
169
|
-
|
|
174
|
+
this.orderAllApi(params).then((response) => {});
|
|
175
|
+
}
|
|
170
176
|
},
|
|
171
177
|
removeSelected() {
|
|
172
178
|
let params = {
|
|
@@ -37,6 +37,15 @@
|
|
|
37
37
|
</div>
|
|
38
38
|
</b-col>
|
|
39
39
|
<b-col class="text-right" sm="6">
|
|
40
|
+
<div class="side-by-side" v-if="id">
|
|
41
|
+
<Button
|
|
42
|
+
key="showModalConfig"
|
|
43
|
+
type="info"
|
|
44
|
+
classIcon="fa-solid fa-gear"
|
|
45
|
+
size="small"
|
|
46
|
+
:clicked="showModalConfig"
|
|
47
|
+
/>
|
|
48
|
+
</div>
|
|
40
49
|
<div class="side-by-side">
|
|
41
50
|
<Button
|
|
42
51
|
key="showModalLegend"
|
|
@@ -69,7 +78,7 @@
|
|
|
69
78
|
</b-row>
|
|
70
79
|
</Molded>
|
|
71
80
|
</div>
|
|
72
|
-
<Modal title="Salvar" :width="
|
|
81
|
+
<Modal title="Salvar" :width="800" v-show="showModal('saveDocument')">
|
|
73
82
|
<slot></slot>
|
|
74
83
|
</Modal>
|
|
75
84
|
<Modal title="Parâmetros" :width="1100" v-if="showModal('legenda')">
|
|
@@ -100,7 +109,7 @@
|
|
|
100
109
|
<div class="a4">
|
|
101
110
|
<div id="printMe">
|
|
102
111
|
<DocumentPreview
|
|
103
|
-
:template="documentPreview"
|
|
112
|
+
:template="documentPreview('dev')"
|
|
104
113
|
:d="parameterExemple"
|
|
105
114
|
/>
|
|
106
115
|
</div>
|
|
@@ -110,7 +119,8 @@
|
|
|
110
119
|
</div>
|
|
111
120
|
</Modal>
|
|
112
121
|
<div class="div-editor">
|
|
113
|
-
<
|
|
122
|
+
<Loading type="line" v-if="!showDocumentEditor" />
|
|
123
|
+
<DocumentEditor v-if="showDocumentEditor" />
|
|
114
124
|
</div>
|
|
115
125
|
</div>
|
|
116
126
|
</div>
|
|
@@ -128,6 +138,7 @@ import Molded from "@nixweb/nixloc-ui/src/component/layout/Molded";
|
|
|
128
138
|
import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
|
|
129
139
|
import Modal from "@nixweb/nixloc-ui/src/component/forms/Modal";
|
|
130
140
|
import ScrollBar from "@nixweb/nixloc-ui/src/component/layout/ScrollBar.vue";
|
|
141
|
+
import Loading from "@nixweb/nixloc-ui/src/component/shared/Loading.vue";
|
|
131
142
|
|
|
132
143
|
import print from "vue-print-nb";
|
|
133
144
|
|
|
@@ -145,6 +156,7 @@ export default {
|
|
|
145
156
|
CodeEditor,
|
|
146
157
|
ParameterLegend,
|
|
147
158
|
Molded,
|
|
159
|
+
Loading,
|
|
148
160
|
Button,
|
|
149
161
|
Modal,
|
|
150
162
|
ScrollBar,
|
|
@@ -158,14 +170,26 @@ export default {
|
|
|
158
170
|
return {
|
|
159
171
|
id: this.$route.params.id,
|
|
160
172
|
isDisabled: true,
|
|
173
|
+
showDocumentEditor: false,
|
|
161
174
|
};
|
|
162
175
|
},
|
|
176
|
+
created() {
|
|
177
|
+
let self = this;
|
|
178
|
+
setTimeout(function () {
|
|
179
|
+
self.showDocumentEditor = true;
|
|
180
|
+
}, 1500);
|
|
181
|
+
},
|
|
163
182
|
computed: {
|
|
164
183
|
...mapState("generic", ["modal", "documentHtml"]),
|
|
165
184
|
...mapGetters("generic", ["showModal", "event", "documentPreview"]),
|
|
166
185
|
},
|
|
167
186
|
methods: {
|
|
168
|
-
...mapMutations("generic", [
|
|
187
|
+
...mapMutations("generic", [
|
|
188
|
+
"openModal",
|
|
189
|
+
"hideModal",
|
|
190
|
+
"removeLoading",
|
|
191
|
+
"addEvent",
|
|
192
|
+
]),
|
|
169
193
|
saveDocument() {
|
|
170
194
|
if (this.id) {
|
|
171
195
|
this.addEvent({ name: "saveDocument" });
|
|
@@ -177,6 +201,10 @@ export default {
|
|
|
177
201
|
saveAs() {
|
|
178
202
|
this.addEvent({ name: "saveAs" });
|
|
179
203
|
},
|
|
204
|
+
showModalConfig() {
|
|
205
|
+
this.openModal("saveDocument");
|
|
206
|
+
this.removeLoading(["showModalConfig"]);
|
|
207
|
+
},
|
|
180
208
|
showModalLegend() {
|
|
181
209
|
this.openModal("legenda");
|
|
182
210
|
this.removeLoading(["showModalLegend"]);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import axios from "@/config/axios";
|
|
2
|
+
import Tips from "@/config/tips";
|
|
2
3
|
import Token from "@nixweb/nixloc-ui/src/config/token";
|
|
3
4
|
|
|
4
5
|
export default {
|
|
@@ -35,7 +36,13 @@ export default {
|
|
|
35
36
|
},
|
|
36
37
|
getters: {
|
|
37
38
|
tip: (state) => (tipId) => {
|
|
38
|
-
|
|
39
|
+
var tips = new Tips();
|
|
40
|
+
let message = "";
|
|
41
|
+
tips.help.find(value => {
|
|
42
|
+
if (value.tipId == tipId)
|
|
43
|
+
message = value.message;
|
|
44
|
+
})
|
|
45
|
+
return message;
|
|
39
46
|
},
|
|
40
47
|
showModal: (state) => (name) => {
|
|
41
48
|
if (name == state.modal.name) return true;
|
|
@@ -60,11 +67,17 @@ export default {
|
|
|
60
67
|
event: (state) => {
|
|
61
68
|
return state.event;
|
|
62
69
|
},
|
|
63
|
-
documentPreview: (state) => {
|
|
70
|
+
documentPreview: (state) => (env) => {
|
|
64
71
|
let documentHtml = state.documentHtml
|
|
65
72
|
let ret = documentHtml;
|
|
66
73
|
|
|
67
|
-
var template =
|
|
74
|
+
var template = null;
|
|
75
|
+
|
|
76
|
+
if (env == 'dev')
|
|
77
|
+
template = document.getElementById("template-dev");
|
|
78
|
+
|
|
79
|
+
if (env == 'prod')
|
|
80
|
+
template = document.getElementById("template-prod");
|
|
68
81
|
|
|
69
82
|
if (template != null) {
|
|
70
83
|
var tables = template.getElementsByTagName("table");
|
|
@@ -86,24 +99,29 @@ export default {
|
|
|
86
99
|
|
|
87
100
|
if (th) {
|
|
88
101
|
|
|
89
|
-
let
|
|
90
|
-
let
|
|
91
|
-
let
|
|
92
|
-
let
|
|
93
|
-
let isMoviment = th.innerText.includes("
|
|
102
|
+
let isPayment = th.innerText.includes("t.pagamentoLocacao");
|
|
103
|
+
let isPeriod = th.innerText.includes("t.periodoLocacao");
|
|
104
|
+
let isProduct = th.innerText.includes("t.produtoLocacao");
|
|
105
|
+
let isGrouped = th.innerText.includes("t.produtoAgrupado");
|
|
106
|
+
let isMoviment = th.innerText.includes("t.produtoMovimentacao");
|
|
107
|
+
let isCustumerAddress = th.innerText.includes("t.enderecoCliente");
|
|
108
|
+
let isAddressRent = th.innerText.includes("t.enderecoLocacao");
|
|
109
|
+
|
|
94
110
|
|
|
95
111
|
if (isProduct) {
|
|
96
|
-
obj.vForSimple = "v-for='
|
|
112
|
+
obj.vForSimple = "v-for='produto in d.itensLocacao'";
|
|
97
113
|
config.push(obj);
|
|
98
114
|
} else if (isPeriod) {
|
|
99
|
-
obj.vForSimple = "v-for='
|
|
115
|
+
obj.vForSimple = "v-for='periodo in d.periodoLocacao'";
|
|
100
116
|
config.push(obj);
|
|
101
117
|
} else if (isPayment) {
|
|
102
|
-
obj.vForSimple = "v-for='
|
|
118
|
+
obj.vForSimple = "v-for='pagamento in d.pagamentoLocacao'";
|
|
103
119
|
config.push(obj);
|
|
104
120
|
} else if (isGrouped) {
|
|
105
|
-
obj.vForGrouped = "v-for='(
|
|
106
|
-
obj.vForSimple = "v-for='
|
|
121
|
+
obj.vForGrouped = "v-for='(itensLocacao, grupo) in produtoAgrupado'";
|
|
122
|
+
obj.vForSimple = "v-for='produto in itensLocacao'";
|
|
123
|
+
|
|
124
|
+
// neste cenário basicamente temos que montar o <tbody> no array de agrupamento
|
|
107
125
|
|
|
108
126
|
var initIndex = documentHtml.split("<tbody>", index + 1).join("<tbody>").length;
|
|
109
127
|
var lastIndex = documentHtml.split("</tbody>", index + 1).join("</tbody>").length;
|
|
@@ -112,13 +130,21 @@ export default {
|
|
|
112
130
|
|
|
113
131
|
let tr = tbody.substring(tbody.indexOf("<tr>"), tbody.lastIndexOf("</tr>"));
|
|
114
132
|
|
|
133
|
+
// faz o replace nameGroup para tirar o <tr/>
|
|
115
134
|
obj.nameGroup = tr.substring(0, tr.indexOf('</tr>')) + "</tr>";
|
|
116
135
|
obj.nameGroup = obj.nameGroup.replaceAll("\"", "'");
|
|
117
136
|
obj.nameGroupReplace = obj.nameGroup.replace("<tr>", "").replace("</tr>", "");
|
|
137
|
+
|
|
118
138
|
config.push(obj);
|
|
119
139
|
|
|
120
140
|
} else if (isMoviment) {
|
|
121
|
-
obj.vForSimple = "v-for='
|
|
141
|
+
obj.vForSimple = "v-for='produto in d.itensMovimentacao'";
|
|
142
|
+
config.push(obj);
|
|
143
|
+
} else if (isCustumerAddress) {
|
|
144
|
+
obj.vForSimple = "v-for='endereco in d.locacao.cliente.endereco'";
|
|
145
|
+
config.push(obj);
|
|
146
|
+
} else if (isAddressRent) {
|
|
147
|
+
obj.vForSimple = "v-for='endereco in d.enderecoLocacao'";
|
|
122
148
|
config.push(obj);
|
|
123
149
|
} else {
|
|
124
150
|
config.push(obj);
|
|
@@ -135,16 +161,19 @@ export default {
|
|
|
135
161
|
});
|
|
136
162
|
|
|
137
163
|
var retParse = ret.replaceAll("\"", "'");
|
|
138
|
-
retParse = eval(`
|
|
139
|
-
|
|
164
|
+
retParse = eval(`retParse${replace}`);
|
|
165
|
+
|
|
140
166
|
var classImportant = retParse
|
|
141
|
-
.replaceAll("
|
|
142
|
-
.replaceAll("
|
|
143
|
-
.replaceAll("
|
|
144
|
-
.replaceAll("
|
|
145
|
-
.replaceAll("
|
|
167
|
+
.replaceAll("t.pagamentoLocacao", "")
|
|
168
|
+
.replaceAll("t.periodoLocacao", "")
|
|
169
|
+
.replaceAll("t.produtoLocacao", "")
|
|
170
|
+
.replaceAll("t.produtoAgrupado", "")
|
|
171
|
+
.replaceAll("t.produtoMovimentacao", "")
|
|
172
|
+
.replaceAll("t.enderecoCliente", "")
|
|
173
|
+
.replaceAll("t.enderecoLocacao", "")
|
|
146
174
|
.replaceAll("<p> !important;</p>", "<p> </p>");
|
|
147
175
|
}
|
|
176
|
+
|
|
148
177
|
return classImportant;
|
|
149
178
|
},
|
|
150
179
|
groupBy: () => (obj) => {
|
|
@@ -393,7 +422,7 @@ export default {
|
|
|
393
422
|
}, (err) => {
|
|
394
423
|
if (err.response)
|
|
395
424
|
if (err.response.status === 403)
|
|
396
|
-
context.commit('addNotifications', [{ message: "Usuário sem permissão para
|
|
425
|
+
context.commit('addNotifications', [{ message: "Usuário sem permissão para remover!" }])
|
|
397
426
|
|
|
398
427
|
if (!err.response)
|
|
399
428
|
context.commit('addNotificationErrorApi');
|