|
|
|
@ -87,20 +87,11 @@ const hideButtons = (type) => {
|
|
|
|
|
$("#voicerecorder").css({ "pointer-events": "none" }); |
|
|
|
|
$("#imgclip").css({ "pointer-events": "none" }); |
|
|
|
|
$("#fieldsendmessage").css({ "pointer-events": "none" }); |
|
|
|
|
// $("#fieldsendmessage").css('opacity', '0');
|
|
|
|
|
$("#fieldsendmessage").hide(); |
|
|
|
|
$("#tranferagent").hide(); |
|
|
|
|
$("#finalizaratendimento").hide(); |
|
|
|
|
// $(".chat-window-header-right").hide();
|
|
|
|
|
|
|
|
|
|
// $("#recuperaratendimento").show();
|
|
|
|
|
|
|
|
|
|
$(".chat-window-header-right").css('bottom', '-50px'); |
|
|
|
|
|
|
|
|
|
// $("#chat-window-header-right-icon").hide();
|
|
|
|
|
// $(".responsive-icon-header").hide();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
$("#voicerecorder").css({ "pointer-events": "auto" }); |
|
|
|
|
$("#imgclip").css({ "pointer-events": "auto" }); |
|
|
|
@ -126,18 +117,6 @@ const alertModal = (title, message) => {
|
|
|
|
|
$("#modalselect").show(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* LOG |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const log = (message) => { |
|
|
|
|
console.log(message); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* HABILITA O ENVIO DE ARQUIVO DE IMAGENS E APRESENTA UMA MODAL PARA APRESENTACAO DA IMAGEM SELECIONADA |
|
|
|
|
*/ |
|
|
|
@ -166,10 +145,7 @@ const startSendImage = (file) => {
|
|
|
|
|
$("#modalselect").show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const startSendImagePrintScreen = (file) => { |
|
|
|
|
|
|
|
|
|
modalStart(); |
|
|
|
|
const fileReader = new FileReader(); |
|
|
|
|
fileReader.readAsDataURL(file); |
|
|
|
@ -192,8 +168,6 @@ const startSendImagePrintScreen = (file) => {
|
|
|
|
|
$("#modalselect").show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* GERENCIA A RESPONSIVIDADE DO LAYOUT |
|
|
|
|
*/ |
|
|
|
@ -645,6 +619,7 @@ const buildNotificationFila = (data = {}) => {
|
|
|
|
|
</div> |
|
|
|
|
</div>`; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const alertNotification = (uniqueid, type = "add") => { |
|
|
|
|
$("#" + uniqueid.replace(".", `\\.`) + " .chat-right-bottom-right").empty(); |
|
|
|
|
if (type != "remove") { |
|
|
|
@ -660,10 +635,12 @@ const alertNotification = (uniqueid, type = "add") => {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
function soundNotification(url) { |
|
|
|
|
const audio = new Audio(url); |
|
|
|
|
audio.play(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const notifyMe = (title, content) => { |
|
|
|
|
if (!("Notification" in window)) { |
|
|
|
|
console.log("This browser does not support desktop notification"); |
|
|
|
@ -796,32 +773,20 @@ const filaNotifications = (obj = {}) => {
|
|
|
|
|
); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const monitoraStatusTransferenciaAtendimento = (date) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let formatedTransferDate = date.slice(0, date.lastIndexOf(':')); |
|
|
|
|
|
|
|
|
|
const data_atual = new Date(); |
|
|
|
|
|
|
|
|
|
let formatedDate = formatDate(data_atual, 'Y-m-d hh:M') |
|
|
|
|
|
|
|
|
|
const start = new Date(formatedTransferDate); |
|
|
|
|
const end = new Date(formatedDate); |
|
|
|
|
|
|
|
|
|
const diffInTime = Math.abs(end - start) / 1000 / 60 / 60 |
|
|
|
|
|
|
|
|
|
log(diffInTime) |
|
|
|
|
|
|
|
|
|
if(diffInTime > RecuperacaoAtendimentoLimite){ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$("#recuperaratendimento").show(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const formatDate = (date, format) => { |
|
|
|
|
const map = { |
|
|
|
|
m: String(date.getMonth()+1).padStart(2,'0'), |
|
|
|
@ -835,14 +800,8 @@ const formatDate = (date, format) => {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return(format.replace(/m|d|y|Y|hh|M|ss|ll/gi, matched => map[matched])) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const monitorPausaAgente = () => { |
|
|
|
|
statusAgente( |
|
|
|
|
localStorage.getItem("my_uniqueid") |
|
|
|
@ -903,7 +862,6 @@ const supervisorAgente = () => {
|
|
|
|
|
}, 30000); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** CONNECT TO WS */ |
|
|
|
|
const connect = (wsserver) => { |
|
|
|
|
const ws = new WebSocket(wsserver); |
|
|
|
|