* Finish task #42144.

This commit is contained in:
hufangzhou
2021-09-03 09:40:11 +08:00
parent 4eee4d5523
commit 67cc48e3cb
3 changed files with 80 additions and 69 deletions
+28 -24
View File
@@ -11,17 +11,17 @@
#navTabs>li.active>a, .nav-tabs>li.active>a:focus, .nav-tabs>li.active>a:hover {border: none;}
#tabContent {margin-top: 10px; z-index: 900;}
#tabContent ul {list-style: none; margin: 0}
#tabContent .tab-pane>ul {padding-left: 7px;}
#tabContent .tab-pane>ul>li>div {display: flex; flex-flow: row nowrap; justify-content: flex-start; align-items: center;}
#tabContent .tab-pane>ul>li label {background: rgba(255,255,255,0.5); line-height: unset; color: #838a9d; border: 1px solid #d8d8d8; border-radius: 2px; padding: 1px 4px;}
#tabContent li a i.icon {font-size: 15px !important;}
#tabContent li a i.icon:before {min-width: 16px !important;}
#tabContent li .label {position: unset; margin-bottom: 0;}
#tabContent li>a, #tabContent li>div>a {display: block; padding: 2px 10px 2px 5px; overflow: hidden; line-height: 20px; text-overflow: ellipsis; white-space: nowrap; border-radius: 4px;}
#tabContent li>a.selected {color: #e9f2fb; background-color: #0c64eb;}
#tabContent .tree li>.list-toggle {line-height: 24px;}
#tabContent .tree li.has-list.open:before {content: unset;}
.executionTree ul {list-style: none; margin: 0}
.executionTree .executions>ul {padding-left: 7px;}
.executionTree .executions>ul>li>div {display: flex; flex-flow: row nowrap; justify-content: flex-start; align-items: center;}
.executionTree .executions>ul>li label {background: rgba(255,255,255,0.5); line-height: unset; color: #838a9d; border: 1px solid #d8d8d8; border-radius: 2px; padding: 1px 4px;}
.executionTree li a i.icon {font-size: 15px !important;}
.executionTree li a i.icon:before {min-width: 16px !important;}
.executionTree li .label {position: unset; margin-bottom: 0;}
.executionTree li>a, div.hide-in-search>a {display: block; padding: 2px 10px 2px 5px; overflow: hidden; line-height: 20px; text-overflow: ellipsis; white-space: nowrap; border-radius: 4px;}
.executionTree li>a.selected {color: #e9f2fb; background-color: #0c64eb;}
.executionTree .tree li>.list-toggle {line-height: 24px;}
.executionTree .tree li.has-list.open:before {content: unset;}
#swapper li>div.hide-in-search>a:focus, #swapper li>div.hide-in-search>a:hover {color: #838a9d; cursor: default;}
a.executionName:focus, a.executionName:hover {background: #0c64eb; color: #fff !important;}
@@ -29,12 +29,12 @@ a.executionName:focus, a.executionName:hover {background: #0c64eb; color: #fff !
#swapper li > a {padding-top: 4px; padding-bottom: 4px;}
#swapper li {padding-top: 0; padding-bottom: 0;}
#swapper .tree li>.list-toggle {top: -1px;}
.col-right {padding-top: 30px;}
</style>
<?php
$executionCounts = array();
$executionNames = array();
$preFix = '';
$closedExecutionsHtml = '';
$tabActive = '';
$myExecutions = 0;
$others = 0;
@@ -44,19 +44,21 @@ foreach($executions as $projectID => $projectExecutions)
{
$executionCounts[$projectID]['myExecution'] = 0;
$executionCounts[$projectID]['others'] = 0;
$executionCounts[$projectID]['closed'] = 0;
foreach($projectExecutions as $execution)
{
if($execution->status != 'done' and $execution->status != 'closed' and ($execution->PM == $this->app->user->account or isset($execution->teams[$this->app->user->account]))) $executionCounts[$projectID]['myExecution'] ++;
if($execution->status != 'done' and $execution->status != 'closed' and $execution->PM != $this->app->user->account and !isset($execution->teams[$this->app->user->account])) $executionCounts[$projectID]['others'] ++;
if($execution->status == 'done' or $execution->status == 'closed') $dones ++;
if($execution->status == 'done' or $execution->status == 'closed') $executionCounts[$projectID]['closed'] ++;
$executionNames[] = $execution->name;
}
}
$executionsPinYin = common::convert2Pinyin($executionNames);
$myExecutionsHtml = $config->systemMode == 'new' ? '<ul class="tree tree-angles" data-ride="tree">' : '<ul class="noProgram">';
$normalExecutionsHtml = $config->systemMode == 'new' ? '<ul class="tree tree-angles" data-ride="tree">' : '<ul class="noProgram">';
$myExecutionsHtml = $config->systemMode == 'new' ? '<ul class="tree tree-angles" data-ride="tree">' : '<ul class="noProject">';
$normalExecutionsHtml = $config->systemMode == 'new' ? '<ul class="tree tree-angles" data-ride="tree">' : '<ul class="noProject">';
$closedExecutionsHtml = $config->systemMode == 'new' ? '<ul class="tree tree-angles" data-ride="tree">' : '<ul class="noProject">';
foreach($executions as $projectID => $projectExecutions)
{
@@ -64,10 +66,10 @@ foreach($executions as $projectID => $projectExecutions)
if($projectID and $config->systemMode == 'new')
{
$projectName = zget($projects, $projectID);
$preFix = $projectName . ' / ';
if($executionCounts[$projectID]['myExecution']) $myExecutionsHtml .= '<li><div class="hide-in-search"><a class="text-muted" title="' . $projectName . '">' . $projectName . '</a> <label class="label">' . $lang->project->common . '</label></div><ul>';
if($executionCounts[$projectID]['others']) $normalExecutionsHtml .= '<li><div class="hide-in-search"><a class="text-muted" title="' . $projectName . '">' . $projectName . '</a> <label class="label">' . $lang->project->common . '</label></div><ul>';
if($executionCounts[$projectID]['closed']) $closedExecutionsHtml .= '<li><div class="hide-in-search"><a class="text-muted" title="' . $projectName . '">' . $projectName . '</a> <label class="label">' . $lang->project->common . '</label></div><ul>';
}
foreach($projectExecutions as $index => $execution)
@@ -91,7 +93,7 @@ foreach($executions as $projectID => $projectExecutions)
}
else if($execution->status == 'done' or $execution->status == 'closed')
{
$closedExecutionsHtml .= html::a(sprintf($link, $execution->id), $preFix . $execution->name, '', "class='$selected' title='" . $preFix . $execution->name . "' data-key='" . zget($executionsPinYin, $execution->name, '') . "' data-app='{$this->app->tab}'");
$closedExecutionsHtml .= '<li>' . html::a(sprintf($link, $execution->id), $execution->name, '', "class='$selected' title='$execution->name' data-key='" . zget($executionsPinYin, $execution->name, '') . "' data-app='{$this->app->tab}'") . '</li>';
if($selected == 'selected') $tabActive = 'closed';
}
@@ -101,11 +103,13 @@ foreach($executions as $projectID => $projectExecutions)
{
if($executionCounts[$projectID]['myExecution']) $myExecutionsHtml .= '</ul></li>';
if($executionCounts[$projectID]['others']) $normalExecutionsHtml .= '</ul></li>';
if($executionCounts[$projectID]['closed']) $closedExecutionsHtml .= '</ul></li>';
}
}
}
$myExecutionsHtml .= '</ul>';
$normalExecutionsHtml .= '</ul>';
$closedExecutionsHtml .= '</ul>';
?>
<div class="table-row">
<div class="table-col col-left">
@@ -117,11 +121,11 @@ $normalExecutionsHtml .= '</ul>';
<li class="<?php if($tabActive == 'other') echo 'active';?>"><?php echo html::a('#other', $lang->project->other, '', "data-toggle='tab' class='not-list-item not-clear-menu'")?><span class="label label-light label-badge"><?php echo $others;?></span><li>
</ul>
<?php endif;?>
<div class="tab-content" id="tabContent">
<div class="tab-pane <?php if($tabActive == 'myExecution') echo 'active';?>" id="myExecution">
<div class="tab-content executionTree" id="tabContent">
<div class="tab-pane executions <?php if($tabActive == 'myExecution') echo 'active';?>" id="myExecution">
<?php echo $myExecutionsHtml;?>
</div>
<div class="tab-pane <?php if($tabActive == 'other') echo 'active';?>" id="other">
<div class="tab-pane executions <?php if($tabActive == 'other') echo 'active';?>" id="other">
<?php echo $normalExecutionsHtml;?>
</div>
</div>
@@ -130,8 +134,8 @@ $normalExecutionsHtml .= '</ul>';
<a class='pull-right toggle-right-col not-list-item'><?php echo $lang->execution->doneExecutions;?><i class='icon icon-angle-right'></i></a>
</div>
</div>
<div class="table-col col-right">
<div class='list-group'><?php echo $closedExecutionsHtml;?></div>
<div class="table-col col-right executionTree">
<div class='list-group executions'><?php echo $closedExecutionsHtml;?></div>
</div>
</div>
<script>scrollToSelected();</script>
@@ -147,7 +151,7 @@ $(function()
$(this).parent().siblings('li').find('span').hide();
})
$('#tabContent [data-ride="tree"]').tree('expand');
$('#swapper [data-ride="tree"]').tree('expand');
$('#swapper #dropMenu .search-box').on('onSearchChange', function(event, value)
{