* [bug#62293,done,0.1h] update modules when lib is changed.
This commit is contained in:
@@ -236,7 +236,7 @@ class caselib extends control
|
||||
$this->loadModel('testcase');
|
||||
helper::setcookie('lastLibCaseModule', (int)$this->post->module, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
|
||||
$case = form::data($this->config->testcase->form->create)->add('lib', $libID)
|
||||
$case = form::data($this->config->testcase->form->create)->add('lib', $_POST['lib'] ? $this->post->lib : $libID)
|
||||
->setIF(($this->config->testcase->needReview && strpos($this->config->testcase->forceNotReview, $this->app->user->account) === false) || (!empty($this->config->testcase->forceReview) && strpos($this->config->testcase->forceReview, $this->app->user->account) !== false), 'status', 'wait')
|
||||
->get();
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* 加载用例库的模块。
|
||||
* Load modules of the caselib.
|
||||
*/
|
||||
function loadModules(e)
|
||||
{
|
||||
const libID = $(e.target).val();
|
||||
const moduleID = $('input[name=module]').val();
|
||||
const getModuleLink = $.createLink('tree', 'ajaxGetOptionMenu', 'rootID=' + libID + '&viewtype=caselib&branch=0&rootModuleID=0&returnType=items');
|
||||
$.getJSON(getModuleLink, function(modules)
|
||||
{
|
||||
if(modules)
|
||||
{
|
||||
const $modulePicker = $('input[name=module]').zui('picker');
|
||||
$modulePicker.render({items: modules});
|
||||
$modulePicker.$.setValue(moduleID);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -24,6 +24,7 @@ formPanel
|
||||
(
|
||||
picker
|
||||
(
|
||||
on::change('loadModules'),
|
||||
set::name('lib'),
|
||||
set::items($libraries),
|
||||
set::required(true),
|
||||
|
||||
Reference in New Issue
Block a user