* Add buildZinForm of search.

This commit is contained in:
zhaoke
2023-08-02 11:03:18 +08:00
parent 1370524889
commit cc053b9d48
14 changed files with 38 additions and 16 deletions
+1
View File
@@ -22,6 +22,7 @@ class commentForm extends wg
(
set::url($url),
set::method($method),
set::submitBtnText($lang->save),
setClass('comment-form'),
editor
(
+2 -1
View File
@@ -16,7 +16,8 @@ class form extends formBase
'items?: array', // 使用一个列定义对象数组来定义表单项。
'grid?: bool=true', // 是否启用网格部件,禅道中所有表单都是网格布局,除非有特殊目的,无需设置此项。
'labelWidth?: int', // 标签宽度,单位为像素。
'actionsClass?: string="form-group no-label"' // 操作按钮栏的 CSS 类。
'actionsClass?: string="form-group no-label"', // 操作按钮栏的 CSS 类。
'submitBtnText?: string' // 提交按钮文本。
);
protected function created()
+1
View File
@@ -132,6 +132,7 @@ class history extends wg
(
setClass('comment-edit-form hidden mt-2 ml-6'),
set::method('post'),
set::submitBtnText($lang->save),
set::action(createLink('action', 'editComment', "actionID=$action->id")),
editor
(
+1 -1
View File
@@ -15,7 +15,7 @@ window.toggleSearchForm = function(moduleName, formName, open)
if(!$form.length) $form = $('<div id="searchFormPanel" data-module="' + moduleName + '"></div>').insertAfter('#mainMenu');
if(!$form.data('loaded'))
{
const url = $.createLink('search', 'buildForm', 'module=' + moduleName + '&fields=&params=&actionURL=&queryID=0&formName=' + formName);
const url = $.createLink('search', 'buildZinForm', 'module=' + moduleName + '&fields=&params=&actionURL=&queryID=0&formName=' + formName);
$.get(url, html =>
{
$form.html(html).data('loaded', true);
+4 -1
View File
@@ -70,7 +70,10 @@ detailBody
)
),
),
history(),
history
(
set::commentUrl(createLink('action', 'comment', array('objectType' => 'account', 'objectID' => $account->id))),
),
floatToolbar
(
set::object($account),
+1 -1
View File
@@ -379,7 +379,7 @@ class action extends control
dao::$errors['submit'][] = $this->lang->action->historyEdit;
return $this->send(array('result' => 'fail', 'message' => dao::getError()));
}
return $this->send(array('result' => 'success', 'locate' => 'reload', 'load' => true));
return $this->send(array('result' => 'success', 'locate' => 'reload', 'load' => true, 'closeModal' => true));
}
/**
+4 -1
View File
@@ -95,7 +95,10 @@ detailBody
)
)
),
history(),
history
(
set::commentUrl(createLink('action', 'comment', array('objectType' => 'host', 'objectID' => $host->id))),
),
floatToolbar
(
set::object($host),
-1
View File
@@ -38,7 +38,6 @@ window.showLink = function(obj)
let link = $(obj).data('url');
let $tabContent = $(obj);
console.log(1111, link, $tabContent, $(obj));
if($(obj).hasClass('link'))
{
$tabContent = $(obj).closest('.tab-pane');
-1
View File
@@ -33,7 +33,6 @@ window.afterPageUpdate = function()
/* Select default tree item. */
const currentElement = findItemInTreeItems(tree, fileAsId, 0);
console.log(1111, $('#' + currentElement.id))
expandTree();
if(currentElement != undefined) setTimeout(() =>
{
+20 -6
View File
@@ -53,15 +53,29 @@ class search extends control
$this->view->onMenuBar = empty($onMenuBar) ? 'no' : $onMenuBar;
$this->app->loadModuleConfig('action');
$_GET['zin'] = 0;
if(in_array($module, $this->config->action->newPageModule))
{
$_GET['zin'] = 1;
$this->view->formSession = $_SESSION[$module . 'Form'];
}
$this->display();
}
/**
* Build search form of 20 version.
*
* @param string $module
* @param array $fields
* @param array $params
* @param string $actionURL
* @param int $queryID
* @access public
* @return void
*/
public function buildZinForm($module = '', $fields = '', $params = '', $actionURL = '', $queryID = 0)
{
if(!commonModel::hasPriv('search', 'buildForm')) $this->loadModel('common')->deny('search', 'buildForm', false);
$module = empty($module) ? $this->session->searchParams['module'] : $module;
$this->view->formSession = $_SESSION[$module . 'Form'];
$this->buildForm($module, $fields, $params, $actionURL, $queryID);
}
/**
* Build query
*
+4 -1
View File
@@ -74,7 +74,10 @@ detailBody
)
),
),
history(),
history
(
set::commentUrl(createLink('action', 'comment', array('objectType' => 'serverroom', 'objectID' => $serverRoom->id))),
),
floatToolbar
(
set::object($serverRoom),
-1
View File
@@ -39,7 +39,6 @@ window.installApp = function()
$('#mainContent').on('keydown', '#name', function(event)
{
console.log(1111, event.key);
if (event.key === 'Enter')
{
const form = new FormData();
-1
View File
@@ -7,7 +7,6 @@ function loadProductBranchesNew(productID)
{
$('#branch').remove();
console.log(1111, caseBranch)
var param = page == 'create' ? 'active' : 'all';
var oldBranch = page == 'edit' ? caseBranch : 0;
var param = "productID=" + productID + "&oldBranch=" + oldBranch + "&param=" + param;