vue-intergrall-plugins 0.0.174 → 0.0.177

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.174",
3
+ "version": "0.0.177",
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="validateInterativity() ? '' : 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,15 @@ export default {
147
153
  this.validadeUrlToMsg()
148
154
  },
149
155
  methods: {
156
+ validateInterativity(){
157
+ try {
158
+ if(this.interatividade.formulario){
159
+ return true;
160
+ }
161
+ } catch (error) {
162
+ return false;
163
+ }
164
+ },
150
165
  validadeUrlToMsg(){
151
166
  this.message = this.msg
152
167
  if(this.validadeIfExistsSticker()){
@@ -0,0 +1,185 @@
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
+ if(this.validateInterativity()){
54
+ this.verifyInfoAditional();
55
+ }
56
+ },
57
+ methods: {
58
+ validateInterativity(){
59
+ try {
60
+ if(this.interatividade.formulario){
61
+ return true;
62
+ }
63
+ } catch (error) {
64
+ return false;
65
+ }
66
+ },
67
+ verifyInfoAditional() {
68
+ try {
69
+ let { formulario } = this.informacao
70
+ formulario = formulario ? formulario : [];
71
+ if(!formulario.length){
72
+ return;
73
+ }
74
+ let foundInfosAdd = formulario.filter(f => f.TIPO_TEXTO > 999);
75
+ let foundInfos = formulario.filter(f => f.TIPO_TEXTO < 1000);
76
+ if(foundInfos){
77
+ this.informacao = foundInfos;
78
+ }
79
+ if(foundInfosAdd){
80
+ this.informacaoAdicional = foundInfosAdd;
81
+ }
82
+ } catch (e) {
83
+ console.error("Erro ao pegar o objeto interatividade formulario")
84
+ console.error(e)
85
+ }
86
+ },
87
+ }
88
+ }
89
+ </script>
90
+
91
+ <style scoped>
92
+ .show-x-enter-active,
93
+ .show-x-leave-enter {
94
+ opacity: 1;
95
+ transform: translateX(0);
96
+ transition: all 200ms linear;
97
+ }
98
+ .show-x-enter,
99
+ .show-x-leave-to {
100
+ opacity: 0;
101
+ transform: translateX(5%);
102
+ }
103
+ .divisor-form-info-aditional {
104
+ display: flex;
105
+ align-items: center;
106
+ justify-content: space-around;
107
+ }
108
+ .info-aditional {
109
+ border-bottom: 1px solid #ccc;
110
+ width: 49%;
111
+ }
112
+ .interatividade-form-header {
113
+ background-color: #efefef;
114
+ margin-top: 5px;
115
+ border-top-right-radius: 10px;
116
+ border-top-left-radius: 10px;
117
+ padding-left: 10px;
118
+ padding-right: 10px;
119
+ padding-top: 5px;
120
+ padding-bottom: 5px;
121
+ justify-content: space-between;
122
+ display: flex;
123
+ color: #333;
124
+ font-weight: 700;
125
+ font-size: .9rem;
126
+ }
127
+ .interatividade-form-body{
128
+ padding: 0px 10px;
129
+ border-right: 1px solid rgb(239, 239, 239);
130
+ border-left: 1px solid rgb(239, 239, 239);
131
+ }
132
+ .interatividade {
133
+ margin: 10px 0;
134
+ }
135
+ .interatividade-titulo-form {
136
+ white-space: nowrap;
137
+ text-overflow: ellipsis;
138
+ font-weight: bold;
139
+ overflow: hidden;
140
+ max-width: 100%;
141
+ margin: 0;
142
+ padding: 0;
143
+ padding-top: 5px;
144
+ }
145
+ .interatividade-description-form {
146
+ overflow: hidden;
147
+ max-width: 100%;
148
+ margin: 0;
149
+ padding: 0;
150
+ }
151
+
152
+ .interatividade-lista {
153
+ width: 100%;
154
+ min-width: 200px;
155
+ border-radius: 15px;
156
+ background-color: #FFF;
157
+ color: #333;
158
+ margin: 10px 0;
159
+ }
160
+ .interatividade-lista-conteudo {
161
+ padding: 10px;
162
+ border-bottom: 1px solid #D7D7D7;
163
+ }
164
+ .interatividade-lista-titulo {
165
+ font-weight: bold;
166
+ font-size: 1.2em;
167
+ margin-bottom: 10px;
168
+ }
169
+ .interatividade-lista-rodape {
170
+ color: #818181;
171
+ margin-top: 5px;
172
+ }
173
+ .interatividade-lista-link {
174
+ width: 100%;
175
+ text-align: center;
176
+ padding: 10px;
177
+ color: rgb(0, 110, 255);
178
+ cursor: pointer;
179
+ transition: color 200ms ease-in-out;
180
+ }
181
+ .interatividade-lista-link:hover {
182
+ color: rgb(0, 98, 143);
183
+ }
184
+
185
+ </style>