* testcase: call ajaxGetScenes instead of ajaxGetScenesForBC.

This commit is contained in:
liugang
2023-08-28 09:52:09 +08:00
parent e2b8dd47fd
commit 35f74bb686
2 changed files with 11 additions and 11 deletions
+6 -5
View File
@@ -11,20 +11,21 @@ function onModuleChanged(event)
function loadScenes(productID, moduleID, $currentRow)
{
let branchID = $currentRow.find('.form-batch-input[data-name="branch"]').val();
let sceneLink = $.createLink('testcase', 'ajaxGetScenesForBC', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&stype=2&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1');
let sceneLink = $.createLink('testcase', 'ajaxGetScenes', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID);
$.getJSON(sceneLink, function(scenes)
{
if(!scenes) return;
const items = JSON.parse(scenes);
let $row = $currentRow;
while($row.length)
{
const $scene = $row.find('[data-name="scene"] .picker').zui('picker');
$scene.render({items: stories});
$scene.$.setValue($scene.$.value);
const $picker = $row.find('[data-name="scene"] .picker').zui('picker');
$picker.render({items});
$picker.$.setValue($scene.$.value);
$row = $row.next('tr');
if(!$row.find('td[data-name="scene"][data-ditto="on"]').length || !$row.find('td[data-name="module"][data-ditto="on"]').length) break;
}
});
+5 -6
View File
@@ -191,12 +191,11 @@ function loadScenes(productID, sceneName = 'scene')
if(typeof(sceneID) == 'undefined') sceneID = 0;
const link = $.createLink('testcase', 'ajaxGetScenes', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&sceneID=' + sceneID);
$.get(link, function(data)
$.get(link, function(scenes)
{
let $scenePicker = $('[name=' + sceneName + ']').zui('picker');
data = JSON.parse(data);
$scenePicker.render({items: data});
$scenePicker.$.changeState({value: ''});
const $picker = $('[name=' + sceneName + ']').zui('picker');
const items = JSON.parse(scenes);
$picker.render({items});
$picker.$.setValue({value: ''});
});
}