@nixweb/nixloc-ui 1.4.0 → 1.5.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/package.json +1 -1
- package/src/component/layout/BottomActionsBar.vue +14 -2
- package/src/component/shared/DocumentPreview.vue +25 -0
- package/src/component/shared/actions/ActionButtons.vue +19 -5
- package/src/component/shared/actions/ActionsOptions.vue +14 -0
- package/src/component/shared/actions/ActionsSelected.vue +4 -6
- package/src/store/modules/generic.js +25 -5
package/package.json
CHANGED
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
</template>
|
|
27
27
|
|
|
28
28
|
<script>
|
|
29
|
-
|
|
30
29
|
import { mapMutations } from "vuex";
|
|
31
30
|
|
|
32
31
|
export default {
|
|
@@ -39,11 +38,17 @@ export default {
|
|
|
39
38
|
return Array.isArray(this.selected) && this.selected.length > 0;
|
|
40
39
|
}
|
|
41
40
|
},
|
|
41
|
+
watch: {
|
|
42
|
+
isOpen(val) {
|
|
43
|
+
document.body.classList.toggle("bab-open", val);
|
|
44
|
+
}
|
|
45
|
+
},
|
|
42
46
|
mounted() {
|
|
43
47
|
document.addEventListener("keydown", this.onKeydown);
|
|
44
48
|
},
|
|
45
49
|
beforeDestroy() {
|
|
46
50
|
document.removeEventListener("keydown", this.onKeydown);
|
|
51
|
+
document.body.classList.remove("bab-open");
|
|
47
52
|
},
|
|
48
53
|
methods: {
|
|
49
54
|
...mapMutations("generic", ["addEvent"]),
|
|
@@ -59,19 +64,24 @@ export default {
|
|
|
59
64
|
</script>
|
|
60
65
|
|
|
61
66
|
<style>
|
|
67
|
+
body.bab-open {
|
|
68
|
+
margin-bottom: 150px;
|
|
69
|
+
transition: margin-bottom 0.25s ease;
|
|
70
|
+
}
|
|
71
|
+
|
|
62
72
|
.bab-container {
|
|
63
73
|
position: fixed;
|
|
64
74
|
left: 0;
|
|
65
75
|
right: 0;
|
|
66
76
|
bottom: 0;
|
|
67
77
|
height: 200px;
|
|
68
|
-
|
|
69
78
|
border-top-left-radius: 18px;
|
|
70
79
|
border-top-right-radius: 18px;
|
|
71
80
|
box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
|
|
72
81
|
z-index: 9999;
|
|
73
82
|
display: flex;
|
|
74
83
|
flex-direction: column;
|
|
84
|
+
background: #fff;
|
|
75
85
|
animation: elevate 0.2s ease-in-out;
|
|
76
86
|
}
|
|
77
87
|
|
|
@@ -156,6 +166,7 @@ export default {
|
|
|
156
166
|
gap: 12px;
|
|
157
167
|
}
|
|
158
168
|
|
|
169
|
+
/* --- Animações e transições --- */
|
|
159
170
|
.slide-up-enter-active,
|
|
160
171
|
.slide-up-leave-active {
|
|
161
172
|
transition: transform 200ms ease-in-out, opacity 200ms ease-in-out;
|
|
@@ -179,6 +190,7 @@ export default {
|
|
|
179
190
|
}
|
|
180
191
|
}
|
|
181
192
|
|
|
193
|
+
/* --- Responsivo --- */
|
|
182
194
|
@media (max-width: 640px) {
|
|
183
195
|
.bab-container {
|
|
184
196
|
height: 220px;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
<div ref='preview'>
|
|
4
4
|
<v-runtime-template :template="`<div>${template}</div>`" />
|
|
5
5
|
</div>
|
|
6
|
+
<div>{{ template }}</div>
|
|
6
7
|
</div>
|
|
7
8
|
</template>
|
|
8
9
|
|
|
@@ -50,6 +51,15 @@ export default {
|
|
|
50
51
|
});
|
|
51
52
|
return sum.reduce((a, b) => a + b, 0);
|
|
52
53
|
},
|
|
54
|
+
somaGrupoMaster(grupoMaster) {
|
|
55
|
+
let sum = [];
|
|
56
|
+
this.d.itensLocacao.forEach((item) => {
|
|
57
|
+
if (item.grupoMaster === grupoMaster) {
|
|
58
|
+
sum.push(item.totalValue);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
return sum.reduce((a, b) => a + b, 0);
|
|
62
|
+
},
|
|
53
63
|
convertToNumber(value) {
|
|
54
64
|
return parseFloat(value.replace("R$", "").replace(",", "."));
|
|
55
65
|
},
|
|
@@ -64,6 +74,21 @@ export default {
|
|
|
64
74
|
var group = this.groupBy({ array: this.d.itensLocacao, key: "grupo" });
|
|
65
75
|
return group;
|
|
66
76
|
},
|
|
77
|
+
produtoGrupoSubgrupo() {
|
|
78
|
+
const resultado = {};
|
|
79
|
+
|
|
80
|
+
this.d.itensLocacao.forEach(item => {
|
|
81
|
+
const nomeGrupoMaster = item.grupoMaster;
|
|
82
|
+
const nomeGrupo = item.grupo;
|
|
83
|
+
|
|
84
|
+
if (!resultado[nomeGrupoMaster]) { resultado[nomeGrupoMaster] = {}; }
|
|
85
|
+
if (!resultado[nomeGrupoMaster][nomeGrupo]) { resultado[nomeGrupoMaster][nomeGrupo] = []; }
|
|
86
|
+
|
|
87
|
+
resultado[nomeGrupoMaster][nomeGrupo].push(item);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
return resultado;
|
|
91
|
+
}
|
|
67
92
|
},
|
|
68
93
|
watch: {
|
|
69
94
|
event: {
|
|
@@ -2,11 +2,22 @@
|
|
|
2
2
|
<div>
|
|
3
3
|
<div class="side-by-side" v-for="item in actions" :key="item.type">
|
|
4
4
|
|
|
5
|
-
<Button v-if="item.type === 'delete'" key="remove" classIcon="fa-solid fa-trash" :title="item.title"
|
|
5
|
+
<Button v-if="item.type === 'delete'" tooltip="Gerar Retorno" key="remove" classIcon="fa-solid fa-trash" :title="item.title"
|
|
6
6
|
type="danger" size="small" :params="item" :clicked="() => $emit('confirm', item)" />
|
|
7
7
|
|
|
8
|
+
<Button v-if="item.type === 'component'" key="component" :title="item.title" :classIcon="item.classIcon"
|
|
9
|
+
:type="item.backgroundColor ? '' : 'primary'" size="small" :params="item" color="white"
|
|
10
|
+
:backGroundColor="item.backgroundColor ? item.backgroundColor : ''"
|
|
11
|
+
:clicked="() => $emit('confirm', item)" />
|
|
12
|
+
|
|
8
13
|
<Button v-if="item.type === 'options'" key="options" :title="item.title" :classIcon="item.classIcon"
|
|
9
|
-
type="primary" size="small" :params="item"
|
|
14
|
+
:type="item.backgroundColor ? '' : 'primary'" size="small" :params="item" color="white"
|
|
15
|
+
:backGroundColor="item.backgroundColor ? item.backgroundColor : ''"
|
|
16
|
+
:clicked="() => $emit('confirm', item)" />
|
|
17
|
+
|
|
18
|
+
<Button v-if="item.type === 'event'" :eventName="item.eventName" key="event" :title="item.title"
|
|
19
|
+
:classIcon="item.classIcon" :type="item.backgroundColor ? '' : 'primary'" size="small" :params="item"
|
|
20
|
+
color="white" :backGroundColor="item.backgroundColor ? item.backgroundColor : ''" />
|
|
10
21
|
|
|
11
22
|
</div>
|
|
12
23
|
</div>
|
|
@@ -15,15 +26,18 @@
|
|
|
15
26
|
<script>
|
|
16
27
|
import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
|
|
17
28
|
|
|
29
|
+
import { mapMutations } from "vuex";
|
|
30
|
+
|
|
18
31
|
export default {
|
|
19
32
|
name: "ActionButtons",
|
|
20
33
|
components: { Button },
|
|
21
34
|
props: {
|
|
22
35
|
actions: { type: Array, default: () => [] },
|
|
23
36
|
},
|
|
37
|
+
methods: {
|
|
38
|
+
...mapMutations("generic", ["addEvent"]),
|
|
39
|
+
}
|
|
24
40
|
};
|
|
25
41
|
</script>
|
|
26
42
|
|
|
27
|
-
<style scoped>
|
|
28
|
-
|
|
29
|
-
</style>
|
|
43
|
+
<style scoped></style>
|
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
<div class="actions-options">
|
|
3
3
|
<div class="ao-body">
|
|
4
4
|
<ScrollBar :minHeight="minHeight" :maxHeight="maxHeight" class="ao-scroll">
|
|
5
|
+
<span class="ao-description title">
|
|
6
|
+
{{ actionSelected.description }}
|
|
7
|
+
</span>
|
|
8
|
+
|
|
9
|
+
<div v-if="actionSelected.type == 'component'">
|
|
10
|
+
<component :is="actionSelected.component" v-model="optionSelected"></component>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
5
13
|
<div v-if="actionSelected.type == 'options'" class="ao-radios" role="group"
|
|
6
14
|
:aria-labelledby="'ao-title'">
|
|
7
15
|
<RadioGroup :field="fieldName" :options="filteredOptions" v-model="optionSelected" />
|
|
@@ -148,6 +156,12 @@ export default {
|
|
|
148
156
|
bottom: 0;
|
|
149
157
|
}
|
|
150
158
|
|
|
159
|
+
.ao-description {
|
|
160
|
+
color: #475569;
|
|
161
|
+
font-weight: 500;
|
|
162
|
+
font-size: 13px;
|
|
163
|
+
}
|
|
164
|
+
|
|
151
165
|
.ao-footer-right {
|
|
152
166
|
display: flex;
|
|
153
167
|
gap: 8px;
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
</Modal>
|
|
31
31
|
|
|
32
32
|
<Modal title="Selecione a opção desejada" :showValidation="false" :closeOnEsc="true" :closeButton="true"
|
|
33
|
-
:width="600" :height="750" v-if="showModal('
|
|
33
|
+
:width="600" :height="750" v-if="showModal('actionsOptions')">
|
|
34
34
|
<ActionsOptions :actionSelected="actionSelected" v-model="optionSelected" />
|
|
35
35
|
</Modal>
|
|
36
36
|
</div>
|
|
@@ -106,7 +106,7 @@ export default {
|
|
|
106
106
|
this.selected.forEach((id) => this.$set(this.status, id, "waiting"));
|
|
107
107
|
|
|
108
108
|
if (params.type != "delete") {
|
|
109
|
-
this.openModal("
|
|
109
|
+
this.openModal("actionsOptions");
|
|
110
110
|
} else {
|
|
111
111
|
this.openModal("confirm");
|
|
112
112
|
}
|
|
@@ -120,6 +120,7 @@ export default {
|
|
|
120
120
|
notNotifyToast: true
|
|
121
121
|
}
|
|
122
122
|
);
|
|
123
|
+
this.addEvent({ name: "actionsUpdated" });
|
|
123
124
|
return response;
|
|
124
125
|
},
|
|
125
126
|
async remove(id) {
|
|
@@ -130,6 +131,7 @@ export default {
|
|
|
130
131
|
notNotifyToast: true
|
|
131
132
|
}
|
|
132
133
|
);
|
|
134
|
+
this.addEvent({ name: "actionsUpdated" });
|
|
133
135
|
return response;
|
|
134
136
|
},
|
|
135
137
|
async ok() {
|
|
@@ -148,10 +150,6 @@ export default {
|
|
|
148
150
|
if (this.actionSelected.method == "put")
|
|
149
151
|
result = await this.put(id);
|
|
150
152
|
|
|
151
|
-
console.log(this.actionSelected);
|
|
152
|
-
console.log(result);
|
|
153
|
-
|
|
154
|
-
|
|
155
153
|
if (result?.success) {
|
|
156
154
|
this.$set(this.status, id, "done");
|
|
157
155
|
this.selectedDone.push(id);
|
|
@@ -106,9 +106,24 @@ export default {
|
|
|
106
106
|
},
|
|
107
107
|
documentPreview: (state) => (env) => {
|
|
108
108
|
let documentHtml = state.documentHtml
|
|
109
|
-
let ret = documentHtml;
|
|
110
|
-
|
|
111
109
|
var template = null;
|
|
110
|
+
let tableStart = 0;
|
|
111
|
+
let tableEnd = 0;
|
|
112
|
+
let removedTableHtml = ""
|
|
113
|
+
|
|
114
|
+
const tabelaGrupoSubGrupo = "t.produtoGrupoSubgrupo";
|
|
115
|
+
const idxMarker = documentHtml.indexOf(tabelaGrupoSubGrupo);
|
|
116
|
+
const marcadorDiv = '<tabela-grupo-subgrupo></tabela-grupo-subgrupo>';
|
|
117
|
+
|
|
118
|
+
if (idxMarker !== -1) {
|
|
119
|
+
tableStart = documentHtml.lastIndexOf("<table", idxMarker);
|
|
120
|
+
tableEnd = documentHtml.indexOf("</table>", idxMarker) + "</table>".length;
|
|
121
|
+
|
|
122
|
+
removedTableHtml = documentHtml.substring(tableStart, tableEnd); // armazena
|
|
123
|
+
documentHtml = documentHtml.substring(0, tableStart) + marcadorDiv + documentHtml.substring(tableEnd);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
let ret = documentHtml;
|
|
112
127
|
|
|
113
128
|
if (env == 'dev')
|
|
114
129
|
template = document.getElementById("template-dev");
|
|
@@ -131,7 +146,7 @@ export default {
|
|
|
131
146
|
vForGrouped: "",
|
|
132
147
|
vForSimple: "",
|
|
133
148
|
nameGroup: "",
|
|
134
|
-
nameGroupReplace: ""
|
|
149
|
+
nameGroupReplace: "",
|
|
135
150
|
};
|
|
136
151
|
|
|
137
152
|
if (th) {
|
|
@@ -179,7 +194,6 @@ export default {
|
|
|
179
194
|
obj.vForSimple = "v-for='produto in itensLocacao'";
|
|
180
195
|
|
|
181
196
|
// neste cenário basicamente temos que montar o <tbody> no array de agrupamento
|
|
182
|
-
|
|
183
197
|
var initIndex = documentHtml.split("<tbody>", index + 1).join("<tbody>").length;
|
|
184
198
|
var lastIndex = documentHtml.split("</tbody>", index + 1).join("</tbody>").length;
|
|
185
199
|
|
|
@@ -217,18 +231,24 @@ export default {
|
|
|
217
231
|
|
|
218
232
|
let replace = "";
|
|
219
233
|
config.forEach(x => {
|
|
220
|
-
|
|
234
|
+
if (x.nameGroup || x.vForGrouped || x.nameGroupReplace || x.vForSimple) {
|
|
235
|
+
replace += `.replace("<tbody>${x.nameGroup}<tr>", "<tbody ${x.vForGrouped}>${x.nameGroupReplace}<tr ${x.vForSimple}>")`;
|
|
236
|
+
}
|
|
221
237
|
});
|
|
222
238
|
|
|
223
239
|
var retParse = ret.replaceAll("\"", "'");
|
|
224
240
|
retParse = eval(`retParse${replace}`);
|
|
225
241
|
|
|
242
|
+
if (removedTableHtml)
|
|
243
|
+
retParse = retParse.replace(marcadorDiv, `<div>${removedTableHtml}</div>`);
|
|
244
|
+
|
|
226
245
|
var classImportant = retParse
|
|
227
246
|
.replaceAll("t.pagamentoLocacao", "")
|
|
228
247
|
.replaceAll("t.periodoLocacao", "")
|
|
229
248
|
.replaceAll("t.produtoLocacao", "")
|
|
230
249
|
.replaceAll("t.produtoFatura", "")
|
|
231
250
|
.replaceAll("t.produtoAgrupado", "")
|
|
251
|
+
.replaceAll("t.produtoGrupoSubgrupo", "")
|
|
232
252
|
.replaceAll("t.produtoMovimentacao", "")
|
|
233
253
|
.replaceAll("t.enderecoCliente", "")
|
|
234
254
|
.replaceAll("t.saidaRetornoLocacao", "")
|