* [bug#59554,done,4h] Get checked rows.
This commit is contained in:
@@ -64,14 +64,25 @@ window.onRenderCell = function(result, {row, col})
|
||||
return result;
|
||||
}
|
||||
|
||||
window.checkedChange = function(changes)
|
||||
{
|
||||
if(!this._checkedRows) this._checkedRows = {};
|
||||
Object.keys(changes).forEach((rowID) =>
|
||||
{
|
||||
const row = this.getRowInfo(rowID);
|
||||
this._checkedRows[rowID] = row.data;
|
||||
});
|
||||
}
|
||||
|
||||
window.insertListToDoc = function()
|
||||
{
|
||||
const dtable = zui.DTable.query($('#bugs'));
|
||||
const checkedList = dtable.$.getChecks();
|
||||
const myTable = dtable.$;
|
||||
const checkedList = Object.keys(myTable.state.checkedRows);
|
||||
if(!checkedList.length) return;
|
||||
|
||||
let {cols, data} = dtable.options;
|
||||
data = data.filter((item) => checkedList.includes(item.id + ''));
|
||||
let {cols} = dtable.options;
|
||||
const data = checkedList.map(rowID => myTable._checkedRows[rowID]);
|
||||
const docID = getDocApp()?.docID;
|
||||
|
||||
const url = $.createLink('doc', 'buildZentaoList', `docID=${docID}&type=bug&blockID=${blockID}`);
|
||||
|
||||
@@ -285,6 +285,7 @@ dtable
|
||||
set::footPager(usePager()),
|
||||
!$isFromDoc ? null : set::afterRender(jsCallback()->call('toggleCheckRows', $idList)),
|
||||
!$isFromDoc ? null : set::height(400),
|
||||
!$isFromDoc ? null : set::onCheckChange(jsRaw('window.checkedChange')),
|
||||
$isFromDoc ? null : set::customCols(true),
|
||||
$isFromDoc ? null : set::sortLink(inlink('browse', "product={$product->id}&branch={$branch}&browseType={$browseType}¶m={$param}&orderBy={name}_{sortType}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}")),
|
||||
set::onRenderCell(jsRaw('window.onRenderCell')),
|
||||
|
||||
@@ -60,14 +60,25 @@ window.toggleCheckRows = function(idList)
|
||||
dtable.$.toggleCheckRows(idList.split(','), true);
|
||||
}
|
||||
|
||||
window.checkedChange = function(changes)
|
||||
{
|
||||
if(!this._checkedRows) this._checkedRows = {};
|
||||
Object.keys(changes).forEach((rowID) =>
|
||||
{
|
||||
const row = this.getRowInfo(rowID);
|
||||
this._checkedRows[rowID] = row.data;
|
||||
});
|
||||
}
|
||||
|
||||
window.insertListToDoc = function()
|
||||
{
|
||||
const dtable = zui.DTable.query($('#caselib'));
|
||||
const checkedList = dtable.$.getChecks();
|
||||
const myTable = dtable.$;
|
||||
const checkedList = Object.keys(myTable.state.checkedRows);
|
||||
if(!checkedList.length) return;
|
||||
|
||||
let {cols, data} = dtable.options;
|
||||
data = data.filter((item) => checkedList.includes(item.id + ''));
|
||||
let {cols} = dtable.options;
|
||||
const data = checkedList.map(rowID => myTable._checkedRows[rowID]);
|
||||
const docID = getDocApp()?.docID;
|
||||
|
||||
const url = $.createLink('doc', 'buildZentaoList', `docID=${docID}&type=caselib&blockID=${blockID}`);
|
||||
|
||||
@@ -260,6 +260,7 @@ dtable
|
||||
$isFromDoc ? null : set::createTip($lang->testcase->create),
|
||||
$isFromDoc ? null : set::createLink($canCreateCase ? createLink('caselib', 'createCase', "libID={$libID}&moduleID={$moduleID}") : ''),
|
||||
!$isFromDoc ? null : set::afterRender(jsCallback()->call('toggleCheckRows', $idList)),
|
||||
!$isFromDoc ? null : set::onCheckChange(jsRaw('window.checkedChange')),
|
||||
!$isFromDoc ? null : set::height(400)
|
||||
);
|
||||
|
||||
|
||||
@@ -173,14 +173,25 @@ window.setShowGrades = function()
|
||||
$.get(link, function() { loadCurrentPage(); });
|
||||
}
|
||||
|
||||
window.checkedChange = function(changes)
|
||||
{
|
||||
if(!this._checkedRows) this._checkedRows = {};
|
||||
Object.keys(changes).forEach((rowID) =>
|
||||
{
|
||||
const row = this.getRowInfo(rowID);
|
||||
this._checkedRows[rowID] = row.data;
|
||||
});
|
||||
}
|
||||
|
||||
window.insertListToDoc = function()
|
||||
{
|
||||
const dtable = zui.DTable.query($('#table-execution-story'));
|
||||
const checkedList = dtable.$.getChecks();
|
||||
const myTable = dtable.$;
|
||||
const checkedList = Object.keys(myTable.state.checkedRows);
|
||||
if(!checkedList.length) return;
|
||||
|
||||
let {cols, data} = dtable.options;
|
||||
data = data.filter((item) => checkedList.includes(item.id + ''));
|
||||
let {cols} = dtable.options;
|
||||
const data = checkedList.map(rowID => myTable._checkedRows[rowID]);
|
||||
const docID = getDocApp()?.docID;
|
||||
|
||||
const url = $.createLink('doc', 'buildZentaoList', `docID=${docID}&type=executionStory&blockID=${blockID}`);
|
||||
|
||||
@@ -198,14 +198,25 @@ $(document).off('click', '.switchButton').on('click', '.switchButton', function(
|
||||
loadCurrentPage();
|
||||
});
|
||||
|
||||
window.checkedChange = function(changes)
|
||||
{
|
||||
if(!this._checkedRows) this._checkedRows = {};
|
||||
Object.keys(changes).forEach((rowID) =>
|
||||
{
|
||||
const row = this.getRowInfo(rowID);
|
||||
this._checkedRows[rowID] = row.data;
|
||||
});
|
||||
}
|
||||
|
||||
window.insertListToDoc = function()
|
||||
{
|
||||
const dtable = zui.DTable.query($('#tasks'));
|
||||
const checkedList = dtable.$.getChecks();
|
||||
const myTable = dtable.$;
|
||||
const checkedList = Object.keys(myTable.state.checkedRows);
|
||||
if(!checkedList.length) return;
|
||||
|
||||
let {cols, data} = dtable.options;
|
||||
data = data.filter((item) => checkedList.includes(item.id + ''));
|
||||
let {cols} = dtable.options;
|
||||
const data = checkedList.map(rowID => myTable._checkedRows[rowID]);
|
||||
const docID = getDocApp()?.docID;
|
||||
|
||||
const url = $.createLink('doc', 'buildZentaoList', `docID=${docID}&type=task&blockID=${blockID}`);
|
||||
|
||||
@@ -570,6 +570,8 @@ foreach($stories as $story)
|
||||
if(!isset($story->children)) continue;
|
||||
}
|
||||
|
||||
if($isFromDoc) $footToolbar = array(array('text' => $lang->doc->insertText, 'data-on' => 'click', 'data-call' => "insertListToDoc"));
|
||||
|
||||
jsVar('cases', $storyCases);
|
||||
jsVar('summary', $summary);
|
||||
jsVar('checkedSummary', $lang->product->checkedAllSummary);
|
||||
@@ -593,6 +595,7 @@ dtable
|
||||
))),
|
||||
set::emptyTip($lang->execution->noStory),
|
||||
!$isFromDoc ? null : set::afterRender(jsCallback()->call('toggleCheckRows', $idList)),
|
||||
!$isFromDoc ? null : set::onCheckChange(jsRaw('window.checkedChange')),
|
||||
!$isFromDoc ? null : set::height(400),
|
||||
$isFromDoc ? null : set::customCols(array('url' => createLink('datatable', 'ajaxcustom', "module={$app->moduleName}&method={$app->methodName}&extra={$storyType}"), 'globalUrl' => createLink('datatable', 'ajaxsaveglobal', "module={$app->moduleName}&method={$app->methodName}&extra={$storyType}"))),
|
||||
$isFromDoc ? null : set::sortLink(createLink('execution', 'story', "executionID={$execution->id}&storyType={$storyType}&orderBy={name}_{sortType}&type={$type}¶m={$param}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&page={$pager->pageID}")),
|
||||
|
||||
@@ -334,6 +334,7 @@ dtable
|
||||
'linkCreator' => helper::createLink('execution', 'task', "executionID={$execution->id}&status={$status}¶m={$param}&orderBy=$orderBy&recTotal={$pager->recTotal}&recPerPage={recPerPage}&page={page}") . "#app={$app->tab}"
|
||||
))),
|
||||
!$isFromDoc ? null : set::afterRender(jsCallback()->call('toggleCheckRows', $idList)),
|
||||
!$isFromDoc ? null : set::onCheckChange(jsRaw('window.checkedChange')),
|
||||
!$isFromDoc ? null : set::height(400),
|
||||
$isFromDoc ? null : set::customCols(true),
|
||||
$isFromDoc ? null : set::sortLink(createLink('execution', 'task', "executionID={$execution->id}&status={$status}¶m={$param}&orderBy={name}_{sortType}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}")),
|
||||
|
||||
@@ -200,14 +200,25 @@ window.importToLib = function()
|
||||
$('#storyIdList').val(storyIdList);
|
||||
}
|
||||
|
||||
window.checkedChange = function(changes)
|
||||
{
|
||||
if(!this._checkedRows) this._checkedRows = {};
|
||||
Object.keys(changes).forEach((rowID) =>
|
||||
{
|
||||
const row = this.getRowInfo(rowID);
|
||||
this._checkedRows[rowID] = row.data;
|
||||
});
|
||||
}
|
||||
|
||||
window.insertListToDoc = function()
|
||||
{
|
||||
const dtable = zui.DTable.query($('#stories'));
|
||||
const checkedList = Object.keys(dtable.$.state.checkedRows);
|
||||
const myTable = dtable.$;
|
||||
const checkedList = Object.keys(myTable.state.checkedRows);
|
||||
if(!checkedList.length) return;
|
||||
|
||||
let {cols, data} = dtable.options;
|
||||
data = data.filter((item) => checkedList.includes(item.id + ''));
|
||||
let {cols} = dtable.options;
|
||||
const data = checkedList.map(rowID => myTable._checkedRows[rowID]);
|
||||
const docID = getDocApp()?.docID;
|
||||
|
||||
let blockType = 'productStory';
|
||||
|
||||
@@ -540,6 +540,7 @@ dtable
|
||||
set::emptyTip($emptyTip),
|
||||
set::footToolbar($footToolbar),
|
||||
!$isFromDoc ? null : set::afterRender(jsCallback()->call('toggleCheckRows', $idList)),
|
||||
!$isFromDoc ? null : set::onCheckChange(jsRaw('window.checkedChange')),
|
||||
!$isFromDoc ? null : set::height(400),
|
||||
$isFromDoc ? null : set::customCols(array('url' => createLink('datatable', 'ajaxcustom', "module={$app->moduleName}&method={$app->methodName}&extra={$storyType}"), 'globalUrl' => createLink('datatable', 'ajaxsaveglobal', "module={$app->moduleName}&method={$app->methodName}&extra={$storyType}"), 'resetUrl' => createLink('datatable', 'ajaxreset', "module={$app->moduleName}&method={$app->methodName}&system=0&confirm=no&extra={$storyType}"), 'resetGlobalUrl' => createLink('datatable', 'ajaxreset', "module={$app->moduleName}&method={$app->methodName}&system=1&confirm=no&extra={$storyType}"))),
|
||||
$isFromDoc ? null : set::sortLink($sortLink),
|
||||
|
||||
@@ -350,14 +350,25 @@ window.getPlanID = function(event)
|
||||
$('[name=planID]').val(planID);
|
||||
}
|
||||
|
||||
window.checkedChange = function(changes)
|
||||
{
|
||||
if(!this._checkedRows) this._checkedRows = {};
|
||||
Object.keys(changes).forEach((rowID) =>
|
||||
{
|
||||
const row = this.getRowInfo(rowID);
|
||||
this._checkedRows[rowID] = row.data;
|
||||
});
|
||||
}
|
||||
|
||||
window.insertListToDoc = function()
|
||||
{
|
||||
const dtable = zui.DTable.query($('#productPlans'));
|
||||
const checkedList = dtable.$.getChecks();
|
||||
const myTable = dtable.$;
|
||||
const checkedList = Object.keys(myTable.state.checkedRows);
|
||||
if(!checkedList.length) return;
|
||||
|
||||
let {cols, data} = dtable.options;
|
||||
data = data.filter((item) => checkedList.includes(item.id + ''));
|
||||
let {cols} = dtable.options;
|
||||
const data = checkedList.map(rowID => myTable._checkedRows[rowID]);
|
||||
const docID = getDocApp()?.docID;
|
||||
|
||||
const url = $.createLink('doc', 'buildZentaoList', `docID=${docID}&type=productPlan&blockID=${blockID}`);
|
||||
|
||||
@@ -1,11 +1,22 @@
|
||||
window.checkedChange = function(changes)
|
||||
{
|
||||
if(!this._checkedRows) this._checkedRows = {};
|
||||
Object.keys(changes).forEach((rowID) =>
|
||||
{
|
||||
const row = this.getRowInfo(rowID);
|
||||
this._checkedRows[rowID] = row.data;
|
||||
});
|
||||
}
|
||||
|
||||
window.insertListToDoc = function()
|
||||
{
|
||||
const dtable = zui.DTable.query($('#bugs'));
|
||||
const checkedList = dtable.$.getChecks();
|
||||
const myTable = dtable.$;
|
||||
const checkedList = Object.keys(myTable.state.checkedRows);
|
||||
if(!checkedList.length) return;
|
||||
|
||||
let {cols, data} = dtable.options;
|
||||
data = data.filter((item) => checkedList.includes(item.id + ''));
|
||||
let {cols} = dtable.options;
|
||||
const data = checkedList.map(rowID => myTable._checkedRows[rowID]);
|
||||
const docID = getDocApp()?.docID;
|
||||
|
||||
let blockType = 'planBug';
|
||||
|
||||
@@ -12,14 +12,25 @@ window.renderStoryCell = function(result, info)
|
||||
return result;
|
||||
};
|
||||
|
||||
window.checkedChange = function(changes)
|
||||
{
|
||||
if(!this._checkedRows) this._checkedRows = {};
|
||||
Object.keys(changes).forEach((rowID) =>
|
||||
{
|
||||
const row = this.getRowInfo(rowID);
|
||||
this._checkedRows[rowID] = row.data;
|
||||
});
|
||||
}
|
||||
|
||||
window.insertListToDoc = function()
|
||||
{
|
||||
const dtable = zui.DTable.query($('#stories'));
|
||||
const checkedList = dtable.$.getChecks();
|
||||
const myTable = dtable.$;
|
||||
const checkedList = Object.keys(myTable.state.checkedRows);
|
||||
if(!checkedList.length) return;
|
||||
|
||||
let {cols, data} = dtable.options;
|
||||
data = data.filter((item) => checkedList.includes(item.id + ''));
|
||||
let {cols} = dtable.options;
|
||||
const data = checkedList.map(rowID => myTable._checkedRows[rowID]);
|
||||
const docID = getDocApp()?.docID;
|
||||
let blockType = 'planStory';
|
||||
const url = $.createLink('doc', 'buildZentaoList', `docID=${docID}&type=${blockType}&blockID=${blockID}`);
|
||||
|
||||
@@ -214,6 +214,7 @@ dtable
|
||||
usePager(array('linkCreator' => createLink($app->rawModule, 'browse', "productID={$productID}&branch={$branch}&browseType={$browseType}&queryID={$queryID}&orderBy={$orderBy}&recTotal={$pager->recTotal}&recPerPage={recPerPage}&pageID={page}&from=$from&blockID=$blockID"))),
|
||||
),
|
||||
!$isFromDoc ? null : set::afterRender(jsCallback()->call('toggleCheckRows', $idList)),
|
||||
!$isFromDoc ? null : set::onCheckChange(jsRaw('window.checkedChange')),
|
||||
!$isFromDoc ? null : set::height(400),
|
||||
$isFromDoc ? null : set::customCols(true),
|
||||
$isFromDoc ? null : set::sortLink($sortLink),
|
||||
|
||||
@@ -104,7 +104,8 @@ dtable
|
||||
set::emptyTip($lang->bug->notice->noBug),
|
||||
set::footToolbar($footToolbar),
|
||||
set::height(400),
|
||||
set::afterRender(jsCallback()->call('toggleCheckRows', $idList))
|
||||
set::afterRender(jsCallback()->call('toggleCheckRows', $idList)),
|
||||
set::onCheckChange(jsRaw('window.checkedChange'))
|
||||
);
|
||||
|
||||
render();
|
||||
|
||||
@@ -115,7 +115,8 @@ dtable
|
||||
set::emptyTip($lang->story->noStory),
|
||||
set::footToolbar($footToolbar),
|
||||
set::height(400),
|
||||
set::afterRender(jsCallback()->call('toggleCheckRows', $idList))
|
||||
set::afterRender(jsCallback()->call('toggleCheckRows', $idList)),
|
||||
set::onCheckChange(jsRaw('window.checkedChange'))
|
||||
);
|
||||
|
||||
render();
|
||||
|
||||
@@ -28,14 +28,25 @@ window.renderCell = function(result, info)
|
||||
return result;
|
||||
};
|
||||
|
||||
window.checkedChange = function(changes)
|
||||
{
|
||||
if(!this._checkedRows) this._checkedRows = {};
|
||||
Object.keys(changes).forEach((rowID) =>
|
||||
{
|
||||
const row = this.getRowInfo(rowID);
|
||||
this._checkedRows[rowID] = row.data;
|
||||
});
|
||||
}
|
||||
|
||||
window.insertListToDoc = function()
|
||||
{
|
||||
const dtable = zui.DTable.query($('#stories'));
|
||||
const checkedList = dtable.$.getChecks();
|
||||
const myTable = dtable.$;
|
||||
const checkedList = Object.keys(myTable.state.checkedRows);
|
||||
if(!checkedList.length) return;
|
||||
|
||||
let {cols, data} = dtable.options;
|
||||
data = data.filter((item) => checkedList.includes(item.id + ''));
|
||||
let {cols} = dtable.options;
|
||||
const data = checkedList.map(rowID => myTable._checkedRows[rowID]);
|
||||
const docID = getDocApp()?.docID;
|
||||
|
||||
const blockType = 'projectStory';
|
||||
|
||||
@@ -125,6 +125,7 @@ dtable
|
||||
set::emptyTip($lang->story->noStory),
|
||||
set::footToolbar($footToolbar),
|
||||
set::afterRender(jsCallback()->call('toggleCheckRows', $idList)),
|
||||
set::onCheckChange(jsRaw('window.checkedChange')),
|
||||
set::height(400)
|
||||
);
|
||||
|
||||
|
||||
@@ -47,14 +47,25 @@ window.getCellSpan = function(cell)
|
||||
}
|
||||
}
|
||||
|
||||
window.checkedChange = function(changes)
|
||||
{
|
||||
if(!this._checkedRows) this._checkedRows = {};
|
||||
Object.keys(changes).forEach((rowID) =>
|
||||
{
|
||||
const row = this.getRowInfo(rowID);
|
||||
this._checkedRows[rowID] = row.data;
|
||||
});
|
||||
}
|
||||
|
||||
window.insertListToDoc = function()
|
||||
{
|
||||
const dtable = zui.DTable.query($('#releases'));
|
||||
const checkedList = dtable.$.getChecks();
|
||||
const myTable = dtable.$;
|
||||
const checkedList = Object.keys(myTable.state.checkedRows);
|
||||
if(!checkedList.length) return;
|
||||
|
||||
let {cols, data} = dtable.options;
|
||||
data = data.filter((item) => checkedList.includes(item.id + ''));
|
||||
let {cols} = dtable.options;
|
||||
const data = checkedList.map(rowID => myTable._checkedRows[rowID]);
|
||||
const docID = getDocApp()?.docID;
|
||||
|
||||
const blockType = 'productRelease';
|
||||
|
||||
@@ -143,6 +143,7 @@ dtable
|
||||
set::checkable($isFromDoc),
|
||||
$isFromDoc ? set::footToolbar(array(array('text' => $lang->doc->insertText, 'data-on' => 'click', 'data-call' => 'insertListToDoc'))) : set::footer([jsRaw("function(){return {html: '{$pageSummary}'};}"), 'flex', 'pager']),
|
||||
!$isFromDoc ? null : set::afterRender(jsCallback()->call('toggleCheckRows', $idList)),
|
||||
!$isFromDoc ? null : set::onCheckChange(jsRaw('window.checkedChange')),
|
||||
!$isFromDoc ? null : set::height(400),
|
||||
$isFromDoc ? null : set::customCols(true),
|
||||
$isFromDoc ? null : set::sortLink(createLink('release', 'browse', "productID={$product->id}&branch={$branch}&type={$type}&orderBy={name}_{sortType}¶m=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}")),
|
||||
|
||||
@@ -296,14 +296,25 @@ $('#dragModal').on('click', '[data-dismiss=modal]', function()
|
||||
loadCurrentPage({cache: false});
|
||||
});
|
||||
|
||||
window.checkedChange = function(changes)
|
||||
{
|
||||
if(!this._checkedRows) this._checkedRows = {};
|
||||
Object.keys(changes).forEach((rowID) =>
|
||||
{
|
||||
const row = this.getRowInfo(rowID);
|
||||
this._checkedRows[rowID] = row.data;
|
||||
});
|
||||
}
|
||||
|
||||
window.insertListToDoc = function()
|
||||
{
|
||||
const dtable = zui.DTable.query($('#testcases'));
|
||||
const checkedList = dtable.$.getChecks();
|
||||
const myTable = dtable.$;
|
||||
const checkedList = Object.keys(myTable.state.checkedRows);
|
||||
if(!checkedList.length) return;
|
||||
|
||||
let {cols, data} = dtable.options;
|
||||
data = data.filter((item) => checkedList.includes(item.id + ''));
|
||||
let {cols} = dtable.options;
|
||||
const data = checkedList.map(rowID => myTable._checkedRows[rowID]);
|
||||
const docID = getDocApp()?.docID;
|
||||
|
||||
const url = $.createLink('doc', 'buildZentaoList', `docID=${docID}&type=productCase&blockID=${blockID}`);
|
||||
|
||||
@@ -162,6 +162,7 @@ div(
|
||||
set::onSortEnd(strpos($orderBy, 'sort_asc') !== false ? jsRaw('window.onSortEnd') : null),
|
||||
set::canSortTo(strpos($orderBy, 'sort_asc') !== false ? jsRaw('window.canSortTo') : null),
|
||||
!$isFromDoc ? null : set::afterRender(jsCallback()->call('toggleCheckRows', $idList)),
|
||||
!$isFromDoc ? null : set::onCheckChange(jsRaw('window.checkedChange')),
|
||||
!$isFromDoc ? null : set::height(400),
|
||||
$isFromDoc || $isOnlyScene ? null : set::customCols(true),
|
||||
$isFromDoc ? null : set::sortLink(createLink($app->rawModule, $app->rawMethod, $linkParams)),
|
||||
|
||||
Reference in New Issue
Block a user