vue-intergrall-plugins 0.0.173 → 0.0.176

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-intergrall-plugins",
3
- "version": "0.0.173",
3
+ "version": "0.0.176",
4
4
  "description": "",
5
5
  "main": "dist/vue-intergrall-plugins.ssr.js",
6
6
  "browser": "dist/vue-intergrall-plugins.esm.js",
@@ -25,11 +25,16 @@
25
25
  </ul>
26
26
  </div>
27
27
  <!-- <LinkPrevue v-if="linkPreview && link" :url="linkPreview" /> -->
28
- <p v-html="formatMsg(message)"></p>
28
+ <p v-html="interatividade.formulario && interatividade.formulario.length ? '' : formatMsg(message)"></p>
29
29
  <InteratividadeBotoes
30
30
  v-if="interatividade"
31
31
  :interatividade="interatividade"
32
32
  />
33
+ <InteratividadeFormulario
34
+ v-if="interatividade"
35
+ :interatividade="interatividade"
36
+ :dictionary="dictionary"
37
+ />
33
38
  <span class="horario-envio" v-text="horario"></span>
34
39
  <transition name="fade" mode="out-in">
35
40
  <span :class="reply" v-if="hasReply && (status == 'C' || status == 'T')" v-tippy :content="msgReply ? msgReply : 'Fazer reenvio da mensagem'" @click="$emit('replyMsg')"> <fa-icon :icon="['fas', 'reply']" /> </span>
@@ -64,12 +69,13 @@
64
69
  <script>
65
70
  import AnexoMensagem from "./AnexoMensagem"
66
71
  import InteratividadeBotoes from "./InteratividadeBotoes"
72
+ import InteratividadeFormulario from "./InteratividadeFormulario"
67
73
  import { formataTimezoneData } from "../../services/textFormatting"
68
74
  import LinkPrevue from "link-prevue"
69
75
  import { getLinkPreview } from "link-preview-js";
70
76
 
