sync
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import AddWorkOrder from "../../element/addWorkorder";
|
||||
import { createElement, setTooltip, createIcon, requestAnimationFrame } from "../../ui";
|
||||
import { r as lang, nullOrEmpty, escapeHtml, escapeEmoji } from "../../utility";
|
||||
import { createBox, appendMedia } from "./lib";
|
||||
@ -115,10 +116,22 @@ export default class InternalComment {
|
||||
return;
|
||||
}
|
||||
this._var.enter.disabled = flag === true;
|
||||
this._var.container.querySelector('.button-call-log').style.display = flag === true ? 'none' : '';
|
||||
this._var.container.querySelector('.button-send-message').style.display = flag === true ? 'none' : '';
|
||||
this._var.container.querySelector('.button-post-note').style.display = flag === true ? 'none' : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {boolean} flag
|
||||
*/
|
||||
set noCallLog(flag) {
|
||||
this._var.option.noCallLog = flag;
|
||||
if (this._var.container == null) {
|
||||
return;
|
||||
}
|
||||
this._var.container.querySelector('.button-call-log').style.display = flag === true ? 'none' : '';
|
||||
}
|
||||
|
||||
create() {
|
||||
const option = this._var.option;
|
||||
const container = createBox(
|
||||
@ -214,6 +227,24 @@ export default class InternalComment {
|
||||
)
|
||||
),
|
||||
createElement('div', 'prompt-count'),
|
||||
createElement('button', button => {
|
||||
button.className = 'roundbtn button-call-log';
|
||||
button.style.backgroundImage = 'url(' + AddWorkOrder.IconWorkOrder + ')';
|
||||
button.style.backgroundSize = '80% 80%';
|
||||
button.style.backgroundPosition = 'center';
|
||||
button.style.backgroundRepeat = 'no-repeat';
|
||||
button.style.verticalAlign = 'top';//firefox图片需要设置verticalAlign
|
||||
if (readonly === true || option.noCallLog === true) {
|
||||
button.style.display = 'none';
|
||||
}
|
||||
setTooltip(button, r('P_WO_CALLLOG', 'Call Log'));
|
||||
button.addEventListener('click', () => {
|
||||
if (typeof option.onAddCallLog === 'function') {
|
||||
this.loading = true;
|
||||
option.onAddCallLog();
|
||||
}
|
||||
})
|
||||
}),
|
||||
createElement('button', button => {
|
||||
button.className = 'roundbtn button-send-message';
|
||||
button.style.backgroundColor = 'rgb(19, 150, 204)';
|
||||
@ -293,7 +324,13 @@ export default class InternalComment {
|
||||
}));
|
||||
const content = createElement('div', 'item-content');
|
||||
const mmsParts = createElement('div', div => div.style.display = 'none');
|
||||
content.appendChild(createElement('span', span => span.innerHTML = escapeHtml(escapeEmoji(comment.Message)), mmsParts));
|
||||
content.appendChild(createElement('span', span => {
|
||||
if (comment.MessageType === 2) {
|
||||
span.innerHTML = comment.Message;
|
||||
} else {
|
||||
span.innerHTML = escapeHtml(escapeEmoji(comment.Message));
|
||||
}
|
||||
}, mmsParts));
|
||||
if (comment.MMSParts?.length > 0) {
|
||||
mmsParts.style.display = '';
|
||||
for (let kv of comment.MMSParts) {
|
||||
|
Reference in New Issue
Block a user