* [refac] Adjust gantt height.

This commit is contained in:
wangyidong
2024-07-16 15:45:38 +08:00
committed by 田淑杰
parent 1d3c3bc894
commit ffd57ec4c5
3 changed files with 17 additions and 10 deletions
+9 -2
View File
@@ -353,9 +353,16 @@ function initGantt()
let resizeGanttView = function()
{
if(gantt.getState().fullscreen) return false;
$('#' + ganttID).css('height', Math.max(200, Math.floor($(window).height() - $('#header').outerHeight() - $('#mainMenu').outerHeight() - 5)));
};
let ganttHeight = $(window).height() - $('#header').height();
if($('#mainNavbar').length) ganttHeight -= $('#mainNavbar').height();
if($('#mainMenu').length) ganttHeight -= $('#mainMenu').height();
if($('.detail-header').length) ganttHeight -= $('.detail-header').height();
ganttHeight -= 30;
if(height) ganttHeight = height;
$('#' + ganttID).css('height', Math.max(200, ganttHeight));
};
let getDeadlineBtn = function(task)
{
+7 -5
View File
@@ -58,10 +58,11 @@ class gantt extends wg
$cssFile = $app->getWebRoot() . 'js/dhtmlxgantt/min.css';
$jsFile = $app->getWebRoot() . 'js/dhtmlxgantt/min.js';
list($id, $zooming, $colsWidth) = $this->prop(array('id', 'zooming', 'colsWidth'));
if(empty($id)) $id = 'ganttView';
if(empty($zooming)) $zooming = 'day';
if(empty($colsWidth)) $colsWidth = '600';
list($id, $zooming, $colsWidth, $showChart) = $this->prop(array('id', 'zooming', 'colsWidth', 'showChart'));
if(empty($id)) $id = 'ganttView';
if(empty($zooming)) $zooming = 'day';
if(empty($colsWidth)) $colsWidth = '600';
if($showChart !== false) $showChart = true;
$fileName = data('fileName');
$ganttType = data('ganttType');
@@ -83,14 +84,15 @@ class gantt extends wg
jsVar('ganttType', $ganttType),
jsVar('showFields', $showFields),
jsVar('colsWidth', $colsWidth),
jsVar('showChart', $showChart),
jsVar('userList', $this->getUserList()),
jsVar('ganttLang', $this->prop('ganttLang')),
jsVar('canGanttEdit', $this->prop('canEdit')),
jsVar('canEditDeadline', $this->prop('canEditDeadline')),
jsVar('ganttFields', $this->prop('ganttFields')),
jsVar('showChart', $this->prop('showChart')),
jsVar('zooming', $this->prop('zooming')),
jsVar('options', $this->prop('options')),
jsVar('height', (int)$this->prop('height')),
setID('ganttContainer'),
div(setID($id), setClass('gantt')),
div(setID('myCover'), div(setID('gantt_here')))
+1 -3
View File
@@ -58,12 +58,10 @@ if($app->rawModule == 'programplan')
gantt
(
setID('ganttView'),
set('ganttLang', $ganttLang),
set('ganttFields', $ganttFields),
set('canEdit', common::hasPriv('programplan', 'ganttEdit')),
set('canEditDeadline', common::hasPriv('review', 'edit')),
set('ganttFields', $ganttFields),
set('showChart', true),
set('zooming', isset($zooming) ? $zooming : 'day'),
set('options', $plans)
);