* Add epic js.

This commit is contained in:
sunguangming
2024-05-14 09:54:38 +08:00
parent 5ca291af4e
commit 9e0ec4bb56
+19
View File
@@ -0,0 +1,19 @@
$(document).off('click', '.batch-btn').on('click', '.batch-btn', function()
{
const dtable = zui.DTable.query($(this).target);
const checkedList = dtable.$.getChecks();
if(!checkedList.length) return;
const url = $(this).data('url');
const form = new FormData();
checkedList.forEach((id) => form.append('storyIdList[]', id));
if($(this).hasClass('ajax-btn'))
{
$.ajaxSubmit({url, data: form});
}
else
{
postAndLoadPage(url, form);
}
});