remove dependency of jQuery plugins.
Grid.expandAll add total field of exported data.
This commit is contained in:
@@ -32,6 +32,18 @@ export default class InternalComment {
|
||||
}
|
||||
}
|
||||
|
||||
get messageHidden() { return this._var.option.showCommentHidden }
|
||||
set messageHidden(flag) {
|
||||
const el = this._var.container.querySelector('.msgadminsetting');
|
||||
if (el == null) {
|
||||
return;
|
||||
}
|
||||
this._var.option.showMessageHidden = flag;
|
||||
// TODO: 是否与参数 flag 无关
|
||||
el.classList.remove('iconview');
|
||||
el.classList.add('iconnotview');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {any} contacts
|
||||
*/
|
||||
@@ -110,7 +122,28 @@ export default class InternalComment {
|
||||
createElement('div', div => {
|
||||
div.className = 'title-module';
|
||||
div.innerText = r('P_WO_INTERNALCOMMENTS', 'Internal Comments');
|
||||
})
|
||||
},
|
||||
createElement('span', span => {
|
||||
if (option.userIsAdmin) {
|
||||
span.className = 'msgadminsetting sbutton iconnotview';
|
||||
span.style.padding = '0px 0px 0px 5px';
|
||||
span.addEventListener('click', function () {
|
||||
if (!option.showMessageHidden) {
|
||||
this.classList.remove('iconnotview');
|
||||
this.classList.add('iconview');
|
||||
option.showMessageHidden = true;
|
||||
container.querySelectorAll('.msgsetting').forEach(x => x.style.display = '');
|
||||
}
|
||||
else {
|
||||
this.classList.remove('iconview');
|
||||
this.classList.add('iconnotview');
|
||||
option.showMessageHidden = false;
|
||||
container.querySelectorAll('.msgsetting').forEach(x => x.style.display = 'none');
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
)
|
||||
), []
|
||||
);
|
||||
const readonly = option.readonly;
|
||||
@@ -245,7 +278,7 @@ export default class InternalComment {
|
||||
return this._var.container = container;
|
||||
}
|
||||
|
||||
load(data) {
|
||||
load(data, func) {
|
||||
const children = [];
|
||||
if (data?.length > 0) {
|
||||
this._var.comments = data;
|
||||
@@ -302,8 +335,28 @@ export default class InternalComment {
|
||||
content,
|
||||
createElement('div', div => {
|
||||
div.className = 'item-time';
|
||||
div.innerText = comment.TimeStr;
|
||||
})
|
||||
},
|
||||
createElement('span', span => {
|
||||
span.className = 'msgsetting sbutton ' + (comment.Hidden ? 'iconnotview' : 'iconview');
|
||||
span.style.padding = '0px 0px 0px 5px';
|
||||
span.style.fontSize = '12px';
|
||||
span.style.display = this._var.option.showMessageHidden ? '' : 'none';
|
||||
span.addEventListener('click', function () {
|
||||
if (this.classList.contains('iconview')) {
|
||||
func(comment.Id, true);
|
||||
this.classList.remove('iconview');
|
||||
this.classList.add('iconnotview');
|
||||
} else {
|
||||
func(comment.Id, false);
|
||||
this.classList.remove('iconnotview');
|
||||
this.classList.add('iconview');
|
||||
}
|
||||
});
|
||||
}),
|
||||
createElement('span', span => {
|
||||
span.innerText = comment.TimeStr;
|
||||
})
|
||||
)
|
||||
);
|
||||
children.push(div);
|
||||
}
|
||||
|
Reference in New Issue
Block a user