* [task#135788,doing,0.5h].
This commit is contained in:
@@ -295,3 +295,38 @@ $('#dragModal').on('click', '[data-dismiss=modal]', function()
|
||||
{
|
||||
loadCurrentPage({cache: false});
|
||||
});
|
||||
|
||||
window.insertListToDoc = function()
|
||||
{
|
||||
const dtable = zui.DTable.query($('#testcases'));
|
||||
const checkedList = dtable.$.getChecks();
|
||||
if(!checkedList.length) return;
|
||||
|
||||
let {cols, data} = dtable.options;
|
||||
data = data.filter((item) => checkedList.includes(item.id + ''));
|
||||
const docID = getDocApp()?.docID;
|
||||
|
||||
const url = $.createLink('doc', 'buildZentaoList', `docID=${docID}&type=case&blockID=${blockID}`);
|
||||
const formData = new FormData();
|
||||
formData.append('cols', JSON.stringify(cols));
|
||||
formData.append('data', JSON.stringify(data));
|
||||
formData.append('idList', checkedList.join(','));
|
||||
formData.append('url', insertListLink);
|
||||
$.post(url, formData, function(resp)
|
||||
{
|
||||
resp = JSON.parse(resp);
|
||||
if(resp.result == 'success')
|
||||
{
|
||||
const blockID = resp.blockID;
|
||||
zui.Modal.hide();
|
||||
window.insertZentaoList && window.insertZentaoList('case', blockID, null, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
window.toggleCheckRows = function(idList)
|
||||
{
|
||||
if(!idList?.length) return;
|
||||
const dtable = zui.DTable.query($('#testcases'));
|
||||
dtable.$.toggleCheckRows(idList.split(','), true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user