@nixweb/nixloc-ui 0.0.125 → 0.0.128
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 +79 -77
- package/src/App.vue +13 -13
- package/src/component/forms/Button.vue +170 -169
- package/src/component/forms/CheckboxGroup.vue +72 -63
- package/src/component/forms/CheckboxSimple.vue +46 -27
- package/src/component/forms/Color.vue +38 -38
- package/src/component/forms/DateTime.vue +167 -177
- package/src/component/forms/Dropdown.vue +218 -224
- package/src/component/forms/EditorHtml.vue +126 -123
- package/src/component/forms/FileUpload.vue +185 -189
- package/src/component/forms/ImageUpload.vue +230 -0
- package/src/component/forms/IncrementDecrement.vue +101 -0
- package/src/component/forms/InputDecimal.vue +142 -137
- package/src/component/forms/InputNumber.vue +154 -149
- package/src/component/forms/InputPassword.vue +135 -135
- package/src/component/forms/InputText.vue +162 -157
- package/src/component/forms/Modal.vue +65 -60
- package/src/component/forms/RadioGroup.vue +50 -50
- package/src/component/forms/Select.vue +349 -337
- package/src/component/forms/SelectStatic.vue +127 -120
- package/src/component/forms/Slider.vue +18 -18
- package/src/component/forms/TextArea.vue +126 -126
- package/src/component/layout/Alert.vue +92 -92
- package/src/component/layout/Badge.vue +103 -103
- package/src/component/layout/FixedBar.vue +100 -68
- package/src/component/layout/Header.vue +38 -35
- package/src/component/layout/LoadingFullPage.vue +27 -27
- package/src/component/layout/Menu.vue +210 -214
- package/src/component/layout/Molded.vue +28 -27
- package/src/component/layout/Panel.vue +140 -142
- package/src/component/layout/Popover.vue +126 -126
- package/src/component/layout/ScrollBar.vue +42 -43
- package/src/component/layout/Tab.vue +135 -0
- package/src/component/layout/Tag.vue +3 -3
- package/src/component/layout/Wizard.vue +211 -213
- package/src/component/rental/DisplayPeriodRent.vue +81 -0
- package/src/component/rental/DisplayTotalization.vue +47 -0
- package/src/component/shared/Collapse.vue +131 -131
- package/src/component/shared/Confirmation.vue +2 -2
- package/src/component/shared/DocumentEditor.vue +1 -1
- package/src/component/shared/DocumentPreview.vue +1 -1
- package/src/component/shared/DocumentPublic.vue +34 -0
- package/src/component/shared/ExportExcel.vue +1 -8
- package/src/component/shared/ExportPDF.vue +116 -116
- package/src/component/shared/{HeaderPrint.vue → HeaderReport.vue} +4 -4
- package/src/component/shared/HorizontalFilter.vue +59 -59
- package/src/component/shared/Loading.vue +107 -107
- package/src/component/shared/LoadingMoreButton.vue +23 -23
- package/src/component/shared/Messages.vue +81 -83
- package/src/component/shared/PDFViewer.vue +22 -22
- package/src/component/shared/Pagination.vue +52 -53
- package/src/component/shared/{LegendaParametro.vue → ParameterLegend.vue} +22 -26
- package/src/component/shared/ProgressBar.vue +22 -21
- package/src/component/shared/QueryButton.vue +66 -66
- package/src/component/shared/Report.vue +187 -0
- package/src/component/shared/SaveCancel.vue +26 -5
- package/src/component/shared/Search.vue +154 -154
- package/src/component/shared/SelectOption.vue +146 -0
- package/src/component/shared/Table.vue +163 -243
- package/src/component/shared/TableButton.vue +36 -36
- package/src/component/shared/TableDraggable.vue +127 -0
- package/src/component/shared/TableItem.vue +177 -0
- package/src/component/shared/TableTotalRecords.vue +9 -10
- package/src/component/shared/TableTotalization.vue +47 -47
- package/src/component/shared/Tip.vue +42 -42
- package/src/component/shared/Toast.vue +54 -54
- package/src/component/shared/TotalizationReport.vue +59 -0
- package/src/component/shared/VerticalFilter.vue +97 -145
- package/src/component/shared/query-builder/AddRule.vue +181 -187
- package/src/component/shared/query-builder/ConvertToOdata.js +34 -43
- package/src/component/shared/query-builder/DynamicComponent.vue +21 -16
- package/src/component/shared/query-builder/DynamicComponentList.vue +73 -0
- package/src/component/shared/query-builder/Fields.vue +29 -63
- package/src/component/shared/query-builder/QueryBuilder.vue +69 -69
- 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/shared/query-builder/utilities.js +21 -21
- package/src/component/template/{ListViewWithHandlerData.vue → ListViewWithDataHandler.vue} +260 -231
- package/src/component/template/{AddEditReport.vue → ReportCreateUpdate.vue} +40 -22
- package/src/component/template/ViewTemplateConfiguration.vue +64 -69
- package/src/component/template/ViewTemplateDocumentView.vue +22 -25
- package/src/component/template/ViewTemplateReportList.vue +39 -57
- package/src/component/template/ViewTemplateReportPreview.vue +270 -341
- package/src/component/template/ViewTemplateReportPreviewCOPIASEGURANCA.vue +497 -0
- package/src/component/template/ViewTemplateSelectOption.vue +60 -0
- package/src/component/template/ViewTemplateWithSalveCancel.vue +32 -32
- package/src/component/template/ViewTemplateWithTable.vue +56 -49
- 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} +24 -17
- package/src/component/value-objects/Person.js +10 -0
- package/src/component/value-objects/{DadosPessoa.vue → Person.vue} +50 -35
- package/src/config/axios.js +9 -9
- package/src/config/dicas.js +14 -14
- package/src/config/router.js +13 -13
- package/src/config/token.js +14 -14
- package/src/main.js +23 -23
- package/src/store/modules/generic.js +512 -488
- package/src/store/modules/report.js +156 -127
- package/src/store/modules/user.js +6 -0
- package/src/store/modules/validation.js +38 -38
- package/src/store/store.js +13 -13
- package/docs/src/component/template/ModeloRelatorioView.drawio +0 -160
- package/src/component/shared/query-builder/ListDynamicComponent.vue +0 -42
- package/src/component/shared/query-builder/Totalization.vue +0 -38
- package/src/component/value-objects/DadosPessoa.js +0 -10
- package/src/component/value-objects/Endereco.js +0 -11
|
@@ -1,243 +1,163 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<table class="table table-responsive-xs">
|
|
4
|
-
<thead>
|
|
5
|
-
<tr>
|
|
6
|
-
<th class="td-checkbox" v-if="showChecks">
|
|
7
|
-
<div>
|
|
8
|
-
<b-form-checkbox v-model="selectAll" @change="select" />
|
|
9
|
-
</div>
|
|
10
|
-
</th>
|
|
11
|
-
<th v-for="(obj, ind) in header" :key="ind">
|
|
12
|
-
<div class="title-margem" :class="obj.classCssTitle">
|
|
13
|
-
<i class="fas fa-search" v-if="obj.iconSearch"></i>
|
|
14
|
-
<span class="title-header"> {{ obj.title }}</span>
|
|
15
|
-
</div>
|
|
16
|
-
</th>
|
|
17
|
-
</tr>
|
|
18
|
-
</thead>
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
this.$router.push({
|
|
165
|
-
name: obj.routeName,
|
|
166
|
-
params: { id: row.id },
|
|
167
|
-
});
|
|
168
|
-
} else {
|
|
169
|
-
this.addEvent({
|
|
170
|
-
nome: obj.eventName,
|
|
171
|
-
data: row,
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
beforeDestroy() {
|
|
177
|
-
this.addSelected([]);
|
|
178
|
-
},
|
|
179
|
-
};
|
|
180
|
-
</script>
|
|
181
|
-
|
|
182
|
-
<style scoped>
|
|
183
|
-
|
|
184
|
-
table tbody tr td {
|
|
185
|
-
max-width: 350px;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
.table th,
|
|
189
|
-
.table td {
|
|
190
|
-
height: 10px !important;
|
|
191
|
-
padding-left: 5px !important;
|
|
192
|
-
padding-top: 7px !important;
|
|
193
|
-
padding-bottom: 5px !important;
|
|
194
|
-
padding-right: 5px !important;
|
|
195
|
-
border-bottom: 0px !important;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.td-checkbox {
|
|
199
|
-
width: 30px;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
tr:hover {
|
|
203
|
-
background-color: #fafafc;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
.title-header {
|
|
207
|
-
font-size: 13px;
|
|
208
|
-
color: #757d8c;
|
|
209
|
-
font-weight: 400;
|
|
210
|
-
text-transform: uppercase;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
.table-number {
|
|
214
|
-
font-size: 14px;
|
|
215
|
-
font-weight: bold;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.table-main {
|
|
219
|
-
color: #757d8c;
|
|
220
|
-
max-width: 200px;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
.table-currency {
|
|
224
|
-
font-size: 14px;
|
|
225
|
-
min-width: 100px;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
.link {
|
|
229
|
-
color: #3f529b;
|
|
230
|
-
font-size: 14px;
|
|
231
|
-
font-weight: 400;
|
|
232
|
-
cursor: pointer;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
.link:hover {
|
|
236
|
-
text-decoration: underline;
|
|
237
|
-
transition: 0.1s;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
.icon-link:hover {
|
|
241
|
-
font-size: 12.5px;
|
|
242
|
-
}
|
|
243
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<table class="table table-responsive-xs">
|
|
4
|
+
<thead>
|
|
5
|
+
<tr>
|
|
6
|
+
<th class="td-checkbox" v-if="showChecks">
|
|
7
|
+
<div>
|
|
8
|
+
<b-form-checkbox v-model="selectAll" @change="select" />
|
|
9
|
+
</div>
|
|
10
|
+
</th>
|
|
11
|
+
<th v-for="(obj, ind) in header" :key="ind">
|
|
12
|
+
<div class="title-margem" :class="obj.classCssTitle">
|
|
13
|
+
<i class="fas fa-search" v-if="obj.iconSearch"></i>
|
|
14
|
+
<span class="title-header"> {{ obj.title }}</span>
|
|
15
|
+
</div>
|
|
16
|
+
</th>
|
|
17
|
+
</tr>
|
|
18
|
+
</thead>
|
|
19
|
+
<draggable
|
|
20
|
+
v-model="data"
|
|
21
|
+
tag="tbody"
|
|
22
|
+
@change="checkMove"
|
|
23
|
+
:options="{ disabled: !dragAndDrop }"
|
|
24
|
+
>
|
|
25
|
+
<tr v-for="(row, index) in data" :key="index" :style="row.rowCss">
|
|
26
|
+
<td class="td-checkbox" v-if="showChecks">
|
|
27
|
+
<div :class="{ 'center-vertical': row.photo != null }">
|
|
28
|
+
<b-form-checkbox v-model="selected" :value="row.id" />
|
|
29
|
+
</div>
|
|
30
|
+
</td>
|
|
31
|
+
<td
|
|
32
|
+
v-for="(obj, ind) in header"
|
|
33
|
+
:key="ind"
|
|
34
|
+
:class="{ 'drag-and-drop': dragAndDrop }"
|
|
35
|
+
>
|
|
36
|
+
<TableItem :obj="obj" :row="row" />
|
|
37
|
+
</td>
|
|
38
|
+
</tr>
|
|
39
|
+
</draggable>
|
|
40
|
+
<tbody v-show="data.length == 0">
|
|
41
|
+
<tr>
|
|
42
|
+
<td colspan="12">
|
|
43
|
+
<span>Nenhum registro encontrado!</span>
|
|
44
|
+
</td>
|
|
45
|
+
</tr>
|
|
46
|
+
</tbody>
|
|
47
|
+
</table>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script>
|
|
52
|
+
import TableItem from "@nixweb/nixloc-ui/src/component/shared/TableItem.vue";
|
|
53
|
+
|
|
54
|
+
import draggable from "vuedraggable";
|
|
55
|
+
|
|
56
|
+
import { mapState, mapMutations, mapActions } from "vuex";
|
|
57
|
+
|
|
58
|
+
export default {
|
|
59
|
+
components: { draggable, TableItem },
|
|
60
|
+
props: {
|
|
61
|
+
header: Array,
|
|
62
|
+
data: Array,
|
|
63
|
+
showChecks: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: true,
|
|
66
|
+
},
|
|
67
|
+
dragAndDrop: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: false,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
data() {
|
|
73
|
+
return {
|
|
74
|
+
selectAll: false,
|
|
75
|
+
dataDragging: [],
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
computed: {
|
|
79
|
+
...mapState("generic", ["selected"]),
|
|
80
|
+
selected: {
|
|
81
|
+
get() {
|
|
82
|
+
return this.$store.state.generic.selected;
|
|
83
|
+
},
|
|
84
|
+
set(value) {
|
|
85
|
+
this.addSelected(value);
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
methods: {
|
|
90
|
+
...mapMutations("generic", ["addSelected", "addEvent"]),
|
|
91
|
+
...mapActions("generic", ["pdfApi"]),
|
|
92
|
+
select() {
|
|
93
|
+
this.addSelected([]);
|
|
94
|
+
if (this.selectAll) {
|
|
95
|
+
for (let i in this.data) {
|
|
96
|
+
this.selected.push(this.data[i].id);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
checkMove() {
|
|
101
|
+
if (this.dragAndDrop) {
|
|
102
|
+
var listIds = [];
|
|
103
|
+
this.data.forEach((item) => {
|
|
104
|
+
listIds.push(item.id);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
this.addEvent({
|
|
108
|
+
name: "tableDragAndDrop",
|
|
109
|
+
data: { listIds: listIds },
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
beforeDestroy() {
|
|
115
|
+
this.addSelected([]);
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
</script>
|
|
119
|
+
|
|
120
|
+
<style scoped>
|
|
121
|
+
table tbody tr td {
|
|
122
|
+
max-width: 350px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.table th,
|
|
126
|
+
.table td {
|
|
127
|
+
height: 10px !important;
|
|
128
|
+
padding-left: 5px !important;
|
|
129
|
+
padding-top: 7px !important;
|
|
130
|
+
padding-bottom: 5px !important;
|
|
131
|
+
padding-right: 5px !important;
|
|
132
|
+
border-bottom: 0px !important;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.td-checkbox {
|
|
136
|
+
width: 30px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
tr:hover {
|
|
140
|
+
background-color: #fafafc;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.title-header {
|
|
144
|
+
font-size: 13px;
|
|
145
|
+
color: #757d8c;
|
|
146
|
+
font-weight: 400;
|
|
147
|
+
text-transform: uppercase;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.table-number {
|
|
151
|
+
font-size: 14px;
|
|
152
|
+
font-weight: bold;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.table-main {
|
|
156
|
+
color: #757d8c;
|
|
157
|
+
max-width: 200px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.drag-and-drop {
|
|
161
|
+
cursor: move;
|
|
162
|
+
}
|
|
163
|
+
</style>
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<Button
|
|
4
|
-
v-if="obj.qualBotao == 'button'"
|
|
5
|
-
:key="row.id"
|
|
6
|
-
:title="obj.button.title"
|
|
7
|
-
:type="obj.button.type"
|
|
8
|
-
:size="obj.button.size"
|
|
9
|
-
:classIcon="obj.button.classIcon"
|
|
10
|
-
:eventName="obj.button.eventName"
|
|
11
|
-
:eventData="row"
|
|
12
|
-
/>
|
|
13
|
-
<Dropdown
|
|
14
|
-
v-if="obj.qualBotao == 'botaodropdown'"
|
|
15
|
-
:title="obj.button.title"
|
|
16
|
-
:type="obj.button.type"
|
|
17
|
-
:size="obj.button.size"
|
|
18
|
-
:classIcon="obj.button.classIcon"
|
|
19
|
-
:eventData="row"
|
|
20
|
-
:items="obj.button.items"
|
|
21
|
-
/>
|
|
22
|
-
</div>
|
|
23
|
-
</template>
|
|
24
|
-
|
|
25
|
-
<script>
|
|
26
|
-
import Dropdown from "../forms/Dropdown";
|
|
27
|
-
import Button from "../forms/Button";
|
|
28
|
-
export default {
|
|
29
|
-
name: "TableButton",
|
|
30
|
-
components: { Button, Dropdown },
|
|
31
|
-
props: {
|
|
32
|
-
obj: Object,
|
|
33
|
-
row: Object,
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<Button
|
|
4
|
+
v-if="obj.qualBotao == 'button'"
|
|
5
|
+
:key="row.id"
|
|
6
|
+
:title="obj.button.title"
|
|
7
|
+
:type="obj.button.type"
|
|
8
|
+
:size="obj.button.size"
|
|
9
|
+
:classIcon="obj.button.classIcon"
|
|
10
|
+
:eventName="obj.button.eventName"
|
|
11
|
+
:eventData="row"
|
|
12
|
+
/>
|
|
13
|
+
<Dropdown
|
|
14
|
+
v-if="obj.qualBotao == 'botaodropdown'"
|
|
15
|
+
:title="obj.button.title"
|
|
16
|
+
:type="obj.button.type"
|
|
17
|
+
:size="obj.button.size"
|
|
18
|
+
:classIcon="obj.button.classIcon"
|
|
19
|
+
:eventData="row"
|
|
20
|
+
:items="obj.button.items"
|
|
21
|
+
/>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script>
|
|
26
|
+
import Dropdown from "../forms/Dropdown";
|
|
27
|
+
import Button from "../forms/Button";
|
|
28
|
+
export default {
|
|
29
|
+
name: "TableButton",
|
|
30
|
+
components: { Button, Dropdown },
|
|
31
|
+
props: {
|
|
32
|
+
obj: Object,
|
|
33
|
+
row: Object,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
</script>
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class="margin">
|
|
4
|
+
<Button
|
|
5
|
+
_key="btnCancelTableDraggable"
|
|
6
|
+
title="Cancelar"
|
|
7
|
+
type="danger"
|
|
8
|
+
size="small"
|
|
9
|
+
:clicked="cancel"
|
|
10
|
+
/>
|
|
11
|
+
<Button
|
|
12
|
+
_key="btnCheckMoveTableDraggable"
|
|
13
|
+
title="Confirmar"
|
|
14
|
+
type="success"
|
|
15
|
+
size="small"
|
|
16
|
+
:clicked="checkMove"
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
<i class="fa-regular fa-maximize icon-order"></i> Clique e arraste para ordenar
|
|
20
|
+
<table class="table table-responsive-xs">
|
|
21
|
+
<thead>
|
|
22
|
+
<tr>
|
|
23
|
+
<th>
|
|
24
|
+
<span class="title-header">Nome</span>
|
|
25
|
+
</th>
|
|
26
|
+
</tr>
|
|
27
|
+
</thead>
|
|
28
|
+
<draggable v-model="dataLocal" tag="tbody">
|
|
29
|
+
<tr v-for="item in dataLocal">
|
|
30
|
+
<td class="item">
|
|
31
|
+
<i class="fa-solid fa-grip-lines icon-order"></i>
|
|
32
|
+
<span v-if="item.name"> {{ item.name }}</span>
|
|
33
|
+
<span class="without-group" v-else> Sem grupo</span>
|
|
34
|
+
</td>
|
|
35
|
+
</tr>
|
|
36
|
+
</draggable>
|
|
37
|
+
<tbody v-show="dataLocal.length == 0">
|
|
38
|
+
<tr>
|
|
39
|
+
<td colspan="12">
|
|
40
|
+
<span>Nenhum registro encontrado!</span>
|
|
41
|
+
</td>
|
|
42
|
+
</tr>
|
|
43
|
+
</tbody>
|
|
44
|
+
</table>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
<script>
|
|
48
|
+
import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
|
|
49
|
+
import draggable from "vuedraggable";
|
|
50
|
+
|
|
51
|
+
import { mapMutations, mapActions } from "vuex";
|
|
52
|
+
|
|
53
|
+
export default {
|
|
54
|
+
name: "TableDraggable",
|
|
55
|
+
components: { Button, draggable },
|
|
56
|
+
props: {
|
|
57
|
+
data: Array,
|
|
58
|
+
propsParam: Object,
|
|
59
|
+
urlOrderAllApi: String,
|
|
60
|
+
},
|
|
61
|
+
data() {
|
|
62
|
+
return {
|
|
63
|
+
dataLocal: [],
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
mounted() {
|
|
67
|
+
this.dataLocal = this.data;
|
|
68
|
+
},
|
|
69
|
+
methods: {
|
|
70
|
+
...mapMutations("generic", ["addEvent", "removeLoading"]),
|
|
71
|
+
...mapActions("generic", ["orderAllApi"]),
|
|
72
|
+
checkMove() {
|
|
73
|
+
let listIds = [];
|
|
74
|
+
|
|
75
|
+
this.dataLocal.forEach((item) => {
|
|
76
|
+
listIds.push(item.id);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
let obj = { ...this.propsParam, listIds: listIds };
|
|
80
|
+
let params = { url: this.urlOrderAllApi, obj: obj };
|
|
81
|
+
|
|
82
|
+
this.orderAllApi(params).then((response) => {
|
|
83
|
+
this.removeLoading(["btnCheckMoveTableDraggable"]);
|
|
84
|
+
this.addEvent({ name: "confirmedTableDraggable" });
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
cancel() {
|
|
88
|
+
this.addEvent({ name: "cancelTableDraggable" });
|
|
89
|
+
this.removeLoading(["btnCancelTableDraggable"]);
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
</script>
|
|
94
|
+
<style scoped>
|
|
95
|
+
.table th,
|
|
96
|
+
.table td {
|
|
97
|
+
height: 10px !important;
|
|
98
|
+
padding-left: 5px !important;
|
|
99
|
+
padding-top: 7px !important;
|
|
100
|
+
padding-bottom: 5px !important;
|
|
101
|
+
padding-right: 5px !important;
|
|
102
|
+
padding-left: 10px !important;
|
|
103
|
+
border-bottom: 0px !important;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.title-header {
|
|
107
|
+
font-size: 14px;
|
|
108
|
+
color: #757d8c;
|
|
109
|
+
font-weight: 400;
|
|
110
|
+
text-transform: uppercase;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.item {
|
|
114
|
+
background-color: #f1f4f9;
|
|
115
|
+
cursor: move;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.without-group {
|
|
119
|
+
font-size: 13px;
|
|
120
|
+
font-style: italic;
|
|
121
|
+
color: grey;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.margin {
|
|
125
|
+
margin-bottom: 10px;
|
|
126
|
+
}
|
|
127
|
+
</style>
|