execution.ui.js 1.2 KB

123456789101112131415161718192021
  1. const today = zui.formatDate(new Date(), 'yyyy-MM-dd');
  2. window.onRenderExecutionCell = function(result, info)
  3. {
  4. if(info.col.name === 'name' && (systemMode == 'ALM' || systemMode == 'PLM'))
  5. {
  6. const executionLink = $.createLink('execution', 'task', `executionID=${info.row.id}`);
  7. const executionType = typeList[info.row.data.type];
  8. let executionName = `<span class='label secondary-pale flex-none'>${executionType}</span> `;
  9. executionName += '<div class="ml-1 clip" style="width: max-content;">';
  10. executionName += (!info.row.data.isParent && typeof result[0] != 'string') ? `<a href="${executionLink}" class="text-primary">${info.row.data.name}</a>` : info.row.data.name;
  11. executionName += '</div>';
  12. executionName += (!['done', 'closed', 'suspended'].includes(info.row.data.status) && today > info.row.data.end) ? '<span class="label danger-pale ml-1 flex-none">' + delayWarning.replace('%s', info.row.data.delay) + '</span>' : '';
  13. result[0] = {html: executionName, className: 'w-full flex items-center'};
  14. return result;
  15. }
  16. if(['estimate', 'consumed','left'].includes(info.col.name) && result) result[0] = {html: result[0] + ' h'};
  17. return result;
  18. }