diff --git a/module/project/config/dtable.php b/module/project/config/dtable.php index 46ab52279d..f3046340e9 100755 --- a/module/project/config/dtable.php +++ b/module/project/config/dtable.php @@ -401,7 +401,7 @@ $config->project->dtable->testtask->fieldList['product']['title'] = $lang->testt $config->project->dtable->testtask->fieldList['product']['type'] = 'text'; $config->project->dtable->testtask->fieldList['product']['group'] = '1'; -$config->project->dtable->testtask->fieldList['id']['name'] = 'id'; +$config->project->dtable->testtask->fieldList['id']['name'] = 'idAB'; $config->project->dtable->testtask->fieldList['id']['title'] = $lang->idAB; $config->project->dtable->testtask->fieldList['id']['type'] = 'id'; $config->project->dtable->testtask->fieldList['id']['checkbox'] = true; diff --git a/module/project/js/testtask.ui.js b/module/project/js/testtask.ui.js index 7a357577cb..efdc8a516a 100644 --- a/module/project/js/testtask.ui.js +++ b/module/project/js/testtask.ui.js @@ -32,7 +32,7 @@ window.getCellSpan = function(cell) { return {rowSpan: cell.row.data.rowspan}; } - if(cell.col.name == 'id' && cell.row.data.colspan) + if(cell.col.name == 'idAB' && cell.row.data.colspan) { return {colSpan: cell.row.data.colspan}; } @@ -61,7 +61,7 @@ window.onRenderCell = function(result, {row, col}) result.push({outer: false, style: {alignItems: 'start', 'padding-top': '8px'}}) } } - if(result && col.name == 'id' && row.data.hidden) + if(result && col.name == 'idAB' && row.data.hidden) { result.push({outer: false, style: {alignItems: 'center', justifyContent: 'start'}}) } @@ -108,7 +108,7 @@ window.deformation = function(event) { if(data && data.product == product) { - options.data[index].id = {html: '' + allTasks + ' ' + '' + data.rowspan + ''}; + options.data[index].idAB = {html: '' + allTasks + ' ' + '' + data.rowspan + ''}; options.data[index].rowspan = 1; options.data[index].colspan = 10; options.data[index].hidden = 1; @@ -172,3 +172,21 @@ window.setStatistics = function(element, checkedIDList) .replace('%done%', doneCount) }; } + +/** + * 判断当前行是否可以选中。 + * Judge whether the row can be selected. + * + * @param string rowID + * @access public + * @return object + */ +window.canRowCheckable = function(rowID) +{ + let checkable = true; + $.each(this.options.data, function(index, data) + { + if(data.id == rowID && data.hidden == 1) checkable = false; + }); + return checkable; +} diff --git a/module/project/ui/testtask.html.php b/module/project/ui/testtask.html.php index fe6ef6eb6f..e598b06856 100644 --- a/module/project/ui/testtask.html.php +++ b/module/project/ui/testtask.html.php @@ -61,6 +61,7 @@ dtable set::cols($config->project->dtable->testtask->fieldList), set::data($tasks), set::onRenderCell(jsRaw('window.onRenderCell')), + set::canRowCheckable(jsRaw('window.canRowCheckable')), set::taskData($tasks), set::userMap($users), set::orderBy($orderBy), diff --git a/module/testtask/model.php b/module/testtask/model.php index 9cb2fd2a08..f30cb77235 100755 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -152,7 +152,7 @@ class testtaskModel extends model */ public function getProjectTasks(int $projectID, string $orderBy = 'id_desc', object $pager = null): array { - $tasks = $this->dao->select('t1.*, t5.multiple, IF(t4.shadow = 1, t5.name, t4.name) AS productName, t3.name AS executionName, t2.name AS buildName, t2.branch AS branch, t5.name AS projectName, t4.order as productOrder') + $tasks = $this->dao->select('t1.*, t1.id as idAB, t5.multiple, IF(t4.shadow = 1, t5.name, t4.name) AS productName, t3.name AS executionName, t2.name AS buildName, t2.branch AS branch, t5.name AS projectName, t4.order as productOrder') ->from(TABLE_TESTTASK)->alias('t1') ->leftJoin(TABLE_BUILD)->alias('t2')->on('t1.build = t2.id') ->leftJoin(TABLE_EXECUTION)->alias('t3')->on('t1.execution = t3.id')