From 9e0ec4bb560ae947e1fbeb4abfb851c633093ab2 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Tue, 14 May 2024 09:54:38 +0800 Subject: [PATCH] * Add epic js. --- module/my/js/epic.ui.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 module/my/js/epic.ui.js diff --git a/module/my/js/epic.ui.js b/module/my/js/epic.ui.js new file mode 100644 index 0000000000..b2d71163be --- /dev/null +++ b/module/my/js/epic.ui.js @@ -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); + } +});