browse.ui.js 968 B

1234567891011121314151617181920212223242526272829
  1. window.onClickBatchDelete = function(event)
  2. {
  3. const dtable = zui.DTable.query(event.target);
  4. const checkedList = dtable.$.getChecks();
  5. if(checkedList.length === 0) return;
  6. let $this = $(event.target);
  7. if(!$this.hasClass('batch-btn')) $this = $this.closest('.batch-btn');
  8. const postData = new FormData();
  9. checkedList.forEach((id) => postData.append('mailIdList[]', id));
  10. zui.Modal.confirm($this.data('confirm')).then((res) => {if(res) $.ajaxSubmit({url: $this.data('formaction'), data: postData})});
  11. };
  12. window.renderCell = function(result, info)
  13. {
  14. if(info.col.name == 'failReason' && result)
  15. {
  16. const mail = info.row.data;
  17. if(!mail.failReason?.length) return result;
  18. let failReason = mail.failReason?.replaceAll('<br />', '') ?? '';
  19. let html = "<span title='" + failReason + "'>" + failReason.replaceAll("\n", '') + "</span> ";
  20. return [{html: html}];
  21. }
  22. return result;
  23. };