$(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 $target = $(this); if($target.hasClass('batch-close-btn')) { const getNonClosableLink = $.createLink('execution', 'ajaxGetNonClosableExecutions', 'executionID=' + checkedList.join(',')); $.getJSON(getNonClosableLink, function(exeuctions) { if(!exeuctions || exeuctions.length == 0) { postBatchBtn($target, checkedList); return; } const confirmCloseTip = confirmBatchCloseExecution.replace('%s', exeuctions.join(', ')); zui.Modal.confirm(confirmCloseTip).then((res) => { if(res) postBatchBtn($target, checkedList); }); }); } else { postBatchBtn($target, checkedList); } }); const today = zui.formatDate(new Date(), 'yyyy-MM-dd'); window.onRenderCell = function(result, {col, row}) { if(col.name == 'nameCol') { const executionLink = $.createLink('execution', 'task', `executionID=${row.data.rawID}`); const executionType = typeList[row.data.type]; let executionName = `${executionType} `; executionName += '