No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

release_centre.js 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // 管理相关
  2. var btfxContent = $('.btfx');
  3. var relatedContent = $('.related-content');
  4. var managementButton = $('#management-button');
  5. function handleClick() {
  6. if (relatedContent.is(':hidden')) {
  7. btfxContent.hide();
  8. relatedContent.show();
  9. managementButton.text('完成');
  10. } else {
  11. btfxContent.show();
  12. relatedContent.hide();
  13. managementButton.text('管理');
  14. }
  15. }
  16. managementButton.on('click', handleClick);
  17. $(function() {
  18. $('input[name*=ids]').click(function() {
  19. if ($('input[name*=ids]').length == $('input[name*=ids]:checked').length) {
  20. $('#checkboxAll').prop('checked', true);
  21. } else {
  22. $('#checkboxAll').prop('checked', false);
  23. }
  24. });
  25. $('#checkboxAll').click(function() {
  26. $('input[type=checkbox]').prop('checked', this.checked);
  27. });
  28. });
  29. // 编辑文档内容
  30. function editArchives(obj) {
  31. window.location.href = $(obj).attr('data-editurl');
  32. }
  33. // 批量删除文档
  34. function batchDelArchives(obj) {
  35. var aids = [];
  36. $('input[name*=ids]').each(function(i, o) {
  37. if ($(o).is(':checked')) aids.push($(o).val());
  38. });
  39. if (0 === parseInt(aids.length)) {
  40. showLayerMsg('请选择需要删除的文档');
  41. return false;
  42. }
  43. showConfirmBox('确认删除选中文档?', null, function() {
  44. showLayerLoad();
  45. $.ajax({
  46. url : $(obj).attr('data-url'),
  47. data: {del_id: aids},
  48. type: "POST",
  49. dataType: 'json',
  50. success: function (res) {
  51. layer.closeAll();
  52. if (1 === parseInt(res.code)) {
  53. for (var i = 0; i < aids.length; i++) {
  54. $('#release_' + aids[i]).remove();
  55. }
  56. showLayerMsg(res.msg, 2, function() {
  57. window.location.reload();
  58. });
  59. } else {
  60. showLayerAlert(res.msg);
  61. }
  62. },
  63. error: function(e) {
  64. layer.closeAll();
  65. showLayerAlert(e.responseText);
  66. }
  67. });
  68. });
  69. }