window.renderCell = function(result, {col, row})
{
if(col.name == 'path')
{
result[0] = '';
if(row.data.pathType == 'scmPath' && row.data.scmPath)
{
const colorStyle = row.data.scmPath.indexOf('http') === 0 ? "style='color:#2463c7;'" : '';
let scmPathHtml = '';
scmPathHtml += "
";
scmPathHtml += "
";
scmPathHtml += colorStyle.length ? "" + row.data.scmPath + "" : row.data.scmPath;
scmPathHtml += ' ';
result[result.length] = {html: scmPathHtml};
}
if(row.data.pathType == 'filePath' && row.data.filePath)
{
const colorStyle = row.data.filePath.indexOf('http') === 0 ? "style='color:#2463c7;'" : '';
let filePathHtml = '';
filePathHtml += " ";
filePathHtml += "
";
filePathHtml += colorStyle.length ? "" + row.data.filePath + "" : row.data.filePath;
filePathHtml += ' ';
result[result.length] = {html: filePathHtml};
}
return result;
}
if(col.name == 'name' && row.data.execution == 0)
{
result[0].props.className = 'overflow-hidden';
result[result.length] = {html:'' + integratedTip + '', className:'flex items-end', style:{flexDirection:"column"}};
return result;
}
if(col.name == 'executionName')
{
let executionHtml = "" + row.data.executionName + '';
if(row.data.executionDeleted == 1) executionHtml += " " + deletedTip + '';
result[0] = {html: executionHtml};
return result;
}
return result;
}
/**
* Change product.
*
* @access public
* @return void
*/
window.changeProduct = function(e)
{
const link = changeProductLink.replace('{productID}', $(e.target).val());
loadPage(link);
}
/**
* 合并单元格。
* cell span in the column.
*
* @param object cell
* @access public
* @return object
*/
window.getCellSpan = function(cell)
{
if(['id', 'name', 'productName', 'branchName', 'system', 'builder', 'date', 'actions'].includes(cell.col.name) && cell.row.data.rowspan)
{
return {rowSpan: cell.row.data.rowspan};
}
if(cell.col.name == 'path' && cell.row.data.pathRowspan)
{
return {rowSpan: cell.row.data.pathRowspan};
}
if(cell.col.name == 'execution' && cell.row.data.executionRowspan)
{
return {rowSpan: cell.row.data.executionRowspan};
}
}