* Adjust the picker.

This commit is contained in:
daitingting
2023-07-15 02:27:18 +00:00
parent 6b5eee769f
commit 3567516708
3 changed files with 15 additions and 17 deletions
+1 -1
View File
@@ -512,7 +512,7 @@ class build extends control
* @access public
* @return string
*/
public function ajaxGetExecutionBuilds(int $executionID, int $productID, string $varName, string $build = '', string|int $branch = 'all', int $index = 0, bool $needCreate = false, string $type = 'normal', string $number = '')
public function ajaxGetExecutionBuilds(int $executionID, int $productID, string $varName, string $build = '', string $branch = 'all', int $index = 0, bool $needCreate = false, string $type = 'normal', string $number = '')
{
$isJsonView = $this->app->getViewType() == 'json';
if($varName == 'openedBuild')
+9 -6
View File
@@ -14,7 +14,7 @@ $(function()
*/
function loadExecutionRelated()
{
loadExecutionBuilds($('#execution').val());
loadExecutionBuilds();
}
/**
@@ -24,9 +24,10 @@ function loadExecutionRelated()
* @access public
* @return void
*/
function loadExecutionBuilds(executionID)
function loadExecutionBuilds()
{
const productID = $('[name=product]').val();
const executionID = $('[name=execution]').val();
var selectedBuild = $('[name=build]').val();
if(!selectedBuild) selectedBuild = 0;
@@ -35,11 +36,12 @@ function loadExecutionBuilds(executionID)
$.get(link, function(data)
{
let $buildPicker = $('[name="build"]').zui('picker');
if(data)
{
data = JSON.parse(data);
$('#build').picker({items: data});
$('#build').picker('setValue', '0');
$buildPicker.render({items: data});
$buildPicker.$.changeState({value: '0'});
}
});
}
@@ -55,11 +57,12 @@ function loadTestReports(productID)
{
$.get($.createLink('testtask', 'ajaxGetTestReports', 'productID=' + productID), function(data)
{
let $testreportPicker = $('[name="testreport"]').zui('picker');
if(data)
{
data = JSON.parse(data);
$('#testreport').picker({items: data});
$('#testreport').picker('setValue', '0');
$testreportPicker.render({items: data});
$testreportPicker.$.changeState({value: '0'});
}
});
}
+5 -10
View File
@@ -6,12 +6,11 @@
*/
function loadProductRelated()
{
const productID = $('[name=product]').val();
const executionID = $('[name=execution]').val();
const productID = $('[name=product]').val();
loadExecutions(productID);
loadTestReports(productID);
loadExecutionBuilds(executionID)
loadExecutionBuilds()
}
/**
@@ -25,16 +24,12 @@ function loadExecutions(productID)
{
$.get($.createLink('product', 'ajaxGetExecutions', 'productID=' + productID + '&projectID=' + projectID + '&branch='), function(data)
{
let $executionPicker = $('[name="execution"]').zui('picker');
if(data)
{
data = JSON.parse(data);
$('#execution').picker({items: data});
$('#execution').picker('setValue', $('[name=execution]').val());
$executionPicker.render({items: data});
$executionPicker.$.changeState({value: '0'});
}
});
}
$(function()
{
loadProductRelated();
});