Files
EasySoft-ZenTaoPMS/module/project/js/execution.ui.js
T

46 lines
1.3 KiB
JavaScript

function showTask()
{
var show = $('#showTask').is(':checked') ? 1 : 0;
$.cookie.set('showTask', show, {expires:config.cookieLife, path:config.webRoot});
const link = $.createLink('project', 'execution', 'status=' + status + '&projectID=' + projectID + '&orderBy=' + orderBy + '&productID=' + productID);
loadPage(link);
}
$(document).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('executionIDList[]', id.replace("pid", '')));
if($(this).hasClass('ajax-btn'))
{
$.ajaxSubmit({url, data:form});
}
else
{
postAndLoadPage(url, form);
}
});
/**
* 提示并删除执行。
* Delete execution with tips.
*
* @param int executionID
* @param string executionName
* @access public
* @return void
*/
window.confirmDeleteExecution = function(executionID, confirmDeleteTip)
{
zui.Modal.confirm({message: confirmDeleteTip, icon:'icon-info-sign', iconClass: 'warning-pale rounded-full icon-2x'}).then((res) =>
{
if(res) $.ajaxSubmit({url: $.createLink('execution', 'delete', 'executionID=' + executionID + '&comfirm=yes')});
});
}