batchcreate.ui.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. window.addTitle = function(titleID, own)
  2. {
  3. var titleObj = "title-" + titleID;
  4. var titleHtml = $(own).closest('.' + titleObj).html();
  5. $(own).parent().after("<div class='" + titleObj +" item flex activity-title'>" + titleHtml + "</div>");
  6. }
  7. window.delTitle = function(titleID)
  8. {
  9. if($(titleID).parent().parent().children().length == 1) return false;
  10. $(titleID).parent().remove();
  11. }
  12. $(document).ready(function()
  13. {
  14. $('form').on('submit', function(e)
  15. {
  16. e.preventDefault();
  17. $.ajax(
  18. {
  19. type: 'POST',
  20. url: $.createLink('auditcl', 'batchCreate', `groupID=${groupID}`),
  21. data: $('#batchCreateForm').serialize(),
  22. dataType: 'json',
  23. success: data =>
  24. {
  25. if(data.result == 'success')
  26. {
  27. window.location.href = data.load;
  28. }
  29. else
  30. {
  31. zui.Modal.alert(data.message)
  32. }
  33. },
  34. complete: () =>
  35. {
  36. $('#batchCreateForm').find('button[type="submit"]').removeAttr('disabled');
  37. }
  38. });
  39. });
  40. });