vue-intergrall-plugins 0.0.208 → 0.0.209
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/dist/vue-intergrall-plugins.esm.js +198 -279
- package/dist/vue-intergrall-plugins.min.js +1 -1
- package/dist/vue-intergrall-plugins.ssr.js +201 -277
- package/package.json +1 -1
- package/src/lib-components/Cards/CardFile.vue +11 -67
- package/src/lib-components/Messages/AnexoMensagem.vue +36 -76
- package/src/lib-components/Messages/CardAttachment.vue +12 -68
- package/src/lib-components/Messages/InteratividadeFormulario.vue +10 -16
- package/src/lib-components/Templates/TemplateGenerator.vue +34 -30
package/package.json
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<span class="file-item">
|
|
3
3
|
<transition-group name="fade" mode="out-in" class="file-item-transition">
|
|
4
|
-
<div v-if="
|
|
4
|
+
<div v-if="isLoading" :small="true" key="card-file-loader" class="req-loader slow"></div>
|
|
5
5
|
<template v-else>
|
|
6
|
-
<span v-if="
|
|
7
|
-
<img :src="`${
|
|
6
|
+
<span v-if="imageURL" class="file-img box-shadow" @click="openWindowFromURL(imageURL, true)" key="card-file-img" :title="filename">
|
|
7
|
+
<img :src="`${imageURL}`" :alt="filename" />
|
|
8
8
|
</span>
|
|
9
9
|
<span
|
|
10
10
|
v-else
|
|
11
11
|
class="file-icon"
|
|
12
12
|
key="card-file-doc"
|
|
13
|
-
:class="[
|
|
14
|
-
@click="
|
|
15
|
-
:title="
|
|
13
|
+
:class="[iconClass]"
|
|
14
|
+
@click="openWindowFromURL(docURL, false)"
|
|
15
|
+
:title="filename"
|
|
16
16
|
target="_blank"
|
|
17
17
|
rel="noreferrer noopener"
|
|
18
18
|
>
|
|
19
19
|
<fa-icon :icon="icon" />
|
|
20
20
|
</span>
|
|
21
|
-
<a :href="
|
|
21
|
+
<a :href="imageURL ? imageURL : docURL" :download="`${filename}`" target="_blank" rel="noreferrer noopener" key="card-file-download-icon" :title="`Download ${filename}`">
|
|
22
22
|
<fa-icon :icon="['fas', 'download']" />
|
|
23
23
|
</a>
|
|
24
24
|
</template>
|
|
@@ -36,9 +36,10 @@
|
|
|
36
36
|
</style>
|
|
37
37
|
|
|
38
38
|
<script>
|
|
39
|
-
import {
|
|
39
|
+
import { fileHandler } from "../../mixins/fileHandler"
|
|
40
40
|
|
|
41
41
|
export default {
|
|
42
|
+
mixins: [fileHandler],
|
|
42
43
|
props: {
|
|
43
44
|
file: {
|
|
44
45
|
type: Object,
|
|
@@ -53,65 +54,8 @@ export default {
|
|
|
53
54
|
required: true
|
|
54
55
|
}
|
|
55
56
|
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return this.fileExt === "pdf" ? "pdf" : "doc"
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
data() {
|
|
62
|
-
return {
|
|
63
|
-
loading: true,
|
|
64
|
-
isAnexo: false,
|
|
65
|
-
imageUrl: "",
|
|
66
|
-
fileExt: "",
|
|
67
|
-
docUrl: "",
|
|
68
|
-
fileName: "",
|
|
69
|
-
audio: false,
|
|
70
|
-
video: false,
|
|
71
|
-
icon: []
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
mounted() {
|
|
75
|
-
this.setFileVars()
|
|
76
|
-
},
|
|
77
|
-
methods: {
|
|
78
|
-
setFileVars() {
|
|
79
|
-
try {
|
|
80
|
-
const {
|
|
81
|
-
anexo,
|
|
82
|
-
imgAnexo,
|
|
83
|
-
tipoDoc,
|
|
84
|
-
docAnexo,
|
|
85
|
-
nomeArquivo,
|
|
86
|
-
audio,
|
|
87
|
-
video
|
|
88
|
-
} = gerarVariaveisAnexo(this.file, { dominio: this.domain });
|
|
89
|
-
|
|
90
|
-
this.isAnexo = anexo;
|
|
91
|
-
this.imageUrl = imgAnexo;
|
|
92
|
-
this.fileExt = tipoDoc;
|
|
93
|
-
this.docUrl = docAnexo;
|
|
94
|
-
this.fileName = nomeArquivo;
|
|
95
|
-
this.audio = audio;
|
|
96
|
-
this.video = video;
|
|
97
|
-
|
|
98
|
-
this.generateIcon();
|
|
99
|
-
|
|
100
|
-
this.loading = false;
|
|
101
|
-
}catch(e) {
|
|
102
|
-
console.error("Erro ao gerar as variaveis dos anexos")
|
|
103
|
-
console.error(e)
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
generateIcon() {
|
|
107
|
-
this.icon = this.fileExt === "pdf" ? ['fas', 'file-pdf'] : ['fas', 'file-alt']
|
|
108
|
-
},
|
|
109
|
-
openFile(link, isImg) {
|
|
110
|
-
const width = window.innerWidth
|
|
111
|
-
const height = window.innerHeight
|
|
112
|
-
const options = !isImg ? `width=${width},height=${height}` : "width=auto,height=auto"
|
|
113
|
-
window.open(link, "card-file", options)
|
|
114
|
-
}
|
|
57
|
+
mounted(){
|
|
58
|
+
this.setFileVars(this.file, { dominio: this.domain })
|
|
115
59
|
}
|
|
116
60
|
}
|
|
117
61
|
</script>
|
|
@@ -7,45 +7,46 @@
|
|
|
7
7
|
{{dictionary.img_com_erro}}
|
|
8
8
|
</div>
|
|
9
9
|
</div>
|
|
10
|
-
<Loader v-if="
|
|
10
|
+
<Loader v-if="isLoading" :small="true" key="anexo-loader" :slow="true" />
|
|
11
11
|
<div v-else key="anexo-mensagem" class="anexo-mensagem">
|
|
12
|
-
<img v-if="
|
|
13
|
-
<div class="anexos-links-container" v-if="
|
|
14
|
-
<a href="#" @click="
|
|
15
|
-
<fa-icon :icon="['fas', 'search-plus']" @click="
|
|
12
|
+
<img v-if="imageURL" @click="showImage(imageURL)" :src="imageURL" :alt="dictionary.alt_msg_img">
|
|
13
|
+
<div class="anexos-links-container" v-if="imageURL">
|
|
14
|
+
<a href="#" @click.prevent="showImage(imageURL)"> {{ dictionary.titulo_visualizar_img }} </a>
|
|
15
|
+
<fa-icon :icon="['fas', 'search-plus']" @click="showImage(imageURL)" />
|
|
16
16
|
</div>
|
|
17
|
-
<div v-else-if="
|
|
17
|
+
<div v-else-if="docURL" class="anexo-container">
|
|
18
18
|
<template v-if="audio || video">
|
|
19
|
-
<audio v-if="audio" :src="
|
|
20
|
-
<p> {{ dictionary.msg_erro_audio }} <a :href="
|
|
19
|
+
<audio v-if="audio" :src="docURL" controls :title="`${fileType} - ${filename}`">
|
|
20
|
+
<p> {{ dictionary.msg_erro_audio }} <a :href="docURL" target="_blank" rel="noreferrer noopener"> {{ dictionary.msg_abrir_audio }} </a> </p>
|
|
21
21
|
</audio>
|
|
22
|
-
<video v-if="video" :src="
|
|
23
|
-
<p> {{ dictionary.msg_erro_video }} <a v-if="
|
|
22
|
+
<video v-if="video" :src="docURL" controls :title="`${fileType} - ${filename}`">
|
|
23
|
+
<p> {{ dictionary.msg_erro_video }} <a v-if="fileType != 'erro'" :href="docURL" target="_blank" rel="noreferrer noopener"> {{ dictionary.msg_abrir_video }} </a> </p>
|
|
24
24
|
</video>
|
|
25
25
|
</template>
|
|
26
26
|
<template v-else>
|
|
27
|
-
<a v-if="
|
|
28
|
-
<fa-icon :icon="
|
|
29
|
-
<p v-text="
|
|
27
|
+
<a v-if="fileType != 'erro'" :href="docURL" target="_blank" rel="noreferrer noopener" :title="`${fileType} - ${filename}`">
|
|
28
|
+
<fa-icon :class="[iconClass]" :icon="icon" />
|
|
29
|
+
<p v-text="filename"></p>
|
|
30
30
|
</a>
|
|
31
|
-
<p v-else :title="`${
|
|
31
|
+
<p v-else :title="`${fileType} - ${filename}`" class="arquivo-erro">
|
|
32
32
|
<fa-icon :icon="['fas', 'file-alt']" />
|
|
33
|
-
{{
|
|
33
|
+
{{ filename }}
|
|
34
34
|
</p>
|
|
35
35
|
</template>
|
|
36
36
|
</div>
|
|
37
|
-
<a v-if="
|
|
38
|
-
<a v-if="
|
|
37
|
+
<a v-if="imageURL" :href="imageURL" :download="`${filename}`" target="_blank" rel="noreferrer noopener"> {{ dictionary.titulo_baixar_img }} <fa-icon :icon="['fas', 'download']" /> </a>
|
|
38
|
+
<a v-if="docURL" :href="docURL" :download="`${filename}`" target="_blank" rel="noreferrer noopener"> {{ dictionary.titulo_baixar_doc }} <fa-icon :icon="['fas', 'download']" /> </a>
|
|
39
39
|
</div>
|
|
40
40
|
</transition-group>
|
|
41
41
|
</div>
|
|
42
42
|
</template>
|
|
43
43
|
|
|
44
44
|
<script>
|
|
45
|
-
import {
|
|
45
|
+
import { fileHandler } from "../../mixins/fileHandler"
|
|
46
46
|
import Loader from "../Loader/Loader"
|
|
47
47
|
|
|
48
48
|
export default {
|
|
49
|
+
mixins: [fileHandler],
|
|
49
50
|
components: { Loader },
|
|
50
51
|
props: {
|
|
51
52
|
anexo: {
|
|
@@ -67,86 +68,37 @@ export default {
|
|
|
67
68
|
},
|
|
68
69
|
data() {
|
|
69
70
|
return {
|
|
70
|
-
carregando: true,
|
|
71
|
-
isAnexo: false,
|
|
72
|
-
imgAnexo: "",
|
|
73
|
-
tipoDoc: "",
|
|
74
|
-
docAnexo: "",
|
|
75
|
-
nomeArquivo: "",
|
|
76
|
-
audio: false,
|
|
77
|
-
video: false,
|
|
78
|
-
icone: [],
|
|
79
71
|
imgErro: false,
|
|
80
72
|
imgMsgErro: '',
|
|
81
73
|
}
|
|
82
74
|
},
|
|
83
75
|
mounted() {
|
|
84
76
|
if(this.validarAnexo()){
|
|
85
|
-
this.
|
|
77
|
+
this.setFileVars(this.anexo, { dominio: this.dominio })
|
|
86
78
|
}
|
|
87
79
|
},
|
|
88
80
|
methods: {
|
|
89
|
-
abrirVisualizacaoImg(imagem){
|
|
90
|
-
this.$emit("abrir-imagem", imagem)
|
|
91
|
-
},
|
|
92
|
-
setVariaveisAnexo() {
|
|
93
|
-
try {
|
|
94
|
-
const {
|
|
95
|
-
anexo,
|
|
96
|
-
imgAnexo,
|
|
97
|
-
tipoDoc,
|
|
98
|
-
docAnexo,
|
|
99
|
-
nomeArquivo,
|
|
100
|
-
audio,
|
|
101
|
-
video
|
|
102
|
-
} = gerarVariaveisAnexo(this.anexo, { dominio: this.dominio });
|
|
103
|
-
|
|
104
|
-
this.isAnexo = anexo;
|
|
105
|
-
this.imgAnexo = imgAnexo;
|
|
106
|
-
this.tipoDoc = tipoDoc;
|
|
107
|
-
this.docAnexo = docAnexo;
|
|
108
|
-
this.nomeArquivo = nomeArquivo;
|
|
109
|
-
this.audio = audio;
|
|
110
|
-
this.video = video;
|
|
111
|
-
|
|
112
|
-
this.gerarIcone();
|
|
113
|
-
|
|
114
|
-
this.carregando = false;
|
|
115
|
-
}catch(e) {
|
|
116
|
-
console.error("Erro ao gerar as variaveis dos anexos")
|
|
117
|
-
console.error(e)
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
81
|
validarAnexo(){
|
|
121
|
-
let status = true
|
|
82
|
+
let status = true
|
|
122
83
|
//caso for audio ou documento ignorar
|
|
123
|
-
if(this.anexo.
|
|
124
|
-
return true;
|
|
125
|
-
}
|
|
84
|
+
if(this.anexo.docURL || this.anexo.audio) return true
|
|
126
85
|
if(!this.anexo.name){
|
|
127
86
|
this.imgMsgErro = this.dictionary.img_com_erro_nome
|
|
128
|
-
status = false
|
|
87
|
+
status = false
|
|
129
88
|
}
|
|
130
89
|
if(!this.anexo.nomeGravacao){
|
|
131
90
|
this.imgMsgErro = this.dictionary.img_com_erro_nome_gravacao
|
|
132
|
-
status = false
|
|
91
|
+
status = false
|
|
133
92
|
}
|
|
134
|
-
// if(!this.anexo.size || this.anexo.size == 0){
|
|
135
|
-
// this.imgMsgErro = this.dictionary.img_com_erro_tamanho
|
|
136
|
-
// status = false;
|
|
137
|
-
// }
|
|
138
93
|
if(!this.anexo.type){
|
|
139
94
|
this.imgMsgErro = this.dictionary.img_com_erro_tipo
|
|
140
|
-
status = false
|
|
95
|
+
status = false
|
|
141
96
|
}
|
|
142
97
|
if(status == false){
|
|
143
|
-
this.imgErro = true
|
|
144
|
-
this.
|
|
98
|
+
this.imgErro = true
|
|
99
|
+
this.isLoading = false
|
|
145
100
|
}
|
|
146
|
-
return status
|
|
147
|
-
},
|
|
148
|
-
gerarIcone() {
|
|
149
|
-
this.icone = this.tipoDoc === "pdf" ? ['fas', 'file-pdf'] : ['fas', 'file-alt']
|
|
101
|
+
return status
|
|
150
102
|
}
|
|
151
103
|
}
|
|
152
104
|
}
|
|
@@ -254,4 +206,12 @@ export default {
|
|
|
254
206
|
font-size: 1.025em;
|
|
255
207
|
margin-right: 2px;
|
|
256
208
|
}
|
|
209
|
+
|
|
210
|
+
.pdf {
|
|
211
|
+
color: #E74C3C;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.doc {
|
|
215
|
+
color: #006bc9
|
|
216
|
+
}
|
|
257
217
|
</style>
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<span class="anexo-item">
|
|
3
3
|
<transition-group name="fade" mode="out-in" class="transition-anexo-item">
|
|
4
|
-
<div v-if="
|
|
4
|
+
<div v-if="isLoading" :small="true" key="ra-loader-anexo" class="req-loader slow"></div>
|
|
5
5
|
<template v-else>
|
|
6
|
-
<span v-if="
|
|
7
|
-
<img :src="`${
|
|
6
|
+
<span v-if="imageURL" class="anexo-img box-shadow" @click="openWindowFromURL(imageURL, true)" key="ra-img-anexo" :title="filename">
|
|
7
|
+
<img :src="`${imageURL}`" :alt="filename" />
|
|
8
8
|
</span>
|
|
9
9
|
<span
|
|
10
10
|
v-else
|
|
11
|
-
class="anexo-
|
|
11
|
+
class="anexo-icon"
|
|
12
12
|
key="ra-doc-anexo"
|
|
13
|
-
:class="[
|
|
14
|
-
@click="
|
|
15
|
-
:title="
|
|
13
|
+
:class="[iconClass]"
|
|
14
|
+
@click="openWindowFromURL(docURL, false)"
|
|
15
|
+
:title="filename"
|
|
16
16
|
target="_blank"
|
|
17
17
|
rel="noreferrer noopener"
|
|
18
18
|
>
|
|
19
|
-
<fa-icon :icon="
|
|
19
|
+
<fa-icon :icon="icon" />
|
|
20
20
|
</span>
|
|
21
|
-
<a :href="
|
|
21
|
+
<a :href="imageURL ? imageURL : docURL" :download="`${filename}`" target="_blank" rel="noreferrer noopener" key="ra-download-icon" :title="`Download ${filename}`">
|
|
22
22
|
<fa-icon :icon="['fas', 'download']" />
|
|
23
23
|
</a>
|
|
24
24
|
</template>
|
|
@@ -36,9 +36,10 @@
|
|
|
36
36
|
</style>
|
|
37
37
|
|
|
38
38
|
<script>
|
|
39
|
-
import {
|
|
39
|
+
import { fileHandler } from "../../mixins/fileHandler"
|
|
40
40
|
|
|
41
41
|
export default {
|
|
42
|
+
mixins: [fileHandler],
|
|
42
43
|
props: {
|
|
43
44
|
anexo: {
|
|
44
45
|
type: Object,
|
|
@@ -53,65 +54,8 @@ export default {
|
|
|
53
54
|
required: true
|
|
54
55
|
}
|
|
55
56
|
},
|
|
56
|
-
computed: {
|
|
57
|
-
iconeClass() {
|
|
58
|
-
return this.tipoDoc === "pdf" ? "pdf" : "doc"
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
data() {
|
|
62
|
-
return {
|
|
63
|
-
carregando: true,
|
|
64
|
-
isAnexo: false,
|
|
65
|
-
imgAnexo: "",
|
|
66
|
-
tipoDoc: "",
|
|
67
|
-
docAnexo: "",
|
|
68
|
-
nomeArquivo: "",
|
|
69
|
-
audio: false,
|
|
70
|
-
video: false,
|
|
71
|
-
icone: []
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
57
|
mounted() {
|
|
75
|
-
this.
|
|
76
|
-
},
|
|
77
|
-
methods: {
|
|
78
|
-
setVariaveisAnexo() {
|
|
79
|
-
try {
|
|
80
|
-
const {
|
|
81
|
-
anexo,
|
|
82
|
-
imgAnexo,
|
|
83
|
-
tipoDoc,
|
|
84
|
-
docAnexo,
|
|
85
|
-
nomeArquivo,
|
|
86
|
-
audio,
|
|
87
|
-
video
|
|
88
|
-
} = gerarVariaveisAnexo(this.anexo, { dominio: this.dominio });
|
|
89
|
-
|
|
90
|
-
this.isAnexo = anexo;
|
|
91
|
-
this.imgAnexo = imgAnexo;
|
|
92
|
-
this.tipoDoc = tipoDoc;
|
|
93
|
-
this.docAnexo = docAnexo;
|
|
94
|
-
this.nomeArquivo = nomeArquivo;
|
|
95
|
-
this.audio = audio;
|
|
96
|
-
this.video = video;
|
|
97
|
-
|
|
98
|
-
this.gerarIcone();
|
|
99
|
-
|
|
100
|
-
this.carregando = false;
|
|
101
|
-
}catch(e) {
|
|
102
|
-
console.error("Erro ao gerar as variaveis dos anexos")
|
|
103
|
-
console.error(e)
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
gerarIcone() {
|
|
107
|
-
this.icone = this.tipoDoc === "pdf" ? ['fas', 'file-pdf'] : ['fas', 'file-alt']
|
|
108
|
-
},
|
|
109
|
-
abrirAnexo(link, isImg) {
|
|
110
|
-
const width = window.innerWidth
|
|
111
|
-
const height = window.innerHeight
|
|
112
|
-
const options = !isImg ? `width=${width},height=${height}` : "width=auto,height=auto"
|
|
113
|
-
window.open(link, "anexo-ra", options)
|
|
114
|
-
}
|
|
58
|
+
this.setFileVars(this.anexo, { dominio: this.dominio })
|
|
115
59
|
}
|
|
116
60
|
}
|
|
117
61
|
</script>
|
|
@@ -84,9 +84,7 @@ export default {
|
|
|
84
84
|
const width = window.innerWidth
|
|
85
85
|
const height = window.innerHeight
|
|
86
86
|
const options = !isImg ? `width=${width},height=${height}` : "width=auto,height=auto"
|
|
87
|
-
|
|
88
|
-
console.log(urlformatted)
|
|
89
|
-
window.open(urlformatted, "card-file", options)
|
|
87
|
+
window.open(`${this.dominio}/callcenter/docs.php?mku=${url}`, "card-file", options)
|
|
90
88
|
},
|
|
91
89
|
validateInterativity(){
|
|
92
90
|
try {
|
|
@@ -101,22 +99,18 @@ export default {
|
|
|
101
99
|
try {
|
|
102
100
|
let { formulario } = this.interatividade
|
|
103
101
|
formulario = formulario ? formulario : [];
|
|
104
|
-
if(!formulario.length)
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
let foundInfosAdd = formulario.filter(f => f.TIPO_TEXTO > 999);
|
|
108
|
-
let foundInfos = formulario.filter(f => f.TIPO_TEXTO < 1000);
|
|
102
|
+
if(!formulario.length) return
|
|
103
|
+
const foundInfosAdd = formulario.filter(f => f.TIPO_TEXTO > 999);
|
|
104
|
+
const foundInfos = formulario.filter(f => f.TIPO_TEXTO < 1000);
|
|
109
105
|
if(foundInfos){
|
|
110
106
|
this.informacao = foundInfos.map(info => {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
if(foundInfosAdd){
|
|
118
|
-
this.informacaoAdicional = foundInfosAdd;
|
|
107
|
+
if(info.TIPO_TEXTO == 1){
|
|
108
|
+
info.TEXTO = info.TEXTO == 'S' ? this.dictionary.msg_sim : this.dictionary.msg_nao
|
|
109
|
+
}
|
|
110
|
+
return info
|
|
111
|
+
})
|
|
119
112
|
}
|
|
113
|
+
if(foundInfosAdd) this.informacaoAdicional = foundInfosAdd;
|
|
120
114
|
} catch (e) {
|
|
121
115
|
console.error("Erro ao pegar o objeto interatividade formulario")
|
|
122
116
|
console.error(e)
|
|
@@ -91,9 +91,11 @@
|
|
|
91
91
|
for (let key in template) {
|
|
92
92
|
if (key === "components" && Array.isArray(template[key])) {
|
|
93
93
|
template[key].map((component) => {
|
|
94
|
-
component.parameters.
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
if(component && component.parameters && component.parameters.length) {
|
|
95
|
+
component.parameters.map((param) => {
|
|
96
|
+
fullText += param.text;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
97
99
|
});
|
|
98
100
|
}
|
|
99
101
|
}
|
|
@@ -162,36 +164,38 @@
|
|
|
162
164
|
for(let index in this.selectedTemplate) {
|
|
163
165
|
if(index === "components" && Array.isArray(this.selectedTemplate[index])) {
|
|
164
166
|
const arrComponents = this.selectedTemplate[index]
|
|
165
|
-
arrComponents.
|
|
166
|
-
|
|
167
|
-
component.parameters.
|
|
168
|
-
message
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
167
|
+
if(arrComponents && arrComponents.length) {
|
|
168
|
+
arrComponents.map(component => {
|
|
169
|
+
if(component && component.parameters && component.parameters.length) {
|
|
170
|
+
component.parameters.map(message => {
|
|
171
|
+
message.currentText = message.text
|
|
172
|
+
let keyIndex = 0
|
|
173
|
+
while(keyIndex < keys.length) {
|
|
174
|
+
const varName = `{{${keys[keyIndex]}}}`
|
|
175
|
+
if(message.text.indexOf(varName) != -1) {
|
|
176
|
+
/**Gerando os obejetos de parametros da notificacao para o component */
|
|
177
|
+
if(component.type === "header") {
|
|
178
|
+
this.selectedTemplate['parameters'][component.type] = {}
|
|
179
|
+
//Header s? pode ter uma vari?vel
|
|
180
|
+
this.selectedTemplate['parameters'][component.type] = {
|
|
181
|
+
tipo: "text",
|
|
182
|
+
text: values[keyIndex]
|
|
183
|
+
}
|
|
184
|
+
} else if(!this.selectedTemplate['parameters'][component.type]) {
|
|
185
|
+
this.selectedTemplate['parameters'][component.type] = new Array()
|
|
180
186
|
}
|
|
181
|
-
|
|
182
|
-
this.selectedTemplate['parameters'][component.type]
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
this.selectedTemplate['parameters'][component.type].push(values[keyIndex])
|
|
187
|
+
//Aplicando valores das v?riaveis dentro dos outros componentes com execess?o do header
|
|
188
|
+
if(this.selectedTemplate['parameters'][component.type] && component.type !== 'header') {
|
|
189
|
+
this.selectedTemplate['parameters'][component.type].push(values[keyIndex])
|
|
190
|
+
}
|
|
191
|
+
message.currentText = message.currentText.replace(varName, values[keyIndex])
|
|
187
192
|
}
|
|
188
|
-
|
|
193
|
+
keyIndex++
|
|
189
194
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
})
|
|
195
|
+
})
|
|
196
|
+
}
|
|
197
|
+
})
|
|
198
|
+
}
|
|
195
199
|
}
|
|
196
200
|
}
|
|
197
201
|
|