v1.4.0 — 蓝图六板块体系
- 立志项新增板块选择器(医疗服务/医药营销/医疗支付/AI智能/公司治理/个人修养)
- 数据格式从纯字符串升级为 {text, pillar},向后兼容旧数据
- 新增蓝图面板:展示使命 + 六板块卡片 + 各板块立志统计
- stats API 新增 morning_items 返回全部立志数据
This commit is contained in:
16
app.py
16
app.py
@@ -77,6 +77,7 @@ def compute_stats():
|
||||
total_evening = 0
|
||||
total_study = 0
|
||||
calendar = {}
|
||||
all_morning_items = [] # 收集所有立志项用于蓝图统计
|
||||
|
||||
for row in rows:
|
||||
d = row['date']
|
||||
@@ -85,7 +86,17 @@ def compute_stats():
|
||||
evening = data.get('evening', [])
|
||||
study = data.get('study', [])
|
||||
|
||||
morning_count = sum(1 for x in morning if isinstance(x, str) and x.strip())
|
||||
# 收集 morning items
|
||||
for mi in morning:
|
||||
if isinstance(mi, dict) and (mi.get('text', '') or '').strip():
|
||||
all_morning_items.append(mi)
|
||||
elif isinstance(mi, str) and mi.strip():
|
||||
all_morning_items.append({'text': mi, 'pillar': ''})
|
||||
|
||||
morning_count = sum(1 for x in morning if (
|
||||
isinstance(x, str) and x.strip() or
|
||||
isinstance(x, dict) and (x.get('text', '') or '').strip()
|
||||
))
|
||||
evening_count = sum(1 for x in evening if (
|
||||
isinstance(x, str) and x.strip() or
|
||||
isinstance(x, dict) and (x.get('mistake', '') or '').strip()
|
||||
@@ -106,7 +117,8 @@ def compute_stats():
|
||||
return dict(
|
||||
total_days=total_days, total_morning=total_morning,
|
||||
total_evening=total_evening, total_study=total_study,
|
||||
calendar=calendar
|
||||
calendar=calendar,
|
||||
morning_items=all_morning_items
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -25,6 +25,16 @@
|
||||
'知识库能力提升'
|
||||
];
|
||||
|
||||
/* 蓝图六板块 */
|
||||
var PILLARS = [
|
||||
{key:'medical_service', name:'医疗服务', emoji:'🥼'},
|
||||
{key:'pharma_mkt', name:'医药营销', emoji:'💊'},
|
||||
{key:'payment', name:'医疗支付', emoji:'🛡️'},
|
||||
{key:'ai', name:'AI 智能', emoji:'🤖'},
|
||||
{key:'governance', name:'公司治理', emoji:'🏛️'},
|
||||
{key:'self_cultivation', name:'个人修养', emoji:'🎯'}
|
||||
];
|
||||
|
||||
/* ================================================================
|
||||
Toast
|
||||
================================================================ */
|
||||
@@ -106,6 +116,7 @@
|
||||
if (name === 'weekly') loadWeekly();
|
||||
if (name === 'history') loadHistory();
|
||||
if (name === 'wishes') loadWishes();
|
||||
if (name === 'blueprint') loadBlueprint();
|
||||
};
|
||||
|
||||
/* ================================================================
|
||||
@@ -231,7 +242,11 @@
|
||||
var mEls = document.querySelectorAll('#morning-list .item-row input');
|
||||
for (var i=0; i<mEls.length; i++) {
|
||||
var v = mEls[i].value.trim();
|
||||
if (v) morningItems.push(v);
|
||||
if (v) {
|
||||
var row = mEls[i].closest('.item-row');
|
||||
var sel = row ? row.querySelector('.morning-pillar') : null;
|
||||
morningItems.push({ text: v, pillar: sel ? sel.value : '' });
|
||||
}
|
||||
}
|
||||
|
||||
var eveningItems = [];
|
||||
@@ -266,10 +281,15 @@
|
||||
var evening = data.evening || [];
|
||||
var study = data.study || [];
|
||||
|
||||
// 早间立志
|
||||
// 早间立志 (兼容旧纯字符串和新 {text, pillar} 格式)
|
||||
document.getElementById('morning-list').innerHTML = '';
|
||||
if (morning.length === 0) morning = [''];
|
||||
for (var m=0; m<morning.length; m++) addMorningRow(morning[m]);
|
||||
if (morning.length === 0) morning = [{text: '', pillar: ''}];
|
||||
for (var m=0; m<morning.length; m++) {
|
||||
var mi = morning[m];
|
||||
var txt = typeof mi === 'string' ? mi : (mi.text || '');
|
||||
var pil = typeof mi === 'string' ? '' : (mi.pillar || '');
|
||||
addMorningRow(txt, pil);
|
||||
}
|
||||
|
||||
// 责善改过
|
||||
document.getElementById('evening-list').innerHTML = '';
|
||||
@@ -296,14 +316,21 @@
|
||||
Dynamic Rows
|
||||
================================================================ */
|
||||
|
||||
function addMorningRow(val) {
|
||||
function addMorningRow(val, pillar) {
|
||||
var container = document.getElementById('morning-list');
|
||||
var idx = container.children.length;
|
||||
val = val || '';
|
||||
var text = typeof val === 'string' ? val : (val && val.text ? val.text : '');
|
||||
var pil = pillar || (val && val.pillar ? val.pillar : '');
|
||||
text = text || '';
|
||||
var pillOpts = '<option value="">-- 板块 --</option>';
|
||||
PILLARS.forEach(function(p){
|
||||
pillOpts += '<option value="' + p.name + '"' + (pil === p.name ? ' selected' : '') + '>' + p.emoji + ' ' + p.name + '</option>';
|
||||
});
|
||||
var div = document.createElement('div');
|
||||
div.className = 'item-row';
|
||||
div.innerHTML = '<span class="idx">' + (idx+1) + '.</span>' +
|
||||
'<input type="text" value="' + esc(val) + '" placeholder="今天最重要的一件事…">' +
|
||||
'<input type="text" value="' + esc(text) + '" placeholder="今天最重要的一件事…">' +
|
||||
'<select class="morning-pillar">' + pillOpts + '</select>' +
|
||||
'<button class="btn-del" onclick="this.parentElement.remove();renumberMorning()"><svg class="icon-sm"><use href="#icon-x"/></svg></button>';
|
||||
container.appendChild(div);
|
||||
renumberMorning();
|
||||
@@ -983,6 +1010,27 @@
|
||||
|
||||
window.renderWishes = renderWishes;
|
||||
|
||||
/* ================================================================
|
||||
Blueprint — 蓝图六板块
|
||||
================================================================ */
|
||||
|
||||
function loadBlueprint() {
|
||||
apiGetStats(function(err, data) {
|
||||
if (err || !data || !data.morning_items) return;
|
||||
var counts = {};
|
||||
PILLARS.forEach(function(p){ counts[p.name] = 0; });
|
||||
var total = 0;
|
||||
(data.morning_items || []).forEach(function(item){
|
||||
var name = (typeof item === 'string') ? '' : (item.pillar || '');
|
||||
if (counts[name] !== undefined) { counts[name]++; total++; }
|
||||
});
|
||||
PILLARS.forEach(function(p){
|
||||
var el = document.getElementById('bp-count-' + p.name);
|
||||
if (el) el.textContent = counts[p.name] + ' 条';
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/* ================================================================
|
||||
Init
|
||||
================================================================ */
|
||||
|
||||
@@ -1423,3 +1423,60 @@ body {
|
||||
}
|
||||
.main-content { height: auto; overflow: visible; padding: 16px; }
|
||||
}
|
||||
|
||||
/* ═══════════════════════════════════════════
|
||||
Blueprint Panel
|
||||
═══════════════════════════════════════════ */
|
||||
|
||||
.blueprint-mission {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: var(--primary);
|
||||
margin-bottom: 24px;
|
||||
padding: 12px 16px;
|
||||
background: var(--primary-light);
|
||||
border-radius: var(--radius);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.blueprint-pillars {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.blueprint-pillar {
|
||||
background: var(--card);
|
||||
border: 1.5px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
padding: 20px 16px;
|
||||
text-align: center;
|
||||
transition: border-color 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
.blueprint-pillar:hover {
|
||||
border-color: var(--primary);
|
||||
box-shadow: 0 4px 16px rgba(74,108,247,0.08);
|
||||
}
|
||||
|
||||
.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); }
|
||||
|
||||
/* 立志板块选择器 */
|
||||
.morning-pillar {
|
||||
padding: 4px 8px;
|
||||
border: 1.5px solid var(--border);
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: 11px;
|
||||
font-family: inherit;
|
||||
color: var(--text-dim);
|
||||
background: var(--card);
|
||||
min-width: 100px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.morning-pillar:hover { border-color: var(--primary); }
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.blueprint-pillars { grid-template-columns: repeat(2, 1fr); }
|
||||
}
|
||||
|
||||
@@ -107,6 +107,10 @@
|
||||
<svg class="icon-sm"><use href="#icon-list-bullet"/></svg>
|
||||
历史记录
|
||||
</a>
|
||||
<a class="nav-item" data-panel="blueprint" onclick="switchPanel('blueprint')">
|
||||
<svg class="icon-sm"><use href="#icon-star"/></svg>
|
||||
蓝图
|
||||
</a>
|
||||
</nav>
|
||||
|
||||
<!-- 底部新建按钮 -->
|
||||
@@ -269,6 +273,54 @@
|
||||
<div class="wishes-empty" id="wishes-empty" style="display:none">暂无心愿,点击上方按钮添加</div>
|
||||
</section>
|
||||
|
||||
<!-- ── 蓝图面板 ── -->
|
||||
<section class="panel" id="panel-blueprint">
|
||||
<div class="panel-header">
|
||||
<h2>蓝图 · 数字医疗集团</h2>
|
||||
</div>
|
||||
<div class="blueprint-mission">
|
||||
一辈子,干成一件事 — 用 AI 重构医疗全链路
|
||||
</div>
|
||||
<div class="blueprint-pillars" id="blueprint-pillars">
|
||||
<div class="blueprint-pillar" data-pillar="医疗服务">
|
||||
<div class="bp-icon">🥼</div>
|
||||
<div class="bp-name">医疗服务</div>
|
||||
<div class="bp-desc">诊疗能力 · 临床路径 · 医疗质量</div>
|
||||
<div class="bp-count" id="bp-count-医疗服务">—</div>
|
||||
</div>
|
||||
<div class="blueprint-pillar" data-pillar="医药营销">
|
||||
<div class="bp-icon">💊</div>
|
||||
<div class="bp-name">医药营销</div>
|
||||
<div class="bp-desc">科普 · 科研 · 学术会议 · 患者管理</div>
|
||||
<div class="bp-count" id="bp-count-医药营销">—</div>
|
||||
</div>
|
||||
<div class="blueprint-pillar" data-pillar="医疗支付">
|
||||
<div class="bp-icon">🛡️</div>
|
||||
<div class="bp-name">医疗支付</div>
|
||||
<div class="bp-desc">医保 · 商保 · 支付闭环</div>
|
||||
<div class="bp-count" id="bp-count-医疗支付">—</div>
|
||||
</div>
|
||||
<div class="blueprint-pillar" data-pillar="AI 智能">
|
||||
<div class="bp-icon">🤖</div>
|
||||
<div class="bp-name">AI 智能</div>
|
||||
<div class="bp-desc">数字人 · 智能平台 · AI 赋能</div>
|
||||
<div class="bp-count" id="bp-count-AI 智能">—</div>
|
||||
</div>
|
||||
<div class="blueprint-pillar" data-pillar="公司治理">
|
||||
<div class="bp-icon">🏛️</div>
|
||||
<div class="bp-name">公司治理</div>
|
||||
<div class="bp-desc">组织 · 人才 · 制度 · 文化</div>
|
||||
<div class="bp-count" id="bp-count-公司治理">—</div>
|
||||
</div>
|
||||
<div class="blueprint-pillar" data-pillar="个人修养">
|
||||
<div class="bp-icon">🎯</div>
|
||||
<div class="bp-name">个人修养</div>
|
||||
<div class="bp-desc">立志 · 责善 · 改过 · 勤学</div>
|
||||
<div class="bp-count" id="bp-count-个人修养">—</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</main>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user