diff --git a/lib/zin/wg/gantt/js/v1.js b/lib/zin/wg/gantt/js/v1.js index 2bdd2d8bfd..1ae73b5c38 100644 --- a/lib/zin/wg/gantt/js/v1.js +++ b/lib/zin/wg/gantt/js/v1.js @@ -646,11 +646,11 @@ function initGantt() resizeGanttView(); $(window).off('.gannt').on('resize.gannt', function(){resizeGanttView()}); - if(typeof isSearch != 'undefined' && isSearch) - { - gantt._clear_data(); - ganttData.links = []; - } + /* 渲染甘特图时先清空原有数据。 */ + gantt._clear_data(); + /* 搜索时隐藏任务关系。 */ + if(typeof isSearch != 'undefined' && isSearch) ganttData.links = []; + gantt.init(ganttID); gantt.parse(ganttData); gantt.showDate(new Date()); diff --git a/module/programplan/ui/gantt.html.php b/module/programplan/ui/gantt.html.php index 8e3fcccf36..4f2312d020 100644 --- a/module/programplan/ui/gantt.html.php +++ b/module/programplan/ui/gantt.html.php @@ -18,28 +18,24 @@ include './ganttfields.html.php'; if($app->rawModule == 'programplan') { + $productDropdown = null; if($project->stageBy == 'product') { $viewName = $productID != 0 ? zget($productList, $productID) : $lang->product->allProduct; $items = array(); foreach($productList as $key => $productName) $items[] = array('text' => $productName, 'url' => $this->createLink('programplan', 'browse', "projectID=$projectID&productID=$key&type=gantt")); - featureBar + $productDropdown = dropdown ( - dropdown - ( - btn(set::type('link'), setClass('no-underline'), $viewName), - set::items($items) - ) - ); - } - else - { - featureBar - ( - btn(setClass('ghost mr-2', ($browseType != 'bysearch' ? 'active' : '')), $lang->programplan->gantt, set::url($this->createLink('programplan', 'browse', "projectID=$projectID&productID=$productID&type=gantt"))), - $hasSearch ? li(searchToggle(set::module('projectTask'), set::open($browseType == 'bysearch'))) : null + btn(set::type('link'), setClass('no-underline'), $viewName), + set::items($items) ); } + featureBar + ( + btn(setClass('ghost mr-2', ($browseType != 'bysearch' ? 'active' : '')), $lang->programplan->gantt, set::url($this->createLink('programplan', 'browse', "projectID=$projectID&productID=$productID&type=gantt"))), + $productDropdown, + $hasSearch ? li(searchToggle(set::module('projectTask'), set::open($browseType == 'bysearch'))) : null + ); toolbar ( btnGroup