sync
This commit is contained in:
@@ -51,6 +51,11 @@ export default class CustomerRecordComment {
|
||||
this._var.enter.disabled = flag;
|
||||
this._var.container.querySelector('.button-send-message').disabled = flag;
|
||||
}
|
||||
get replyMsgId() { return this._var.replymsgid || -1 }
|
||||
set replyMsgId(v) {
|
||||
this._var.replymsgid = null;
|
||||
this._var.replymsgctrl.style.display = 'none'
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {boolean} flag
|
||||
@@ -111,6 +116,24 @@ export default class CustomerRecordComment {
|
||||
container.appendChild(
|
||||
createElement('div', 'message-bar',
|
||||
enter,
|
||||
createElement('div', div => {
|
||||
div.className = 'customer-reply';
|
||||
div.style.display = 'none';
|
||||
this._var.replymsgctrl = div;
|
||||
},
|
||||
createElement('span', span => {
|
||||
span.className = 'reply-user';
|
||||
}),
|
||||
createElement('span', span => {
|
||||
span.className = 'reply-msg';
|
||||
}),
|
||||
createElement('layer', layer => {
|
||||
layer.appendChild(createIcon('fa-light', 'times'));
|
||||
layer.addEventListener('click', () => {
|
||||
this.replyMsgId = null;
|
||||
});
|
||||
})
|
||||
),
|
||||
createElement('div', div => div.style.textAlign = 'right',
|
||||
createElement('div', 'prompt-count'),
|
||||
createElement('button', button => {
|
||||
@@ -124,7 +147,8 @@ export default class CustomerRecordComment {
|
||||
setTooltip(button, r('FLTL_02301', 'Post Note'));
|
||||
button.addEventListener('click', () => {
|
||||
if (typeof this._var.option.onAddComment === 'function') {
|
||||
this._var.option.onAddComment(this.text);
|
||||
this._var.option.onAddComment(this.text, this._var.replymsgid);
|
||||
this.replyMsgId = null;
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -158,6 +182,13 @@ export default class CustomerRecordComment {
|
||||
div.innerText = comment.UserName;
|
||||
}));
|
||||
const content = createElement('div', 'item-content');
|
||||
if (comment.ReplyMessage) {
|
||||
const reply = createElement('div', div => {
|
||||
div.className = 'reply';
|
||||
div.innerHTML = comment.ReplyMessage.Comment;
|
||||
});
|
||||
content.appendChild(reply);
|
||||
}
|
||||
const mmsParts = createElement('div', div => div.style.display = 'none');
|
||||
content.appendChild(createElement('span', span => span.innerHTML = escapeHtml(escapeEmoji(comment.Comment)), mmsParts));
|
||||
if (comment.MMSParts?.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user