diff --git a/module/task/js/create.ui.js b/module/task/js/create.ui.js index 78853aa0d7..86b7746b89 100644 --- a/module/task/js/create.ui.js +++ b/module/task/js/create.ui.js @@ -77,14 +77,13 @@ function typeChange(e) * 根据选择研发需求是否勾选切换相关字段的展示与隐藏。 * Dynamically control whether task fields are hidden based on selection status of selectTestStory. * - * @param int $executionID + * @param int executionID * @access public * @return void */ function toggleSelectTestStory(executionID) { - executionID = parseInt(executionID); - if(!executionID) executionID = $("[name='execution'").val(); + if(typeof(executionID) == 'undefined') executionID = window.executionID; $('#testStoryBox').load($.createLink('task', 'ajaxGetTestStories', 'executionID=' + executionID + '&taskID=' + taskID)); if(!$('#selectTestStoryBox').hasClass('hidden') && $('#selectTestStory').prop('checked')) @@ -186,7 +185,7 @@ function loadModules(executionID) window.loadExecutionStories = function() { const storyID = $('input[name="story"]').val(); - const executionID = $('input[name="execution"]').val(); + const executionID = $('input[name="execution"]').length == 0 ? window.executionID : $('input[name="execution"]').val(); const moduleID = $('input[name="module"]').val(); const getStoryLink = $.createLink('story', 'ajaxGetExecutionStories', 'executionID=' + executionID + '&productID=0&branch=0&moduleID=' + moduleID + '&storyID=' + storyID + '&number=&type=full&status=active'); $.get(getStoryLink, function(stories) diff --git a/module/task/ui/create.html.php b/module/task/ui/create.html.php index c8303c2e52..a796eeac67 100644 --- a/module/task/ui/create.html.php +++ b/module/task/ui/create.html.php @@ -32,13 +32,13 @@ $hiddenMailto = strpos(",$showFields,", ',mailto,') !== false ? '' : 'hidden jsVar('showFields', $showFields); jsVar('toTaskList', !empty($task->id)); jsVar('blockID', $blockID); -jsVar('executionID', $execution->id); jsVar('taskID', $taskID ?? 0); jsVar('ditto', $lang->task->ditto); jsVar('teamMemberError', $lang->task->error->teamMember); jsVar('vision', $config->vision); jsVar('requiredFields', $config->task->create->requiredFields); jsVar('estimateNotEmpty', sprintf($lang->error->gt, $lang->task->estimate, '0')); +jsVar('window.executionID', $execution->id); jsVar('window.lifetime', $execution->lifetime); jsVar('window.attribute', $execution->attribute); jsVar('window.lifetimeList', $lifetimeList); @@ -105,6 +105,7 @@ if(!empty($execution->hasProduct)) ( set::href($this->createLink('execution', 'linkStory', "executionID=$execution->id")), setClass('text-primary'), + on::click('closeModal'), $lang->execution->linkStory ) ); @@ -123,12 +124,7 @@ $storyPreviewBtn = span setID('preview'), modalTrigger ( - to::trigger( - btn( - setClass('text-gray'), - set::icon('eye') - ) - ) + to::trigger(btn(setClass('text-gray'), set::icon('eye'))) ) ); @@ -188,10 +184,7 @@ for($i = 1; $i <= 3; $i ++) $selectStoryRow = ''; if($execution->lifetime != 'ops' and !in_array($execution->attribute, array('request', 'review'))) { - $selectStoryRow = formRow( - setID('testStoryBox'), - setClass('hidden') - ); + $selectStoryRow = formRow(setID('testStoryBox'), setClass('hidden')); } $afterCreateRow = '';