@nixweb/nixloc-ui 0.0.128 → 0.0.129
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 +87 -79
- package/src/App.vue +13 -13
- package/src/component/forms/Button.vue +171 -170
- package/src/component/forms/ButtonGroup.vue +57 -0
- package/src/component/forms/ButtonSub.vue +98 -0
- package/src/component/forms/CheckboxGroup.vue +73 -72
- package/src/component/forms/CheckboxSimple.vue +46 -46
- package/src/component/forms/Color.vue +38 -38
- package/src/component/forms/DateTime.vue +167 -167
- package/src/component/forms/Dropdown.vue +242 -218
- package/src/component/forms/EditorHtml.vue +126 -126
- package/src/component/forms/FileUpload.vue +185 -185
- package/src/component/forms/IncrementDecrement.vue +7 -2
- package/src/component/forms/InputDecimal.vue +150 -142
- package/src/component/forms/InputDecimalDiscount.vue +92 -0
- package/src/component/forms/InputNumber.vue +160 -154
- package/src/component/forms/InputPassword.vue +135 -135
- package/src/component/forms/InputText.vue +174 -162
- package/src/component/forms/InputTextEdit.vue +68 -0
- package/src/component/forms/Modal.vue +65 -65
- package/src/component/forms/RadioGroup.vue +50 -50
- package/src/component/forms/Select.vue +351 -349
- package/src/component/forms/SelectStatic.vue +127 -127
- package/src/component/forms/Slider.vue +18 -18
- package/src/component/forms/TextArea.vue +126 -126
- package/src/component/forms/Toggle.vue +3 -1
- package/src/component/layout/Account.vue +3 -3
- package/src/component/layout/Alert.vue +92 -92
- package/src/component/layout/Badge.vue +104 -103
- package/src/component/layout/FixedBar.vue +100 -100
- package/src/component/layout/Gantt.vue +130 -0
- package/src/component/layout/Header.vue +38 -38
- package/src/component/layout/IconMolded.vue +48 -0
- package/src/component/layout/LoadingFullPage.vue +27 -27
- package/src/component/layout/Menu.vue +213 -210
- package/src/component/layout/Molded.vue +28 -28
- package/src/component/layout/Panel.vue +140 -140
- package/src/component/layout/Popover.vue +126 -126
- package/src/component/layout/ScrollBar.vue +42 -42
- package/src/component/layout/Wizard.vue +211 -211
- package/src/component/rental/DisplayCalculatePeriod.vue +49 -0
- package/src/component/rental/DisplayPeriodRent.vue +19 -44
- package/src/component/rental/DisplayTotalization.vue +11 -2
- package/src/component/shared/Collapse.vue +131 -131
- package/src/component/shared/Confirmation.vue +21 -2
- package/src/component/shared/DocumentPreview.vue +2 -1
- package/src/component/shared/ExportPDF.vue +116 -116
- package/src/component/shared/FullCalendar.vue +159 -0
- 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 -81
- package/src/component/shared/PDFViewer.vue +22 -22
- package/src/component/shared/Pagination.vue +52 -52
- package/src/component/shared/ProgressBar.vue +22 -22
- package/src/component/shared/QueryButton.vue +66 -66
- package/src/component/shared/SaveCancel.vue +3 -2
- package/src/component/shared/Search.vue +154 -154
- package/src/component/shared/Table.vue +163 -163
- package/src/component/shared/TableButton.vue +36 -36
- package/src/component/shared/TableTotalization.vue +47 -47
- package/src/component/shared/TimeLine.vue +47 -0
- package/src/component/shared/Tip.vue +42 -42
- package/src/component/shared/Toast.vue +54 -54
- package/src/component/shared/VerticalFilter.vue +97 -97
- package/src/component/shared/query-builder/AddRule.vue +181 -181
- package/src/component/shared/query-builder/DynamicComponentList.vue +73 -73
- package/src/component/shared/query-builder/QueryBuilder.vue +69 -69
- package/src/component/shared/query-builder/utilities.js +21 -21
- package/src/component/template/ListViewWithDataHandler.vue +260 -260
- package/src/component/template/ViewTemplateConfiguration.vue +64 -64
- package/src/component/template/ViewTemplateReportList.vue +1 -1
- package/src/component/template/ViewTemplateReportPreview.vue +0 -1
- package/src/component/template/ViewTemplateWithSalveCancel.vue +32 -32
- package/src/component/template/ViewTemplateWithTable.vue +56 -56
- 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 +543 -512
- package/src/store/modules/user.js +3 -0
- package/src/store/modules/validation.js +38 -38
- package/src/store/store.js +13 -13
|
@@ -1,154 +1,154 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<b-row>
|
|
3
|
-
<b-col xs="12" sm="12" md="12" lg="7" xl="6">
|
|
4
|
-
<div class="margin">
|
|
5
|
-
<div class="molded">
|
|
6
|
-
<b-row>
|
|
7
|
-
<b-col sm="9">
|
|
8
|
-
<input
|
|
9
|
-
type="text"
|
|
10
|
-
name="search"
|
|
11
|
-
placeholder="Pesquisar ..."
|
|
12
|
-
@keyup="verifyCleanSearch()"
|
|
13
|
-
@keyup.enter.prevent="executeSearch()"
|
|
14
|
-
v-model="search.content"
|
|
15
|
-
/></b-col>
|
|
16
|
-
<b-col sm="3">
|
|
17
|
-
<div class="div-select">
|
|
18
|
-
<SelectStatic
|
|
19
|
-
fieldTarget="filter"
|
|
20
|
-
:onlyQuery="true"
|
|
21
|
-
:initialValue="{ content: 'Contém', id: 'contains' }"
|
|
22
|
-
v-model="search.filter"
|
|
23
|
-
:showBorder="false"
|
|
24
|
-
:data="[
|
|
25
|
-
{ content: 'Contém', id: 'contains' },
|
|
26
|
-
{ content: 'Igual', id: 'equal' },
|
|
27
|
-
]"
|
|
28
|
-
/>
|
|
29
|
-
</div>
|
|
30
|
-
</b-col>
|
|
31
|
-
</b-row>
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
</b-col>
|
|
35
|
-
<b-col xs="4" sm="4" md="4" lg="4" xl="4">
|
|
36
|
-
<div class="div-button">
|
|
37
|
-
<Button
|
|
38
|
-
_key="btnSearch"
|
|
39
|
-
type="info"
|
|
40
|
-
title="Buscar"
|
|
41
|
-
classIcon="fas fa-search"
|
|
42
|
-
size="small"
|
|
43
|
-
:clicked="executeSearch"
|
|
44
|
-
/>
|
|
45
|
-
<Button
|
|
46
|
-
_key="btnClean"
|
|
47
|
-
type="info"
|
|
48
|
-
title="Limpar"
|
|
49
|
-
classIcon="fas fa-broom"
|
|
50
|
-
size="small"
|
|
51
|
-
:clicked="executeClean"
|
|
52
|
-
/>
|
|
53
|
-
</div>
|
|
54
|
-
</b-col>
|
|
55
|
-
</b-row>
|
|
56
|
-
</template>
|
|
57
|
-
|
|
58
|
-
<script>
|
|
59
|
-
import Button from "../forms/Button";
|
|
60
|
-
import SelectStatic from "../forms/SelectStatic.vue";
|
|
61
|
-
|
|
62
|
-
import { mapMutations } from "vuex";
|
|
63
|
-
|
|
64
|
-
export default {
|
|
65
|
-
components: { Button, SelectStatic },
|
|
66
|
-
name: "Search",
|
|
67
|
-
computed: {
|
|
68
|
-
search: {
|
|
69
|
-
get() {
|
|
70
|
-
return this.$store.state.generic.search;
|
|
71
|
-
},
|
|
72
|
-
set(value) {
|
|
73
|
-
this.updateSearch(value);
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
methods: {
|
|
78
|
-
...mapMutations("generic", [
|
|
79
|
-
"updateSearch",
|
|
80
|
-
"executedSearch",
|
|
81
|
-
"clearedSearch",
|
|
82
|
-
]),
|
|
83
|
-
executeSearch() {
|
|
84
|
-
this.executedSearch();
|
|
85
|
-
},
|
|
86
|
-
executeClean() {
|
|
87
|
-
this.clearedSearch();
|
|
88
|
-
let search = { content: "", filter: { content: "Contém", id: "contains" } };
|
|
89
|
-
this.updateSearch(search);
|
|
90
|
-
},
|
|
91
|
-
verifyCleanSearch() {
|
|
92
|
-
if (this.search.content.length == 0) this.clearedSearch();
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
</script>
|
|
97
|
-
|
|
98
|
-
<style scoped>
|
|
99
|
-
.icon-search {
|
|
100
|
-
font-size: 20px;
|
|
101
|
-
color: #577696;
|
|
102
|
-
display: inline-block;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.input {
|
|
106
|
-
display: inline-block;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.margin {
|
|
110
|
-
padding-top: 28px;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.div-button {
|
|
114
|
-
padding-top: 33px;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
::placeholder {
|
|
118
|
-
color: #b8c4d2;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.molded {
|
|
122
|
-
width: 100%;
|
|
123
|
-
height: 45px;
|
|
124
|
-
font-size: 14px;
|
|
125
|
-
padding: 5px 8px 6px 15px;
|
|
126
|
-
background-color: rgb(255, 255, 255);
|
|
127
|
-
border: 1px solid #E5E4E8;
|
|
128
|
-
border-radius: 40px;
|
|
129
|
-
box-sizing: border-box;
|
|
130
|
-
box-shadow: none;
|
|
131
|
-
color: rgb(38, 41, 44);
|
|
132
|
-
opacity: 1;
|
|
133
|
-
transition: background-color 0.1s ease-in 0s, border 0.1s ease-in 0s;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
input[type="text"] {
|
|
137
|
-
width: 100%;
|
|
138
|
-
height: 30px;
|
|
139
|
-
font-size: 14px;
|
|
140
|
-
border: 0px solid white;
|
|
141
|
-
background-color: rgb(255, 255, 255);
|
|
142
|
-
margin-bottom: 50px;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
input[type="text"]:focus {
|
|
146
|
-
outline: none;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.div-select {
|
|
150
|
-
margin-top: -30px;
|
|
151
|
-
margin-right: 5px;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<b-row>
|
|
3
|
+
<b-col xs="12" sm="12" md="12" lg="7" xl="6">
|
|
4
|
+
<div class="margin">
|
|
5
|
+
<div class="molded">
|
|
6
|
+
<b-row>
|
|
7
|
+
<b-col sm="9">
|
|
8
|
+
<input
|
|
9
|
+
type="text"
|
|
10
|
+
name="search"
|
|
11
|
+
placeholder="Pesquisar ..."
|
|
12
|
+
@keyup="verifyCleanSearch()"
|
|
13
|
+
@keyup.enter.prevent="executeSearch()"
|
|
14
|
+
v-model="search.content"
|
|
15
|
+
/></b-col>
|
|
16
|
+
<b-col sm="3">
|
|
17
|
+
<div class="div-select">
|
|
18
|
+
<SelectStatic
|
|
19
|
+
fieldTarget="filter"
|
|
20
|
+
:onlyQuery="true"
|
|
21
|
+
:initialValue="{ content: 'Contém', id: 'contains' }"
|
|
22
|
+
v-model="search.filter"
|
|
23
|
+
:showBorder="false"
|
|
24
|
+
:data="[
|
|
25
|
+
{ content: 'Contém', id: 'contains' },
|
|
26
|
+
{ content: 'Igual', id: 'equal' },
|
|
27
|
+
]"
|
|
28
|
+
/>
|
|
29
|
+
</div>
|
|
30
|
+
</b-col>
|
|
31
|
+
</b-row>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</b-col>
|
|
35
|
+
<b-col xs="4" sm="4" md="4" lg="4" xl="4">
|
|
36
|
+
<div class="div-button">
|
|
37
|
+
<Button
|
|
38
|
+
_key="btnSearch"
|
|
39
|
+
type="info"
|
|
40
|
+
title="Buscar"
|
|
41
|
+
classIcon="fas fa-search"
|
|
42
|
+
size="small"
|
|
43
|
+
:clicked="executeSearch"
|
|
44
|
+
/>
|
|
45
|
+
<Button
|
|
46
|
+
_key="btnClean"
|
|
47
|
+
type="info"
|
|
48
|
+
title="Limpar"
|
|
49
|
+
classIcon="fas fa-broom"
|
|
50
|
+
size="small"
|
|
51
|
+
:clicked="executeClean"
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
</b-col>
|
|
55
|
+
</b-row>
|
|
56
|
+
</template>
|
|
57
|
+
|
|
58
|
+
<script>
|
|
59
|
+
import Button from "../forms/Button";
|
|
60
|
+
import SelectStatic from "../forms/SelectStatic.vue";
|
|
61
|
+
|
|
62
|
+
import { mapMutations } from "vuex";
|
|
63
|
+
|
|
64
|
+
export default {
|
|
65
|
+
components: { Button, SelectStatic },
|
|
66
|
+
name: "Search",
|
|
67
|
+
computed: {
|
|
68
|
+
search: {
|
|
69
|
+
get() {
|
|
70
|
+
return this.$store.state.generic.search;
|
|
71
|
+
},
|
|
72
|
+
set(value) {
|
|
73
|
+
this.updateSearch(value);
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
methods: {
|
|
78
|
+
...mapMutations("generic", [
|
|
79
|
+
"updateSearch",
|
|
80
|
+
"executedSearch",
|
|
81
|
+
"clearedSearch",
|
|
82
|
+
]),
|
|
83
|
+
executeSearch() {
|
|
84
|
+
this.executedSearch();
|
|
85
|
+
},
|
|
86
|
+
executeClean() {
|
|
87
|
+
this.clearedSearch();
|
|
88
|
+
let search = { content: "", filter: { content: "Contém", id: "contains" } };
|
|
89
|
+
this.updateSearch(search);
|
|
90
|
+
},
|
|
91
|
+
verifyCleanSearch() {
|
|
92
|
+
if (this.search.content.length == 0) this.clearedSearch();
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
</script>
|
|
97
|
+
|
|
98
|
+
<style scoped>
|
|
99
|
+
.icon-search {
|
|
100
|
+
font-size: 20px;
|
|
101
|
+
color: #577696;
|
|
102
|
+
display: inline-block;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.input {
|
|
106
|
+
display: inline-block;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.margin {
|
|
110
|
+
padding-top: 28px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.div-button {
|
|
114
|
+
padding-top: 33px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
::placeholder {
|
|
118
|
+
color: #b8c4d2;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.molded {
|
|
122
|
+
width: 100%;
|
|
123
|
+
height: 45px;
|
|
124
|
+
font-size: 14px;
|
|
125
|
+
padding: 5px 8px 6px 15px;
|
|
126
|
+
background-color: rgb(255, 255, 255);
|
|
127
|
+
border: 1px solid #E5E4E8;
|
|
128
|
+
border-radius: 40px;
|
|
129
|
+
box-sizing: border-box;
|
|
130
|
+
box-shadow: none;
|
|
131
|
+
color: rgb(38, 41, 44);
|
|
132
|
+
opacity: 1;
|
|
133
|
+
transition: background-color 0.1s ease-in 0s, border 0.1s ease-in 0s;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
input[type="text"] {
|
|
137
|
+
width: 100%;
|
|
138
|
+
height: 30px;
|
|
139
|
+
font-size: 14px;
|
|
140
|
+
border: 0px solid white;
|
|
141
|
+
background-color: rgb(255, 255, 255);
|
|
142
|
+
margin-bottom: 50px;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
input[type="text"]:focus {
|
|
146
|
+
outline: none;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.div-select {
|
|
150
|
+
margin-top: -30px;
|
|
151
|
+
margin-right: 5px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
</style>
|
|
@@ -1,163 +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
|
-
<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
|
+
<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>
|