* [refac bug #57891] Adjust for check task delay.

This commit is contained in:
wangyidong
2024-12-16 13:27:59 +08:00
committed by 孙广明
parent 5af8496fe6
commit 093e51dec4
+8 -7
View File
@@ -44,24 +44,25 @@ $(document).off('click','.batch-btn').on('click', '.batch-btn', function()
const today = zui.formatDate(new Date(), 'yyyy-MM-dd');
window.onRenderCell = function(result, {col, row})
{
const data = row.data;
if(col.name == 'nameCol')
{
const executionLink = $.createLink('execution', 'task', `executionID=${row.data.rawID}`);
const executionType = typeList[row.data.type];
const executionLink = $.createLink('execution', 'task', `executionID=${data.rawID}`);
const executionType = typeList[data.type];
let executionName = '';
if(typeof executionType != 'undefined') executionName += `<span class='label secondary-pale flex-none'>${executionType}</span> `;
executionName += '<div class="ml-1 clip flex items-center" style="width: max-content;">';
executionName += (executionType !== undefined && !row.data.isParent) ? `<a href="${executionLink}" class="text-primary">${row.data.name}</a>` : row.data.name;
executionName += (executionType !== undefined && !data.isParent) ? `<a href="${executionLink}" class="text-primary">${data.name}</a>` : data.name;
executionName += '</div>';
executionName += (!['done', 'closed', 'suspended'].includes(row.data.status) && row.data.type != 'point' && row.data.end != '' && today > row.data.end) ? '<span class="label danger-pale ml-1 flex-none">' + (typeof row.data.delay != 'undefined' ? delayWarning.replace('%s', row.data.delay) : delayed) + '</span>' : '';
executionName += (!['done', 'closed', 'suspended'].includes(data.status) && data.type != 'point' && data.end != '' && data.end != '0000-00-00' && today > data.end) ? '<span class="label danger-pale ml-1 flex-none">' + (typeof data.delay != 'undefined' ? delayWarning.replace('%s', data.delay) : delayed) + '</span>' : '';
result.push({html: executionName, className: 'w-full flex items-center'});
return result;
}
if(col.name == 'rawID' && row.data.parent && !row.data.isExecution) result.push({className: 'ml-5'});
if(['estimate', 'consumed', 'left'].includes(col.name) && result) result[0] = row.data.type == 'point' ? '' : {html: result[0] + ' h'};
if(col.name == 'progress' && row.data.type == 'point') result[0] = '';
if(col.name == 'rawID' && data.parent && !data.isExecution) result.push({className: 'ml-5'});
if(['estimate', 'consumed', 'left'].includes(col.name) && result) result[0] = data.type == 'point' ? '' : {html: result[0] + ' h'};
if(col.name == 'progress' && data.type == 'point') result[0] = '';
return result;
}