browse.ui.js 973 B

1234567891011121314151617181920212223242526272829303132333435
  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 url = $(this).data('url');
  7. const form = new FormData();
  8. checkedList.forEach((id) => form.append('feedbackIDList[]', id));
  9. if($(this).hasClass('ajax-btn'))
  10. {
  11. $.ajaxSubmit({url, data:form});
  12. }
  13. else
  14. {
  15. postAndLoadPage(url, form);
  16. }
  17. });
  18. window.renderCell = function(result, info)
  19. {
  20. if(info.col.name == 'title' && result)
  21. {
  22. const module = this.options.modules[info.row.data.module];
  23. if(module) result.unshift({html: '<span class="label gray-pale rounded-full whitespace-nowrap w-auto">' + module + '</span>'}); // 添加模块标签
  24. }
  25. if(info.col.name == 'status' && result)
  26. {
  27. result[0].props.children = info.row.data.realStatus;
  28. }
  29. return result;
  30. };