diff --git a/module/block/ui/assigntomeblock.html.php b/module/block/ui/assigntomeblock.html.php index 1abceb7f05..8f75193c27 100644 --- a/module/block/ui/assigntomeblock.html.php +++ b/module/block/ui/assigntomeblock.html.php @@ -10,23 +10,69 @@ declare(strict_types=1); */ namespace zin; +$blockNavCode = 'nav-' . uniqid(); + +$menus = array(); +foreach($hasViewPriv as $type => $bool) +{ + $selected = key($hasViewPriv); + $menus[] = li + ( + set('class', 'nav-item nav-switch'), + a + ( + set('class', $type == $selected ? 'active' : ''), + set('data-toggle', 'tab'), + set('href', "#assigntome{$type}Tab{$blockNavCode}"), + $type == 'review' ? $lang->my->audit : zget($lang->block->availableBlocks, $type) + ) + ); +} + +$contents = array(); +foreach($hasViewPriv as $type => $bool) +{ + if(empty($config->block->{$type}->dtable->fieldList) || empty(${"{$type}s"})) continue; + + $selected = key($hasViewPriv); + $contents[] = div + ( + set('class', 'tab-pane ' . ($type == $selected ? 'active' : '')), + set('id', "assigntome{$type}Tab{$blockNavCode}"), + dtable + ( + set::height(318), + set::bordered(false), + set::horzScrollbarPos('inside'), + set::cols(array_values($config->block->{$type}->dtable->fieldList)), + set::data(array_values(${"{$type}s"})), + set::userMap($users), + ) + ); +} panel ( set('class', 'assigntome-block'), + set('headingClass', 'border-b'), + set('bodyClass', 'p-0'), to::heading ( div ( set('class', 'panel-title flex w-full'), $block->title, + div + ( + ul + ( + set('class', 'nav nav-tabs'), + $menus + ) + ) ) ), - div - ( - '我的待处理', - '正在开发中...' - ) + div($contents) ); render(); diff --git a/module/block/ui/projectblock.html.php b/module/block/ui/projectblock.html.php index f316cd1e74..fc076944f3 100644 --- a/module/block/ui/projectblock.html.php +++ b/module/block/ui/projectblock.html.php @@ -42,7 +42,7 @@ panel dtable ( set::id('project'), - set::height(320), + set::height(318), set::bordered(false), set::horzScrollbarPos('inside'), set::cols(array_values($config->block->project->dtable->fieldList)),