* [bug#50682,done,1h] hide checkbox if the row has been collapase.

This commit is contained in:
liumengyi
2024-06-12 15:07:04 +08:00
parent 97be618176
commit e2e691de0c
4 changed files with 24 additions and 5 deletions
+1 -1
View File
@@ -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;
+21 -3
View File
@@ -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: '<span class="text-gray">' + allTasks + ' ' + '<strong>' + data.rowspan + '</strong></span>'};
options.data[index].idAB = {html: '<span class="text-gray">' + allTasks + ' ' + '<strong>' + data.rowspan + '</strong></span>'};
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;
}
+1
View File
@@ -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),
+1 -1
View File
@@ -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')