|
|
@ -87,11 +87,20 @@ const hideButtons = (type) => { |
|
|
|
$("#voicerecorder").css({ "pointer-events": "none" }); |
|
|
|
$("#voicerecorder").css({ "pointer-events": "none" }); |
|
|
|
$("#imgclip").css({ "pointer-events": "none" }); |
|
|
|
$("#imgclip").css({ "pointer-events": "none" }); |
|
|
|
$("#fieldsendmessage").css({ "pointer-events": "none" }); |
|
|
|
$("#fieldsendmessage").css({ "pointer-events": "none" }); |
|
|
|
|
|
|
|
// $("#fieldsendmessage").css('opacity', '0');
|
|
|
|
$("#fieldsendmessage").hide(); |
|
|
|
$("#fieldsendmessage").hide(); |
|
|
|
$("#tranferagent").hide(); |
|
|
|
$("#tranferagent").hide(); |
|
|
|
$("#finalizaratendimento").hide(); |
|
|
|
$("#finalizaratendimento").hide(); |
|
|
|
$(".chat-window-header-right").hide(); |
|
|
|
// $(".chat-window-header-right").hide();
|
|
|
|
$("#chat-window-header-right-icon").hide(); |
|
|
|
|
|
|
|
|
|
|
|
// $("#recuperaratendimento").show();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(".chat-window-header-right").css('bottom', '-50px'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// $("#chat-window-header-right-icon").hide();
|
|
|
|
|
|
|
|
// $(".responsive-icon-header").hide();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$("#voicerecorder").css({ "pointer-events": "auto" }); |
|
|
|
$("#voicerecorder").css({ "pointer-events": "auto" }); |
|
|
|
$("#imgclip").css({ "pointer-events": "auto" }); |
|
|
|
$("#imgclip").css({ "pointer-events": "auto" }); |
|
|
@ -99,8 +108,14 @@ const hideButtons = (type) => { |
|
|
|
$("#fieldsendmessage").show(); |
|
|
|
$("#fieldsendmessage").show(); |
|
|
|
$("#tranferagent").show(); |
|
|
|
$("#tranferagent").show(); |
|
|
|
$("#finalizaratendimento").show(); |
|
|
|
$("#finalizaratendimento").show(); |
|
|
|
|
|
|
|
|
|
|
|
$(".chat-window-header-right").show(); |
|
|
|
$(".chat-window-header-right").show(); |
|
|
|
$("#chat-window-header-right-icon").show(); |
|
|
|
|
|
|
|
|
|
|
|
$(".chat-window-header-right").css('bottom', '-90px'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#recuperaratendimento").hide(); |
|
|
|
|
|
|
|
$('#fieldsendmessage').focus(); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
const alertModal = (title, message) => { |
|
|
|
const alertModal = (title, message) => { |
|
|
@ -110,32 +125,74 @@ const alertModal = (title, message) => { |
|
|
|
$(".modal-header-title").append(`${message}`); |
|
|
|
$(".modal-header-title").append(`${message}`); |
|
|
|
$("#modalselect").show(); |
|
|
|
$("#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 |
|
|
|
* HABILITA O ENVIO DE ARQUIVO DE IMAGENS E APRESENTA UMA MODAL PARA APRESENTACAO DA IMAGEM SELECIONADA |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
const startSendImage = () => { |
|
|
|
const startSendImage = (file) => { |
|
|
|
|
|
|
|
|
|
|
|
modalStart(); |
|
|
|
modalStart(); |
|
|
|
$("#uploadimage").on("change", function () { |
|
|
|
const fileReader = new FileReader();
|
|
|
|
const file = new FileReader(); |
|
|
|
// const file = new FileReader();
|
|
|
|
file.readAsDataURL(this.files[0]); |
|
|
|
fileReader.readAsDataURL(file[0]); |
|
|
|
const imgName = this.files[0].name; |
|
|
|
const imgName = file[0].name; |
|
|
|
file.onload = function (e) { |
|
|
|
|
|
|
|
$("#myImg").remove(); |
|
|
|
fileReader.onload = function (e) { |
|
|
|
$("#footername").remove(); |
|
|
|
$("#myImg").remove(); |
|
|
|
$("#footersend").remove(); |
|
|
|
$("#footername").remove(); |
|
|
|
$(".modal-content-body").append( |
|
|
|
$("#footersend").remove(); |
|
|
|
`<img id="myImg" src="${e.target.result}" >` |
|
|
|
$(".modal-content-body").append( |
|
|
|
); |
|
|
|
`<img id="myImg" src="${e.target.result}" >` |
|
|
|
$("#footer-content-left").append( |
|
|
|
); |
|
|
|
`<label id="footername"><b>Arquivo:</b> ${imgName}</label>` |
|
|
|
$("#footer-content-left").append( |
|
|
|
); |
|
|
|
`<label id="footername"><b>Arquivo:</b> ${imgName}</label>` |
|
|
|
$("#footer-content-right").append( |
|
|
|
); |
|
|
|
`<a href="#" class="btn-send" id="footersend"><img src="${path}/images/enter.svg" /></a>` |
|
|
|
$("#footer-content-right").append( |
|
|
|
); |
|
|
|
`<a href="#" class="btn-send" id="footersend"><img src="${path}/images/enter.svg" /></a>` |
|
|
|
}; |
|
|
|
); |
|
|
|
$("#modalselect").show(); |
|
|
|
}; |
|
|
|
}); |
|
|
|
$("#modalselect").show(); |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const startSendImagePrintScreen = (file) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
modalStart(); |
|
|
|
|
|
|
|
const fileReader = new FileReader(); |
|
|
|
|
|
|
|
fileReader.readAsDataURL(file); |
|
|
|
|
|
|
|
const imgName = file.name; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fileReader.onload = function (e) { |
|
|
|
|
|
|
|
$("#myImg").remove(); |
|
|
|
|
|
|
|
$("#footername").remove(); |
|
|
|
|
|
|
|
$("#footersend").remove(); |
|
|
|
|
|
|
|
$(".modal-content-body").append( |
|
|
|
|
|
|
|
`<img id="myImg" src="${e.target.result}" >` |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
$("#footer-content-left").append( |
|
|
|
|
|
|
|
`<label id="footername"><b>Arquivo:</b> ${imgName}</label>` |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
$("#footer-content-right").append( |
|
|
|
|
|
|
|
`<a href="#" class="btn-send" id="footersend"><img src="${path}/images/enter.svg" /></a>` |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
$("#modalselect").show(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* GERENCIA A RESPONSIVIDADE DO LAYOUT |
|
|
|
* GERENCIA A RESPONSIVIDADE DO LAYOUT |
|
|
@ -543,7 +600,7 @@ const buildNotification = (data = {}) => { |
|
|
|
} |
|
|
|
} |
|
|
|
const datesend = converdata(data.datetime); |
|
|
|
const datesend = converdata(data.datetime); |
|
|
|
const status = data.status == 0 ? "opacity-8" : ""; |
|
|
|
const status = data.status == 0 ? "opacity-8" : ""; |
|
|
|
return `<div class="chat ${status}" id="${data.uniqueid}" onclick="selectNotification(this.id)">
|
|
|
|
return `<div class="chat ${status}" id="${data.uniqueid}" onclick="selectNotification(this.id, ${data.status}, '${data.datetime}')">
|
|
|
|
<div class="chat-left"> |
|
|
|
<div class="chat-left"> |
|
|
|
<img src="${path}/images/${data.media}.png"/> |
|
|
|
<img src="${path}/images/${data.media}.png"/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -739,6 +796,53 @@ 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'), |
|
|
|
|
|
|
|
d: date.getDate().toString().padStart(2,'0'), |
|
|
|
|
|
|
|
y: date.getFullYear().toString().slice(-2), |
|
|
|
|
|
|
|
Y: date.getFullYear(), |
|
|
|
|
|
|
|
hh: date.getHours(), |
|
|
|
|
|
|
|
M: date.getMinutes(), |
|
|
|
|
|
|
|
ss: date.getSeconds(), |
|
|
|
|
|
|
|
ll: date.getMilliseconds() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return(format.replace(/m|d|y|Y|hh|M|ss|ll/gi, matched => map[matched])) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const monitorPausaAgente = () => { |
|
|
|
const monitorPausaAgente = () => { |
|
|
|
statusAgente( |
|
|
|
statusAgente( |
|
|
|
localStorage.getItem("my_uniqueid") |
|
|
|
localStorage.getItem("my_uniqueid") |
|
|
|