@burh/nuxt-core 1.0.122 → 1.0.123
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.
|
@@ -1,99 +1,116 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<modal
|
|
2
|
+
<modal
|
|
3
|
+
:show.sync="openModal"
|
|
4
|
+
v-on:close="$emit('close-modal-video')"
|
|
5
|
+
modalContentClasses="container-fluid"
|
|
6
|
+
class="modal"
|
|
7
|
+
>
|
|
3
8
|
<template slot="header">
|
|
4
|
-
|
|
5
|
-
|
|
9
|
+
<div class="">
|
|
10
|
+
<h2 class="display-4">Editar capa do treinamento</h2>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
6
13
|
|
|
7
|
-
<dropzone-file-upload
|
|
14
|
+
<dropzone-file-upload
|
|
15
|
+
v-if="image == null"
|
|
8
16
|
v-on:error="showError"
|
|
9
|
-
|
|
17
|
+
ref="Mydropzone"
|
|
18
|
+
:options="dropzoneOptions"
|
|
19
|
+
v-model="fileToUpload"
|
|
20
|
+
class=""
|
|
21
|
+
/>
|
|
10
22
|
|
|
11
23
|
<div class="row mb-4" v-if="image != null">
|
|
12
|
-
<img class="col-12" :src="image" alt="Cover"
|
|
24
|
+
<img class="col-12" :src="image" alt="Cover" />
|
|
13
25
|
</div>
|
|
14
26
|
|
|
15
27
|
<template slot="footer">
|
|
16
|
-
<base-button type="link" @click="removeImage"
|
|
28
|
+
<base-button type="link" @click="removeImage"
|
|
29
|
+
>Remover Imagem
|
|
17
30
|
</base-button>
|
|
18
|
-
<base-button
|
|
31
|
+
<base-button
|
|
32
|
+
type="primary"
|
|
33
|
+
class="ml-auto"
|
|
34
|
+
role="button"
|
|
19
35
|
@click="saveImage"
|
|
20
36
|
>Salvar Imagem
|
|
21
37
|
</base-button>
|
|
22
|
-
|
|
38
|
+
</template>
|
|
23
39
|
</modal>
|
|
24
40
|
</template>
|
|
25
41
|
<script>
|
|
26
42
|
import DropzoneFileUpload from '@burh/nuxt-core/components/argon-core/Inputs/DropzoneFileUpload.vue';
|
|
27
|
-
import swal from
|
|
43
|
+
import swal from 'sweetalert2';
|
|
28
44
|
|
|
29
45
|
export default {
|
|
30
46
|
components: {
|
|
31
|
-
DropzoneFileUpload
|
|
47
|
+
DropzoneFileUpload
|
|
32
48
|
},
|
|
33
|
-
props:{
|
|
49
|
+
props: {
|
|
34
50
|
show: false,
|
|
35
51
|
image: {
|
|
36
52
|
type: String,
|
|
37
53
|
default: null
|
|
38
54
|
}
|
|
39
55
|
},
|
|
40
|
-
data(){
|
|
41
|
-
return{
|
|
56
|
+
data() {
|
|
57
|
+
return {
|
|
42
58
|
fileToUpload: null,
|
|
43
59
|
dropzoneOptions: {
|
|
44
60
|
maxFiles: 1,
|
|
45
|
-
maxFilesize:
|
|
46
|
-
dictFileTooBig:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
61
|
+
maxFilesize: 2, // ESTÁ DEFINIDO TAMANHO MÁXIMO DE 20 KB NA FOTO
|
|
62
|
+
dictFileTooBig:
|
|
63
|
+
'A imagem que você tentou inserir é maior que 2MB',
|
|
64
|
+
dictDefaultMessage: 'Clique ou arraste seu arquivo aqui'
|
|
65
|
+
}
|
|
66
|
+
};
|
|
50
67
|
},
|
|
51
|
-
model:{
|
|
68
|
+
model: {
|
|
52
69
|
prop: 'show'
|
|
53
70
|
},
|
|
54
|
-
computed:{
|
|
55
|
-
openModal:{
|
|
56
|
-
get(){
|
|
57
|
-
return this.show
|
|
71
|
+
computed: {
|
|
72
|
+
openModal: {
|
|
73
|
+
get() {
|
|
74
|
+
return this.show;
|
|
58
75
|
},
|
|
59
|
-
set(show){
|
|
60
|
-
this.$emit('input', show)
|
|
76
|
+
set(show) {
|
|
77
|
+
this.$emit('input', show);
|
|
61
78
|
}
|
|
62
79
|
}
|
|
63
80
|
},
|
|
64
|
-
methods:{
|
|
81
|
+
methods: {
|
|
65
82
|
showError(file, message) {
|
|
66
83
|
return swal.fire({
|
|
67
|
-
title:
|
|
84
|
+
title: 'Erro',
|
|
68
85
|
text: message,
|
|
69
|
-
type:
|
|
86
|
+
type: 'error',
|
|
70
87
|
buttonsStyling: false,
|
|
71
|
-
confirmButtonText:
|
|
72
|
-
confirmButtonClass:
|
|
88
|
+
confirmButtonText: 'Ok, fechar!',
|
|
89
|
+
confirmButtonClass: 'btn btn-primary btn-fill'
|
|
73
90
|
});
|
|
74
91
|
},
|
|
75
92
|
removeImage() {
|
|
76
|
-
if(!this.image) {
|
|
93
|
+
if (!this.image) {
|
|
77
94
|
this.$refs.Mydropzone.removeAllFiles();
|
|
78
95
|
}
|
|
79
|
-
this.$emit('remove-image')
|
|
96
|
+
this.$emit('remove-image');
|
|
80
97
|
},
|
|
81
98
|
async saveImage() {
|
|
82
|
-
if(this.fileToUpload != null) {
|
|
83
|
-
let image = this.fileToUpload
|
|
84
|
-
this.$emit('save-img', image)
|
|
99
|
+
if (this.fileToUpload != null) {
|
|
100
|
+
let image = this.fileToUpload;
|
|
101
|
+
this.$emit('save-img', image);
|
|
85
102
|
}
|
|
86
103
|
|
|
87
|
-
this.$emit('close-modal-video')
|
|
104
|
+
this.$emit('close-modal-video');
|
|
88
105
|
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
106
|
+
}
|
|
107
|
+
};
|
|
91
108
|
</script>
|
|
92
109
|
<style lang="scss" scoped>
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
110
|
+
/deep/.dropzone {
|
|
111
|
+
button.dz-button {
|
|
112
|
+
background-color: transparent;
|
|
113
|
+
border: 0;
|
|
98
114
|
}
|
|
99
|
-
|
|
115
|
+
}
|
|
116
|
+
</style>
|