v1.4.5 — 蓝图去统计数+勤学显示备注

- 六板块卡片移除统计数字,仅保留 emoji+名称
- 勤学项在列表中显示备注 note
This commit is contained in:
mac
2026-06-04 16:38:54 +08:00
parent 8c81fae334
commit 8ac6f1af6b
3 changed files with 13 additions and 10 deletions

1
app.py
View File

@@ -137,6 +137,7 @@ def compute_stats():
all_study_items.append({
'name': name.strip(),
'done': si.get('done', False) if isinstance(si, dict) else False,
'note': si.get('note', '') if isinstance(si, dict) else '',
'pillar': pillar
})

View File

@@ -1026,18 +1026,9 @@
if (!container) return;
var html = '';
PILLARS.forEach(function(p){
var info = pb[p.name] || {};
var m = info.morning || 0, e = info.evening || 0, s = info.study || 0;
var total = m + e + s;
html += '<div class="blueprint-pillar" data-pillar="' + p.name + '">' +
'<div class="bp-icon">' + p.emoji + '</div>' +
'<div class="bp-name">' + p.name + '</div>' +
'<div class="bp-count">' +
(m ? '<span class="bp-type morning">🥼' + m + '</span>' : '') +
(e ? '<span class="bp-type evening">🔍' + e + '</span>' : '') +
(s ? '<span class="bp-type study">📚' + s + '</span>' : '') +
(total === 0 ? '<span class="bp-type">—</span>' : '') +
'</div>' +
'</div>';
});
container.innerHTML = html;
@@ -1057,7 +1048,7 @@
(info.evening_items || []).forEach(function(ei){ items.push({pillar: p, text: ei.mistake || ei.improvement, type: 'evening'}); });
}
if (blueprintFilter === 'all' || blueprintFilter === 'study') {
(info.study_items || []).forEach(function(si){ items.push({pillar: p, text: si.name, type: 'study', done: si.done}); });
(info.study_items || []).forEach(function(si){ items.push({pillar: p, text: si.name, type: 'study', done: si.done, note: si.note}); });
}
});
if (items.length === 0) {
@@ -1069,10 +1060,12 @@
var typeLabels = {morning: '立志', evening: '责善', study: '勤学'};
var html = '';
items.forEach(function(item){
var noteHtml = item.type === 'study' && item.note ? '<span class="bp-item-note">' + esc(item.note) + '</span>' : '';
html += '<div class="bp-list-item">' +
'<span class="bp-item-pillar">' + item.pillar.emoji + ' ' + item.pillar.name + '</span>' +
'<span class="bp-item-type ' + item.type + '">' + (typeLabels[item.type] || item.type) + '</span>' +
'<span class="bp-item-text">' + esc(item.text) + '</span>' +
noteHtml +
'</div>';
});
list.innerHTML = html;

View File

@@ -1531,6 +1531,15 @@ body {
text-overflow: ellipsis;
white-space: nowrap;
}
.bp-item-note {
font-size: 11px;
color: var(--text-muted);
margin-left: 8px;
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.bp-list-empty {
font-size: 13px;
color: var(--text-muted);