* zin: refactor zui::tree usage.

This commit is contained in:
sunhao
2023-11-15 10:31:04 +08:00
parent fe99a2a24a
commit 4322d4df57
2 changed files with 12 additions and 9 deletions
+11 -8
View File
@@ -19,7 +19,7 @@ class moduleMenu extends wg
'app?: string=""',
'checkbox?: bool',
'checkOnClick?: bool|string',
'onCheck?: function',
'onCheck?: function'
);
public static function getPageCSS(): string|false
@@ -34,9 +34,11 @@ class moduleMenu extends wg
$children = $this->getChildModule($parentID);
if(count($children) === 0) return [];
$activeKey = $this->prop('activeKey');
$treeItems = array();
$tab = $this->prop('app');
$activeKey = $this->prop('activeKey');
$treeItems = array();
$tab = $this->prop('app');
$titleAttrs = array('data-app' => $tab);
if(isInModal()) $titleAttrs['data-load'] = 'modal';
foreach($children as $child)
{
@@ -45,7 +47,7 @@ class moduleMenu extends wg
'text' => $child->name,
'hint' => $child->name,
'url' => zget($child, 'url', ''),
'data-app' => $tab,
'titleAttrs' => $titleAttrs,
'contentClass' => 'overflow-x-hidden'
);
$items = $this->buildMenuTree($child->id);
@@ -153,6 +155,7 @@ class moduleMenu extends wg
return a
(
set('href', $closeLink),
isInModal() ? set('data-load', 'modal') : null,
icon('close', setStyle('color', 'var(--color-slate-600)'))
);
}
@@ -178,18 +181,18 @@ class moduleMenu extends wg
setClass('module-title text-lg font-semibold clip'),
$title
),
$this->buildCloseBtn(),
$this->buildCloseBtn()
),
zui::tree
(
set::_tag('ul'),
set::_tag('menu'),
set::_class('col flex-auto scrollbar-hover scrollbar-thin overflow-y-auto overflow-x-hidden px-4'),
set::defaultNestedShow(true),
set::hover(true),
set::preserve($preserve),
set($treeProps)
),
$this->buildActions(),
$this->buildActions()
);
}
}
+1 -1
View File
@@ -13,7 +13,7 @@ class treeEditor extends wg
'canUpdateOrder?: bool=false',
'canEdit?: bool=false',
'canDelete?: bool=false',
'canSplit?: bool=true',
'canSplit?: bool=true'
);
public static function getPageJS(): string|false