71
77
  export default {
72
- components: { AnexoMensagem, InteratividadeBotoes, LinkPrevue },
78
+ components: { AnexoMensagem, InteratividadeBotoes, InteratividadeFormulario, LinkPrevue },
73
79
  props: ["smartchannel", "messageIndex", "dictionary", "autor", "origem", "msg", "link", "anexo", "imgAnexo", "tipoDoc", "docAnexo", "nomeArquivo", "audio", "video", "horario", "status", "logo", "msgTooltip", "seq", "mapa", "histMsg", "erro", "msgErro", "origemExterna", "anexos", "dominio", "corMsg", "interatividade", "msgReply", "hasReply", "iniDialogo", "dialogoId", "dialogoOrigem", "expSessao"],
74
80
  data(){
75
81
  return{
@@ -147,6 +153,21 @@ export default {
147
153
  this.validadeUrlToMsg()
148
154
  },
149
155
  methods: {
156
+ recuperarTabelaInteratividade(interatividade){
157
+ let estrutura = ''
158
+ if(!interatividade.formulario){
159
+ return false;
160
+ }
161
+ for (const forms of interatividade.formulario) {
162
+ if(forms.TIPO_TEXTO < 1000){
163
+ estrutura += `
164
+ <div class="title-consumidor-card">${forms.DESC_TIPO_TEXTO}</div>
165
+ <div class="description-consumidor-card">${forms.TEXTO}</div>
166
+ `
167
+ }
168
+ }
169
+ return estrutura;
170
+ },
150
171
  validadeUrlToMsg(){
151
172
  this.message = this.msg
152
173
  if(this.validadeIfExistsSticker()){
@@ -157,11 +178,11 @@ export default {
157
178
  if(this.validadeIfExistsUrl()){
158
179
  const linkRegex = /(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$])/igm;
159
180
  let link = [];
160
- link = this.removeTags(this.message).match(linkRegex);
181
+ link = this.message.match(linkRegex);
161
182
  if(!link || link.length == 0){
162
183
  return;
163
184
  }
164
- getLinkPreview(this.removeTags(link[0])).then((data) => {
185
+ getLinkPreview(link[0]).then((data) => {
165
186
  if(data.images && data.images.length > 0){
166
187
  this.urlSticker = data.images[0];
167
188
  }
@@ -234,23 +255,6 @@ export default {
234
255
  // if(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/gi.test(msg) && this.link) this.setLinkPreview(msg)
235
256
  return msg
236
257
  },
237
- removeTags(str) {
238
- if ((str===null) || (str==='')){
239
- return false;
240
- }
241
- else{
242
- str = str.toString();
243
- return str.replace( /(<([^>]+)>)/ig, '');
244
- }
245
- }
246
- // setLinkPreview(link) {
247
- // try {
248
- // this.linkPreview = link
249
- // }catch(e) {
250
- // console.error("Erro ao receber a previa do link")
251
- // console.error(e)
252
- // }
253
- // }
254
258
  }
255
259
  }
256
260
  </script>
@@ -0,0 +1,171 @@
1
+ <template>
2
+ <div class="interatividade">
3
+ <template v-if="informacao.length">
4
+ <div class="interatividade-form-header">
5
+ {{dictionary.msg_abertura_reclamacao}}
6
+ </div>
7
+ <div class="interatividade-form-body">
8
+ <div v-for="(form) in informacao" :key="form.TIPO_TEXTO" class="interatividade-info-form">
9
+ <p v-if="form.TIPO_TEXTO < 1000" v-text="form.DESC_TIPO_TEXTO" class="interatividade-titulo-form"></p>
10
+ <p v-if="form.TIPO_TEXTO < 1000" v-text="form.TEXTO" class="interatividade-description-form"></p>
11
+ </div>
12
+ <div v-if="informacaoAdicional.length" class="interatividade-form-header">
13
+ {{dictionary.msg_info_adicional}}
14
+ </div>
15
+ <div class="interatividade-form-body">
16
+ <div v-for="(form) in informacaoAdicional" :key="form.TIPO_TEXTO" class="interatividade-add-info-form">
17
+ <div class="divisor-form-info-aditional">
18
+ <div class="info-aditional">
19
+ <p v-if="form.TIPO_TEXTO > 999" v-text="form.DESC_TIPO_TEXTO+': '" class="interatividade-titulo-form"></p>
20
+ </div>
21
+ <div class="info-aditional">
22
+ <p v-if="form.TIPO_TEXTO > 999" v-text="form.TEXTO" class="interatividade-description-form"></p>
23
+ </div>
24
+ </div>
25
+ </div>
26
+ </div>
27
+ </div>
28
+ </template>
29
+ </div>
30
+ </template>
31
+ <script>
32
+ import InteratividadePopup from './InteratividadePopup'
33
+
34
+ export default {
35
+ components: {InteratividadePopup},
36
+ data() {
37
+ return {
38
+ informacaoAdicional: [],
39
+ informacao: []
40
+ }
41
+ },
42
+ props: {
43
+ interatividade: {
44
+ type: Object,
45
+ required: true
46
+ },
47
+ dictionary: {
48
+ type: Object,
49
+ required: true
50
+ }
51
+ },
52
+ mounted(){
53
+ this.verifyInfoAditional();
54
+ },
55
+ computed: {
56
+ arrBotoes() {
57
+ const { formulario } = this.interatividade
58
+ return formulario ? formulario : []
59
+ },
60
+ },
61
+ methods: {
62
+ verifyInfoAditional() {
63
+ let { formulario } = this.interatividade
64
+ let foundInfosAdd = formulario.filter(f => f.TIPO_TEXTO > 999);
65
+ let foundInfos = formulario.filter(f => f.TIPO_TEXTO < 1000);
66
+ if(foundInfos){
67
+ this.informacao = foundInfos;
68
+ }
69
+ if(foundInfosAdd){
70
+ this.informacaoAdicional = foundInfosAdd;
71
+ }
72
+ }
73
+ }
74
+ }
75
+ </script>
76
+
77
+ <style scoped>
78
+ .show-x-enter-active,
79
+ .show-x-leave-enter {
80
+ opacity: 1;
81
+ transform: translateX(0);
82
+ transition: all 200ms linear;
83
+ }
84
+ .show-x-enter,
85
+ .show-x-leave-to {
86
+ opacity: 0;
87
+ transform: translateX(5%);
88
+ }
89
+ .divisor-form-info-aditional {
90
+ display: flex;
91
+ align-items: center;
92
+ justify-content: space-around;
93
+ }
94
+ .info-aditional {
95
+ border-bottom: 1px solid #ccc;
96
+ width: 49%;
97
+ }
98
+ .interatividade-form-header {
99
+ background-color: #efefef;
100
+ margin-top: 5px;
101
+ border-top-right-radius: 10px;
102
+ border-top-left-radius: 10px;
103
+ padding-left: 10px;
104
+ padding-right: 10px;
105
+ padding-top: 5px;
106
+ padding-bottom: 5px;
107
+ justify-content: space-between;
108
+ display: flex;
109
+ color: #333;
110
+ font-weight: 700;
111
+ font-size: .9rem;
112
+ }
113
+ .interatividade-form-body{
114
+ padding: 0px 10px;
115
+ border-right: 1px solid rgb(239, 239, 239);
116
+ border-left: 1px solid rgb(239, 239, 239);
117
+ }
118
+ .interatividade {
119
+ margin: 10px 0;
120
+ }
121
+ .interatividade-titulo-form {
122
+ white-space: nowrap;
123
+ text-overflow: ellipsis;
124
+ font-weight: bold;
125
+ overflow: hidden;
126
+ max-width: 100%;
127
+ margin: 0;
128
+ padding: 0;
129
+ padding-top: 5px;
130
+ }
131
+ .interatividade-description-form {
132
+ overflow: hidden;
133
+ max-width: 100%;
134
+ margin: 0;
135
+ padding: 0;
136
+ }
137
+
138
+ .interatividade-lista {
139
+ width: 100%;
140
+ min-width: 200px;
141
+ border-radius: 15px;
142
+ background-color: #FFF;
143
+ color: #333;
144
+ margin: 10px 0;
145
+ }
146
+ .interatividade-lista-conteudo {
147
+ padding: 10px;
148
+ border-bottom: 1px solid #D7D7D7;
149
+ }
150
+ .interatividade-lista-titulo {
151
+ font-weight: bold;
152
+ font-size: 1.2em;
153
+ margin-bottom: 10px;
154
+ }
155
+ .interatividade-lista-rodape {
156
+ color: #818181;
157
+ margin-top: 5px;
158
+ }
159
+ .interatividade-lista-link {
160
+ width: 100%;
161
+ text-align: center;
162
+ padding: 10px;
163
+ color: rgb(0, 110, 255);
164
+ cursor: pointer;
165
+ transition: color 200ms ease-in-out;
166
+ }
167
+ .interatividade-lista-link:hover {
168
+ color: rgb(0, 98, 143);
169
+ }
170
+
171
+ </style>