linktask.ui.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. window.createSortLink = function(col)
  2. {
  3. var sort = col.name + '_asc';
  4. if(sort == orderBy) sort = col.name + '_desc';
  5. return "javascript:loadModal('" + sortLink.replace('{orderBy}', sort) + "', '#table-repo-linktask')";
  6. }
  7. $(document).off('click','.dtable-footer .batch-btn-repo').on('click', '.dtable-footer .batch-btn-repo', function(e)
  8. {
  9. const dtable = zui.DTable.query(e.target);
  10. const checkedList = dtable.$.getChecks();
  11. if(!checkedList.length) return;
  12. const tabType = $(this).data('type');
  13. const postData = new FormData();
  14. checkedList.forEach((id) => postData.append(`${tabType}[]`, id));
  15. $.ajaxSubmit({
  16. url: $(this).data('url'),
  17. data: postData
  18. });
  19. });
  20. window.renderTaskCell = function(result, info)
  21. {
  22. const task = info.row.data;
  23. if(info.col.name == 'name' && result)
  24. {
  25. let html = '';
  26. if(task.mode)
  27. {
  28. html += "<span class='label gray-pale rounded p-0 size-sm whitespace-nowrap'>" + multipleAB + "</span>";
  29. }
  30. if(task.isParent > 0)
  31. {
  32. html += "<span class='label gray-pale rounded p-0 size-sm whitespace-nowrap'>" + parentAB + "</span>";
  33. }
  34. else if(task.parent > 0)
  35. {
  36. html += "<span class='label gray-pale rounded p-0 size-sm whitespace-nowrap'>" + childrenAB + "</span>";
  37. }
  38. if(task.color) result[0].props.style = 'color: ' + task.color;
  39. if(html) result.unshift({html});
  40. }
  41. return result;
  42. }