$(function () { // collapse click, toggle itself var urlParams = new URLSearchParams(window.location.search); var examId = urlParams.get('examId'); var caseId = urlParams.get('caseId'); $('table#report-list .collapse').click(function () { $(this).collapse('toggle'); }); // load table var reportListTable = $('#report-list').DataTable({ searching: false, pageLength: 25 }); // assign click $('#assign-btn').click(function () { // 修改assign-btn的文字以及让其处于不可用状态 $(this).attr('disabled', true); $(this).find('span').text('融合中...'); $.get('/aggregate', {examId: examId, caseId: caseId}, function () { setInterval(function () { $.get('/agg_task_status', {examId: examId, caseId: caseId}, function (result) { if (result == 1) { agg_success(); } }); }, 10000) }); }); $('#deliver-btn').click(function () { if (confirm("是否确定全部交付?") == true) { $(this).attr('disabled', true); $(this).find('span').text('处理中...'); $.get('/appendBugToFinalReport', {examId: examId, caseId: caseId}, function () { alert("处理完成"); location.reload(); }); } }); }); function agg_success() { var rand = Math.round(Math.random() * 100); var count = $('#report-list tbody tr').length; $('#report-list tbody tr').each(function (i, el) { setTimeout(function () { rand = Math.round(Math.random() * 100); // 在此条记录最后添加loading的图标 $(el).find('td:last').after('