ui(component): metric_explain默认折叠(details)避免Dashboard口径说明撑满

This commit is contained in:
萝卜
2026-03-17 19:37:09 +08:00
parent 283cc6349a
commit e4156ecf75
2 changed files with 52 additions and 6 deletions

View File

@@ -1,13 +1,25 @@
@php
$items = $items ?? [];
$title = $title ?? '口径说明';
$collapsible = (bool) ($collapsible ?? true);
@endphp
@if(is_array($items) && count($items) > 0)
<div class="muted muted-xs">
<strong>{{ $title }}</strong>
@foreach($items as $i => $text)
<span>{{ $text }}@if($i < count($items) - 1)@endif</span>
@endforeach
</div>
@if($collapsible)
<details class="muted muted-xs" data-role="metric-explain" style="margin-top:4px;">
<summary style="cursor:pointer; user-select:none;"><strong>{{ $title }}</strong><span class="muted">(点击展开)</span></summary>
<div class="mt-6">
@foreach($items as $i => $text)
<span>{{ $text }}@if($i < count($items) - 1)@endif</span>
@endforeach
</div>
</details>
@else
<div class="muted muted-xs" data-role="metric-explain" style="margin-top:4px;">
<strong>{{ $title }}</strong>
@foreach($items as $i => $text)
<span>{{ $text }}@if($i < count($items) - 1)@endif</span>
@endforeach
</div>
@endif
@endif