From b02394bd59f18e0159593a9b5ffd86e21bd6a03f Mon Sep 17 00:00:00 2001 From: wangyidong Date: Sat, 13 Jul 2024 10:56:02 +0800 Subject: [PATCH] * [perf story #59018] Set gantt templates config for initGantt for gantt wg. --- lib/zin/wg/gantt/js/v1.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/zin/wg/gantt/js/v1.js b/lib/zin/wg/gantt/js/v1.js index 4c0cad121f..342841eba6 100644 --- a/lib/zin/wg/gantt/js/v1.js +++ b/lib/zin/wg/gantt/js/v1.js @@ -471,6 +471,25 @@ function initGantt() text: ganttLang.today, title: ganttLang.today + ": " + date2Str(today) }); + + gantt.templates.grid_folder = function(item) { return "" }; + gantt.templates.grid_file = function(item) { return "" }; + gantt.templates.task_class = function(start, end, task){return 'pri-' + (task.pri || 0);}; + gantt.templates.rightside_text = function(start, end, task) + { + if(typeof task.owner_id == 'undefined') return; + if(task.type == 'point') return "" + task.status + ''; + return getByIdForGantt(gantt.serverList('userList'), task.owner_id); + }; + + gantt.templates.link_class = function(link) + { + let types = gantt.config.links; + if(link.type == types.finish_to_start) return 'finish_to_start'; + if(link.type == types.start_to_start) return 'start_to_start'; + if(link.type == types.finish_to_finish) return 'finish_to_finish'; + if(link.type == types.start_to_finish) return 'start_to_finish'; + }; } $(function()