* [task#134016,doing,0.5h] add grade group.

This commit is contained in:
sunguangming
2024-12-16 09:11:04 +08:00
committed by 王怡栋
parent 9266b651da
commit 873e4a1df1
2 changed files with 20 additions and 0 deletions
+5
View File
@@ -588,6 +588,10 @@ class story extends control
$this->product->setMenu($story->product, $story->branch);
}
$gradeGroup = array();
$gradeList = $this->story->getGradeList('');
foreach($gradeList as $grade) $gradeGroup[$grade->type][$grade->grade] = $grade->name;
$this->view->title = "STORY #$story->id $story->title - $product->name";
$this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($product->id);
$this->view->users = $this->user->getPairs('noletter');
@@ -600,6 +604,7 @@ class story extends control
$this->view->product = $product;
$this->view->maxGradeGroup = $this->story->getMaxGradeGroup();
$this->view->gradePairs = $this->story->getGradePairs($story->type, 'all');
$this->view->gradeGroup = $gradeGroup;
$this->view->roadmaps = $this->config->edition == 'ipd' ? array(0 => '') + $this->loadModel('roadmap')->getPairs() : array();
$this->view->demand = $this->config->edition == 'ipd' ? $this->loadModel('demand')->getByID($story->demand) : new stdclass();
$this->view->showGrade = !empty($this->config->showStoryGrade);
+15
View File
@@ -36,3 +36,18 @@ window.waitDom('body.body-modal .toolbar', function()
{
$('.body-modal .toolbar a[data-load="modal"]').attr('data-toggle', 'modal').removeAttr('data-load');
})
window.renderChildCell = function(result, info)
{
if(info.col.name == 'title' && result)
{
let html = '';
const story = info.row.data;
const gradeMap = gradeGroup[story.type] || {};
let gradeLabel = gradeMap[story.grade];
if(gradeLabel) html += "<span class='label gray-pale rounded-xl clip'>" + gradeLabel + "</span> ";
if(html) result.unshift({html});
}
return result;
}