zentaomax.ui.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * 产品列合并单元格。
  3. * Merge cell in the product column.
  4. *
  5. * @param object cell
  6. * @access public
  7. * @return object
  8. */
  9. window.getCellSpan = function(cell)
  10. {
  11. if(!['buildName', 'productName', 'executionName'].includes(cell.col.name) && cell.row.data.trowspan)
  12. {
  13. return {rowSpan: cell.row.data.trowspan};
  14. }
  15. if(['productName'].includes(cell.col.name) && cell.row.data.prowspan)
  16. {
  17. return {rowSpan: cell.row.data.prowspan};
  18. }
  19. }
  20. /**
  21. * 产品列显示展开收起的图标。
  22. * Display show icon in the product column.
  23. *
  24. * @param object result
  25. * @param object info
  26. * @access public
  27. * @return object
  28. */
  29. window.onRenderCell = function(result, {row, col})
  30. {
  31. if(result && col.name == 'name' && row.data.joint == 1)
  32. {
  33. result.push({html: "<i class='icon icon-code-fork'></i>"});
  34. }
  35. if(result && col.name == 'idName' && row.data.hidden)
  36. {
  37. result.push({outer: false, style: {alignItems: 'center', justifyContent: 'start'}})
  38. }
  39. if(col.name == 'status' && result)
  40. {
  41. result[0] = {html: `<span class='status-${row.data.rawStatus}'>` + row.data.status + "</span>"};
  42. }
  43. return result;
  44. }