diff --git a/static/app.js b/static/app.js index 906562c..e09f88a 100644 --- a/static/app.js +++ b/static/app.js @@ -1009,34 +1009,82 @@ Blueprint — 蓝图六板块 ================================================================ */ + var blueprintData = null; + var blueprintFilter = 'all'; + function loadBlueprint() { apiGetStats(function(err, data) { if (err || !data || !data.pillar_breakdown) return; - var pb = data.pillar_breakdown; - PILLARS.forEach(function(p){ - var el = document.getElementById('bp-count-' + p.name); - var info = pb[p.name] || {}; - var m = info.morning || 0, e = info.evening || 0, s = info.study || 0; - if (el) el.textContent = '立志' + m + ' · 责善' + e + ' · 勤学' + s; - // 显示详情列表 - var detailEl = document.getElementById('bp-detail-' + p.name); - if (detailEl) { - var html = ''; - (info.morning_items || []).forEach(function(mi){ - html += '
🥼 ' + esc(mi.text) + '
'; - }); - (info.evening_items || []).forEach(function(ei){ - html += '
🔍 ' + esc(ei.mistake || ei.improvement) + '
'; - }); - (info.study_items || []).forEach(function(si){ - html += '
📚 ' + esc(si.name) + '
'; - }); - detailEl.innerHTML = html || '
暂无记录
'; - } - }); + blueprintData = data.pillar_breakdown; + renderBlueprintPillars(blueprintData); + renderBlueprintList(); }); } + function renderBlueprintPillars(pb) { + var container = document.getElementById('blueprint-pillars'); + 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 += '
' + + '
' + p.emoji + '
' + + '
' + p.name + '
' + + '
' + + (m ? '🥼' + m + '' : '') + + (e ? '🔍' + e + '' : '') + + (s ? '📚' + s + '' : '') + + (total === 0 ? '' : '') + + '
' + + '
'; + }); + container.innerHTML = html; + } + + function renderBlueprintList() { + var list = document.getElementById('bp-list'); + var empty = document.getElementById('bp-list-empty'); + if (!list || !blueprintData) return; + var items = []; + PILLARS.forEach(function(p){ + var info = blueprintData[p.name] || {}; + if (blueprintFilter === 'all' || blueprintFilter === 'morning') { + (info.morning_items || []).forEach(function(mi){ items.push({pillar: p, text: mi.text, type: 'morning'}); }); + } + if (blueprintFilter === 'all' || blueprintFilter === 'evening') { + (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}); }); + } + }); + if (items.length === 0) { + list.innerHTML = ''; + if (empty) empty.style.display = 'block'; + return; + } + if (empty) empty.style.display = 'none'; + var typeLabels = {morning: '立志', evening: '责善', study: '勤学'}; + var html = ''; + items.forEach(function(item){ + html += '
' + + '' + item.pillar.emoji + ' ' + item.pillar.name + '' + + '' + (typeLabels[item.type] || item.type) + '' + + '' + esc(item.text) + '' + + '
'; + }); + list.innerHTML = html; + } + + window.filterBlueprint = function(btn) { + blueprintFilter = btn.dataset.filter; + document.querySelectorAll('.bp-tab').forEach(function(t){ t.classList.remove('active'); }); + btn.classList.add('active'); + renderBlueprintList(); + }; + /* ================================================================ Init ================================================================ */ diff --git a/static/style.css b/static/style.css index 0b3fbf7..71c7204 100644 --- a/static/style.css +++ b/static/style.css @@ -1461,25 +1461,84 @@ body { .bp-icon { font-size: 32px; margin-bottom: 8px; } .bp-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; } .bp-desc { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.5; } -.bp-count { font-size: 13px; font-weight: 600; color: var(--primary); } +.bp-count { font-size: 12px; font-weight: 600; color: var(--primary); display: flex; gap: 10px; justify-content: center; } +.bp-type { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; } +.bp-type.morning { color: var(--warning); } +.bp-type.evening { color: var(--danger); } +.bp-type.study { color: var(--success); } -.bp-detail { - margin-top: 10px; - text-align: left; - font-size: 11px; - max-height: 120px; - overflow-y: auto; - border-top: 1px solid var(--border); - padding-top: 8px; +/* Tab 筛选 */ +.bp-tabs { + display: flex; + gap: 4px; + margin-bottom: 16px; + border-bottom: 1.5px solid var(--border); + padding-bottom: 0; } -.bp-item { - padding: 2px 0; +.bp-tab { + padding: 8px 16px; + border: none; + background: none; + font-size: 13px; + font-weight: 500; + color: var(--text-dim); + cursor: pointer; + border-bottom: 2px solid transparent; + margin-bottom: -1.5px; + transition: all 0.15s; + font-family: inherit; +} +.bp-tab:hover { color: var(--text); } +.bp-tab.active { color: var(--primary); border-bottom-color: var(--primary); } + +/* 明细列表 */ +.bp-list { + display: flex; + flex-direction: column; + gap: 1px; +} +.bp-list-item { + display: flex; + align-items: center; + gap: 10px; + padding: 10px 14px; + background: var(--card); + border-bottom: 0.5px solid var(--border); + transition: background 0.15s; +} +.bp-list-item:hover { background: var(--bg); } +.bp-item-pillar { + font-size: 12px; color: var(--text-dim); white-space: nowrap; + min-width: 80px; +} +.bp-item-type { + font-size: 11px; + font-weight: 600; + padding: 2px 8px; + border-radius: 8px; + white-space: nowrap; +} +.bp-item-type.morning { background: var(--warning-light); color: #D97706; } +.bp-item-type.evening { background: var(--danger-light); color: var(--danger); } +.bp-item-type.study { background: var(--success-light); color: var(--success); } +.bp-item-text { + flex: 1; + font-size: 13px; + color: var(--text); overflow: hidden; text-overflow: ellipsis; + white-space: nowrap; } -.bp-empty { color: var(--text-muted); text-align: center; padding: 6px 0; } +.bp-list-empty { + font-size: 13px; + color: var(--text-muted); + text-align: center; + padding: 32px 0; +} + +/* 移除旧样式 */ @media (max-width: 900px) { .blueprint-pillars { grid-template-columns: repeat(2, 1fr); } diff --git a/templates/index.html b/templates/index.html index f114f29..aed74ee 100644 --- a/templates/index.html +++ b/templates/index.html @@ -281,50 +281,18 @@
一辈子,干成一件事 — 用 AI 重构医疗全链路
-
-
-
🥼
-
医疗服务
-
诊疗能力 · 临床路径 · 医疗质量
-
-
-
-
-
💊
-
医药营销
-
科普 · 科研 · 学术会议 · 患者管理
-
-
-
-
-
🛡️
-
医疗支付
-
医保 · 商保 · 支付闭环
-
-
-
-
-
🤖
-
AI 智能
-
数字人 · 智能平台 · AI 赋能
-
-
-
-
-
🏛️
-
公司治理
-
组织 · 人才 · 制度 · 文化
-
-
-
-
-
🎯
-
个人修养
-
立志 · 责善 · 改过 · 勤学
-
-
-
+ +
+ +
+ + + +
+ +
+