* zin: refactor detailbody to compatible with edit page.
This commit is contained in:
@@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;}
|
||||
|
||||
@@ -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()
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user