importtask.ui.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. $(document).off('click','.batch-btn').on('click', '.batch-btn', function()
  2. {
  3. const dtable = zui.DTable.query($(this).target);
  4. const checkedList = dtable.$.getChecks();
  5. if(!checkedList.length) return;
  6. const form = new FormData();
  7. checkedList.forEach((id) => form.append('taskIdList[]', id));
  8. $.ajaxSubmit({url: $(this).data('url'), data: form});
  9. });
  10. window.changeExecution = function(e)
  11. {
  12. loadPage($.createLink('execution', 'importTask', 'executionID=' + executionID + '&fromExecution=' + $(e.target).val()));
  13. }
  14. window.renderCell = function(result, info)
  15. {
  16. const task = info.row.data;
  17. if(info.col.name == 'name' && result)
  18. {
  19. let html = '';
  20. if(task.isParent > 0)
  21. {
  22. html += "<span class='label gray-pale rounded p-0 size-sm whitespace-nowrap'>" + parentAB + "</span>";
  23. }
  24. else if(task.parent > 0)
  25. {
  26. html += "<span class='label gray-pale rounded p-0 size-sm whitespace-nowrap'>" + childrenAB + "</span>";
  27. }
  28. if(html) result.unshift({html});
  29. }
  30. return result;
  31. }
  32. $(document).off('click', '.switchButton').on('click', '.switchButton', function()
  33. {
  34. var taskViewType = $(this).attr('data-type');
  35. $.cookie.set('taskViewType', taskViewType, {expires:config.cookieLife, path:config.webRoot});
  36. loadCurrentPage();
  37. });