* Fix stage-task tree list bug.

This commit is contained in:
孙广明
2022-07-14 13:29:23 +08:00
parent a7bbc6c953
commit 083ebb7f29
3 changed files with 8 additions and 7 deletions
+2 -2
View File
@@ -4327,13 +4327,13 @@ class executionModel extends model
} }
else else
{ {
$trClass = 'is-nest-child'; $trClass = 'table-nest-hide';
$trAttrs = "data-id={$execution->id} data-parent={$execution->parent}"; $trAttrs = "data-id={$execution->id} data-parent={$execution->parent}";
$trAttrs .= " data-nest-parent='$execution->parent' data-order='$execution->order' data-nest-path=',$execution->parent,$execution->id,'"; $trAttrs .= " data-nest-parent='$execution->parent' data-order='$execution->order' data-nest-path=',$execution->parent,$execution->id,'";
} }
$burns = join(',', $execution->burns); $burns = join(',', $execution->burns);
echo "<tr $trAttrs class=$trClass>"; echo "<tr $trAttrs class='$trClass'>";
echo "<td><span id=$execution->id class='table-nest-icon icon table-nest-toggle'></span>"; echo "<td><span id=$execution->id class='table-nest-icon icon table-nest-toggle'></span>";
if($this->config->systemMode == 'new') if($this->config->systemMode == 'new')
{ {
+1
View File
@@ -31,6 +31,7 @@ function loadData($showmore)
var executionID = $showmore.attr('data-parent'); var executionID = $showmore.attr('data-parent');
var maxTaskID = $showmore.attr('data-id'); var maxTaskID = $showmore.attr('data-id');
var maxTaskID = maxTaskID.replace('t', '');
var link = createLink('task', 'ajaxGetTasks', 'executionID=' + executionID + '&maxTaskID=' + maxTaskID); var link = createLink('task', 'ajaxGetTasks', 'executionID=' + executionID + '&maxTaskID=' + maxTaskID);
$.get(link, function(data) $.get(link, function(data)
{ {
+5 -5
View File
@@ -3760,19 +3760,19 @@ class taskModel extends model
public function buildNestedList($execution, $task, $isChild = false, $showmore = false, $users) public function buildNestedList($execution, $task, $isChild = false, $showmore = false, $users)
{ {
$showmore = $showmore ? 'showmore' : ''; $showmore = $showmore ? 'showmore' : '';
$trAttrs = "data-id=$task->id"; $trAttrs = "data-id='t$task->id'";
if(!$isChild) if(!$isChild)
{ {
$path = $execution->grade == 2 ? "$execution->parent,$execution->id,$task->id," : ",$execution->id,$task->id,"; $path = $execution->grade == 2 ? "$execution->parent,$execution->id,t$task->id," : ",$execution->id,t$task->id,";
$trAttrs .= " data-parent=$execution->id data-nest-parent=$execution->id data-nest-path=$path"; $trAttrs .= " data-parent='$execution->id' data-nest-parent='$execution->id' data-nest-path='$path'";
if(empty($task->children)) $trAttrs .= " data-nested='false'"; if(empty($task->children)) $trAttrs .= " data-nested='false'";
$trClass = empty($task->children) ? '' : " has-nest-child"; $trClass = empty($task->children) ? '' : " has-nest-child";
} }
else else
{ {
$path = $execution->grade == 2 ? "$execution->parent,$execution->id,$task->parent,$task->id," : ",$execution->id,$task->parent,$task->id,"; $path = $execution->grade == 2 ? "$execution->parent,$execution->id,$task->parent,t$task->id," : ",$execution->id,$task->parent,t$task->id,";
$trClass = 'is-nest-child no-nest'; $trClass = 'is-nest-child no-nest';
$trAttrs .= " data-nested='false' data-parent=$task->parent data-nest-parent=$task->parent data-nest-path=$path"; $trAttrs .= " data-nested='false' data-parent='t$task->parent' data-nest-parent='t$task->parent' data-nest-path='$path'";
} }
$list = "<tr $trAttrs class='$trClass $showmore'>"; $list = "<tr $trAttrs class='$trClass $showmore'>";