fix: clarify member activity statistics and their scope
This commit is contained in:
Vendored
+15
-2
@@ -237,9 +237,19 @@ textarea { width: 100%; resize: vertical; }
|
||||
}
|
||||
.mcard b { display: block; }
|
||||
.mcard .muted { margin-top: 2px; }
|
||||
.mcard-stats { display: flex; gap: 14px; margin-top: 12px; }
|
||||
.mcard-stats div b { font-size: 16px; }
|
||||
.mcard-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
|
||||
.mcard-stats div b { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
|
||||
.mcard-stats small { margin-left: 4px; font-size: 11px; color: var(--muted); font-weight: 400; }
|
||||
.mcard-stats div span { display: block; font-size: 12px; color: var(--muted); }
|
||||
.stats-help { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
|
||||
.stats-help summary { width: fit-content; cursor: pointer; padding: 6px 0; border-radius: 4px; }
|
||||
.stats-help summary:hover { color: var(--primary); }
|
||||
.stats-help summary:focus-visible { outline: 3px solid #28664f80; outline-offset: 4px; }
|
||||
.stats-help dl { margin: 10px 0; display: grid; gap: 10px; }
|
||||
.stats-help dl > div { display: flex; align-items: baseline; gap: 16px; }
|
||||
.stats-help dt { min-width: 4em; color: var(--ink); font-weight: 600; }
|
||||
.stats-help dd { margin: 0; line-height: 1.7; }
|
||||
.stats-help p { margin: 10px 0 0; line-height: 1.7; }
|
||||
.mcard-bio { margin-top: 10px; font-size: 13px; color: #3d4351; }
|
||||
|
||||
/* ---------- 个人主页 ---------- */
|
||||
@@ -518,6 +528,9 @@ button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px s
|
||||
.meta-item { max-width: 100%; }
|
||||
.acard-actions .btn { min-height: 42px; }
|
||||
.member-grid { grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); }
|
||||
#members-table { table-layout: fixed; }
|
||||
#members-table th, #members-table td { padding: 12px 8px; font-size: 13px; overflow-wrap: anywhere; }
|
||||
.stats-help summary { min-height: 44px; display: list-item; align-content: center; }
|
||||
.form-row { flex-direction: column; gap: 0; }
|
||||
.form-card { padding: 22px; }
|
||||
.modal-mask { padding: 16px 10px; }
|
||||
|
||||
Vendored
+22
-3
@@ -5,7 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>WorkLog · 活动记录</title>
|
||||
<meta name="theme-color" content="#f5f7f5" />
|
||||
<link rel="stylesheet" href="/assets/styles.css?v=7" />
|
||||
<link rel="stylesheet" href="/assets/styles.css?v=8" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
@@ -167,9 +167,18 @@
|
||||
<button id="members-compact" class="btn btn-ghost" type="button">简表</button>
|
||||
</div>
|
||||
</div>
|
||||
<details class="stats-help">
|
||||
<summary>仅统计公开活动 · 统计说明</summary>
|
||||
<dl>
|
||||
<div><dt>活动记录</dt><dd>成员的全部公开活动记录,包含已确认、已参加和缺席。</dd></div>
|
||||
<div><dt>已出席</dt><dd>活动记录中,参加状态标记为「已参加」的场数。</dd></div>
|
||||
<div><dt>发起活动</dt><dd>由该成员创建的公开活动场数,不代表已出席。</dd></div>
|
||||
</dl>
|
||||
<p>三项存在重叠,不能相加;发起活动时也会自动生成一条活动记录。</p>
|
||||
</details>
|
||||
<div id="members-list" class="member-grid"></div>
|
||||
<table id="members-table" class="hidden">
|
||||
<thead><tr><th>姓名</th><th>部门</th><th>参加数</th></tr></thead>
|
||||
<thead><tr><th scope="col">姓名</th><th scope="col">部门</th><th scope="col">活动记录</th><th scope="col">已出席</th><th scope="col">发起活动</th></tr></thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
<div id="members-empty" class="empty hidden">没有找到成员。</div>
|
||||
@@ -182,6 +191,16 @@
|
||||
<button class="btn ghost" id="user-back">← 返回</button>
|
||||
<div id="user-header" class="profile-header"></div>
|
||||
<div id="user-stats" class="stats-row"></div>
|
||||
<details class="stats-help">
|
||||
<summary><span id="user-stats-scope">仅统计公开活动</span> · 统计说明</summary>
|
||||
<dl>
|
||||
<div><dt>活动记录</dt><dd>全部活动记录,包含已确认、已参加和缺席。</dd></div>
|
||||
<div><dt>已出席</dt><dd>活动记录中,参加状态标记为「已参加」的场数。</dd></div>
|
||||
<div><dt>发起活动</dt><dd>由该成员创建的活动场数,不代表已出席。</dd></div>
|
||||
<div><dt>出席率</dt><dd>已出席场数 ÷ 活动记录总数,包含未开始的记录。</dd></div>
|
||||
</dl>
|
||||
<p>活动记录、已出席和发起活动存在重叠,不能相加;发起活动时也会自动生成一条活动记录。</p>
|
||||
</details>
|
||||
<div id="user-list" class="card-list"></div>
|
||||
<div id="user-empty" class="empty hidden">TA 的公开记录还很少。</div>
|
||||
</div>
|
||||
@@ -223,7 +242,7 @@
|
||||
|
||||
<div id="toast" class="toast hidden" role="status" aria-live="polite"></div>
|
||||
|
||||
<script src="/js/app.js?v=13"></script>
|
||||
<script src="/js/app.js?v=14"></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Vendored
+9
-6
@@ -573,9 +573,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="mcard-stats">
|
||||
<div><b>${u.total}</b><span>参加</span></div>
|
||||
<div><b>${u.attended}</b><span>已参加</span></div>
|
||||
<div><b>${u.organized}</b><span>发起</span></div>
|
||||
<div><b>${u.total}<small>场</small></b><span>活动记录</span></div>
|
||||
<div><b>${u.attended}<small>场</small></b><span>已出席</span></div>
|
||||
<div><b>${u.organized}<small>场</small></b><span>发起活动</span></div>
|
||||
</div>
|
||||
</div>`).join("");
|
||||
$("#members-table tbody").innerHTML = data.items.map((u) => `
|
||||
@@ -583,6 +583,8 @@
|
||||
<td><b>${esc(u.display_name)}</b></td>
|
||||
<td>${esc(u.department || "—")}</td>
|
||||
<td>${u.total}</td>
|
||||
<td>${u.attended}</td>
|
||||
<td>${u.organized}</td>
|
||||
</tr>`).join("");
|
||||
$("#members-list").classList.toggle("hidden", !data.items.length || compact);
|
||||
$("#members-table").classList.toggle("hidden", !data.items.length || !compact);
|
||||
@@ -627,10 +629,11 @@
|
||||
<p class="muted">${u.department ? `${esc(u.department)} · ` : ""}加入于 ${fmtDay(u.created_at)}</p>
|
||||
</div>`;
|
||||
const s = data.stats;
|
||||
$("#user-stats-scope").textContent = data.is_self ? "包含你自己的公开和私密活动" : "仅统计公开活动";
|
||||
$("#user-stats").innerHTML = `
|
||||
<div class="stat"><b>${s.total}</b><span>可见记录</span></div>
|
||||
<div class="stat"><b>${s.attended}</b><span>已参加</span></div>
|
||||
<div class="stat"><b>${s.organized}</b><span>发起</span></div>
|
||||
<div class="stat"><b>${s.total}</b><span>活动记录</span></div>
|
||||
<div class="stat"><b>${s.attended}</b><span>已出席</span></div>
|
||||
<div class="stat"><b>${s.organized}</b><span>发起活动</span></div>
|
||||
<div class="stat"><b>${Math.round((s.attendance_rate || 0) * 100)}%</b><span>出席率</span></div>`;
|
||||
$("#user-list").innerHTML = data.items.map((a) => activityCard(a)).join("");
|
||||
$("#user-list").classList.toggle("hidden", !data.items.length);
|
||||
|
||||
Reference in New Issue
Block a user