This commit is contained in:
mayue
2022-04-11 09:19:19 +08:00
parent 327ff13564
commit a8d114fe3c
+20 -20
View File
@@ -361,32 +361,32 @@ function updateStepID()
*/
function loadStories(productID, moduleID, num)
{
var branchIDName = config.currentMethod == 'batchcreate' ? '#branch' : '#branches';
var branchID = $(branchIDName + num).val();
var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1&executionID=0&number=' + num);
$.get(storyLink, function(stories)
{
if(!stories) stories = '<select id="story' + num + '" name="story[' + num + ']" class="form-control"></select>';
if(config.currentMethod == 'batchcreate')
{
var branchIDName = config.currentMethod == 'batchcreate' ? '#branch' : '#branches';
var branchID = $(branchIDName + num).val();
var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1&executionID=0&number=' + num);
$.get(storyLink, function(stories)
{
if(!stories) stories = '<select id="story' + num + '" name="story[' + num + ']" class="form-control"></select>';
if(config.currentMethod == 'batchcreate')
{
for(var i = num; i < 10 ; i ++)
{
if(i != num && $('#module' + i).val() != 'ditto') break;
var nowStories = stories.replaceAll('story' + num, 'story' + i);
$('#story' + i).replaceWith(nowStories);
$('#story' + i + "_chosen").remove();
$('#story' + i).next('.picker').remove();
$('#story' + i).attr('name', 'story[' + i + ']');
$('#story' + i).chosen();
if(i != num && $('#module' + i).val() != 'ditto') break;
var nowStories = stories.replaceAll('story' + num, 'story' + i);
$('#story' + i).replaceWith(nowStories);
$('#story' + i + "_chosen").remove();
$('#story' + i).next('.picker').remove();
$('#story' + i).attr('name', 'story[' + i + ']');
$('#story' + i).chosen();
}
}
else
{
}
else
{
$('#story' + num).replaceWith(stories);
$('#story' + num + "_chosen").remove();
$('#story' + num).next('.picker').remove();
$('#story' + num).attr('name', 'story[' + num + ']');
$('#story' + num).chosen();
}
});
}
});
}