* [task#133222,doing,0.5h] add delay tip in execution::task.

This commit is contained in:
liumengyi
2024-12-03 13:25:42 +08:00
committed by 田淑杰
parent 61967aa5ba
commit 0fc9a67f98
3 changed files with 16 additions and 0 deletions
+3
View File
@@ -108,6 +108,7 @@ window.renderCell = function(result, info)
if(info.col.name == 'name' && result)
{
let html = '';
if(typeof result[0] == 'object') result[0].props.className = 'overflow-hidden';
const module = this.options.modules[info.row.data.module];
if(module) html += '<span class="label gray-pale rounded-full mr-1 whitespace-nowrap">' + module + '</span>'; // 添加模块标签
@@ -122,6 +123,8 @@ window.renderCell = function(result, info)
}
if(task.color) result[0].props.style = 'color: ' + task.color;
if(html) result.unshift({html});
if(typeof task.delay != 'undefined' && task.delay) result[result.length] = {html:'<span class="label danger-pale ml-1 flex-none nowrap">' + delayWarning.replace('%s', task.delay) + '</span>', className: 'flex items-end', style:{flexDirection:"column"}};
if(task.fromBug > 0)
{
+12
View File
@@ -1931,11 +1931,23 @@ class executionModel extends model
$taskIdList = array_unique($taskIdList);
$teamGroups = $this->dao->select('id,task,account,status')->from(TABLE_TASKTEAM)->where('task')->in($taskIdList)->fetchGroup('task', 'id');
$today = helper::today();
foreach($executionTasks as $tasks)
{
foreach($tasks as $task)
{
if(isset($teamGroups[$task->id])) $task->team = $teamGroups[$task->id];
/* Delayed or not?. */
if(!empty($task->deadline) and !helper::isZeroDate($task->deadline))
{
$endDate = $today;
if(($task->status == 'done' || $task->status == 'closed') && !helper::isZeroDate($task->finishedDate)) $endDate = substr($task->finishedDate, 0, 10);
$actualDays = $this->loadModel('holiday')->getActualWorkingDays($task->deadline, $endDate);
$delay = count($actualDays) - 1;
if($delay > 0) $task->delay = $delay;
}
}
}
+1
View File
@@ -204,6 +204,7 @@ jsVar('childrenAB', $lang->task->childrenAB);
jsVar('todayLabel', $lang->today);
jsVar('yesterdayLabel', $lang->yesterday);
jsVar('teamLang', $lang->task->team);
jsVar('delayWarning', $lang->task->delayWarning);
dtable
(