From 093e51dec49c8f6eb7509cfed584bb58e7b88058 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 16 Dec 2024 11:26:15 +0800 Subject: [PATCH] * [refac bug #57891] Adjust for check task delay. --- module/project/js/execution.ui.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/module/project/js/execution.ui.js b/module/project/js/execution.ui.js index c587190a81..5d522dbaf3 100644 --- a/module/project/js/execution.ui.js +++ b/module/project/js/execution.ui.js @@ -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 += `${executionType} `; executionName += '
'; - executionName += (executionType !== undefined && !row.data.isParent) ? `${row.data.name}` : row.data.name; + executionName += (executionType !== undefined && !data.isParent) ? `${data.name}` : data.name; executionName += '
'; - executionName += (!['done', 'closed', 'suspended'].includes(row.data.status) && row.data.type != 'point' && row.data.end != '' && today > row.data.end) ? '' + (typeof row.data.delay != 'undefined' ? delayWarning.replace('%s', row.data.delay) : delayed) + '' : ''; + executionName += (!['done', 'closed', 'suspended'].includes(data.status) && data.type != 'point' && data.end != '' && data.end != '0000-00-00' && today > data.end) ? '' + (typeof data.delay != 'undefined' ? delayWarning.replace('%s', data.delay) : delayed) + '' : ''; 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; }