From b37876ba175b245cd0ca242584cf8c2b9023d4f9 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 18 Oct 2023 11:24:14 +0800 Subject: [PATCH] + Add a module label to the task name according to the display setting. --- module/execution/control.php | 7 +++++-- module/execution/js/task.ui.js | 4 ++++ module/execution/ui/task.html.php | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 20e4ae71ec..9e55e21460 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -167,7 +167,9 @@ class execution extends control if(isset($branchGroups[$task->product][$task->branch])) $task->branch = $branchGroups[$task->product][$task->branch]; } - $showModule = empty($this->config->execution->task->allModule) ? '' : 'allModule'; + $showAllModule = empty($this->config->execution->task->allModule) ? '' : 'allModule'; + $showModule = !empty($this->config->execution->task->showModule) ? $this->config->execution->task->showModule : ''; + $this->view->title = $execution->name . $this->lang->colon . $this->lang->execution->task; $this->view->tasks = $tasks; $this->view->pager = $pager; @@ -176,7 +178,8 @@ class execution extends control $this->view->status = $status; $this->view->param = $param; $this->view->moduleID = $moduleID; - $this->view->modules = $this->loadModel('tree')->getTaskOptionMenu($executionID, 0, $showModule); + $this->view->modules = $this->loadModel('tree')->getTaskOptionMenu($executionID, 0, $showAllModule); + $this->view->modulePairs = $this->tree->getModulePairs($executionID, 'task', $showModule); $this->view->moduleTree = $this->tree->getTaskTreeMenu($executionID, $productID, 0, array('treeModel', 'createTaskLink'), $showModule); $this->view->memberPairs = $memberPairs; $this->display(); diff --git a/module/execution/js/task.ui.js b/module/execution/js/task.ui.js index 42dd119064..b6424166d4 100644 --- a/module/execution/js/task.ui.js +++ b/module/execution/js/task.ui.js @@ -100,6 +100,10 @@ window.renderCell = function(result, info) { const task = info.row.data; let html = ''; + + const module = this.options.modules[info.row.data.module]; + if(module) html += '' + module + ''; // 添加模块标签 + if(task.team) { html += "" + multipleAB + ""; diff --git a/module/execution/ui/task.html.php b/module/execution/ui/task.html.php index b06b8d0c99..4b6845ebf6 100644 --- a/module/execution/ui/task.html.php +++ b/module/execution/ui/task.html.php @@ -198,6 +198,7 @@ dtable set::checkable($canBatchAction), set::sortLink(jsRaw('createSortLink')), set::onRenderCell(jsRaw('window.renderCell')), + set::modules($modulePairs), set::footToolbar($footToolbar), set::footPager(usePager(array (