* zin: refactor detailbody to compatible with edit page.

This commit is contained in:
dingyongliang
2023-06-27 18:11:04 +08:00
parent f3ab49c419
commit 3f07643ea7
3 changed files with 39 additions and 10 deletions
+36 -7
View File
@@ -4,11 +4,16 @@ namespace zin;
class detailBody extends wg
{
protected static $defineProps = array(
'isForm?: bool=false'
);
protected static $defineBlocks = array(
'main' => array('map' => 'sectionList'),
'side' => array('map' => 'detailSide'),
'bottom' => array('map' => 'history,fileList'),
'floating' => array('map' => 'floatToolbar'),
'fixedActions' => array(),
);
protected function build()
@@ -17,19 +22,43 @@ class detailBody extends wg
$side = $this->block('side');
$bottom = $this->block('bottom');
$floating = $this->block('floating');
$isForm = $this->prop('isForm');
return div
if(!$isForm)
{
return div
(
setClass('detail-body rounded flex gap-1'),
set($this->props->skip(array_keys(static::getDefinedProps()))),
div
(
setClass('col gap-1 grow'),
$main,
$bottom,
center(setClass('pt-6'), $floating),
),
$side
);
}
return form
(
setClass('detail-body rounded flex gap-1'),
set::actionsClass('h-14 flex flex-auto items-center justify-center shadow'),
setClass('detail-body rounded col of-y-hidden bg-white'),
set($this->props->skip(array_keys(static::getDefinedProps()))),
setStyle('height', 'calc(100vh - 120px)'),
div
(
setClass('col gap-1 grow'),
$main,
$bottom,
center(setClass('pt-6'), $floating),
setClass('flex flex-auto of-y-auto'),
div
(
setClass('col grow border-r-4'),
setStyle('border-color', 'var(--zt-page-bg)'),
$main,
$bottom,
),
$side,
),
$side
);
}
}
+2 -2
View File
@@ -1,4 +1,4 @@
.detail-side {width: 370px; max-height: 752px;}
.detail-side {width: 370px;}
.detail-side .tab-content>.tab-pane {padding-left: 0 !important;}
.detail-side .tabs {padding: 12px 24px 8px 24px; background: #fff;}
.detail-side {background: #fff;}
.detail-side .tabs:not(:first-child) {border-top: 1px solid #E6EAF1;}
+1 -1
View File
@@ -13,7 +13,7 @@ class detailSide extends wg
{
return div
(
setClass('detail-side flex-none'),
setClass('detail-side flex-none px-6 py-3'),
set($this->props->skip(array_keys(static::getDefinedProps()))),
$this->children()
);