@nixweb/nixloc-ui 0.0.124 → 0.0.127
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 +3 -1
- package/src/component/forms/Button.vue +7 -6
- package/src/component/forms/CheckboxGroup.vue +7 -4
- package/src/component/forms/CheckboxSimple.vue +17 -2
- package/src/component/forms/DateTime.vue +15 -29
- package/src/component/forms/EditorHtml.vue +8 -5
- package/src/component/forms/FileUpload.vue +7 -11
- package/src/component/forms/ImageUpload.vue +222 -0
- package/src/component/forms/InputDecimal.vue +10 -9
- package/src/component/forms/InputNumber.vue +20 -15
- package/src/component/forms/InputPassword.vue +1 -1
- package/src/component/forms/InputText.vue +3 -3
- package/src/component/forms/Modal.vue +9 -4
- package/src/component/forms/Select.vue +12 -9
- package/src/component/forms/SelectStatic.vue +8 -1
- package/src/component/layout/Menu.vue +4 -3
- package/src/component/layout/Panel.vue +0 -2
- package/src/component/layout/{Scrollbar.vue → ScrollBar.vue} +4 -5
- package/src/component/layout/Tag.vue +3 -3
- package/src/component/layout/Wizard.vue +11 -13
- package/src/component/shared/BodyReport.vue +186 -0
- package/src/component/shared/Confirmation.vue +2 -2
- package/src/component/shared/DocumentEditor.vue +1 -1
- package/src/component/shared/ExportExcel.vue +1 -8
- package/src/component/shared/{HeaderPrint.vue → HeaderReport.vue} +3 -3
- package/src/component/shared/HorizontalFilter.vue +1 -1
- package/src/component/shared/Loading.vue +1 -1
- package/src/component/shared/Messages.vue +2 -4
- package/src/component/shared/Pagination.vue +4 -5
- package/src/component/shared/{LegendaParametro.vue → ParameterLegend.vue} +25 -29
- package/src/component/shared/ProgressBar.vue +2 -1
- package/src/component/shared/SaveCancel.vue +20 -4
- package/src/component/shared/Search.vue +16 -16
- package/src/component/shared/SelectOption.vue +137 -0
- package/src/component/shared/Table.vue +33 -22
- package/src/component/shared/TableButton.vue +3 -3
- package/src/component/shared/TableTotalRecords.vue +9 -10
- package/src/component/shared/Toast.vue +2 -2
- package/src/component/shared/VerticalFilter.vue +2 -50
- package/src/component/shared/query-builder/AddRule.vue +49 -55
- package/src/component/shared/query-builder/ConvertToOdata.js +39 -42
- package/src/component/shared/query-builder/DynamicComponent.vue +16 -15
- package/src/component/shared/query-builder/DynamicComponentList.vue +62 -0
- package/src/component/shared/query-builder/Fields.vue +32 -66
- package/src/component/shared/query-builder/QueryBuilder.vue +12 -12
- 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/template/{ListViewWithHandlerData.vue → ListViewWithDataHandler.vue} +30 -23
- package/src/component/template/{AddEditReport.vue → ReportCreateUpdate.vue} +31 -20
- package/src/component/template/ViewTemplateConfiguration.vue +6 -12
- package/src/component/template/ViewTemplateDocumentView.vue +21 -25
- package/src/component/template/ViewTemplateReportList.vue +39 -57
- package/src/component/template/ViewTemplateReportPreview.vue +238 -354
- package/src/component/template/ViewTemplateReportPreviewCOPIASEGURANCA.vue +497 -0
- package/src/component/template/ViewTemplateSelectOption.vue +60 -0
- package/src/component/template/ViewTemplateWithTable.vue +21 -14
- 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} +17 -17
- package/src/component/value-objects/Person.js +10 -0
- package/src/component/value-objects/{DadosPessoa.vue → Person.vue} +35 -35
- package/src/store/modules/generic.js +17 -11
- package/src/store/modules/report.js +124 -113
- package/src/store/modules/user.js +3 -0
- package/docs/src/component/template/ModeloRelatorioView.drawio +0 -160
- package/src/component/shared/query-builder/ListDynamicComponent.vue +0 -42
- package/src/component/value-objects/DadosPessoa.js +0 -10
- package/src/component/value-objects/Endereco.js +0 -11
|
@@ -2,32 +2,30 @@
|
|
|
2
2
|
<div>
|
|
3
3
|
<div class="wrapper-stepper">
|
|
4
4
|
<div class="stepper">
|
|
5
|
-
<div class="stepper-progress" v-if="
|
|
5
|
+
<div class="stepper-progress" v-if="showSteps">
|
|
6
6
|
<div class="stepper-progress-bar" :style="'width:' + stepperProgress"></div>
|
|
7
7
|
</div>
|
|
8
8
|
|
|
9
9
|
<div
|
|
10
10
|
class="stepper-item"
|
|
11
|
-
v-if="
|
|
11
|
+
v-if="showSteps"
|
|
12
12
|
:class="{ current: step == item, success: step > item }"
|
|
13
|
-
v-for="item in
|
|
13
|
+
v-for="item in totalSteps"
|
|
14
14
|
:key="item"
|
|
15
15
|
>
|
|
16
16
|
<div class="stepper-item-counter">
|
|
17
17
|
<img
|
|
18
18
|
class="icon-success"
|
|
19
19
|
src="https://www.seekpng.com/png/full/1-10353_check-mark-green-png-green-check-mark-svg.png"
|
|
20
|
-
alt=""
|
|
21
20
|
/>
|
|
22
21
|
<span class="number">
|
|
23
22
|
{{ item }}
|
|
24
23
|
</span>
|
|
25
24
|
</div>
|
|
26
|
-
<div class="stepper-item-title text-center">{{
|
|
25
|
+
<div class="stepper-item-title text-center">{{ legend[item - 1] }}</div>
|
|
27
26
|
</div>
|
|
28
27
|
</div>
|
|
29
|
-
|
|
30
|
-
<div class="stepper-content" v-for="item in etapa" :key="item">
|
|
28
|
+
<div class="stepper-content" v-for="item in totalSteps" :key="item">
|
|
31
29
|
<div class="stepper-pane" v-if="step == item">
|
|
32
30
|
<slot :name="step"></slot>
|
|
33
31
|
</div>
|
|
@@ -35,7 +33,7 @@
|
|
|
35
33
|
<div class="controls">
|
|
36
34
|
<button class="btn" @click="step--" v-if="step != 1">Anterior</button>
|
|
37
35
|
<button
|
|
38
|
-
v-if="step <
|
|
36
|
+
v-if="step < totalSteps"
|
|
39
37
|
class="btn btn--green-1"
|
|
40
38
|
@click="step++"
|
|
41
39
|
:disabled="!isFormValid(formName[step - 1])"
|
|
@@ -43,7 +41,7 @@
|
|
|
43
41
|
Próximo
|
|
44
42
|
</button>
|
|
45
43
|
<div class="slot-final" v-else>
|
|
46
|
-
<slot name="
|
|
44
|
+
<slot name="finish"></slot>
|
|
47
45
|
</div>
|
|
48
46
|
</div>
|
|
49
47
|
</div>
|
|
@@ -56,10 +54,10 @@ import { mapGetters, mapActions, mapMutations } from "vuex";
|
|
|
56
54
|
export default {
|
|
57
55
|
name: "Wizard",
|
|
58
56
|
props: {
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
totalSteps: Number,
|
|
58
|
+
legend: Array,
|
|
61
59
|
formName: Array,
|
|
62
|
-
|
|
60
|
+
showSteps: {
|
|
63
61
|
type: Boolean,
|
|
64
62
|
default: true,
|
|
65
63
|
},
|
|
@@ -72,7 +70,7 @@ export default {
|
|
|
72
70
|
computed: {
|
|
73
71
|
...mapGetters("validation", ["isFormValid"]),
|
|
74
72
|
stepperProgress() {
|
|
75
|
-
return (100 / this.
|
|
73
|
+
return (100 / this.totalSteps) * (this.step - 1) + "%";
|
|
76
74
|
},
|
|
77
75
|
},
|
|
78
76
|
};
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="preview">
|
|
3
|
+
<div class="toolbar">
|
|
4
|
+
<div class="icon-toolbar" v-print="'#printMe'">
|
|
5
|
+
<i class="fas fa-print"></i>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="icon-toolbar icon-excel">
|
|
8
|
+
<ExportExcel :header="header" :data="data" />
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
<ScrollBar :minHeight="400" :maxHeight="820">
|
|
12
|
+
<br />
|
|
13
|
+
<div id="printMe" class="a4 footer">
|
|
14
|
+
<HeaderReport />
|
|
15
|
+
<table class="table table-responsive-xs">
|
|
16
|
+
<thead>
|
|
17
|
+
<tr>
|
|
18
|
+
<th v-for="(obj, ind) in header" :key="ind">
|
|
19
|
+
<div class="title-margem" :class="obj.classCssTitle">
|
|
20
|
+
<i class="fas fa-search" v-if="obj.iconSearch"></i>
|
|
21
|
+
<span class="title-header"> {{ obj.title }}</span>
|
|
22
|
+
</div>
|
|
23
|
+
</th>
|
|
24
|
+
</tr>
|
|
25
|
+
</thead>
|
|
26
|
+
<tbody>
|
|
27
|
+
<tr v-for="(row, index) in data" :key="index" :style="row.rowCss">
|
|
28
|
+
<td v-for="(obj, ind) in header" :key="ind">
|
|
29
|
+
<div
|
|
30
|
+
:class="convertClass(row[obj.fieldComparison], obj.classCssBody)"
|
|
31
|
+
v-if="obj.type === 'text'"
|
|
32
|
+
>
|
|
33
|
+
{{ row[obj.field] }}
|
|
34
|
+
</div>
|
|
35
|
+
<div
|
|
36
|
+
:class="convertClass(row[obj.fieldComparison], obj.classCssBody)"
|
|
37
|
+
v-if="obj.type === 'date'"
|
|
38
|
+
>
|
|
39
|
+
{{ row[obj.field] | moment("DD/MM/YYYY") }}
|
|
40
|
+
</div>
|
|
41
|
+
<div
|
|
42
|
+
:class="convertClass(row[obj.fieldComparison], obj.classCssBody)"
|
|
43
|
+
v-if="obj.type === 'dateTime'"
|
|
44
|
+
>
|
|
45
|
+
{{ row[obj.field] | moment("DD/MM/YYYY HH:mm") }}
|
|
46
|
+
</div>
|
|
47
|
+
<div
|
|
48
|
+
:class="convertClass(row[obj.fieldComparison], obj.classCssBody)"
|
|
49
|
+
v-if="obj.type === 'currency'"
|
|
50
|
+
>
|
|
51
|
+
{{ row[obj.field] | currency }}
|
|
52
|
+
</div>
|
|
53
|
+
</td>
|
|
54
|
+
</tr>
|
|
55
|
+
</tbody>
|
|
56
|
+
<tbody v-show="data.length == 0">
|
|
57
|
+
<tr>
|
|
58
|
+
<td colspan="12">
|
|
59
|
+
<span>Nenhum registro encontrado!</span>
|
|
60
|
+
</td>
|
|
61
|
+
</tr>
|
|
62
|
+
</tbody>
|
|
63
|
+
</table>
|
|
64
|
+
</div>
|
|
65
|
+
</ScrollBar>
|
|
66
|
+
</div>
|
|
67
|
+
</template>
|
|
68
|
+
|
|
69
|
+
<script>
|
|
70
|
+
import ScrollBar from "@nixweb/nixloc-ui/src/component/layout/ScrollBar.vue";
|
|
71
|
+
import HeaderReport from "../shared/HeaderReport.vue";
|
|
72
|
+
import ExportExcel from "@nixweb/nixloc-ui/src/component/shared/ExportExcel";
|
|
73
|
+
import print from "vue-print-nb";
|
|
74
|
+
|
|
75
|
+
import { mapState, mapMutations, mapActions } from "vuex";
|
|
76
|
+
|
|
77
|
+
export default {
|
|
78
|
+
directives: {
|
|
79
|
+
print,
|
|
80
|
+
},
|
|
81
|
+
props: {
|
|
82
|
+
header: Array,
|
|
83
|
+
data: Array,
|
|
84
|
+
},
|
|
85
|
+
components: { ScrollBar, HeaderReport, ExportExcel },
|
|
86
|
+
methods: {
|
|
87
|
+
convertClass(fieldComparison, classCssBody) {
|
|
88
|
+
if (Array.isArray(classCssBody)) {
|
|
89
|
+
let ret = [];
|
|
90
|
+
classCssBody.forEach(function (value) {
|
|
91
|
+
let classCss = value.classCss;
|
|
92
|
+
let condition = value.fieldComparison == fieldComparison;
|
|
93
|
+
let obj = { [classCss]: condition };
|
|
94
|
+
ret.push(obj);
|
|
95
|
+
});
|
|
96
|
+
return ret;
|
|
97
|
+
} else {
|
|
98
|
+
return classCssBody;
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
</script>
|
|
104
|
+
|
|
105
|
+
<style scoped>
|
|
106
|
+
table tbody tr td {
|
|
107
|
+
max-width: 350px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.table thead tr {
|
|
111
|
+
border-top: 1px solid rgb(172, 172, 172);
|
|
112
|
+
border-bottom: 1px solid rgb(172, 172, 172);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.table th,
|
|
116
|
+
.table td {
|
|
117
|
+
height: 10px !important;
|
|
118
|
+
padding-left: 0px !important;
|
|
119
|
+
padding-top: 0px !important;
|
|
120
|
+
padding-bottom: 0px !important;
|
|
121
|
+
padding-right: 5px !important;
|
|
122
|
+
border-bottom: 0px !important;
|
|
123
|
+
border-top: 0px !important;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.title-header {
|
|
127
|
+
font-size: 13px;
|
|
128
|
+
color: #757d8c;
|
|
129
|
+
font-weight: 400;
|
|
130
|
+
text-transform: uppercase;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.table-number {
|
|
134
|
+
font-size: 14px;
|
|
135
|
+
font-weight: bold;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.table-main {
|
|
139
|
+
color: #757d8c;
|
|
140
|
+
max-width: 200px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.table-currency {
|
|
144
|
+
font-size: 14px;
|
|
145
|
+
min-width: 100px;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.preview {
|
|
149
|
+
background-color: #fafafa;
|
|
150
|
+
padding-bottom: 20px;
|
|
151
|
+
border: 1px solid #e4e6ec;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.toolbar {
|
|
155
|
+
height: 40px;
|
|
156
|
+
border-bottom: 1px hsl(0, 0%, 82.7%) solid;
|
|
157
|
+
overflow: hidden;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.icon-toolbar {
|
|
161
|
+
width: 20px;
|
|
162
|
+
font-size: 18px;
|
|
163
|
+
margin-left: 10px;
|
|
164
|
+
margin-top: 2px;
|
|
165
|
+
cursor: pointer;
|
|
166
|
+
display: inline-block;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.a4 {
|
|
170
|
+
max-width: 1100px;
|
|
171
|
+
min-height: 700px;
|
|
172
|
+
padding: 20px;
|
|
173
|
+
border-radius: var(--ck-border-radius);
|
|
174
|
+
background: white;
|
|
175
|
+
box-shadow: 0 0 5px hsl(0deg 0% 0% / 10%);
|
|
176
|
+
margin: 0 auto;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.footer {
|
|
180
|
+
margin-bottom: 10px;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.icon-excel {
|
|
184
|
+
color: green;
|
|
185
|
+
}
|
|
186
|
+
</style>
|
|
@@ -50,9 +50,9 @@ export default {
|
|
|
50
50
|
confirmed: Function,
|
|
51
51
|
},
|
|
52
52
|
methods: {
|
|
53
|
-
...mapMutations("generic", ["
|
|
53
|
+
...mapMutations("generic", ["openModal", "hideModal", "removeLoading"]),
|
|
54
54
|
execute() {
|
|
55
|
-
this.
|
|
55
|
+
this.openModal(`confirmation${this.data.id}`);
|
|
56
56
|
},
|
|
57
57
|
confirm() {
|
|
58
58
|
let self = this;
|
|
@@ -7,13 +7,7 @@
|
|
|
7
7
|
worksheet="Planilha"
|
|
8
8
|
:name="`${fileName}.xls`"
|
|
9
9
|
>
|
|
10
|
-
<
|
|
11
|
-
key="exportExcel"
|
|
12
|
-
:type="button.type"
|
|
13
|
-
:title="button.title"
|
|
14
|
-
classIcon="fas fa-file-excel"
|
|
15
|
-
:size="button.size"
|
|
16
|
-
/>
|
|
10
|
+
<i class="fas fa-file-excel"></i>
|
|
17
11
|
</download-excel>
|
|
18
12
|
</div>
|
|
19
13
|
</template>
|
|
@@ -26,7 +20,6 @@ import { mapMutations } from "vuex";
|
|
|
26
20
|
export default {
|
|
27
21
|
name: "ExportExcel",
|
|
28
22
|
props: {
|
|
29
|
-
button: Object,
|
|
30
23
|
header: Array,
|
|
31
24
|
data: Array,
|
|
32
25
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="div-header
|
|
2
|
+
<div class="div-header">
|
|
3
3
|
<div class="title">{{ fileName }}</div>
|
|
4
4
|
<div class="side-by-side div-tag" v-for="tag in tags" :key="tag.id">
|
|
5
5
|
<span>{{ tag.title }}</span> <span>{{ tag.value }}</span>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import { mapGetters } from "vuex";
|
|
13
13
|
|
|
14
14
|
export default {
|
|
15
|
-
name: "
|
|
15
|
+
name: "HeaderReport",
|
|
16
16
|
computed: {
|
|
17
17
|
...mapGetters("report", ["tags"]),
|
|
18
18
|
fileName() {
|
|
@@ -23,7 +23,7 @@ export default {
|
|
|
23
23
|
</script>
|
|
24
24
|
<style scoped>
|
|
25
25
|
.div-header {
|
|
26
|
-
margin: 20px;
|
|
26
|
+
margin-bottom: 20px;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.div-tag {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<div :class="{ 'div-message': !modal.open }" v-if="storageNotification.length > 0">
|
|
4
|
-
<div>
|
|
4
|
+
<div v-for="notification in storageNotification">
|
|
5
5
|
<Alert type="danger">
|
|
6
|
-
|
|
7
|
-
{{ notification.message }}
|
|
8
|
-
</div>
|
|
6
|
+
{{ notification.message }}
|
|
9
7
|
</Alert>
|
|
10
8
|
</div>
|
|
11
9
|
<b-alert
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<b-pagination
|
|
4
|
-
v-model="pagination(
|
|
4
|
+
v-model="pagination(_key).currentPage"
|
|
5
5
|
prev-text="Anterior"
|
|
6
6
|
next-text="Próximo"
|
|
7
7
|
align="right"
|
|
8
8
|
:hide-goto-end-buttons="true"
|
|
9
|
-
:per-page="pagination(
|
|
9
|
+
:per-page="pagination(_key).totalPerPage"
|
|
10
10
|
:total-rows="totalRecords"
|
|
11
11
|
></b-pagination>
|
|
12
12
|
</div>
|
|
@@ -18,12 +18,12 @@ import { mapGetters, mapMutations } from "vuex";
|
|
|
18
18
|
export default {
|
|
19
19
|
name: "Pagination",
|
|
20
20
|
props: {
|
|
21
|
-
|
|
21
|
+
_key: String,
|
|
22
22
|
totalRecords: Number,
|
|
23
23
|
},
|
|
24
24
|
created() {
|
|
25
25
|
this.addPagination({
|
|
26
|
-
key: this.
|
|
26
|
+
key: this._key,
|
|
27
27
|
currentPage: 1,
|
|
28
28
|
totalPerPage: 10,
|
|
29
29
|
});
|
|
@@ -38,7 +38,6 @@ export default {
|
|
|
38
38
|
</script>
|
|
39
39
|
|
|
40
40
|
<style>
|
|
41
|
-
|
|
42
41
|
.page-item {
|
|
43
42
|
font-size: 13px !important;
|
|
44
43
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<
|
|
3
|
+
<Search />
|
|
4
4
|
<br />
|
|
5
5
|
<ScrollBar :minHeight="400" :maxHeight="400">
|
|
6
6
|
<table class="table table-responsive-xs">
|
|
@@ -11,19 +11,19 @@
|
|
|
11
11
|
<th><span class="title-header">Exemplo</span></th>
|
|
12
12
|
</tr>
|
|
13
13
|
</thead>
|
|
14
|
-
<tbody v-for="(
|
|
15
|
-
<td class="
|
|
16
|
-
<div>{{
|
|
14
|
+
<tbody v-for="(legendLocal, groupName) in grouped">
|
|
15
|
+
<td class="group text-center" colspan="8">
|
|
16
|
+
<div>{{ groupName.toUpperCase() }}</div>
|
|
17
17
|
</td>
|
|
18
|
-
<tr v-for="item in
|
|
18
|
+
<tr v-for="item in legendLocal">
|
|
19
19
|
<td class="parametro">
|
|
20
|
-
<span> {{ item.
|
|
20
|
+
<span> {{ item.parameter }}</span>
|
|
21
21
|
</td>
|
|
22
22
|
<td>
|
|
23
23
|
<span> {{ item.description }}</span>
|
|
24
24
|
</td>
|
|
25
25
|
<td>
|
|
26
|
-
<span class="exemplo"> {{ item.
|
|
26
|
+
<span class="exemplo"> {{ item.example }}</span>
|
|
27
27
|
</td>
|
|
28
28
|
</tr>
|
|
29
29
|
</tbody>
|
|
@@ -32,27 +32,27 @@
|
|
|
32
32
|
</div>
|
|
33
33
|
</template>
|
|
34
34
|
<script>
|
|
35
|
-
import
|
|
35
|
+
import Search from "@nixweb/nixloc-ui/src/component/shared/Search.vue";
|
|
36
36
|
import ScrollBar from "@nixweb/nixloc-ui/src/component/layout/ScrollBar.vue";
|
|
37
37
|
|
|
38
38
|
import { mapGetters, mapState, mapMutations } from "vuex";
|
|
39
39
|
|
|
40
40
|
export default {
|
|
41
|
-
name: "
|
|
41
|
+
name: "ParameterLegend",
|
|
42
42
|
components: {
|
|
43
43
|
ScrollBar,
|
|
44
|
-
|
|
44
|
+
Search,
|
|
45
45
|
},
|
|
46
46
|
props: {
|
|
47
|
-
|
|
47
|
+
legend: [],
|
|
48
48
|
},
|
|
49
49
|
data() {
|
|
50
50
|
return {
|
|
51
|
-
|
|
51
|
+
legendLocal: [],
|
|
52
52
|
};
|
|
53
53
|
},
|
|
54
54
|
mounted() {
|
|
55
|
-
this.
|
|
55
|
+
this.legendLocal = this.legend;
|
|
56
56
|
},
|
|
57
57
|
methods: {
|
|
58
58
|
...mapMutations("generic", ["removeLoading"]),
|
|
@@ -60,36 +60,32 @@ export default {
|
|
|
60
60
|
computed: {
|
|
61
61
|
...mapGetters("generic", ["groupBy"]),
|
|
62
62
|
...mapState("generic", ["search", "executedSearch", "clearedSearch"]),
|
|
63
|
-
|
|
64
|
-
var
|
|
65
|
-
return
|
|
63
|
+
grouped() {
|
|
64
|
+
var list = this.groupBy({ array: this.legendLocal, key: "groupName" });
|
|
65
|
+
return list;
|
|
66
66
|
},
|
|
67
67
|
},
|
|
68
68
|
watch: {
|
|
69
69
|
executedSearch: function () {
|
|
70
|
-
let
|
|
71
|
-
|
|
70
|
+
let legend = [];
|
|
72
71
|
let self = this;
|
|
73
72
|
setTimeout(function () {
|
|
74
|
-
self.
|
|
75
|
-
if (self.search.filter.content == "
|
|
76
|
-
if (item.description == self.search.content)
|
|
73
|
+
self.legend.forEach(function (item) {
|
|
74
|
+
if (self.search.filter.content == "equal") {
|
|
75
|
+
if (item.description == self.search.content) legend.push(item);
|
|
77
76
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
if (item.description.includes(self.search.content)) legenda.push(item);
|
|
77
|
+
if (self.search.filter.content == "contains") {
|
|
78
|
+
if (item.description.includes(self.search.content)) legend.push(item);
|
|
81
79
|
}
|
|
82
80
|
});
|
|
83
|
-
|
|
84
|
-
self.legendaLocal = legenda;
|
|
85
|
-
|
|
81
|
+
self.legendLocal = legend;
|
|
86
82
|
self.removeLoading(["search", "clean"]);
|
|
87
83
|
}, 300);
|
|
88
84
|
},
|
|
89
85
|
clearedSearch: function () {
|
|
90
86
|
let self = this;
|
|
91
87
|
setTimeout(function () {
|
|
92
|
-
self.
|
|
88
|
+
self.legendLocal = self.legend;
|
|
93
89
|
self.removeLoading(["search", "clean"]);
|
|
94
90
|
}, 300);
|
|
95
91
|
},
|
|
@@ -114,7 +110,7 @@ export default {
|
|
|
114
110
|
text-transform: uppercase;
|
|
115
111
|
}
|
|
116
112
|
|
|
117
|
-
.
|
|
113
|
+
.group {
|
|
118
114
|
background-color: #fafafc;
|
|
119
115
|
font-size: 14px;
|
|
120
116
|
font-weight: 500;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<FixedBar
|
|
3
|
+
<FixedBar position="footer" v-show="formDirty && !modal.open">
|
|
4
4
|
<div>
|
|
5
5
|
<Button
|
|
6
|
-
|
|
6
|
+
_key="cancelSaveCancel"
|
|
7
7
|
eventName="cancelSaveCancel"
|
|
8
8
|
title="Cancelar"
|
|
9
9
|
type="danger"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
:clicked="cancel"
|
|
12
12
|
/>
|
|
13
13
|
<Button
|
|
14
|
-
|
|
14
|
+
_key="saveSaveCancel"
|
|
15
15
|
eventName="saveSaveCancel"
|
|
16
16
|
title="Salvar"
|
|
17
17
|
type="success"
|
|
@@ -34,13 +34,29 @@ export default {
|
|
|
34
34
|
props: {
|
|
35
35
|
formName: String,
|
|
36
36
|
},
|
|
37
|
+
data() {
|
|
38
|
+
return {
|
|
39
|
+
id: this.$route.params.id,
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
mounted() {
|
|
43
|
+
if (!this.id) {
|
|
44
|
+
let self = this;
|
|
45
|
+
setTimeout(function () {
|
|
46
|
+
self.resetValidation(this.formName);
|
|
47
|
+
self.updateFormDirty(false);
|
|
48
|
+
self.removeLoading(["panel"]);
|
|
49
|
+
}, 350);
|
|
50
|
+
}
|
|
51
|
+
},
|
|
37
52
|
computed: {
|
|
38
53
|
...mapState("validation", ["formDirty"]),
|
|
54
|
+
...mapState("generic", ["loading"]),
|
|
39
55
|
...mapGetters("validation", ["isFormValid"]),
|
|
40
56
|
...mapState("generic", ["modal"]),
|
|
41
57
|
},
|
|
42
58
|
methods: {
|
|
43
|
-
...mapMutations("validation", ["updateFormDirty"]),
|
|
59
|
+
...mapMutations("validation", ["updateFormDirty", "resetValidation"]),
|
|
44
60
|
...mapMutations("generic", ["removeLoading"]),
|
|
45
61
|
cancel() {
|
|
46
62
|
this.updateFormDirty(false);
|