vue-intergrall-plugins 0.0.168 → 0.0.169
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.
|
@@ -7763,7 +7763,7 @@ var axios_1 = axios$1;
|
|
|
7763
7763
|
// Allow use of default import syntax in TypeScript
|
|
7764
7764
|
var _default = axios$1;
|
|
7765
7765
|
axios_1.default = _default;var axios = axios_1;vue__default["default"].prototype.$httpRequest = axios;
|
|
7766
|
-
var baseURL = window.location.hostname == 'localhost' ? "https://linux07/im/atdHumano/middleware/
|
|
7766
|
+
var baseURL = window.location.hostname == 'localhost' ? "https://linux07/im/atdHumano/middleware/smartchannel_api.php" : "https://".concat(window.location.hostname, "/im/atdHumano/middleware/smartchannel_api.php");
|
|
7767
7767
|
var dev = window.location.hostname == 'localhost' ? '&teste=levchat2' : '';
|
|
7768
7768
|
var standardMessages = {
|
|
7769
7769
|
methods: {
|
|
@@ -7778,18 +7778,21 @@ var standardMessages = {
|
|
|
7778
7778
|
_context.prev = 0;
|
|
7779
7779
|
return _context.abrupt("return", _this.$httpRequest({
|
|
7780
7780
|
method: 'get',
|
|
7781
|
-
url: "".concat(baseURL, "/
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7781
|
+
url: "".concat(baseURL, "/messages/").concat(type, "?token_cliente=").concat(token).concat(dev),
|
|
7782
|
+
headers: {
|
|
7783
|
+
Authorization: "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdGQiOiJNS1VuWHd3eGI0NGF3dzkwVVRXOGlIYUREd2doNm1sOFB0RVdoUHRWUjRHZW5YNnd3aW00bDV3d3M5SHB0bUIiLCJtYW5hZ2VyIjoiTUtVWHJHY2hOUlRZTkF3aHRvVUxldmtJYUdHcW9vSTVad3d4YjQ0YXd3ODRZQWxIVXpPZFZ3d3hiNDRhd3dpIiwibnJvcyI6WyI0OCJdLCJhdXRoIjoiTUtVd3d4YjQ0YXd3ZFVQVXQwVUlhaTNwanFGcmlQZ2dtaTY0SkViVnJJOXVjWFdBODRXRzR5ciIsImlhdCI6MTY0NjY1NzA0OSwiZXhwIjoxNjQ2NzQzNDQ5fQ.MqUARy1bbSc0iSOBcERwPYesIf-AdDcZaHa1yvn3RDM"
|
|
7784
|
+
}
|
|
7785
7785
|
}).then(function (response) {
|
|
7786
7786
|
var data = response.data;
|
|
7787
7787
|
var tipo = data.tipo,
|
|
7788
7788
|
nivel = data.nivel,
|
|
7789
|
+
conteudo = data.conteudo,
|
|
7789
7790
|
msg_ret = data.msg_ret,
|
|
7790
7791
|
st_ret = data.st_ret;
|
|
7791
7792
|
if (tipo) _this.$emit('set-message-type', tipo);
|
|
7792
|
-
return st_ret === 'OK' ? nivel : st_ret === 'AVISO' ?
|
|
7793
|
+
return st_ret === 'OK' ? conteudo ? conteudo : nivel : st_ret === 'AVISO' ? {
|
|
7794
|
+
msg_ret: msg_ret
|
|
7795
|
+
} : false;
|
|
7793
7796
|
}).catch(function (err) {
|
|
7794
7797
|
return console.error('Erro na requisicao para o servidor', err);
|
|
7795
7798
|
}));
|
|
@@ -7895,8 +7898,8 @@ var script$g = {
|
|
|
7895
7898
|
this.loadingReq = true;
|
|
7896
7899
|
this.getStandardMessages(cod, this.token_cliente).then(function (data) {
|
|
7897
7900
|
_this.loadingReq = false;
|
|
7898
|
-
if (data
|
|
7899
|
-
msg: data
|
|
7901
|
+
if (data.msg_ret) return _this.$toasted.global.emConstrucao({
|
|
7902
|
+
msg: data.msg_ret
|
|
7900
7903
|
});
|
|
7901
7904
|
if (data) return _this.showFormattedMessage(data, selectionIndex);
|
|
7902
7905
|
|
|
@@ -7914,7 +7917,7 @@ var script$g = {
|
|
|
7914
7917
|
try {
|
|
7915
7918
|
var success = false;
|
|
7916
7919
|
if (Array.isArray(messageData)) success = true;
|
|
7917
|
-
if (!success) this.$toasted.global.emConstrucao({
|
|
7920
|
+
if (!success && selectionIndex != 4) this.$toasted.global.emConstrucao({
|
|
7918
7921
|
msg: messageData ? messageData.msg : "Nao foi possível obter mensagens"
|
|
7919
7922
|
});
|
|
7920
7923
|
|
|
@@ -7944,24 +7947,24 @@ var script$g = {
|
|
|
7944
7947
|
});
|
|
7945
7948
|
this.$emit("close-blocker-standard-message");
|
|
7946
7949
|
} else {
|
|
7947
|
-
if (
|
|
7948
|
-
this.formatted_messages_3.push(this.dictionary.msg_erro_sem_msg_formatada);
|
|
7949
|
-
this.key_3 = this.formatted_messages_3[0];
|
|
7950
|
-
this.openFormattedMsgType2(this.key_3);
|
|
7951
|
-
} else {
|
|
7950
|
+
if (messageData.length) {
|
|
7952
7951
|
this.formatted_messages_3 = messageData;
|
|
7953
7952
|
|
|
7954
|
-
if (this.formatted_messages_3.length == 1) {
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
this.openFormattedMsgType2(this.key_3);
|
|
7958
|
-
}
|
|
7953
|
+
if (this.formatted_messages_3.length == 1 && this.formatted_messages_3[0].cod) {
|
|
7954
|
+
this.key_3 = this.formatted_messages_3[0].cod;
|
|
7955
|
+
this.openMsg();
|
|
7959
7956
|
}
|
|
7960
7957
|
}
|
|
7961
7958
|
}
|
|
7962
7959
|
|
|
7963
7960
|
break;
|
|
7964
7961
|
|
|
7962
|
+
case 4:
|
|
7963
|
+
var finalMessage = "".concat(this.message).concat(this.message && !this.message.endsWith(" ") ? " ".concat(messageData) : messageData);
|
|
7964
|
+
return messageData ? this.$emit("add-standard-message", finalMessage) : this.$toasted.global.emConstrucao({
|
|
7965
|
+
msg: 'Mensagem vazia'
|
|
7966
|
+
});
|
|
7967
|
+
|
|
7965
7968
|
default:
|
|
7966
7969
|
console.error("Error in showFormattedMessage: selectionIndex not found");
|
|
7967
7970
|
break;
|
|
@@ -7972,8 +7975,7 @@ var script$g = {
|
|
|
7972
7975
|
},
|
|
7973
7976
|
openMsg: function openMsg() {
|
|
7974
7977
|
try {
|
|
7975
|
-
|
|
7976
|
-
this.openFormattedMsgType2(this.key_3);
|
|
7978
|
+
this.messageType == 1 ? this.insertFormattedMessage(this.key_3) : this.openFormattedMsgType2(this.key_3);
|
|
7977
7979
|
} catch (e) {
|
|
7978
7980
|
console.error("Error in openMsg: ", e);
|
|
7979
7981
|
}
|
|
@@ -7995,9 +7997,8 @@ var script$g = {
|
|
|
7995
7997
|
try {
|
|
7996
7998
|
if (!this.key_3) return this.$toasted.global.defaultError({
|
|
7997
7999
|
msg: 'Selecione uma mensagem'
|
|
7998
|
-
});
|
|
7999
|
-
|
|
8000
|
-
// return value ? this.$emit("add-standard-message", finalMessage) : this.$toasted.global.emConstrucao({msg: 'Mensagem vazia'})
|
|
8000
|
+
});
|
|
8001
|
+
this.receiveValueFormattedMessage("T/".concat(this.key_2, "/").concat(this.key_3), 4);
|
|
8001
8002
|
} catch (e) {
|
|
8002
8003
|
console.error("Erro ao inserir mensagem formatada: ", e);
|
|
8003
8004
|
}
|
|
@@ -8091,6 +8092,9 @@ var __vue_render__$g = function __vue_render__() {
|
|
|
8091
8092
|
"appendToBody": "",
|
|
8092
8093
|
"calculatePosition": _vm.calculateSelectPosition,
|
|
8093
8094
|
"options": _vm.formatted_messages_3,
|
|
8095
|
+
"reduce": function reduce(formatted_messages_3) {
|
|
8096
|
+
return formatted_messages_3.cod;
|
|
8097
|
+
},
|
|
8094
8098
|
"label": "value",
|
|
8095
8099
|
"clearable": false
|
|
8096
8100
|
},
|
|
@@ -8111,7 +8115,24 @@ var __vue_render__$g = function __vue_render__() {
|
|
|
8111
8115
|
"slot": "no-options"
|
|
8112
8116
|
},
|
|
8113
8117
|
slot: "no-options"
|
|
8114
|
-
}, [_vm._v(" " + _vm._s(_vm.dictionary.msg_sem_resultados) + " ")])]), _vm._v(" "), _vm.key_3.
|
|
8118
|
+
}, [_vm._v(" " + _vm._s(_vm.dictionary.msg_sem_resultados) + " ")])]), _vm._v(" "), _vm.key_3 && _vm.messageType == 1 ? _c('span', {
|
|
8119
|
+
staticClass: "text-footer--btn-select-03",
|
|
8120
|
+
class: {
|
|
8121
|
+
'loading-message': _vm.loadingReq
|
|
8122
|
+
},
|
|
8123
|
+
attrs: {
|
|
8124
|
+
"title": _vm.dictionary.title_btn_preencher_msg_formatada
|
|
8125
|
+
},
|
|
8126
|
+
on: {
|
|
8127
|
+
"click": function click($event) {
|
|
8128
|
+
return _vm.insertFormattedMessage(_vm.key_3);
|
|
8129
|
+
}
|
|
8130
|
+
}
|
|
8131
|
+
}, [_vm.loadingReq ? _c('VueLoader') : _c('fa-icon', {
|
|
8132
|
+
attrs: {
|
|
8133
|
+
"icon": ['fas', 'level-up-alt']
|
|
8134
|
+
}
|
|
8135
|
+
})], 1) : _vm.key_3 && _vm.messageType == 2 ? _c('span', {
|
|
8115
8136
|
staticClass: "text-footer--btn-select-03",
|
|
8116
8137
|
attrs: {
|
|
8117
8138
|
"title": _vm.dictionary.title_btn_abrir_msg_tipo_2
|
|
@@ -8125,7 +8146,7 @@ var __vue_render__$g = function __vue_render__() {
|
|
|
8125
8146
|
attrs: {
|
|
8126
8147
|
"icon": ['fas', 'file-alt']
|
|
8127
8148
|
}
|
|
8128
|
-
})], 1)
|
|
8149
|
+
})], 1) : _vm._e()], 1) : _vm.key_2 && _vm.loadingReq ? _c('div', {
|
|
8129
8150
|
staticClass: "loader-select"
|
|
8130
8151
|
}, [_c('VueLoader')], 1) : _vm._e()])], 2)], 2);
|
|
8131
8152
|
};
|
|
@@ -8135,8 +8156,8 @@ var __vue_staticRenderFns__$g = [];
|
|
|
8135
8156
|
|
|
8136
8157
|
var __vue_inject_styles__$g = function __vue_inject_styles__(inject) {
|
|
8137
8158
|
if (!inject) return;
|
|
8138
|
-
inject("data-v-
|
|
8139
|
-
source: ".transition-selects{min-height:80px;display:flex;flex-direction:column;width:100%}.loader-select{position:relative;min-height:35px;background:#fff;width:100%;border:1px solid #ccc;border-radius:5px;z-index:1}",
|
|
8159
|
+
inject("data-v-4b879b5e_0", {
|
|
8160
|
+
source: ".transition-selects{min-height:80px;display:flex;flex-direction:column;width:100%}.loader-select{position:relative;min-height:35px;background:#fff;width:100%;border:1px solid #ccc;border-radius:5px;z-index:1}.loading-message{background-color:#555!important}",
|
|
8140
8161
|
map: undefined,
|
|
8141
8162
|
media: undefined
|
|
8142
8163
|
});
|
|
@@ -8147,7 +8168,7 @@ var __vue_inject_styles__$g = function __vue_inject_styles__(inject) {
|
|
|
8147
8168
|
var __vue_scope_id__$g = undefined;
|
|
8148
8169
|
/* module identifier */
|
|
8149
8170
|
|
|
8150
|
-
var __vue_module_identifier__$g = "data-v-
|
|
8171
|
+
var __vue_module_identifier__$g = "data-v-4b879b5e";
|
|
8151
8172
|
/* functional template */
|
|
8152
8173
|
|
|
8153
8174
|
var __vue_is_functional_template__$g = false;
|
|
@@ -8297,23 +8318,23 @@ var script$f = {
|
|
|
8297
8318
|
},
|
|
8298
8319
|
methods: {
|
|
8299
8320
|
listenerPostMessage: function listenerPostMessage(event) {
|
|
8321
|
+
var baseURL = window.location.hostname == 'localhost' ? "https://linux07" : "https://".concat(window.location.hostname);
|
|
8300
8322
|
if (!this.formattedMessageSettings.hasStandardMessages) return;
|
|
8301
8323
|
if (event.data.gerenciador || event.data.abrirFishing || event.data.multiplos_contatos || event.data.inserir_cliente_omni || event.data.multiple_contatos) return;
|
|
8302
8324
|
|
|
8303
|
-
if (event.
|
|
8304
|
-
if (this.showStandardMessages) {
|
|
8325
|
+
if (event.origin == baseURL) {
|
|
8326
|
+
if (event.data == '' && this.showStandardMessages) {
|
|
8327
|
+
this.closeBlockerStandardMessage();
|
|
8328
|
+
this.toggleStandardMessages();
|
|
8329
|
+
this.$toasted.global.emConstrucao({
|
|
8330
|
+
msg: this.dictionary.msg_erro_sem_msg_formatada
|
|
8331
|
+
});
|
|
8332
|
+
} else if (typeof event.data === "string" && this.showStandardMessages) {
|
|
8333
|
+
this.message = event.data;
|
|
8334
|
+
this.focusTextarea();
|
|
8305
8335
|
this.closeBlockerStandardMessage();
|
|
8306
8336
|
this.toggleStandardMessages();
|
|
8307
8337
|
}
|
|
8308
|
-
|
|
8309
|
-
this.$toasted.global.emConstrucao({
|
|
8310
|
-
msg: this.dicionario.msg_erro_sem_msg_formatada
|
|
8311
|
-
});
|
|
8312
|
-
} else if (typeof event.data === "string") {
|
|
8313
|
-
this.message = event.data;
|
|
8314
|
-
this.focusTextarea();
|
|
8315
|
-
this.closeBlockerStandardMessage();
|
|
8316
|
-
this.toggleStandardMessages();
|
|
8317
8338
|
}
|
|
8318
8339
|
},
|
|
8319
8340
|
closeEmojis: function closeEmojis() {
|
|
@@ -8762,7 +8783,7 @@ var __vue_staticRenderFns__$f = [];
|
|
|
8762
8783
|
|
|
8763
8784
|
var __vue_inject_styles__$f = function __vue_inject_styles__(inject) {
|
|
8764
8785
|
if (!inject) return;
|
|
8765
|
-
inject("data-v-
|
|
8786
|
+
inject("data-v-3d59a30a_0", {
|
|
8766
8787
|
source: ".toasted svg{margin-right:10px}.d-none{display:none}ul{list-style-type:none}.text-footer-container{display:flex;justify-content:center;align-items:center;flex-direction:column;width:100%;position:relative}.text-footer-container .text-footer{min-height:48px;box-shadow:0 3px 7px -2px rgba(0,0,0,.45);position:relative;display:flex;justify-content:center;align-items:center;border:1px solid #ccc;padding:5px 2px 5px 5px;border-radius:5px}.text-footer-container .text-footer.full{width:100%}.text-footer-container .text-footer.almostFull{width:95%}.text-footer-container .text-footer.medium{width:75%}.text-footer-container.bigger .text-footer{height:80px}.text-footer-container.bigger .text-footer>textarea{font-size:.875rem;height:75px;max-height:75px;min-height:75px}.text-footer-container textarea{margin:0 5px;border:unset;flex:1;resize:none;min-height:30px;max-height:60px;font-size:.875rem;font-family:inherit;background:inherit}.text-footer-container textarea:focus{outline:unset}.text-footer-container textarea::placeholder{font-size:.75rem}.text-footer-container .text-footer-audio{flex:1;display:flex;justify-content:center;align-items:center}.text-footer-container audio{flex:1;outline:unset;width:auto;height:38px}.text-footer-container .delete-audio{display:flex;justify-content:center;align-items:center;color:#e74c3c;transition:background .3s;border-radius:50%;font-size:1rem;padding:10px;cursor:pointer;margin:0 5px;width:31px;height:31px}.text-footer-container .delete-audio:hover{background-color:rgba(208,0,0,.2)}.text-footer-container .max-characters{font-size:.575rem;z-index:1;color:#444;position:relative;top:30px;left:-30px}.text-footer-container .max-characters.no-width{width:0}.text-footer-container .text-footer-actions{display:flex}.text-footer-container .text-footer-actions.outside-buttons{display:flex;align-items:center;justify-content:flex-end;position:absolute;top:-42px;right:2px;background-color:#ddd;box-shadow:inset 0 -10px 5px -11px rgba(0,0,0,.5)}.text-footer-container .text-footer-actions .text-footer-actions--btn{display:flex;justify-content:center;align-items:center;color:#777;border-radius:50%;transition:background .3s;padding:10px;font-size:1rem;width:36px;height:36px;cursor:pointer;margin-right:2.5px}.text-footer-container .text-footer-actions .text-footer-actions--btn:last-child{margin-right:unset}.text-footer-container .text-footer-actions .text-footer-actions--btn:hover{background-color:rgba(0,0,0,.1)}.text-footer-container .text-footer-actions .text-footer-actions--btn.files-activated{background-color:rgba(0,0,0,.1)}.text-footer-container .text-footer-actions .text-footer-actions--btn.audio-activated{background-color:rgba(208,0,0,.7);color:#fff}.text-footer-container .text-footer-actions .text-footer-actions--btn.left-button{position:absolute;left:0}.text-footer-container .text-footer-hsm-container{margin:12px 0 7px 0}.text-footer-container .text-footer-hsm-container.full{width:100%}.text-footer-container .text-footer-hsm-container.almostFull{width:95%}.text-footer-container .text-footer-hsm-container.medium{width:75%}.text-footer-container .text-footer-hsm-container .text-footer-v-select{border-radius:5px;margin-bottom:5px}.text-footer-container .text-footer-hsm-container .text-footer-select-03{display:flex;align-items:center;flex:1;width:100%}.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer-v-select{flex:1}.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03{transition-duration:.3s;user-select:none;cursor:pointer;box-shadow:inset 0 -3px rgba(0,0,0,.2);opacity:.9;border-radius:2.5px;display:flex;justify-content:center;align-items:center;margin-left:5px;margin-bottom:5px;background-color:#f7fe72;width:32px;height:32px}.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03:hover{opacity:1}.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03:active{opacity:1;box-shadow:inset 0 -1px rgba(0,0,0,.2);-webkit-transform:translateY(1px);-moz-transform:translateY(1px);-o-transform:translateY(1px);-ms-transform:translateY(1px);transform:translateY(1px)}.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03 svg{font-size:1rem}.text-footer-container .text-footer-files-container{position:absolute;right:0;top:-55px;padding:5px;background-color:rgba(0,0,0,.4);border-radius:5px;display:flex;align-items:center;justify-content:space-between;z-index:1}.text-footer-container .text-footer-files-container.horizontal{right:-55px;flex-direction:column}.text-footer-container .text-footer-files-container .files-btn{transition-duration:.3s;transition-property:opacity;opacity:.8;cursor:pointer;display:flex;justify-content:center;align-items:center;border-radius:10px;padding:3px;width:40px;height:40px;font-size:1rem;color:#fff}.text-footer-container .text-footer-files-container .files-btn:hover{opacity:1}.text-footer-container .text-footer-files-container .files-btn svg{color:#fff}.text-footer-container .text-footer-files-container .files-btn.images{background-color:#9575cd;margin-right:5px}.text-footer-container .text-footer-files-container .files-btn.images.margin-bottom{margin-right:unset;margin-bottom:5px}.text-footer-container .text-footer-files-container .files-btn.docs{background-color:#7986cb;margin-right:5px}.text-footer-container .text-footer-files-container .files-btn.system{background-color:#49a349}.text-footer-container .text-footer-preview-container{cursor:default;position:absolute;left:0;background-color:#f1f1f1;border:2px solid #ccc;border-bottom:unset;border-top-left-radius:2.5px;border-top-right-radius:2.5px}.text-footer-container .text-footer-preview-container.isDoc{top:-50px;width:100%;height:45px}.text-footer-container .text-footer-preview-container.isImg,.text-footer-container .text-footer-preview-container.isMultiple{top:-205px;width:100%;height:200px}.text-footer-container .text-footer-preview-container.isImg .text-footer-image-preview{height:170px}.text-footer-container .text-footer-preview-container.isError{top:-80px;width:100%;height:75px}.text-footer-container .text-footer-alt{margin-top:-12px;width:100%;padding:0 10px}.text-footer-container .text-footer-alt .text-footer-out-session{margin-top:12px}.text-footer-container .text-footer-alt .text-footer-sem-24h{font-size:.8rem;text-align:right;font-weight:600;letter-spacing:-.5px;color:#dd7f0c;margin-top:5px;position:absolute;right:0}.text-footer-container .text-footer-alt .sem-templates{margin-top:10px;font-size:.8rem;text-align:right;font-weight:600;letter-spacing:-.5px;color:#921e12}.text-footer-container .text-footer-alt .text-footer-templates{position:relative;width:100%}.text-footer-container .text-footer-alt .text-footer-templates .text-footer-group-selection{width:100%;display:flex;align-items:center}.text-footer-container .text-footer-alt .text-footer-templates .text-footer-group-selection h4{margin-right:5px}.text-footer-container .text-footer-alt .text-footer-templates .text-footer-group-selection .sm__select{flex:1}.vs__dropdown-menu{font-size:.85rem!important}.emoji-mart-anchor,.emoji-mart-emoji span{cursor:pointer!important}.emoji-mart{z-index:2!important}.emoji-mart-scroll{overflow-x:hidden}",
|
|
8767
8788
|
map: undefined,
|
|
8768
8789
|
media: undefined
|
|
@@ -8774,7 +8795,7 @@ var __vue_inject_styles__$f = function __vue_inject_styles__(inject) {
|
|
|
8774
8795
|
var __vue_scope_id__$f = undefined;
|
|
8775
8796
|
/* module identifier */
|
|
8776
8797
|
|
|
8777
|
-
var __vue_module_identifier__$f = "data-v-
|
|
8798
|
+
var __vue_module_identifier__$f = "data-v-3d59a30a";
|
|
8778
8799
|
/* functional template */
|
|
8779
8800
|
|
|
8780
8801
|
var __vue_is_functional_template__$f = false;
|
package/package.json
CHANGED
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
:calculatePosition="calculateSelectPosition"
|
|
43
43
|
class="text-footer-v-select"
|
|
44
44
|
:options="formatted_messages_3"
|
|
45
|
+
:reduce="formatted_messages_3 => formatted_messages_3.cod"
|
|
45
46
|
label="value"
|
|
46
47
|
:clearable="false"
|
|
47
48
|
@input="openMsg()"
|
|
@@ -49,14 +50,13 @@
|
|
|
49
50
|
>
|
|
50
51
|
<div slot="no-options"> {{ dictionary.msg_sem_resultados }} </div>
|
|
51
52
|
</v-select>
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</template>
|
|
53
|
+
<span v-if="key_3 && messageType == 1" class="text-footer--btn-select-03" :class="{'loading-message' : loadingReq}" :title="dictionary.title_btn_preencher_msg_formatada" @click="insertFormattedMessage(key_3)">
|
|
54
|
+
<VueLoader v-if="loadingReq" />
|
|
55
|
+
<fa-icon v-else :icon="['fas', 'level-up-alt']" />
|
|
56
|
+
</span>
|
|
57
|
+
<span v-else-if="key_3 && messageType == 2" class="text-footer--btn-select-03" :title="dictionary.title_btn_abrir_msg_tipo_2" @click="openFormattedMsgType2(key_3)">
|
|
58
|
+
<fa-icon :icon="['fas', 'file-alt']" />
|
|
59
|
+
</span>
|
|
60
60
|
</div>
|
|
61
61
|
<div class="loader-select" v-else-if="key_2 && loadingReq">
|
|
62
62
|
<VueLoader />
|
|
@@ -73,6 +73,9 @@
|
|
|
73
73
|
.loader-select {
|
|
74
74
|
position: relative; min-height: 35px;background: #FFF;width: 100%; border: 1px solid #ccc;border-radius: 5px;z-index: 1;
|
|
75
75
|
}
|
|
76
|
+
.loading-message {
|
|
77
|
+
background-color: #555!important;
|
|
78
|
+
}
|
|
76
79
|
</style>
|
|
77
80
|
|
|
78
81
|
<script>
|
|
@@ -156,7 +159,7 @@ export default {
|
|
|
156
159
|
this.loadingReq = true
|
|
157
160
|
this.getStandardMessages(cod, this.token_cliente).then((data) => {
|
|
158
161
|
this.loadingReq = false
|
|
159
|
-
if(data
|
|
162
|
+
if(data.msg_ret) return this.$toasted.global.emConstrucao({ msg: data.msg_ret })
|
|
160
163
|
if(data) return this.showFormattedMessage(data, selectionIndex)
|
|
161
164
|
this.$toasted.global.defaultError()
|
|
162
165
|
}).catch(e => {
|
|
@@ -172,7 +175,7 @@ export default {
|
|
|
172
175
|
try {
|
|
173
176
|
let success = false
|
|
174
177
|
if(Array.isArray(messageData)) success = true
|
|
175
|
-
if(!success) this.$toasted.global.emConstrucao({ msg: messageData ? messageData.msg : "Nao foi possível obter mensagens" })
|
|
178
|
+
if(!success && selectionIndex != 4) this.$toasted.global.emConstrucao({ msg: messageData ? messageData.msg : "Nao foi possível obter mensagens" })
|
|
176
179
|
|
|
177
180
|
switch (selectionIndex) {
|
|
178
181
|
case 2:
|
|
@@ -195,21 +198,18 @@ export default {
|
|
|
195
198
|
this.$toasted.global.emConstrucao({msg: this.dictionary.msg_erro_sem_msg_formatada})
|
|
196
199
|
this.$emit("close-blocker-standard-message")
|
|
197
200
|
}else{
|
|
198
|
-
if(
|
|
199
|
-
this.formatted_messages_3.push(this.dictionary.msg_erro_sem_msg_formatada)
|
|
200
|
-
this.key_3 = this.formatted_messages_3[0]
|
|
201
|
-
this.openFormattedMsgType2(this.key_3)
|
|
202
|
-
}else{
|
|
201
|
+
if(messageData.length){
|
|
203
202
|
this.formatted_messages_3 = messageData
|
|
204
|
-
if(this.formatted_messages_3.length == 1) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
this.openFormattedMsgType2(this.key_3)
|
|
208
|
-
}
|
|
203
|
+
if(this.formatted_messages_3.length == 1 && this.formatted_messages_3[0].cod) {
|
|
204
|
+
this.key_3 = this.formatted_messages_3[0].cod
|
|
205
|
+
this.openMsg()
|
|
209
206
|
}
|
|
210
207
|
}
|
|
211
208
|
}
|
|
212
209
|
break
|
|
210
|
+
case 4:
|
|
211
|
+
const finalMessage = `${this.message}${this.message && !this.message.endsWith(" ") ? ` ${messageData}` : messageData}`
|
|
212
|
+
return messageData ? this.$emit("add-standard-message", finalMessage) : this.$toasted.global.emConstrucao({msg: 'Mensagem vazia'})
|
|
213
213
|
default:
|
|
214
214
|
console.error("Error in showFormattedMessage: selectionIndex not found")
|
|
215
215
|
break
|
|
@@ -221,8 +221,7 @@ export default {
|
|
|
221
221
|
},
|
|
222
222
|
openMsg() {
|
|
223
223
|
try {
|
|
224
|
-
|
|
225
|
-
this.openFormattedMsgType2(this.key_3)
|
|
224
|
+
this.messageType == 1 ? this.insertFormattedMessage(this.key_3) : this.openFormattedMsgType2(this.key_3)
|
|
226
225
|
}catch(e) {
|
|
227
226
|
console.error("Error in openMsg: ", e)
|
|
228
227
|
}
|
|
@@ -240,9 +239,7 @@ export default {
|
|
|
240
239
|
insertFormattedMessage() {
|
|
241
240
|
try {
|
|
242
241
|
if(!this.key_3) return this.$toasted.global.defaultError({msg: 'Selecione uma mensagem'})
|
|
243
|
-
|
|
244
|
-
// const finalMessage = `${this.message}${this.message && !this.message.endsWith(" ") ? ` ${value}` : value}`
|
|
245
|
-
// return value ? this.$emit("add-standard-message", finalMessage) : this.$toasted.global.emConstrucao({msg: 'Mensagem vazia'})
|
|
242
|
+
this.receiveValueFormattedMessage(`T/${this.key_2}/${this.key_3}`, 4)
|
|
246
243
|
}catch(e) {
|
|
247
244
|
console.error("Erro ao inserir mensagem formatada: ", e)
|
|
248
245
|
}
|
|
@@ -203,20 +203,20 @@ export default {
|
|
|
203
203
|
},
|
|
204
204
|
methods: {
|
|
205
205
|
listenerPostMessage(event){
|
|
206
|
+
const baseURL = window.location.hostname == 'localhost' ? `https://linux07` : `https://${window.location.hostname}`
|
|
206
207
|
if(!this.formattedMessageSettings.hasStandardMessages) return
|
|
207
208
|
if(event.data.gerenciador || event.data.abrirFishing || event.data.multiplos_contatos || event.data.inserir_cliente_omni || event.data.multiple_contatos) return
|
|
208
|
-
if(event.
|
|
209
|
-
if(this.showStandardMessages)
|
|
209
|
+
if(event.origin == baseURL) {
|
|
210
|
+
if(event.data == '' && this.showStandardMessages){
|
|
211
|
+
this.closeBlockerStandardMessage()
|
|
212
|
+
this.toggleStandardMessages()
|
|
213
|
+
this.$toasted.global.emConstrucao({msg: this.dictionary.msg_erro_sem_msg_formatada})
|
|
214
|
+
}else if(typeof event.data === "string" && this.showStandardMessages){
|
|
215
|
+
this.message = event.data
|
|
216
|
+
this.focusTextarea()
|
|
210
217
|
this.closeBlockerStandardMessage()
|
|
211
218
|
this.toggleStandardMessages()
|
|
212
219
|
}
|
|
213
|
-
this.$toasted.global.emConstrucao({msg: this.dicionario.msg_erro_sem_msg_formatada})
|
|
214
|
-
}else if(typeof event.data === "string"){
|
|
215
|
-
this.message = event.data
|
|
216
|
-
this.focusTextarea()
|
|
217
|
-
|
|
218
|
-
this.closeBlockerStandardMessage()
|
|
219
|
-
this.toggleStandardMessages()
|
|
220
220
|
}
|
|
221
221
|
},
|
|
222
222
|
closeEmojis() {
|