v1.js 537 B

12345678910111213141516171819
  1. /**
  2. * 计算数据表格的高度。
  3. * Calculate height of data table.
  4. *
  5. * @param int height
  6. * @access public
  7. * @return int
  8. */
  9. window.getHeight = function(height = 800, filterCount = 0)
  10. {
  11. const dtableContent = $('#stepContent .dtable-content').height();
  12. const titleContent = 48 + 8 * 2;
  13. const filterRows = Math.ceil(filterCount / 2);
  14. let conditionHeight = filterRows * 40 + 16;
  15. if(filterCount != 0) conditionHeight += 8;
  16. return Math.min(dtableContent - titleContent - conditionHeight, height);
  17. }