* export testcase by moodule chosen story

This commit is contained in:
yfl
2019-04-19 14:38:33 +08:00
parent 17b87ba461
commit f468d76d9e
3 changed files with 25 additions and 8 deletions
+7
View File
@@ -1638,4 +1638,11 @@ class testcase extends control
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->display();
}
public function ajaxGetStoryMoule($storyID)
{
$story = $this->dao->select('module')->from(TABLE_STORY)->where('id')->eq($storyID)->fetch();
$moduleID = !empty($story) ? $story->module : 0;
die(json_encode(array('moduleID'=> $moduleID)));
}
}
+16 -8
View File
@@ -1,13 +1,21 @@
$(document).on('change', '.moduleChange',function ajaxGetMouletStories(){
$(document).on('change', '.moduleChange',function(){
var moduleID = $(this).val();
if(typeof(moduleID) == 'undefined') moduleID = 0;
link = createLink('testcase', 'ajaxGetMouletStories', 'moduleID=' + moduleID);
$(this).parent('td').next('td').load(link, function(){$(this).parent('td').next('td').find('slect').chosen();});
var id = $(this).attr('id');
var index = id.substring(6);
link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branch + '&moduleID=' + moduleID + '&storyID='+ '' + '&onlyOption=true&status=noclosed');
$('#story' + index).load(link, function(){$(this).trigger("chosen:updated");});
})
$(document).on('change', '.storyChange',function ajaxGetStoryMoule(){
var storyID = $(this).val();
if(typeof(storyID) == 'undefined') storyID = 0;
link = createLink('testcase', 'ajaxGetStoryMoule', 'storyID=' + storyID);
$(this).parent('td').prev('td').load(link, function(){$(this).parent('td').prev('td').find('slect').chosen();});
$(document).on('change', '.storyChange',function(){
var storyID = $(this).val();
if(typeof(storyID) == 'undefined') storyID = 0;
link = createLink('testcase', 'ajaxGetStoryMoule', 'storyID=' + storyID);
var id = $(this).attr('id');
var index = id.substring(5);
$.get(link,function(json){
var obj = JSON.parse(json);
$("#module" + index).val(obj.moduleID);
$('#module' + index).trigger("chosen:updated");
})
})
+2
View File
@@ -2,6 +2,8 @@
<style>
.affix {position:fixed; top:0px; width:95.6%;z-index:10000;}
</style>
<?php js::set('productID', $productID);?>
<?php js::set('branch', $branch);?>
<?php if(isset($suhosinInfo)):?>
<div class='alert alert-info'><?php echo $suhosinInfo?></div>
<?php else:?>