Merge branch release/21.7.6 of zentao/zentaopms (#11885)

This commit is contained in:
刘刚
2025-10-16 10:53:01 +08:00
committed by Gitfox
7 changed files with 27 additions and 19 deletions
+4 -4
View File
@@ -124,7 +124,7 @@ $config->ai->targetForm['productplan']['create'] = (object)array('m' =>
// $config->ai->targetForm['project']['issue/create'] = (object)array('m' => 'issue', 'f' => 'create');
// $config->ai->targetForm['project']['doc/create'] = (object)array('m' => 'doc', 'f' => 'create');
$config->ai->targetForm['project']['programplan/create'] = (object)array('m' => 'programplan', 'f' => 'create', 'for' => 'project');
$config->ai->targetForm['execution']['batchcreatetask'] = (object)array('m' => 'task', 'f' => 'batchcreate');
$config->ai->targetForm['execution']['batchcreatetask'] = (object)array('m' => 'task', 'f' => 'batchcreate', 'for' => 'execution');
// $config->ai->targetForm['execution']['createtestreport'] = (object)array('m' => 'execution', 'f' => 'testreport');
// $config->ai->targetForm['execution']['createqa'] = (object)array('m' => 'execution', 'f' => 'createQA');
// $config->ai->targetForm['execution']['createrisk'] = (object)array('m' => 'execution', 'f' => 'createRisk');
@@ -210,7 +210,7 @@ $config->ai->menuPrint->locations['execution']['storyView'] = $config->ai->men
$config->ai->menuPrint->locations['execution']['view'] = (object)array( // TODO: fix this.
'module' => 'execution',
'injectMethod' => 'prepend',
'targetContainer' => '#mainContent.main-row > .col-4.side-col .detail:first-child > .detail-title',
'targetContainer' => '#mainContent .ai-menu-box',
'class' => 'pull-right'
);
@@ -222,14 +222,14 @@ $config->ai->menuPrint->locations['project']['view']->module = 'project';
$config->ai->menuPrint->locations['product']['view'] = (object)array( // TODO: fix this.
'module' => 'product',
'injectMethod' => 'append',
'targetContainer' => '#mainContent.main-row > .col-8.main-col .detail:first-child > .detail-title',
'targetContainer' => '#mainContent .ai-menu-box',
'class' => 'pull-right'
);
$config->ai->menuPrint->locations['productplan']['view'] = (object)array(
'module' => 'productplan',
'injectMethod' => 'prepend',
'targetContainer' => '#mainContent .toolbar',
'targetContainer' => '#mainContent .tab-actions',
'objectVarName' => 'plan'
);
$config->ai->menuPrint->locations['projectplan']['view'] = $config->ai->menuPrint->locations['productplan']['view'];
+3 -1
View File
@@ -98,7 +98,9 @@ $promptMenuInject = function()
container.classList.remove('no-delay');
}
JAVASCRIPT;
$script .= "$(`$menuOptions->targetContainer`).first()." . (!empty($menuOptions->injectMethod) ? $menuOptions->injectMethod : 'append') . "(`$html`).css('z-index', 2);\n";
$script .= 'let $aiMenu = $("' . $menuOptions->targetContainer . '").first();';
$script .= 'if(!$aiMenu.length) $aiMenu = $("#mainContent .ai-menu-box").empty();';
$script .= '$aiMenu.' . (!empty($menuOptions->injectMethod) ? $menuOptions->injectMethod : 'append') . "(`$html`).css('z-index', 2);\n";
$script .= <<< JAVASCRIPT
$('[data-toggle="popover"]').popover({template: '<div class="popover"><h3 class="popover-title"></h3><div class="popover-content"></div></div>'});
JAVASCRIPT;
+2 -1
View File
@@ -268,7 +268,8 @@ div
set('data-class-name', 'text-gray border border-light'),
setClass('ml-2 mt-2 text-gray')
)
)
),
div(setClass('ai-menu-box flex-auto'))
),
div
(
+5 -4
View File
@@ -160,9 +160,9 @@ div
setClass($product->status == 'normal' ? 'text-success' : 'text-gray'),
$this->processStatus('product', $product)
),
span
div
(
setClass('ml-2 flex-none'),
setClass('ml-2 flex-none row items-center gap-2'),
$lang->product->abbr->aclList[$product->acl],
icon
(
@@ -171,9 +171,10 @@ div
set('data-placement', 'right'),
set('data-type', 'white'),
set('data-class-name', 'text-gray border border-light'),
setClass('ml-2 mt-2 text-gray')
setClass('text-gray')
)
)
),
div(setClass('ai-menu-box flex-auto'))
),
div
(
+2 -1
View File
@@ -272,7 +272,8 @@ row
setClass('ghost form-label-hint text-gray-300 ml-2'),
toggle::tooltip(array('title' => $lang->project->subAclList[$project->acl], 'className' => 'text-gray border border-gray-300', 'type' => 'white', 'placement' => 'right'))
)
)
),
div(setClass('ai-menu-box flex-auto'))
),
div
(
+7 -4
View File
@@ -20,9 +20,11 @@ window.openPageForm = function(url, data, callback)
{
return new Promise((resolve, reject) => {
const openedApp = $.apps.openApp(url);
const handlePageLoad = () =>
let updateTimer = 0;
const tryUpdateForm = () =>
{
setTimeout(() =>
if(updateTimer) clearTimeout(updateTimer);
updateTimer = setTimeout(() =>
{
try
{
@@ -36,8 +38,8 @@ window.openPageForm = function(url, data, callback)
} catch (error) {reject(error)}
}, 2000);
};
openedApp.$app.one('updateapp.apps updatepage.app', handlePageLoad);
setTimeout(() => openedApp.$app.off('updateapp.apps', handlePageLoad), 5000);
openedApp.$app.one('updateapp.apps updatepage.app', tryUpdateForm);
setTimeout(() => openedApp.$app.off('updateapp.apps', tryUpdateForm), 5000);
});
}
@@ -80,6 +82,7 @@ window.executeZentaoPrompt = async function(info, auto)
}
},
fn: (response) => {
console.log('> executeZentaoPrompt', info.name, {info, response});
const result = response.data;
const targetForm = info.targetForm;
if(!targetForm) return {result: result};
File diff suppressed because one or more lines are too long