feat: 日志统计汇总数字支持点击查看明细 #889

Merged
renshen merged 1 commits from fix/renshen-worklog-summary-card-details into main 2026-11-05 12:29:36 +08:00
2 changed files with 47 additions and 19 deletions

View File

@ -121,6 +121,19 @@
background: var(--vip-surface, #fff);
}
.log-statistics-card.is-link {
color: inherit;
text-decoration: none;
transition: border-color 150ms ease, background 150ms ease;
}
.log-statistics-card.is-link:hover,
.log-statistics-card.is-link:focus-visible {
border-color: var(--vip-content-accent, #B9954F);
background: var(--vip-content-accent-soft, #F7F0DE);
outline: none;
}
.log-statistics-card span {
color: var(--vip-content-muted, #595959);
font-size: 0.6875rem;
@ -137,6 +150,12 @@
text-decoration: none;
}
.log-statistics-card__hint {
color: var(--vip-content-accent-dark, #856632) !important;
font-size: 0.625rem !important;
font-weight: 600;
}
.log-statistics-panel {
overflow: hidden;
border: 1px solid var(--vip-border, #D8D2C7);
@ -320,36 +339,41 @@
</span>
</form>
@php
$currentDetailsUrl = route('business.pages.show', [
'section' => 'other',
'page' => 'log-statistics',
'from' => $worklogFilters['from'],
'to' => $worklogFilters['to'],
'date' => $worklogCurrent['statistics_date'],
'details' => 1,
]) . '#worklog-detail';
@endphp
<div class="log-statistics-cards">
<div class="log-statistics-card">
<a class="log-statistics-card is-link" href="#worklog-penalty" title="点击查看扣分明细">
<span>{{ $worklogPenalty['start_date'] ?: '2026-11-04' }} 起扣分合计</span>
<strong><a href="#worklog-penalty">{{ $worklogPenalty['total_points_formatted'] }}</a></strong>
</div>
<div class="log-statistics-card">
<strong>{{ $worklogPenalty['total_points_formatted'] }}</strong>
<span class="log-statistics-card__hint">点击查看扣分明细</span>
</a>
<a class="log-statistics-card is-link" href="{{ $currentDetailsUrl }}" title="点击查看提交人明细">
<span>{{ $worklogCurrent['statistics_date'] }} 提交人数</span>
<strong>
<a href="{{ route('business.pages.show', [
'section' => 'other',
'page' => 'log-statistics',
'from' => $worklogFilters['from'],
'to' => $worklogFilters['to'],
'date' => $worklogCurrent['statistics_date'],
'details' => 1,
]) }}#worklog-detail">{{ number_format((int) $worklogCurrent['submitter_count']) }}</a>
</strong>
</div>
<div class="log-statistics-card">
<strong>{{ number_format((int) $worklogCurrent['submitter_count']) }}</strong>
<span class="log-statistics-card__hint">点击查看提交人</span>
</a>
<a class="log-statistics-card is-link" href="{{ $currentDetailsUrl }}" title="点击查看日志明细">
<span>{{ $worklogCurrent['statistics_date'] }} 日志条数</span>
<strong>{{ number_format((int) $worklogCurrent['submission_count']) }}</strong>
</div>
<span class="log-statistics-card__hint">点击查看日志明细</span>
</a>
<div class="log-statistics-card">
<span>当前统计日截止时间</span>
<strong>{{ $worklogCutoffAt }}</strong>
</div>
<div class="log-statistics-card">
<a class="log-statistics-card is-link" href="#worklog-summary" title="点击查看每日统计">
<span>查询范围日志总数</span>
<strong>{{ number_format((int) $worklogTotalSubmissions) }}</strong>
</div>
<span class="log-statistics-card__hint">点击查看每日统计</span>
</a>
</div>
<section id="worklog-summary" class="log-statistics-panel" aria-label="每日日志提交统计">

View File

@ -171,6 +171,10 @@ class PagesTest extends FeatureTestCase
->assertSee('title="查看 2026-11-03 提交人姓名"', false)
->assertSee('title="查看 2026-11-03 日志明细"', false)
->assertSee('收起明细')
->assertSeeText('点击查看扣分明细')
->assertSeeText('点击查看提交人')
->assertSeeText('点击查看日志明细')
->assertSeeText('点击查看每日统计')
->assertSee('data-worklog-penalty', false)
->assertSeeText('2026-11-04 起扣分合计')
->assertSeeText('第 1 次漏写扣 10 分')