Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c5512d39d0 | ||
|
|
9fff01a272 | ||
|
|
979e7fd097 | ||
|
|
a2f009f986 | ||
|
|
30904723d2 | ||
|
|
07fa69478f | ||
|
|
377d1ba2cf | ||
|
|
f674bb4c66 | ||
|
|
e5d416f89f | ||
|
|
e09883a33f | ||
|
|
55dc83ce83 | ||
|
|
ae817fe8f9 | ||
|
|
9e296e59e6 | ||
|
|
3f1becd374 | ||
|
|
b5d7720e52 | ||
|
|
caec0196bb | ||
|
|
d1404765d2 | ||
|
|
e2c97ca1fb | ||
|
|
8188364813 | ||
|
|
b50d8e17e2 | ||
|
|
c70aeff2ed | ||
|
|
f63ab8b8ea | ||
|
|
b48e95c800 | ||
|
|
bf1be1aa9f | ||
|
|
083935f2da | ||
|
|
e6ae7f2eb4 | ||
|
|
24561e1f59 | ||
|
|
9fad18733e | ||
|
|
5e97f6d6d8 | ||
|
|
99bc6d3c6c | ||
|
|
5d3192dfaf | ||
|
|
9c9511e817 |
132
.gitea/workflows/deploy.yml
Normal file
132
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
name: Deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: prod-deploy
|
||||||
|
env:
|
||||||
|
DEPLOY_BASE: /opt/ziwei-power
|
||||||
|
REPO_URL: https://qiukai:${{ secrets.DEPLOY_TOKEN }}@git.qiukai.me/qiukai/ziwei-power.git
|
||||||
|
SERVICE_NAME: ziwei-power
|
||||||
|
steps:
|
||||||
|
- name: Clone and deploy
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
RELEASE_ID="${{ github.sha }}"
|
||||||
|
RELEASE_DIR="${DEPLOY_BASE}/releases/${RELEASE_ID}"
|
||||||
|
CLONE_DIR="/tmp/zw-deploy-${RELEASE_ID}"
|
||||||
|
|
||||||
|
echo "=== 1. Clone repository ==="
|
||||||
|
rm -rf "${CLONE_DIR}"
|
||||||
|
git clone --depth 1 --branch main "${REPO_URL}" "${CLONE_DIR}"
|
||||||
|
|
||||||
|
echo "=== 2. Prepare release directory ==="
|
||||||
|
rm -rf "${RELEASE_DIR}"
|
||||||
|
mkdir -p "${RELEASE_DIR}"
|
||||||
|
|
||||||
|
# Copy repo content to release dir (exclude .git, .env, venv, data)
|
||||||
|
rsync -a --exclude='.git' \
|
||||||
|
--exclude='.env' \
|
||||||
|
--exclude='.env.local' \
|
||||||
|
--exclude='.venv' \
|
||||||
|
--exclude='data/' \
|
||||||
|
--exclude='__pycache__' \
|
||||||
|
--exclude='.gitea' \
|
||||||
|
"${CLONE_DIR}/" "${RELEASE_DIR}/"
|
||||||
|
|
||||||
|
echo "=== 2.5 Ensure .env secrets ==="
|
||||||
|
mkdir -p "${DEPLOY_BASE}/shared"
|
||||||
|
SHARED_ENV="${DEPLOY_BASE}/shared/.env"
|
||||||
|
touch "${SHARED_ENV}"
|
||||||
|
ensure_env_var() {
|
||||||
|
key="$1"; val="$2"
|
||||||
|
if [ -z "$val" ]; then
|
||||||
|
echo " ! ${key} 未提供(CI secret 为空),跳过写入"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
if ! grep -q "^${key}=" "${SHARED_ENV}"; then
|
||||||
|
echo "${key}=${val}" >> "${SHARED_ENV}"
|
||||||
|
echo " + 已写入 ${key}"
|
||||||
|
else
|
||||||
|
echo " = ${key} 已存在,保留原值"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
ensure_env_var "SECRET_KEY" "${{ secrets.ZW_SECRET_KEY }}"
|
||||||
|
|
||||||
|
echo "=== 3. Link shared resources ==="
|
||||||
|
mkdir -p "${RELEASE_DIR}/data"
|
||||||
|
# .env from shared dir (not in git)
|
||||||
|
ln -sfn "${DEPLOY_BASE}/shared/.env" "${RELEASE_DIR}/.env"
|
||||||
|
|
||||||
|
# Database dir symlink to persist across releases
|
||||||
|
DB_DIR="$HOME/.workbuddy/data/ziwei-power"
|
||||||
|
mkdir -p "${DB_DIR}"
|
||||||
|
ln -sfn "${DB_DIR}" "${RELEASE_DIR}/data"
|
||||||
|
|
||||||
|
echo "=== 4. Setup Python venv ==="
|
||||||
|
cd "${RELEASE_DIR}"
|
||||||
|
python3 -m venv .venv
|
||||||
|
. .venv/bin/activate
|
||||||
|
pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
echo "=== 5. Setup systemd service ==="
|
||||||
|
if ! systemctl is-enabled "${SERVICE_NAME}" >/dev/null 2>&1; then
|
||||||
|
cat > "/etc/systemd/system/${SERVICE_NAME}.service" <<EOF
|
||||||
|
[Unit]
|
||||||
|
Description=ziwei-power 日课系统
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=$USER
|
||||||
|
WorkingDirectory=${DEPLOY_BASE}/current
|
||||||
|
ExecStart=${DEPLOY_BASE}/current/.venv/bin/python ${DEPLOY_BASE}/current/app.py
|
||||||
|
Restart=always
|
||||||
|
RestartSec=5
|
||||||
|
Environment=PORT=5058
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl enable "${SERVICE_NAME}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "=== 6. Restart service ==="
|
||||||
|
ln -sfn "${RELEASE_DIR}" "${DEPLOY_BASE}/current"
|
||||||
|
systemctl restart "${SERVICE_NAME}"
|
||||||
|
sleep 3
|
||||||
|
|
||||||
|
echo "=== 7. Health check ==="
|
||||||
|
for i in 1 2 3 4 5; do
|
||||||
|
if curl -fsS http://127.0.0.1:5058/api/health >/dev/null 2>&1; then
|
||||||
|
echo "Health check passed"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echo "Attempt $i: waiting for service..."
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
|
||||||
|
# Final verify
|
||||||
|
if ! curl -fsS http://127.0.0.1:5058/api/health >/dev/null 2>&1; then
|
||||||
|
echo "ERROR: Health check failed after 5 attempts"
|
||||||
|
echo "Rolling back to previous release..."
|
||||||
|
PREV=$(ls -t "${DEPLOY_BASE}/releases" | sed -n '2p')
|
||||||
|
if [ -n "${PREV}" ]; then
|
||||||
|
ln -sfn "${DEPLOY_BASE}/releases/${PREV}" "${DEPLOY_BASE}/current"
|
||||||
|
systemctl restart "${SERVICE_NAME}"
|
||||||
|
echo "Rolled back to ${PREV}"
|
||||||
|
fi
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "=== 8. Cleanup old releases ==="
|
||||||
|
ls -dt "${DEPLOY_BASE}"/releases/*/ | tail -n +6 | xargs -r rm -rf
|
||||||
|
|
||||||
|
echo "=== 9. Cleanup temp ==="
|
||||||
|
rm -rf "${CLONE_DIR}"
|
||||||
|
|
||||||
|
echo "=== Deploy complete: ${RELEASE_ID} ==="
|
||||||
81
app.py
81
app.py
@@ -6,7 +6,7 @@ from datetime import timedelta
|
|||||||
from functools import wraps
|
from functools import wraps
|
||||||
from flask import Flask, render_template, request, jsonify, session, redirect, url_for
|
from flask import Flask, render_template, request, jsonify, session, redirect, url_for
|
||||||
from werkzeug.security import generate_password_hash, check_password_hash
|
from werkzeug.security import generate_password_hash, check_password_hash
|
||||||
from database import init_db, get_checkin, save_checkin, delete_checkin, get_all_checkins, get_weeks_list, get_daily_backup, get_wishes, save_wish, update_wish, delete_wish, reorder_wishes
|
from database import init_db, get_checkin, save_checkin, delete_checkin, get_all_checkins, get_weeks_list, get_daily_backup
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
# 固定密钥确保 gunicorn 多 worker 下 session 可互通
|
# 固定密钥确保 gunicorn 多 worker 下 session 可互通
|
||||||
@@ -136,8 +136,7 @@ def compute_stats():
|
|||||||
pillar = classify_auto(name)
|
pillar = classify_auto(name)
|
||||||
all_study_items.append({
|
all_study_items.append({
|
||||||
'name': name.strip(),
|
'name': name.strip(),
|
||||||
'done': si.get('done', False) if isinstance(si, dict) else False,
|
'count': si.get('count', 0) if isinstance(si, dict) else 0,
|
||||||
'note': si.get('note', '') if isinstance(si, dict) else '',
|
|
||||||
'pillar': pillar
|
'pillar': pillar
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -149,7 +148,7 @@ def compute_stats():
|
|||||||
isinstance(x, str) and x.strip() or
|
isinstance(x, str) and x.strip() or
|
||||||
isinstance(x, dict) and (x.get('mistake', '') or '').strip()
|
isinstance(x, dict) and (x.get('mistake', '') or '').strip()
|
||||||
))
|
))
|
||||||
study_count = sum(1 for x in study if x.get('done'))
|
study_count = sum(1 for x in study if x.get('count', 0) > 0)
|
||||||
|
|
||||||
total_morning += morning_count
|
total_morning += morning_count
|
||||||
total_evening += evening_count
|
total_evening += evening_count
|
||||||
@@ -202,11 +201,9 @@ def compute_stats():
|
|||||||
def index():
|
def index():
|
||||||
import json
|
import json
|
||||||
stats = compute_stats()
|
stats = compute_stats()
|
||||||
wishes = [dict(w) for w in get_wishes()]
|
|
||||||
return render_template('index.html',
|
return render_template('index.html',
|
||||||
username=session.get('display_name', session.get('username', '')),
|
username=session.get('display_name', session.get('username', '')),
|
||||||
initial_stats=json.dumps(stats, ensure_ascii=False),
|
initial_stats=json.dumps(stats, ensure_ascii=False))
|
||||||
initial_wishes=json.dumps(wishes, ensure_ascii=False))
|
|
||||||
|
|
||||||
|
|
||||||
# ── API ──────────────────────────────────────────────
|
# ── API ──────────────────────────────────────────────
|
||||||
@@ -283,54 +280,6 @@ def api_user():
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
# ── 心愿清单 API ──────────────────────────────
|
|
||||||
|
|
||||||
@app.route('/api/wishes', methods=['GET'])
|
|
||||||
@login_required
|
|
||||||
def api_get_wishes():
|
|
||||||
wishes = [dict(w) for w in get_wishes()]
|
|
||||||
return jsonify({'ok': True, 'data': wishes})
|
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/wishes', methods=['POST'])
|
|
||||||
@login_required
|
|
||||||
def api_create_wish():
|
|
||||||
body = request.get_json(force=True)
|
|
||||||
name = body.get('name', '').strip()
|
|
||||||
if not name:
|
|
||||||
return jsonify({'ok': False, 'error': '名称不能为空'}), 400
|
|
||||||
quadrant = body.get('quadrant', '重要不紧急')
|
|
||||||
deadline = body.get('deadline', '')
|
|
||||||
wid = save_wish(name, quadrant, deadline)
|
|
||||||
return jsonify({'ok': True, 'id': wid})
|
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/wishes/<int:wish_id>', methods=['PUT'])
|
|
||||||
@login_required
|
|
||||||
def api_update_wish(wish_id):
|
|
||||||
body = request.get_json(force=True)
|
|
||||||
update_wish(wish_id, **body)
|
|
||||||
return jsonify({'ok': True})
|
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/wishes/<int:wish_id>', methods=['DELETE'])
|
|
||||||
@login_required
|
|
||||||
def api_delete_wish(wish_id):
|
|
||||||
delete_wish(wish_id)
|
|
||||||
return jsonify({'ok': True})
|
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/wishes/reorder', methods=['PUT'])
|
|
||||||
@login_required
|
|
||||||
def api_reorder_wishes():
|
|
||||||
body = request.get_json(force=True)
|
|
||||||
order = body.get('order', [])
|
|
||||||
if not isinstance(order, list):
|
|
||||||
return jsonify({'ok': False, 'error': 'order 必须是列表'}), 400
|
|
||||||
reorder_wishes(order)
|
|
||||||
return jsonify({'ok': True})
|
|
||||||
|
|
||||||
|
|
||||||
# ── 日历同步 API ────────────────────────────
|
# ── 日历同步 API ────────────────────────────
|
||||||
|
|
||||||
CALENDAR_CACHE = os.path.join(os.path.expanduser('~'), '.workbuddy', 'data', 'ziwei-power', 'calendar_cache.json')
|
CALENDAR_CACHE = os.path.join(os.path.expanduser('~'), '.workbuddy', 'data', 'ziwei-power', 'calendar_cache.json')
|
||||||
@@ -428,7 +377,20 @@ def api_calendar_sync_all():
|
|||||||
summary = (evt.get('summary') or '').strip()
|
summary = (evt.get('summary') or '').strip()
|
||||||
if not summary:
|
if not summary:
|
||||||
continue
|
continue
|
||||||
text = f"【{evt['time']}】{summary}" if evt.get('time') else summary
|
date_str = evt.get('date', '')
|
||||||
|
if date_str:
|
||||||
|
try:
|
||||||
|
parts = date_str.split('-')
|
||||||
|
date_label = f"{int(parts[1])}月{int(parts[2])}日"
|
||||||
|
except:
|
||||||
|
date_label = date_str
|
||||||
|
else:
|
||||||
|
date_label = ''
|
||||||
|
time_str = evt.get('time', '')
|
||||||
|
prefix = f"【{date_label} {time_str}】" if date_label and time_str else \
|
||||||
|
(f"【{date_label}】" if date_label else \
|
||||||
|
(f"【{time_str}】" if time_str else ''))
|
||||||
|
text = f"{prefix}{summary}" if prefix else summary
|
||||||
loc = evt.get('location', '')
|
loc = evt.get('location', '')
|
||||||
if loc:
|
if loc:
|
||||||
text += f" @{loc}"
|
text += f" @{loc}"
|
||||||
@@ -444,6 +406,13 @@ def api_calendar_sync_all():
|
|||||||
return jsonify({'ok': True, 'data': results, 'saved_days': saved_weeks})
|
return jsonify({'ok': True, 'data': results, 'saved_days': saved_weeks})
|
||||||
|
|
||||||
|
|
||||||
|
# ── 健康检查 ──────────────────────────────────────────
|
||||||
|
|
||||||
|
@app.route('/api/health')
|
||||||
|
def api_health():
|
||||||
|
return jsonify({'ok': True, 'service': 'ziwei-power'})
|
||||||
|
|
||||||
|
|
||||||
# ── 启动 ──────────────────────────────────────────────
|
# ── 启动 ──────────────────────────────────────────────
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
79
database.py
79
database.py
@@ -11,7 +11,7 @@ os.makedirs(DB_DIR, exist_ok=True)
|
|||||||
DB_PATH = os.path.join(DB_DIR, 'ziwei_power.db')
|
DB_PATH = os.path.join(DB_DIR, 'ziwei_power.db')
|
||||||
|
|
||||||
# 当前数据库 schema 版本 —— 改表结构时必须 +1 并补迁移逻辑
|
# 当前数据库 schema 版本 —— 改表结构时必须 +1 并补迁移逻辑
|
||||||
CURRENT_SCHEMA_VERSION = 4
|
CURRENT_SCHEMA_VERSION = 2
|
||||||
|
|
||||||
|
|
||||||
def get_conn():
|
def get_conn():
|
||||||
@@ -56,26 +56,7 @@ def init_db():
|
|||||||
''')
|
''')
|
||||||
|
|
||||||
if current < 2:
|
if current < 2:
|
||||||
# v2: 心愿清单
|
# v2: 日打卡 → 周打卡
|
||||||
conn.execute('''
|
|
||||||
CREATE TABLE IF NOT EXISTS wishes (
|
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
||||||
name TEXT NOT NULL,
|
|
||||||
priority TEXT NOT NULL DEFAULT '中',
|
|
||||||
deadline TEXT NOT NULL DEFAULT '',
|
|
||||||
done INTEGER NOT NULL DEFAULT 0,
|
|
||||||
sort_order INTEGER NOT NULL DEFAULT 0,
|
|
||||||
created_at TEXT NOT NULL
|
|
||||||
)
|
|
||||||
''')
|
|
||||||
|
|
||||||
if current < 3:
|
|
||||||
# v3: 优先级改为四象限
|
|
||||||
conn.execute("ALTER TABLE wishes ADD COLUMN quadrant TEXT NOT NULL DEFAULT '重要不紧急'")
|
|
||||||
conn.execute("UPDATE wishes SET quadrant = CASE priority WHEN '高' THEN '重要紧急' WHEN '中' THEN '重要不紧急' WHEN '低' THEN '不紧急不重要' ELSE '重要不紧急' END WHERE quadrant = '重要不紧急'")
|
|
||||||
|
|
||||||
if current < 4:
|
|
||||||
# v4: 日打卡 → 周打卡
|
|
||||||
# 备份旧表 → 聚合 → 新建周表
|
# 备份旧表 → 聚合 → 新建周表
|
||||||
existing = conn.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='checkins'").fetchone()
|
existing = conn.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='checkins'").fetchone()
|
||||||
if existing:
|
if existing:
|
||||||
@@ -170,62 +151,6 @@ def get_all_checkins():
|
|||||||
return results
|
return results
|
||||||
|
|
||||||
|
|
||||||
# ── 心愿清单 CRUD ──────────────────────────────────
|
|
||||||
|
|
||||||
def get_wishes():
|
|
||||||
"""获取所有心愿,按 sort_order 排序"""
|
|
||||||
conn = get_conn()
|
|
||||||
rows = conn.execute('SELECT * FROM wishes ORDER BY sort_order').fetchall()
|
|
||||||
conn.close()
|
|
||||||
return [dict(row) for row in rows]
|
|
||||||
|
|
||||||
|
|
||||||
def save_wish(name, quadrant, deadline):
|
|
||||||
"""新增一条心愿"""
|
|
||||||
now = datetime.now().isoformat()
|
|
||||||
conn = get_conn()
|
|
||||||
max_order = conn.execute('SELECT COALESCE(MAX(sort_order), -1) + 1 AS n FROM wishes').fetchone()['n']
|
|
||||||
conn.execute(
|
|
||||||
'INSERT INTO wishes (name, quadrant, deadline, done, sort_order, created_at) VALUES (?, ?, ?, 0, ?, ?)',
|
|
||||||
(name, quadrant, deadline, max_order, now)
|
|
||||||
)
|
|
||||||
conn.commit()
|
|
||||||
wish_id = conn.execute('SELECT last_insert_rowid()').fetchone()[0]
|
|
||||||
conn.close()
|
|
||||||
return wish_id
|
|
||||||
|
|
||||||
|
|
||||||
def update_wish(wish_id, **kwargs):
|
|
||||||
"""更新心愿字段"""
|
|
||||||
allowed = ['name', 'quadrant', 'deadline', 'done']
|
|
||||||
updates = {k: v for k, v in kwargs.items() if k in allowed}
|
|
||||||
if not updates:
|
|
||||||
return
|
|
||||||
conn = get_conn()
|
|
||||||
sets = ', '.join(f'{k} = ?' for k in updates)
|
|
||||||
vals = list(updates.values()) + [wish_id]
|
|
||||||
conn.execute(f'UPDATE wishes SET {sets} WHERE id = ?', vals)
|
|
||||||
conn.commit()
|
|
||||||
conn.close()
|
|
||||||
|
|
||||||
|
|
||||||
def delete_wish(wish_id):
|
|
||||||
"""删除心愿"""
|
|
||||||
conn = get_conn()
|
|
||||||
conn.execute('DELETE FROM wishes WHERE id = ?', (wish_id,))
|
|
||||||
conn.commit()
|
|
||||||
conn.close()
|
|
||||||
|
|
||||||
|
|
||||||
def reorder_wishes(order_list):
|
|
||||||
"""批量更新排序:order_list = [id1, id2, ...]"""
|
|
||||||
conn = get_conn()
|
|
||||||
for idx, wid in enumerate(order_list):
|
|
||||||
conn.execute('UPDATE wishes SET sort_order = ? WHERE id = ?', (idx, wid))
|
|
||||||
conn.commit()
|
|
||||||
conn.close()
|
|
||||||
|
|
||||||
|
|
||||||
def get_weeks_list():
|
def get_weeks_list():
|
||||||
"""返回所有已有打卡记录的周号列表"""
|
"""返回所有已有打卡记录的周号列表"""
|
||||||
conn = get_conn()
|
conn = get_conn()
|
||||||
|
|||||||
647
static/app.js
647
static/app.js
@@ -9,7 +9,6 @@
|
|||||||
var calYear;
|
var calYear;
|
||||||
var calMonth = new Date().getMonth(); // 月份索引 0-11
|
var calMonth = new Date().getMonth(); // 月份索引 0-11
|
||||||
var activePanel = 'daily';
|
var activePanel = 'daily';
|
||||||
var weekOffset = 0;
|
|
||||||
var lastSavedData = null;
|
var lastSavedData = null;
|
||||||
var lastSavedWeek = null;
|
var lastSavedWeek = null;
|
||||||
var selectedWeek = null;
|
var selectedWeek = null;
|
||||||
@@ -114,9 +113,7 @@
|
|||||||
if (nav) nav.classList.add('active');
|
if (nav) nav.classList.add('active');
|
||||||
if (panel) panel.classList.add('active');
|
if (panel) panel.classList.add('active');
|
||||||
|
|
||||||
if (name === 'weekly') loadWeekly();
|
|
||||||
if (name === 'history') loadHistory();
|
if (name === 'history') loadHistory();
|
||||||
if (name === 'wishes') loadWishes();
|
|
||||||
if (name === 'blueprint') loadBlueprint();
|
if (name === 'blueprint') loadBlueprint();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -169,29 +166,35 @@
|
|||||||
weeks.push(fmtWeek(monday));
|
weeks.push(fmtWeek(monday));
|
||||||
monday.setDate(monday.getDate() + 7);
|
monday.setDate(monday.getDate() + 7);
|
||||||
}
|
}
|
||||||
// 确保至少有4周显示
|
|
||||||
while (weeks.length < 4) {
|
|
||||||
var w = fmtWeek(monday);
|
|
||||||
if (weeks.indexOf(w) < 0) weeks.push(w);
|
|
||||||
monday.setDate(monday.getDate() + 7);
|
|
||||||
}
|
|
||||||
|
|
||||||
var todayWk = fmtWeek(new Date());
|
var todayWk = fmtWeek(new Date());
|
||||||
|
var today = new Date();
|
||||||
var wHtml = '';
|
var wHtml = '';
|
||||||
for (var i2 = 0; i2 < weeks.length; i2++) {
|
for (var i2 = 0; i2 < weeks.length; i2++) {
|
||||||
var w = weeks[i2];
|
var w = weeks[i2];
|
||||||
var cls = 'cal-week-cell';
|
var cls = 'cal-week-row';
|
||||||
var status = calendarStatus[w];
|
var status = calendarStatus[w];
|
||||||
if (status) cls += ' ' + status;
|
|
||||||
if (w === todayWk) cls += ' today';
|
if (w === todayWk) cls += ' today';
|
||||||
if (w === selectedWeek) cls += ' selected';
|
if (w === selectedWeek) cls += ' selected';
|
||||||
wHtml += '<div class="' + cls + '" data-week="' + w + '" title="' + w + '">' +
|
// 计算日期范围
|
||||||
'W' + w.split('-W')[1].replace(/^0/, '') + '</div>';
|
var monday = new Date(calYear, calMonth, 1);
|
||||||
|
while (fmtWeek(monday) !== w) monday.setDate(monday.getDate() + 7);
|
||||||
|
var sunday = new Date(monday);
|
||||||
|
sunday.setDate(sunday.getDate() + 6);
|
||||||
|
var dateRange = (monday.getMonth()+1) + '.' + monday.getDate() + ' - ' + sunday.getDate();
|
||||||
|
var statusLabel = status === 'pass' ? '达标' : (status === 'fail' ? '未达标' : '未打卡');
|
||||||
|
wHtml += '<div class="' + cls + '" data-week="' + w + '">' +
|
||||||
|
'<div class="cal-wk-info">' +
|
||||||
|
'<span class="cal-wk-label">第' + w.split('-W')[1].replace(/^0/, '') + '周</span>' +
|
||||||
|
'<span class="cal-wk-date">' + dateRange + '</span>' +
|
||||||
|
'</div>' +
|
||||||
|
'<span class="cal-wk-badge">' + statusLabel + '</span>' +
|
||||||
|
'</div>';
|
||||||
}
|
}
|
||||||
var we = document.getElementById('cal-weeks');
|
var we = document.getElementById('cal-weeks');
|
||||||
we.innerHTML = wHtml;
|
we.innerHTML = wHtml;
|
||||||
we.querySelectorAll('.cal-week-cell').forEach(function(cell) {
|
we.querySelectorAll('.cal-week-row').forEach(function(row) {
|
||||||
cell.addEventListener('click', function() {
|
row.addEventListener('click', function() {
|
||||||
var wk = this.dataset.week;
|
var wk = this.dataset.week;
|
||||||
if (wk) navigateToWeek(wk);
|
if (wk) navigateToWeek(wk);
|
||||||
});
|
});
|
||||||
@@ -235,10 +238,19 @@
|
|||||||
|
|
||||||
function buildData() {
|
function buildData() {
|
||||||
var morningItems = [];
|
var morningItems = [];
|
||||||
var mEls = document.querySelectorAll('#morning-list .item-row input');
|
var mRows = document.querySelectorAll('#morning-list .item-row');
|
||||||
for (var i=0; i<mEls.length; i++) {
|
for (var i=0; i<mRows.length; i++) {
|
||||||
var v = mEls[i].value.trim();
|
var input = mRows[i].querySelector('input[type="text"]');
|
||||||
if (v) morningItems.push(v);
|
var noteEl = mRows[i].querySelector('.item-note-val');
|
||||||
|
var v = input ? input.value.trim() : '';
|
||||||
|
var n = noteEl ? noteEl.value.trim() : '';
|
||||||
|
if (v) morningItems.push(n ? {text: v, note: n} : v);
|
||||||
|
}
|
||||||
|
// 收集日历日程
|
||||||
|
var calEls = document.querySelectorAll('#morning-calendar-list .cal-task-item span:last-child');
|
||||||
|
for (var ci=0; ci<calEls.length; ci++) {
|
||||||
|
var txt = calEls[ci].textContent.trim();
|
||||||
|
if (txt) { morningItems.push(txt); }
|
||||||
}
|
}
|
||||||
|
|
||||||
var eveningItems = [];
|
var eveningItems = [];
|
||||||
@@ -251,17 +263,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
var studyItems = [];
|
var studyItems = [];
|
||||||
var pItems = document.querySelectorAll('#study-list .preset-item');
|
var sCards = document.querySelectorAll('#study-cards .study-card');
|
||||||
for (var k=0; k<pItems.length; k++) {
|
for (var k=0; k<sCards.length; k++) {
|
||||||
var cb = pItems[k].querySelector('input[type="checkbox"]');
|
var nameEl = sCards[k].querySelector('.study-card-name');
|
||||||
var noteEl = pItems[k].querySelector('.preset-note');
|
var countEl = sCards[k].querySelector('.study-card-count');
|
||||||
var nameEl = pItems[k].querySelector('.preset-name');
|
var name = nameEl ? nameEl.textContent.trim() : '';
|
||||||
var name = nameEl ? nameEl.textContent : '';
|
var count = parseInt(countEl ? countEl.textContent : '0') || 0;
|
||||||
if (cb && cb.checked) {
|
studyItems.push({ name: name, count: count, last_checkin_date: sCards[k].dataset.lastDate || '' });
|
||||||
studyItems.push({ name: name, done: true, note: noteEl ? noteEl.value.trim() : '' });
|
|
||||||
} else {
|
|
||||||
studyItems.push({ name: name, done: false, note: '' });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return { morning: morningItems, evening: eveningItems, study: studyItems };
|
return { morning: morningItems, evening: eveningItems, study: studyItems };
|
||||||
@@ -273,12 +281,29 @@
|
|||||||
var evening = data.evening || [];
|
var evening = data.evening || [];
|
||||||
var study = data.study || [];
|
var study = data.study || [];
|
||||||
|
|
||||||
// 早间立志
|
// 本周重点:拆分手动任务 vs 日历日程
|
||||||
document.getElementById('morning-list').innerHTML = '';
|
document.getElementById('morning-list').innerHTML = '';
|
||||||
|
document.getElementById('morning-calendar-list').innerHTML = '';
|
||||||
|
var manualItems = [];
|
||||||
|
var calItems = [];
|
||||||
if (morning.length === 0) morning = [''];
|
if (morning.length === 0) morning = [''];
|
||||||
for (var m=0; m<morning.length; m++) {
|
for (var m=0; m<morning.length; m++) {
|
||||||
var txt = typeof morning[m] === 'string' ? morning[m] : (morning[m].text || '');
|
var txt = typeof morning[m] === 'string' ? morning[m] : (morning[m].text || '');
|
||||||
addMorningRow(txt);
|
if (txt && txt.trim().startsWith('【')) { calItems.push(txt); }
|
||||||
|
else { manualItems.push(txt); }
|
||||||
|
}
|
||||||
|
if (manualItems.length === 0) manualItems = [''];
|
||||||
|
for (var a=0; a<manualItems.length; a++) { addMorningRow(manualItems[a]); }
|
||||||
|
if (calItems.length > 0) {
|
||||||
|
document.getElementById('morning-calendar').style.display = 'block';
|
||||||
|
for (var b=0; b<calItems.length; b++) {
|
||||||
|
var div = document.createElement('div');
|
||||||
|
div.className = 'cal-task-item';
|
||||||
|
div.innerHTML = '<span class="cal-task-dot">📅</span><span>' + esc(calItems[b]) + '</span>';
|
||||||
|
document.getElementById('morning-calendar-list').appendChild(div);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
document.getElementById('morning-calendar').style.display = 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 责善改过
|
// 责善改过
|
||||||
@@ -289,16 +314,25 @@
|
|||||||
addEveningRow(item.mistake || '', item.improvement || '');
|
addEveningRow(item.mistake || '', item.improvement || '');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 勤学 — 渲染预设项目并回填状态
|
// 勤学 — 渲染已保存习惯 + 未渲染预设
|
||||||
var studyMap = {};
|
var studyMap = {};
|
||||||
for (var si=0; si<study.length; si++) {
|
for (var si=0; si<study.length; si++) {
|
||||||
studyMap[study[si].name] = study[si];
|
studyMap[study[si].name] = study[si];
|
||||||
}
|
}
|
||||||
document.getElementById('study-list').innerHTML = '';
|
var rendered = {};
|
||||||
|
document.getElementById('study-cards').innerHTML = '';
|
||||||
|
for (var sk=0; sk<study.length; sk++) {
|
||||||
|
var item = study[sk];
|
||||||
|
if (item.name) {
|
||||||
|
renderStudyCard(item.name, item.count || 0, item.last_checkin_date || '');
|
||||||
|
rendered[item.name] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
for (var sp=0; sp<PRESET_STUDY_ITEMS.length; sp++) {
|
for (var sp=0; sp<PRESET_STUDY_ITEMS.length; sp++) {
|
||||||
var sName = PRESET_STUDY_ITEMS[sp];
|
var sName = PRESET_STUDY_ITEMS[sp];
|
||||||
var saved = studyMap[sName] || { done: false, note: '' };
|
if (!rendered[sName]) {
|
||||||
addPresetItem(sName, saved.done, saved.note || '');
|
renderStudyCard(sName, 0, '');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -311,15 +345,60 @@
|
|||||||
var idx = container.children.length;
|
var idx = container.children.length;
|
||||||
var text = typeof val === 'string' ? val : (val && val.text ? val.text : '');
|
var text = typeof val === 'string' ? val : (val && val.text ? val.text : '');
|
||||||
text = text || '';
|
text = text || '';
|
||||||
|
var note = (val && val.note) ? val.note : '';
|
||||||
|
var hasNote = !!note;
|
||||||
var div = document.createElement('div');
|
var div = document.createElement('div');
|
||||||
div.className = 'item-row';
|
div.className = 'item-row';
|
||||||
div.innerHTML = '<span class="idx">' + (idx+1) + '.</span>' +
|
div.draggable = true;
|
||||||
|
div.innerHTML = '<span class="drag-handle" title="拖动排序">⋮⋮</span>' +
|
||||||
|
'<span class="idx">' + (idx+1) + '.</span>' +
|
||||||
'<input type="text" value="' + esc(text) + '" placeholder="本周最重要的一件事…">' +
|
'<input type="text" value="' + esc(text) + '" placeholder="本周最重要的一件事…">' +
|
||||||
|
'<button class="btn-note-toggle' + (hasNote ? ' has-note' : '') + '" onclick="openNoteModal(this)" title="备注"><svg class="icon-sm"><use href="#icon-file-text"/></svg></button>' +
|
||||||
'<button class="btn-del" onclick="this.parentElement.remove();renumberMorning()"><svg class="icon-sm"><use href="#icon-x"/></svg></button>';
|
'<button class="btn-del" onclick="this.parentElement.remove();renumberMorning()"><svg class="icon-sm"><use href="#icon-x"/></svg></button>';
|
||||||
|
// 隐藏存储备注
|
||||||
|
var noteHidden = document.createElement('input');
|
||||||
|
noteHidden.type = 'hidden';
|
||||||
|
noteHidden.className = 'item-note-val';
|
||||||
|
noteHidden.value = note;
|
||||||
|
div.appendChild(noteHidden);
|
||||||
|
div.addEventListener('dragstart', dragStart);
|
||||||
|
div.addEventListener('dragover', dragOver);
|
||||||
|
div.addEventListener('drop', function(e){ dragDrop.call(this, e, 'morning-list'); });
|
||||||
|
div.addEventListener('dragend', dragEnd);
|
||||||
container.appendChild(div);
|
container.appendChild(div);
|
||||||
renumberMorning();
|
renumberMorning();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var noteModalRow = null;
|
||||||
|
|
||||||
|
window.openNoteModal = function(btn) {
|
||||||
|
noteModalRow = btn.closest('.item-row');
|
||||||
|
var noteEl = noteModalRow.querySelector('.item-note-val');
|
||||||
|
var input = noteModalRow.querySelector('input[type="text"]');
|
||||||
|
var title = input ? input.value.trim() || '未命名任务' : '备注';
|
||||||
|
document.getElementById('note-modal-title').textContent = title;
|
||||||
|
document.getElementById('note-modal-textarea').value = noteEl ? noteEl.value : '';
|
||||||
|
document.getElementById('note-modal').style.display = 'flex';
|
||||||
|
};
|
||||||
|
|
||||||
|
window.saveNoteModal = function() {
|
||||||
|
var modal = document.getElementById('note-modal');
|
||||||
|
if (!noteModalRow) return;
|
||||||
|
var noteEl = noteModalRow.querySelector('.item-note-val');
|
||||||
|
var btn = noteModalRow.querySelector('.btn-note-toggle');
|
||||||
|
var val = document.getElementById('note-modal-textarea').value.trim();
|
||||||
|
if (noteEl) noteEl.value = val;
|
||||||
|
if (btn) { if (val) { btn.classList.add('has-note'); } else { btn.classList.remove('has-note'); } }
|
||||||
|
modal.style.display = 'none';
|
||||||
|
noteModalRow = null;
|
||||||
|
triggerAutoSave();
|
||||||
|
};
|
||||||
|
|
||||||
|
window.closeNoteModal = function() {
|
||||||
|
document.getElementById('note-modal').style.display = 'none';
|
||||||
|
noteModalRow = null;
|
||||||
|
};
|
||||||
|
|
||||||
function renumberMorning() {
|
function renumberMorning() {
|
||||||
var rows = document.querySelectorAll('#morning-list .item-row');
|
var rows = document.querySelectorAll('#morning-list .item-row');
|
||||||
for (var i=0; i<rows.length; i++) {
|
for (var i=0; i<rows.length; i++) {
|
||||||
@@ -334,42 +413,116 @@
|
|||||||
improve = improve || '';
|
improve = improve || '';
|
||||||
var div = document.createElement('div');
|
var div = document.createElement('div');
|
||||||
div.className = 'evening-row';
|
div.className = 'evening-row';
|
||||||
|
div.draggable = true;
|
||||||
div.innerHTML =
|
div.innerHTML =
|
||||||
|
'<span class="drag-handle evening-drag" title="拖动排序">⋮⋮</span>' +
|
||||||
'<button class="btn-del" onclick="this.parentElement.remove()"><svg class="icon-sm"><use href="#icon-x"/></svg></button>' +
|
'<button class="btn-del" onclick="this.parentElement.remove()"><svg class="icon-sm"><use href="#icon-x"/></svg></button>' +
|
||||||
'<input type="text" value="' + esc(mistake) + '" placeholder="犯的错误…">' +
|
'<input type="text" value="' + esc(mistake) + '" placeholder="犯的错误…">' +
|
||||||
'<input type="text" value="' + esc(improve) + '" placeholder="改进方案…">';
|
'<input type="text" value="' + esc(improve) + '" placeholder="改进方案…">';
|
||||||
|
div.addEventListener('dragstart', dragStart);
|
||||||
|
div.addEventListener('dragover', dragOver);
|
||||||
|
div.addEventListener('drop', function(e){ dragDrop.call(this, e, 'evening-list'); });
|
||||||
|
div.addEventListener('dragend', dragEnd);
|
||||||
container.appendChild(div);
|
container.appendChild(div);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ── 勤学预设项目 ── */
|
/* ── 勤学打卡卡片 ── */
|
||||||
|
|
||||||
function addPresetItem(name, done, note) {
|
function renderStudyCard(name, count, lastDate) {
|
||||||
var container = document.getElementById('study-list');
|
var container = document.getElementById('study-cards');
|
||||||
|
var today = fmtDate(new Date());
|
||||||
|
var checked = count > 0;
|
||||||
|
var checkedToday = lastDate === today;
|
||||||
|
var btnText = checkedToday ? '已打卡' : '打卡';
|
||||||
var div = document.createElement('div');
|
var div = document.createElement('div');
|
||||||
div.className = 'preset-item' + (done ? ' active' : '');
|
div.className = 'study-card' + (checked ? ' checked' : '');
|
||||||
var noteEsc = esc(note || '');
|
div.setAttribute('data-last-date', lastDate || '');
|
||||||
div.innerHTML =
|
div.innerHTML =
|
||||||
'<label class="preset-check">' +
|
'<button class="study-card-del" onclick="deleteStudyItem(this)" title="删除">×</button>' +
|
||||||
'<input type="checkbox"' + (done ? ' checked' : '') + ' onchange="togglePresetNote(this)">' +
|
'<div class="study-card-info">' +
|
||||||
'<span class="preset-name">' + esc(name) + '</span>' +
|
'<span class="study-card-name">' + esc(name) + '</span>' +
|
||||||
'</label>' +
|
'<span class="study-card-count">' + count + '</span>' +
|
||||||
'<textarea class="preset-note" placeholder="一句话备注…">' + noteEsc + '</textarea>';
|
'</div>' +
|
||||||
|
'<button class="study-card-btn' + (checkedToday ? ' done' : '') + '" onclick="checkinStudy(this)">' + btnText + '</button>';
|
||||||
container.appendChild(div);
|
container.appendChild(div);
|
||||||
}
|
}
|
||||||
|
|
||||||
window.togglePresetNote = function(cb) {
|
window.toggleStudyEdit = function() {
|
||||||
var item = cb.closest('.preset-item');
|
var panel = document.getElementById('panel-daily');
|
||||||
if (item) {
|
var btn = document.getElementById('study-edit-toggle');
|
||||||
if (cb.checked) item.classList.add('active');
|
if (!panel || !btn) return;
|
||||||
else { item.classList.remove('active'); item.querySelector('.preset-note').value = ''; }
|
var editing = panel.classList.toggle('editing-study');
|
||||||
|
btn.classList.toggle('active', editing);
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ── 拖拽排序 ── */
|
||||||
|
var dragSrc = null;
|
||||||
|
|
||||||
|
function dragStart(e) {
|
||||||
|
dragSrc = this;
|
||||||
|
this.classList.add('dragging');
|
||||||
|
e.dataTransfer.effectAllowed = 'move';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function dragOver(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.dataTransfer.dropEffect = 'move';
|
||||||
|
if (this !== dragSrc) this.classList.add('drag-over');
|
||||||
|
}
|
||||||
|
|
||||||
|
function dragDrop(e, listId) {
|
||||||
|
e.preventDefault();
|
||||||
|
this.classList.remove('drag-over');
|
||||||
|
if (dragSrc === this) return;
|
||||||
|
var container = document.getElementById(listId);
|
||||||
|
var items = container.querySelectorAll('.' + (dragSrc.classList.contains('evening-row') ? 'evening-row' : 'item-row'));
|
||||||
|
var from = Array.prototype.indexOf.call(items, dragSrc);
|
||||||
|
var to = Array.prototype.indexOf.call(items, this);
|
||||||
|
if (from < to) { container.insertBefore(dragSrc, this.nextSibling); }
|
||||||
|
else { container.insertBefore(dragSrc, this); }
|
||||||
|
if (listId === 'morning-list') renumberMorning();
|
||||||
|
triggerAutoSave();
|
||||||
|
}
|
||||||
|
|
||||||
|
function dragEnd() {
|
||||||
|
this.classList.remove('dragging');
|
||||||
|
document.querySelectorAll('.drag-over').forEach(function(el){ el.classList.remove('drag-over'); });
|
||||||
|
dragSrc = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addStudyItem = function() {
|
||||||
|
var name = prompt('请输入新习惯名称:');
|
||||||
|
if (!name || !name.trim()) return;
|
||||||
|
renderStudyCard(name.trim(), 0, '');
|
||||||
|
triggerAutoSave();
|
||||||
|
};
|
||||||
|
|
||||||
|
window.deleteStudyItem = function(btn) {
|
||||||
|
var card = btn.closest('.study-card');
|
||||||
|
var nameEl = card.querySelector('.study-card-name');
|
||||||
|
if (nameEl && !confirm('确定删除「' + nameEl.textContent + '」?')) return;
|
||||||
|
card.remove();
|
||||||
|
triggerAutoSave();
|
||||||
|
};
|
||||||
|
|
||||||
|
window.checkinStudy = function(btn) {
|
||||||
|
var card = btn.closest('.study-card');
|
||||||
|
var today = fmtDate(new Date());
|
||||||
|
if (card.dataset.lastDate === today) { showToast('今天已打卡', 'info'); return; }
|
||||||
|
var countEl = card.querySelector('.study-card-count');
|
||||||
|
var count = parseInt(countEl.textContent) + 1;
|
||||||
|
countEl.textContent = count;
|
||||||
|
card.dataset.lastDate = today;
|
||||||
|
card.classList.add('checked');
|
||||||
|
btn.classList.add('done');
|
||||||
|
btn.textContent = '已打卡';
|
||||||
triggerAutoSave();
|
triggerAutoSave();
|
||||||
};
|
};
|
||||||
|
|
||||||
function initStudyPresets() {
|
function initStudyPresets() {
|
||||||
document.getElementById('study-list').innerHTML = '';
|
document.getElementById('study-cards').innerHTML = '';
|
||||||
for (var i=0; i<PRESET_STUDY_ITEMS.length; i++) {
|
for (var i=0; i<PRESET_STUDY_ITEMS.length; i++) {
|
||||||
addPresetItem(PRESET_STUDY_ITEMS[i], false, '');
|
renderStudyCard(PRESET_STUDY_ITEMS[i], 0, '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -414,10 +567,12 @@
|
|||||||
html += '<div class="sync-day">';
|
html += '<div class="sync-day">';
|
||||||
html += '<div class="sync-day-header"><span>' + day.date + '</span></div>';
|
html += '<div class="sync-day-header"><span>' + day.date + '</span></div>';
|
||||||
day.events.forEach(function(e) {
|
day.events.forEach(function(e) {
|
||||||
var timeStr = e.time ? ' (' + e.time + ')' : '';
|
var timeStr = e.time ? e.time : '';
|
||||||
|
var dateStr = e.date || '';
|
||||||
html += '<div class="sync-event">' +
|
html += '<div class="sync-event">' +
|
||||||
'<span class="sync-event-icon">📌</span>' +
|
'<span class="sync-event-icon">📌</span>' +
|
||||||
'<span class="sync-event-text">' + esc(e.summary) + '<span class="sync-event-time">' + esc(timeStr) + '</span></span>' +
|
'<span class="sync-event-text">' + esc(e.summary) + '</span>' +
|
||||||
|
'<span class="sync-event-meta">' + esc(dateStr) + (timeStr ? ' ' + esc(timeStr) : '') + '</span>' +
|
||||||
'</div>';
|
'</div>';
|
||||||
});
|
});
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
@@ -441,8 +596,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
window.addMorning = function() {
|
window.addMorning = function() {
|
||||||
var count = document.querySelectorAll('#morning-list .item-row').length;
|
|
||||||
if (count >= 3) { showToast('最多 3 条立志', 'error'); return; }
|
|
||||||
addMorningRow('');
|
addMorningRow('');
|
||||||
};
|
};
|
||||||
window.addEvening = function() {
|
window.addEvening = function() {
|
||||||
@@ -469,6 +622,17 @@
|
|||||||
if (card) card.classList.add('active');
|
if (card) card.classList.add('active');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* 头像菜单 */
|
||||||
|
window.toggleUserMenu = function(e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
var dd = document.getElementById('user-dropdown');
|
||||||
|
if (dd) dd.style.display = dd.style.display === 'none' ? 'block' : 'none';
|
||||||
|
};
|
||||||
|
document.addEventListener('click', function() {
|
||||||
|
var dd = document.getElementById('user-dropdown');
|
||||||
|
if (dd) dd.style.display = 'none';
|
||||||
|
});
|
||||||
|
|
||||||
/* ================================================================
|
/* ================================================================
|
||||||
Load & Auto Save Checkin
|
Load & Auto Save Checkin
|
||||||
================================================================ */
|
================================================================ */
|
||||||
@@ -482,7 +646,7 @@
|
|||||||
if (lastSavedWeek && lastSavedData !== null && currentStr !== lastSavedData) {
|
if (lastSavedWeek && lastSavedData !== null && currentStr !== lastSavedData) {
|
||||||
var hasContent = currentData.morning.some(function(x){return x && x.trim();}) ||
|
var hasContent = currentData.morning.some(function(x){return x && x.trim();}) ||
|
||||||
currentData.evening.some(function(x){return (x.mistake||'').trim() || (x.improvement||'').trim();}) ||
|
currentData.evening.some(function(x){return (x.mistake||'').trim() || (x.improvement||'').trim();}) ||
|
||||||
currentData.study.some(function(x){return x.done;});
|
currentData.study.some(function(x){return x.count > 0;});
|
||||||
if (hasContent) {
|
if (hasContent) {
|
||||||
apiSaveCheckin(lastSavedWeek, currentData, function(){});
|
apiSaveCheckin(lastSavedWeek, currentData, function(){});
|
||||||
}
|
}
|
||||||
@@ -545,95 +709,6 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ================================================================
|
|
||||||
Weekly Score
|
|
||||||
================================================================ */
|
|
||||||
var WEEKDAYS_CN = ['日','一','二','三','四','五','六'];
|
|
||||||
|
|
||||||
function getMonday(d) {
|
|
||||||
var day = d.getDay();
|
|
||||||
var diff = d.getDate() - day + (day === 0 ? -6 : 1);
|
|
||||||
var m = new Date(d);
|
|
||||||
m.setDate(diff);
|
|
||||||
return m;
|
|
||||||
}
|
|
||||||
|
|
||||||
window.changeWeek = function(dir) {
|
|
||||||
weekOffset += dir;
|
|
||||||
loadWeekly();
|
|
||||||
};
|
|
||||||
|
|
||||||
function loadWeekly() {
|
|
||||||
var today = new Date();
|
|
||||||
today.setDate(today.getDate() + weekOffset * 7);
|
|
||||||
var wk = fmtWeek(today);
|
|
||||||
document.getElementById('week-label').textContent = wk;
|
|
||||||
|
|
||||||
apiGetCheckin(wk, function(err, row){
|
|
||||||
if (err) { showToast('加载失败', 'error'); return; }
|
|
||||||
var dd = row ? row.data : null;
|
|
||||||
if (!dd) {
|
|
||||||
document.getElementById('weekly-score').textContent = '--';
|
|
||||||
document.getElementById('score-text').textContent = '本周暂无记录';
|
|
||||||
document.getElementById('score-stats').textContent = '';
|
|
||||||
document.getElementById('week-days-grid').innerHTML = '';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var morning = dd.morning || [];
|
|
||||||
var evening = dd.evening || [];
|
|
||||||
var study = dd.study || [];
|
|
||||||
|
|
||||||
var morningCount = morning.filter(function(x){ return x && typeof x === 'string' && x.trim(); }).length;
|
|
||||||
if (!morningCount) {
|
|
||||||
morningCount = morning.filter(function(x){
|
|
||||||
return x && typeof x === 'object' && (x.text || '').trim();
|
|
||||||
}).length;
|
|
||||||
}
|
|
||||||
var eveningCount = evening.filter(function(x){
|
|
||||||
var mst = typeof x === 'string' ? x : (x.mistake || '');
|
|
||||||
return mst && typeof mst === 'string' && mst.trim();
|
|
||||||
}).length;
|
|
||||||
var studyCount = study.filter(function(x){ return x.done; }).length;
|
|
||||||
|
|
||||||
var allThree = morningCount > 0 && eveningCount > 0 && studyCount > 0;
|
|
||||||
var score, status;
|
|
||||||
if (allThree) {
|
|
||||||
score = 60 + (morningCount - 1) * 5 + (eveningCount - 1) * 3 + studyCount * 3;
|
|
||||||
status = 'pass';
|
|
||||||
} else {
|
|
||||||
score = 0;
|
|
||||||
status = 'fail';
|
|
||||||
}
|
|
||||||
|
|
||||||
var grade = score >= 90 ? '优秀' : score >= 75 ? '良好' : score >= 60 ? '达标' : '未达标';
|
|
||||||
|
|
||||||
document.getElementById('weekly-score').textContent = score;
|
|
||||||
|
|
||||||
var ring = document.querySelector('.score-ring');
|
|
||||||
if (ring) {
|
|
||||||
var R = 50, C = 2 * Math.PI * R;
|
|
||||||
ring.setAttribute('stroke-dasharray', C);
|
|
||||||
var ratio = Math.min(score / 100, 1);
|
|
||||||
ring.setAttribute('stroke-dashoffset', C - (C * ratio));
|
|
||||||
}
|
|
||||||
|
|
||||||
var txt = grade + ' · ' + score + ' 分';
|
|
||||||
document.getElementById('score-text').textContent = txt;
|
|
||||||
document.getElementById('score-stats').textContent =
|
|
||||||
'立志 ' + morningCount + ' · 责善 ' + eveningCount + ' · 勤学 ' + studyCount + '/8';
|
|
||||||
|
|
||||||
// 渲染周统计网格(简化版)
|
|
||||||
var gridHtml = '<div class="day-cell ' + status + '">' +
|
|
||||||
'<div class="day-label">' + wk + '</div>' +
|
|
||||||
'<div class="day-date">' + grade + '</div>' +
|
|
||||||
'<div class="day-score">' + score + '<span style="font-size:11px;font-weight:400">分</span></div>' +
|
|
||||||
'<div class="day-badge">' + (status === 'pass' ? '达标' : '未达标') + '</div>' +
|
|
||||||
'</div>';
|
|
||||||
document.getElementById('week-days-grid').innerHTML = gridHtml;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ================================================================
|
/* ================================================================
|
||||||
History
|
History
|
||||||
================================================================ */
|
================================================================ */
|
||||||
@@ -688,278 +763,6 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ================================================================
|
|
||||||
Wishes — 心愿清单(四象限)
|
|
||||||
================================================================ */
|
|
||||||
var wishes = [];
|
|
||||||
var dragSourceId = null;
|
|
||||||
var dragSourceQuadrant = null;
|
|
||||||
var wishesLoaded = false;
|
|
||||||
var QUADRANTS = ['重要紧急', '重要不紧急', '紧急不重要', '不紧急不重要'];
|
|
||||||
|
|
||||||
function normalizeQuadrant(w) {
|
|
||||||
if (QUADRANTS.indexOf(w.quadrant) >= 0) return w.quadrant;
|
|
||||||
// 老数据回退: priority → quadrant
|
|
||||||
var map = {'高': '重要紧急', '中': '重要不紧急', '低': '不紧急不重要'};
|
|
||||||
return map[w.priority] || '重要不紧急';
|
|
||||||
}
|
|
||||||
|
|
||||||
function loadWishes() {
|
|
||||||
if (wishesLoaded) { renderWishes(); return; }
|
|
||||||
if (window.__INITIAL_WISHES__) {
|
|
||||||
wishes = window.__INITIAL_WISHES__;
|
|
||||||
// 规范化 quadrant
|
|
||||||
wishes.forEach(function(w){ w.quadrant = normalizeQuadrant(w); });
|
|
||||||
wishesLoaded = true;
|
|
||||||
renderWishes();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
fetch('/api/wishes')
|
|
||||||
.then(function(r){ return r.json(); })
|
|
||||||
.then(function(res){ if (res.ok) { wishes = res.data; wishesLoaded = true; renderWishes(); } });
|
|
||||||
}
|
|
||||||
|
|
||||||
function renderWishes() {
|
|
||||||
var emptyEl = document.getElementById('wishes-empty');
|
|
||||||
if (!wishes.length) {
|
|
||||||
QUADRANTS.forEach(function(q){ document.getElementById('quad-list-' + q).innerHTML = ''; });
|
|
||||||
if (emptyEl) emptyEl.style.display = 'block';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (emptyEl) emptyEl.style.display = 'none';
|
|
||||||
|
|
||||||
// 按象限分组渲染
|
|
||||||
QUADRANTS.forEach(function(quadrant) {
|
|
||||||
var list = document.getElementById('quad-list-' + quadrant);
|
|
||||||
if (!list) return;
|
|
||||||
var items = wishes.filter(function(w){ return normalizeQuadrant(w) === quadrant; });
|
|
||||||
var html = '';
|
|
||||||
for (var i = 0; i < items.length; i++) {
|
|
||||||
var w = items[i];
|
|
||||||
var doneCls = w.done ? ' done' : '';
|
|
||||||
var deadline = w.deadline ? w.deadline : '';
|
|
||||||
html += '<div class="wish-item' + doneCls + '" draggable="true" data-id="' + w.id + '" data-quadrant="' + quadrant + '">' +
|
|
||||||
'<span class="wish-drag-handle"><svg class="icon-xs"><use href="#icon-list-bullet"/></svg></span>' +
|
|
||||||
'<input type="checkbox" class="wish-check" ' + (w.done ? 'checked' : '') + ' onchange="toggleWish(' + w.id + ', this.checked)">' +
|
|
||||||
'<span class="wish-name" title="' + esc(w.name) + '">' + esc(w.name) + '</span>' +
|
|
||||||
(deadline ? '<span class="wish-deadline">' + esc(deadline) + '</span>' : '') +
|
|
||||||
'<button class="btn-del wish-del" onclick="deleteWishItem(' + w.id + ')"><svg class="icon-xs"><use href="#icon-x"/></svg></button>' +
|
|
||||||
'</div>';
|
|
||||||
}
|
|
||||||
list.innerHTML = html;
|
|
||||||
});
|
|
||||||
|
|
||||||
bindDragEvents();
|
|
||||||
bindEditClicks();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ── 点击编辑 ── */
|
|
||||||
|
|
||||||
function bindEditClicks() {
|
|
||||||
document.querySelectorAll('#panel-wishes .wish-item').forEach(function(item) {
|
|
||||||
// 只在点击名称或日期区域时触发编辑(排除 checkbox / 拖拽手柄 / 删除按钮)
|
|
||||||
item.addEventListener('click', function(e) {
|
|
||||||
if (e.target.closest('.wish-check') || e.target.closest('.wish-drag-handle') ||
|
|
||||||
e.target.closest('.wish-del') || e.target.closest('.wish-edit-form')) return;
|
|
||||||
var id = parseInt(this.dataset.id);
|
|
||||||
var w = wishes.find(function(x){ return x.id === id; });
|
|
||||||
if (w) startEditWish(this, w);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function startEditWish(el, w) {
|
|
||||||
if (el.querySelector('.wish-edit-form')) return; // 已在编辑中
|
|
||||||
el.classList.add('editing');
|
|
||||||
var deadline = w.deadline || '';
|
|
||||||
var quadOpts = QUADRANTS.map(function(q){
|
|
||||||
return '<option value="' + q + '"' + (q === normalizeQuadrant(w) ? ' selected' : '') + '>' + q + '</option>';
|
|
||||||
}).join('');
|
|
||||||
el.innerHTML =
|
|
||||||
'<div class="wish-edit-form">' +
|
|
||||||
'<input type="text" class="wish-edit-name" value="' + esc(w.name) + '" maxlength="50">' +
|
|
||||||
'<div class="wish-edit-row">' +
|
|
||||||
'<select class="wish-edit-quadrant">' + quadOpts + '</select>' +
|
|
||||||
'<input type="date" class="wish-edit-deadline" value="' + esc(deadline) + '">' +
|
|
||||||
'</div>' +
|
|
||||||
'<div class="wish-edit-actions">' +
|
|
||||||
'<button class="btn-wish-save" onclick="event.stopPropagation();saveEditWish(' + w.id + ', this)">保存</button>' +
|
|
||||||
'<button class="btn-wish-cancel" onclick="event.stopPropagation();window.renderWishes()">取消</button>' +
|
|
||||||
'</div>' +
|
|
||||||
'</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
window.saveEditWish = function(id, btn) {
|
|
||||||
var form = btn.closest('.wish-edit-form');
|
|
||||||
var name = form.querySelector('.wish-edit-name').value.trim();
|
|
||||||
if (!name) { showToast('名称不能为空', 'error'); return; }
|
|
||||||
var quadrant = form.querySelector('.wish-edit-quadrant').value;
|
|
||||||
var deadline = form.querySelector('.wish-edit-deadline').value;
|
|
||||||
fetch('/api/wishes/' + id, {
|
|
||||||
method: 'PUT',
|
|
||||||
headers: {'Content-Type': 'application/json'},
|
|
||||||
body: JSON.stringify({name: name, quadrant: quadrant, deadline: deadline})
|
|
||||||
}).then(function(r){ return r.json(); })
|
|
||||||
.then(function(res) {
|
|
||||||
if (!res.ok) { showToast(res.error, 'error'); return; }
|
|
||||||
var w = wishes.find(function(x){ return x.id === id; });
|
|
||||||
if (w) { w.name = name; w.quadrant = quadrant; w.deadline = deadline; }
|
|
||||||
renderWishes();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/* ── Drag & Drop (跨象限) ── */
|
|
||||||
|
|
||||||
function bindDragEvents() {
|
|
||||||
var items = document.querySelectorAll('#panel-wishes .wish-item');
|
|
||||||
items.forEach(function(item) {
|
|
||||||
item.addEventListener('dragstart', function(e) {
|
|
||||||
dragSourceId = parseInt(this.dataset.id);
|
|
||||||
dragSourceQuadrant = this.dataset.quadrant;
|
|
||||||
this.classList.add('dragging');
|
|
||||||
e.dataTransfer.effectAllowed = 'move';
|
|
||||||
});
|
|
||||||
item.addEventListener('dragend', function() {
|
|
||||||
this.classList.remove('dragging');
|
|
||||||
dragSourceId = null;
|
|
||||||
dragSourceQuadrant = null;
|
|
||||||
document.querySelectorAll('.quad-cell, .wish-item').forEach(function(el){ el.classList.remove('drag-over'); });
|
|
||||||
});
|
|
||||||
item.addEventListener('dragover', function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
e.dataTransfer.dropEffect = 'move';
|
|
||||||
this.classList.add('drag-over');
|
|
||||||
});
|
|
||||||
item.addEventListener('dragleave', function() {
|
|
||||||
this.classList.remove('drag-over');
|
|
||||||
});
|
|
||||||
item.addEventListener('drop', function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
this.classList.remove('drag-over');
|
|
||||||
var targetId = parseInt(this.dataset.id);
|
|
||||||
var targetQuadrant = this.dataset.quadrant;
|
|
||||||
if (dragSourceId === targetId) return;
|
|
||||||
|
|
||||||
var fromIdx = -1, toIdx = -1;
|
|
||||||
for (var j = 0; j < wishes.length; j++) {
|
|
||||||
if (wishes[j].id === dragSourceId) fromIdx = j;
|
|
||||||
if (wishes[j].id === targetId) toIdx = j;
|
|
||||||
}
|
|
||||||
if (fromIdx >= 0 && toIdx >= 0) {
|
|
||||||
var moved = wishes.splice(fromIdx, 1)[0];
|
|
||||||
wishes.splice(toIdx, 0, moved);
|
|
||||||
// 更新象限
|
|
||||||
if (dragSourceQuadrant !== targetQuadrant) {
|
|
||||||
moved.quadrant = targetQuadrant;
|
|
||||||
fetch('/api/wishes/' + moved.id, {
|
|
||||||
method: 'PUT',
|
|
||||||
headers: {'Content-Type': 'application/json'},
|
|
||||||
body: JSON.stringify({quadrant: targetQuadrant})
|
|
||||||
}).catch(function(){ showToast('保存失败', 'error'); });
|
|
||||||
}
|
|
||||||
renderWishes();
|
|
||||||
saveWishOrder();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// 象限空区域接受 drop
|
|
||||||
document.querySelectorAll('.quad-cell').forEach(function(cell) {
|
|
||||||
cell.addEventListener('dragover', function(e) {
|
|
||||||
if (this.querySelector('.wish-item')) return; // 有内容时让 item 处理
|
|
||||||
e.preventDefault();
|
|
||||||
this.classList.add('drag-over');
|
|
||||||
});
|
|
||||||
cell.addEventListener('dragleave', function() { this.classList.remove('drag-over'); });
|
|
||||||
cell.addEventListener('drop', function(e) {
|
|
||||||
this.classList.remove('drag-over');
|
|
||||||
if (this.querySelector('.wish-item')) return; // 已由 item 处理
|
|
||||||
e.preventDefault();
|
|
||||||
var q = this.dataset.quadrant;
|
|
||||||
var moved = wishes.find(function(w){ return w.id === dragSourceId; });
|
|
||||||
if (moved) {
|
|
||||||
moved.quadrant = q;
|
|
||||||
fetch('/api/wishes/' + moved.id, {
|
|
||||||
method: 'PUT',
|
|
||||||
headers: {'Content-Type': 'application/json'},
|
|
||||||
body: JSON.stringify({quadrant: q})
|
|
||||||
}).catch(function(){ showToast('保存失败', 'error'); });
|
|
||||||
renderWishes();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function saveWishOrder() {
|
|
||||||
var order = wishes.map(function(w){ return w.id; });
|
|
||||||
fetch('/api/wishes/reorder', {
|
|
||||||
method: 'PUT',
|
|
||||||
headers: {'Content-Type': 'application/json'},
|
|
||||||
body: JSON.stringify({order: order})
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ── CRUD ── */
|
|
||||||
|
|
||||||
window.showWishForm = function() {
|
|
||||||
var form = document.getElementById('wish-form');
|
|
||||||
if (form) form.style.display = 'block';
|
|
||||||
};
|
|
||||||
|
|
||||||
window.hideWishForm = function() {
|
|
||||||
var form = document.getElementById('wish-form');
|
|
||||||
if (form) form.style.display = 'none';
|
|
||||||
document.getElementById('wish-name').value = '';
|
|
||||||
document.getElementById('wish-deadline').value = '';
|
|
||||||
var sel = document.getElementById('wish-quadrant');
|
|
||||||
if (sel) sel.value = '重要不紧急';
|
|
||||||
};
|
|
||||||
|
|
||||||
window.addWish = function() {
|
|
||||||
var name = document.getElementById('wish-name').value.trim();
|
|
||||||
if (!name) { showToast('请输入心愿名称', 'error'); return; }
|
|
||||||
var quadrant = document.getElementById('wish-quadrant').value;
|
|
||||||
var deadline = document.getElementById('wish-deadline').value;
|
|
||||||
fetch('/api/wishes', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {'Content-Type': 'application/json'},
|
|
||||||
body: JSON.stringify({name: name, quadrant: quadrant, deadline: deadline})
|
|
||||||
}).then(function(r){ return r.json(); })
|
|
||||||
.then(function(res){
|
|
||||||
if (!res.ok) { showToast(res.error, 'error'); return; }
|
|
||||||
hideWishForm();
|
|
||||||
wishes.push({id: res.id, name: name, quadrant: quadrant, deadline: deadline, done: 0});
|
|
||||||
renderWishes();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
window.toggleWish = function(id, done) {
|
|
||||||
fetch('/api/wishes/' + id, {
|
|
||||||
method: 'PUT',
|
|
||||||
headers: {'Content-Type': 'application/json'},
|
|
||||||
body: JSON.stringify({done: done ? 1 : 0})
|
|
||||||
});
|
|
||||||
var w = wishes.find(function(x){ return x.id === id; });
|
|
||||||
if (w) w.done = done ? 1 : 0;
|
|
||||||
renderWishes();
|
|
||||||
};
|
|
||||||
|
|
||||||
window.deleteWishItem = function(id) {
|
|
||||||
fetch('/api/wishes/' + id, {method: 'DELETE'});
|
|
||||||
wishes = wishes.filter(function(w){ return w.id !== id; });
|
|
||||||
renderWishes();
|
|
||||||
};
|
|
||||||
|
|
||||||
window.toggleWishesEdit = function(btn) {
|
|
||||||
var panel = document.getElementById('panel-wishes');
|
|
||||||
if (!panel) return;
|
|
||||||
var editing = panel.classList.toggle('editing');
|
|
||||||
btn.classList.toggle('active', editing);
|
|
||||||
};
|
|
||||||
|
|
||||||
window.renderWishes = renderWishes;
|
|
||||||
|
|
||||||
/* ================================================================
|
/* ================================================================
|
||||||
Blueprint — 蓝图六板块
|
Blueprint — 蓝图六板块
|
||||||
================================================================ */
|
================================================================ */
|
||||||
@@ -1002,7 +805,7 @@
|
|||||||
(info.evening_items || []).forEach(function(ei){ items.push({pillar: p, text: ei.mistake || ei.improvement, improvement: ei.improvement, type: 'evening'}); });
|
(info.evening_items || []).forEach(function(ei){ items.push({pillar: p, text: ei.mistake || ei.improvement, improvement: ei.improvement, type: 'evening'}); });
|
||||||
}
|
}
|
||||||
if (blueprintFilter === 'all' || blueprintFilter === 'study') {
|
if (blueprintFilter === 'all' || blueprintFilter === 'study') {
|
||||||
(info.study_items || []).forEach(function(si){ items.push({pillar: p, text: si.name, type: 'study', done: si.done, note: si.note}); });
|
(info.study_items || []).forEach(function(si){ items.push({pillar: p, text: si.name, type: 'study', count: si.count}); });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (items.length === 0) {
|
if (items.length === 0) {
|
||||||
@@ -1020,7 +823,7 @@
|
|||||||
items.forEach(function(item){
|
items.forEach(function(item){
|
||||||
var dot = '<span class="bp-pillar-dot" style="background:' + (pillarColors[item.pillar.name] || '#94A3B8') + '"></span>';
|
var dot = '<span class="bp-pillar-dot" style="background:' + (pillarColors[item.pillar.name] || '#94A3B8') + '"></span>';
|
||||||
var extra = '';
|
var extra = '';
|
||||||
if (item.type === 'study' && item.note) extra = '<span class="bp-item-note">' + esc(item.note) + '</span>';
|
if (item.type === 'study' && item.count > 0) extra = '<span class="bp-item-note">打卡 ' + item.count + ' 次</span>';
|
||||||
if (item.type === 'evening' && item.improvement) extra = '<span class="bp-item-note evening">→ ' + esc(item.improvement) + '</span>';
|
if (item.type === 'evening' && item.improvement) extra = '<span class="bp-item-note evening">→ ' + esc(item.improvement) + '</span>';
|
||||||
html += '<div class="bp-list-item">' +
|
html += '<div class="bp-list-item">' +
|
||||||
dot +
|
dot +
|
||||||
|
|||||||
547
static/style.css
547
static/style.css
@@ -71,6 +71,41 @@ body {
|
|||||||
gap: 8px;
|
gap: 8px;
|
||||||
padding: 24px 12px 16px;
|
padding: 24px 12px 16px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-user .user-avatar {
|
||||||
|
transition: transform 0.15s;
|
||||||
|
}
|
||||||
|
.sidebar-user:hover .user-avatar { transform: scale(1.05); }
|
||||||
|
|
||||||
|
.user-dropdown {
|
||||||
|
position: absolute;
|
||||||
|
top: 100%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
background: var(--card);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
box-shadow: var(--shadow-hover);
|
||||||
|
z-index: 100;
|
||||||
|
min-width: 120px;
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
|
.user-dropdown-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
padding: 8px 12px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: var(--text-dim);
|
||||||
|
text-decoration: none;
|
||||||
|
border-radius: 6px;
|
||||||
|
transition: all 0.15s;
|
||||||
|
}
|
||||||
|
.user-dropdown-item:hover {
|
||||||
|
background: var(--danger-light);
|
||||||
|
color: var(--danger);
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-user .user-name {
|
.sidebar-user .user-name {
|
||||||
@@ -174,6 +209,45 @@ body {
|
|||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ═══════════════════════════════════════════
|
||||||
|
Sidebar Dark Theme(左侧导航栏专属)
|
||||||
|
═══════════════════════════════════════════ */
|
||||||
|
.sidebar {
|
||||||
|
background: linear-gradient(180deg, #1E293B 0%, #0F172A 100%);
|
||||||
|
border-right: 1px solid #334155;
|
||||||
|
}
|
||||||
|
.sidebar .user-name {
|
||||||
|
color: #94A3B8;
|
||||||
|
}
|
||||||
|
.sidebar .user-avatar {
|
||||||
|
background: #4F46E5;
|
||||||
|
color: #FFF;
|
||||||
|
}
|
||||||
|
.sidebar .btn-logout-icon {
|
||||||
|
color: #64748B;
|
||||||
|
}
|
||||||
|
.sidebar .btn-logout-icon:hover {
|
||||||
|
background: rgba(248,113,113,0.15);
|
||||||
|
color: #FCA5A5;
|
||||||
|
}
|
||||||
|
.sidebar .nav-item {
|
||||||
|
color: #94A3B8;
|
||||||
|
}
|
||||||
|
.sidebar .nav-item:hover {
|
||||||
|
background: rgba(99,102,241,0.08);
|
||||||
|
color: #E2E8F0;
|
||||||
|
}
|
||||||
|
.sidebar .nav-item .icon-md {
|
||||||
|
color: #6366F1;
|
||||||
|
}
|
||||||
|
.sidebar .nav-item:hover .icon-md { color: #818CF8; }
|
||||||
|
.sidebar .nav-item.active {
|
||||||
|
background: rgba(99,102,241,0.15);
|
||||||
|
color: #FFF;
|
||||||
|
border: 1px solid rgba(99,102,241,0.3);
|
||||||
|
}
|
||||||
|
.sidebar .nav-item.active .icon-md { color: #818CF8; }
|
||||||
|
|
||||||
/* ═══════════════════════════════════════════
|
/* ═══════════════════════════════════════════
|
||||||
Calendar Widget
|
Calendar Widget
|
||||||
═══════════════════════════════════════════ */
|
═══════════════════════════════════════════ */
|
||||||
@@ -218,37 +292,60 @@ body {
|
|||||||
color: var(--text);
|
color: var(--text);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 周选择 */
|
/* 周列表行 */
|
||||||
.cal-weeks {
|
.cal-week-rows {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 8px;
|
flex-direction: column;
|
||||||
|
gap: 6px;
|
||||||
padding: 8px 14px 10px;
|
padding: 8px 14px 10px;
|
||||||
justify-content: center;
|
|
||||||
}
|
}
|
||||||
.cal-week-cell {
|
.cal-week-row {
|
||||||
width: 44px;
|
display: flex;
|
||||||
height: 44px;
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
padding: 8px 10px;
|
||||||
|
border: 0.5px solid var(--border);
|
||||||
|
border-radius: 8px;
|
||||||
|
background: var(--card);
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.15s;
|
||||||
|
}
|
||||||
|
.cal-week-row:hover { border-color: var(--primary); }
|
||||||
|
.cal-week-row.today { border-color: var(--primary); }
|
||||||
|
.cal-week-row.selected { background: var(--primary); color: #FFF; border-color: transparent; }
|
||||||
|
.cal-week-row.selected .cal-wk-label,
|
||||||
|
.cal-week-row.selected .cal-wk-date,
|
||||||
|
.cal-week-row.selected .cal-wk-badge { color: #FFF; }
|
||||||
|
.cal-week-row.selected .cal-wk-status { background: rgba(255,255,255,0.2); color: #FFF; }
|
||||||
|
|
||||||
|
.cal-wk-status {
|
||||||
|
width: 28px;
|
||||||
|
height: 28px;
|
||||||
|
border-radius: 50%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
font-size: 13px;
|
font-size: 12px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
border-radius: 8px;
|
flex-shrink: 0;
|
||||||
color: var(--text-dim);
|
|
||||||
cursor: pointer;
|
|
||||||
transition: all 0.15s;
|
|
||||||
border: 1.5px solid var(--border);
|
|
||||||
background: var(--card);
|
|
||||||
}
|
}
|
||||||
.cal-week-cell:hover { border-color: var(--primary); color: var(--primary); }
|
.cal-wk-status.pass { background: var(--success-light); color: var(--success); }
|
||||||
.cal-week-cell.pass { background: var(--success-light); border-color: var(--success); color: var(--success); }
|
.cal-wk-status.fail { background: var(--danger-light); color: var(--danger); }
|
||||||
.cal-week-cell.fail { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }
|
.cal-wk-status.empty { background: var(--bg); color: var(--text-muted); }
|
||||||
.cal-week-cell.today { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
|
|
||||||
.cal-week-cell.selected { background: var(--primary); color: #FFF; border-color: var(--primary); }
|
|
||||||
|
|
||||||
/* 旧样式清理 */
|
.cal-wk-info {
|
||||||
.cal-week-list { display: none; }
|
flex: 1;
|
||||||
.cal-week-cell .wk-num, .cal-week-cell .wk-dot { display: none; }
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 1px;
|
||||||
|
}
|
||||||
|
.cal-wk-label { font-size: 12px; font-weight: 600; color: var(--text); }
|
||||||
|
.cal-wk-date { font-size: 10px; color: var(--text-muted); }
|
||||||
|
.cal-wk-badge { font-size: 10px; color: var(--text-muted); }
|
||||||
|
|
||||||
|
/* 旧样式隐藏 */
|
||||||
|
.cal-weeks { display: none; }
|
||||||
|
.cal-week-cell { display: none; }
|
||||||
|
|
||||||
.cal-header {
|
.cal-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -735,9 +832,7 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* 编辑模式下才显示的元素 */
|
/* 编辑模式下才显示的元素 */
|
||||||
.edit-only { display: none; }
|
.edit-only { display: flex; }
|
||||||
.card.editing .edit-only { display: flex; }
|
|
||||||
.card.editing .btn-del { display: inline-flex; }
|
|
||||||
|
|
||||||
/* 默认隐藏删除按钮 */
|
/* 默认隐藏删除按钮 */
|
||||||
.btn-del { display: none; }
|
.btn-del { display: none; }
|
||||||
@@ -933,7 +1028,7 @@ body {
|
|||||||
gap: 5px;
|
gap: 5px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 9px;
|
padding: 9px;
|
||||||
margin-top: auto;
|
margin-top: 12px;
|
||||||
border: 1.5px dashed var(--primary);
|
border: 1.5px dashed var(--primary);
|
||||||
background: var(--primary-light);
|
background: var(--primary-light);
|
||||||
color: var(--primary);
|
color: var(--primary);
|
||||||
@@ -975,172 +1070,6 @@ body {
|
|||||||
|
|
||||||
.btn-save:active { transform: translateY(0); }
|
.btn-save:active { transform: translateY(0); }
|
||||||
|
|
||||||
/* ═══════════════════════════════════════════
|
|
||||||
Weekly Panel
|
|
||||||
═══════════════════════════════════════════ */
|
|
||||||
|
|
||||||
.week-nav {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 20px;
|
|
||||||
padding: 8px 0 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-nav {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 4px;
|
|
||||||
padding: 8px 16px;
|
|
||||||
border: 1.5px solid var(--border);
|
|
||||||
background: var(--card);
|
|
||||||
border-radius: var(--radius-sm);
|
|
||||||
font-size: 13px;
|
|
||||||
font-weight: 500;
|
|
||||||
cursor: pointer;
|
|
||||||
color: var(--text);
|
|
||||||
transition: all 0.2s;
|
|
||||||
font-family: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-nav:hover {
|
|
||||||
border-color: var(--primary);
|
|
||||||
color: var(--primary);
|
|
||||||
background: var(--primary-light);
|
|
||||||
}
|
|
||||||
|
|
||||||
#week-label {
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 600;
|
|
||||||
min-width: 200px;
|
|
||||||
text-align: center;
|
|
||||||
color: var(--text);
|
|
||||||
}
|
|
||||||
|
|
||||||
.weekly-overview {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 40px;
|
|
||||||
padding: 20px 0;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.score-circle {
|
|
||||||
position: relative;
|
|
||||||
width: 140px;
|
|
||||||
height: 140px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.score-svg {
|
|
||||||
width: 140px;
|
|
||||||
height: 140px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.score-svg circle {
|
|
||||||
transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.score-inner {
|
|
||||||
position: absolute;
|
|
||||||
top: 50%; left: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
display: flex;
|
|
||||||
align-items: baseline;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.score-num {
|
|
||||||
font-size: 40px;
|
|
||||||
font-weight: 800;
|
|
||||||
color: var(--primary);
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.score-unit {
|
|
||||||
font-size: 15px;
|
|
||||||
color: var(--text-muted);
|
|
||||||
margin-left: 2px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.score-meta {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.score-text {
|
|
||||||
font-size: 15px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--text);
|
|
||||||
}
|
|
||||||
|
|
||||||
.score-stats {
|
|
||||||
font-size: 13px;
|
|
||||||
color: var(--text-muted);
|
|
||||||
line-height: 1.6;
|
|
||||||
}
|
|
||||||
|
|
||||||
.week-days-grid {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(7, 1fr);
|
|
||||||
gap: 8px;
|
|
||||||
margin-top: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.day-cell {
|
|
||||||
background: var(--card);
|
|
||||||
border-radius: var(--radius-sm);
|
|
||||||
padding: 12px 8px;
|
|
||||||
text-align: center;
|
|
||||||
box-shadow: var(--shadow);
|
|
||||||
transition: box-shadow 0.2s;
|
|
||||||
border-top: 3px solid transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.day-cell:hover { box-shadow: var(--shadow-hover); }
|
|
||||||
|
|
||||||
.day-cell.pass { border-top-color: var(--success); }
|
|
||||||
.day-cell.fail { border-top-color: var(--warning); }
|
|
||||||
.day-cell.empty { border-top-color: var(--border); opacity: 0.5; }
|
|
||||||
|
|
||||||
.day-cell .day-label {
|
|
||||||
font-size: 11px;
|
|
||||||
color: var(--text-muted);
|
|
||||||
margin-bottom: 4px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.day-cell .day-date {
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--text);
|
|
||||||
margin-bottom: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.day-cell .day-score {
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
.day-cell.pass .day-score { color: var(--success); }
|
|
||||||
.day-cell.fail .day-score { color: var(--warning); }
|
|
||||||
.day-cell.empty .day-score { color: var(--text-muted); }
|
|
||||||
|
|
||||||
.day-cell .day-badge {
|
|
||||||
display: inline-block;
|
|
||||||
padding: 2px 8px;
|
|
||||||
border-radius: 10px;
|
|
||||||
font-size: 10px;
|
|
||||||
font-weight: 600;
|
|
||||||
margin-top: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.day-cell.pass .day-badge { background: var(--success-light); color: var(--success); }
|
|
||||||
.day-cell.fail .day-badge { background: var(--warning-light); color: #D97706; }
|
|
||||||
.day-cell.empty .day-badge { background: var(--bg); color: var(--text-muted); }
|
|
||||||
|
|
||||||
/* ═══════════════════════════════════════════
|
/* ═══════════════════════════════════════════
|
||||||
History Panel
|
History Panel
|
||||||
═══════════════════════════════════════════ */
|
═══════════════════════════════════════════ */
|
||||||
@@ -1365,7 +1294,7 @@ body {
|
|||||||
.sync-event + .sync-event { border-top: 1px solid var(--bg); }
|
.sync-event + .sync-event { border-top: 1px solid var(--bg); }
|
||||||
.sync-event-icon { flex-shrink: 0; }
|
.sync-event-icon { flex-shrink: 0; }
|
||||||
.sync-event-text { flex: 1; }
|
.sync-event-text { flex: 1; }
|
||||||
.sync-event-time { font-size: 11px; color: var(--text-muted); margin-left: 6px; }
|
.sync-event-meta { font-size: 11px; color: var(--text-muted); }
|
||||||
.sync-modal-footer {
|
.sync-modal-footer {
|
||||||
padding: 12px 20px;
|
padding: 12px 20px;
|
||||||
border-top: 1px solid var(--border);
|
border-top: 1px solid var(--border);
|
||||||
@@ -1373,190 +1302,6 @@ body {
|
|||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
.sync-modal-footer .btn-wish-save {
|
|
||||||
width: auto;
|
|
||||||
padding: 8px 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ═══════════════════════════════════════════
|
|
||||||
Wishes — 四象限
|
|
||||||
═══════════════════════════════════════════ */
|
|
||||||
|
|
||||||
#panel-wishes.editing .edit-only { display: inline-flex; }
|
|
||||||
#panel-wishes.editing .wish-del { display: inline-flex; }
|
|
||||||
|
|
||||||
.wish-form {
|
|
||||||
background: var(--bg);
|
|
||||||
border-radius: var(--radius-sm);
|
|
||||||
padding: 10px 12px;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
max-width: 480px;
|
|
||||||
}
|
|
||||||
.wish-form input[type="text"],
|
|
||||||
.wish-form input[type="date"],
|
|
||||||
.wish-form select {
|
|
||||||
width: 100%;
|
|
||||||
padding: 8px 10px;
|
|
||||||
border: 1.5px solid var(--border);
|
|
||||||
border-radius: var(--radius-sm);
|
|
||||||
font-size: 13px;
|
|
||||||
font-family: inherit;
|
|
||||||
color: var(--text);
|
|
||||||
margin-bottom: 8px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
background: var(--card);
|
|
||||||
}
|
|
||||||
.wish-form input:focus, .wish-form select:focus {
|
|
||||||
outline: none;
|
|
||||||
border-color: var(--primary);
|
|
||||||
box-shadow: 0 0 0 3px rgba(74,108,247,0.08);
|
|
||||||
}
|
|
||||||
.wish-form-row { display: flex; gap: 8px; }
|
|
||||||
.wish-form-row select, .wish-form-row input { flex: 1; }
|
|
||||||
.wish-form-actions { display: flex; gap: 8px; }
|
|
||||||
.btn-wish-save {
|
|
||||||
flex: 1; padding: 8px; border: none; background: var(--primary); color: #FFF;
|
|
||||||
border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
|
|
||||||
cursor: pointer; font-family: inherit;
|
|
||||||
}
|
|
||||||
.btn-wish-save:hover { background: var(--primary-dark); }
|
|
||||||
.btn-wish-cancel {
|
|
||||||
flex: 1; padding: 8px; border: 1.5px solid var(--border); background: var(--card);
|
|
||||||
color: var(--text-dim); border-radius: var(--radius-sm); font-size: 13px;
|
|
||||||
cursor: pointer; font-family: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 四象限网格 */
|
|
||||||
.quad-grid {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr 1fr;
|
|
||||||
grid-template-rows: 1fr 1fr;
|
|
||||||
gap: 12px;
|
|
||||||
min-height: 400px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.quad-cell {
|
|
||||||
background: var(--card);
|
|
||||||
border: 1.5px solid var(--border);
|
|
||||||
border-radius: var(--radius);
|
|
||||||
padding: 12px 14px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
min-height: 180px;
|
|
||||||
transition: border-color 0.2s, box-shadow 0.2s;
|
|
||||||
}
|
|
||||||
.quad-cell.drag-over {
|
|
||||||
border-color: var(--primary);
|
|
||||||
box-shadow: 0 0 0 3px rgba(74,108,247,0.10);
|
|
||||||
background: var(--primary-light);
|
|
||||||
}
|
|
||||||
|
|
||||||
.quad-title {
|
|
||||||
font-size: 13px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--text);
|
|
||||||
margin-bottom: 10px;
|
|
||||||
padding-bottom: 8px;
|
|
||||||
border-bottom: 1px solid var(--border);
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.quad-list {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 4px;
|
|
||||||
min-height: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wish-item {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
padding: 7px 10px;
|
|
||||||
border-radius: var(--radius-sm);
|
|
||||||
background: var(--bg);
|
|
||||||
transition: opacity 0.15s, box-shadow 0.15s;
|
|
||||||
}
|
|
||||||
.wish-item:hover { box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
|
|
||||||
.wish-item.dragging { opacity: 0.3; }
|
|
||||||
.wish-item.drag-over {
|
|
||||||
box-shadow: inset 0 0 0 2px var(--primary);
|
|
||||||
background: var(--card);
|
|
||||||
}
|
|
||||||
|
|
||||||
.wish-drag-handle {
|
|
||||||
color: var(--text-muted); cursor: grab; flex-shrink: 0;
|
|
||||||
display: flex; align-items: center;
|
|
||||||
}
|
|
||||||
.wish-drag-handle:active { cursor: grabbing; }
|
|
||||||
|
|
||||||
.wish-check {
|
|
||||||
width: 15px; height: 15px; accent-color: var(--success);
|
|
||||||
flex-shrink: 0; cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wish-name {
|
|
||||||
flex: 1; font-size: 13px; color: var(--text); min-width: 0;
|
|
||||||
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
||||||
}
|
|
||||||
.wish-item.done .wish-name { text-decoration: line-through; color: var(--text-muted); }
|
|
||||||
|
|
||||||
.wish-deadline {
|
|
||||||
font-size: 11px; color: var(--text-dim); white-space: nowrap; flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wish-del { display: none; }
|
|
||||||
.wish-del .icon-xs { width: 13px; height: 13px; }
|
|
||||||
|
|
||||||
/* 内联编辑 */
|
|
||||||
.wish-item.editing {
|
|
||||||
background: var(--card);
|
|
||||||
padding: 8px 10px;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
.wish-edit-form {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 6px;
|
|
||||||
}
|
|
||||||
.wish-edit-form input[type="text"],
|
|
||||||
.wish-edit-form input[type="date"],
|
|
||||||
.wish-edit-form select {
|
|
||||||
width: 100%;
|
|
||||||
padding: 6px 8px;
|
|
||||||
border: 1.5px solid var(--border);
|
|
||||||
border-radius: var(--radius-sm);
|
|
||||||
font-size: 12px;
|
|
||||||
font-family: inherit;
|
|
||||||
color: var(--text);
|
|
||||||
background: var(--card);
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
.wish-edit-form input:focus,
|
|
||||||
.wish-edit-form select:focus {
|
|
||||||
outline: none;
|
|
||||||
border-color: var(--primary);
|
|
||||||
box-shadow: 0 0 0 2px rgba(74,108,247,0.08);
|
|
||||||
}
|
|
||||||
.wish-edit-name { font-weight: 500; }
|
|
||||||
.wish-edit-row { display: flex; gap: 6px; }
|
|
||||||
.wish-edit-row select,
|
|
||||||
.wish-edit-row input { flex: 1; }
|
|
||||||
.wish-edit-actions { display: flex; gap: 6px; }
|
|
||||||
.wish-edit-actions .btn-wish-save,
|
|
||||||
.wish-edit-actions .btn-wish-cancel {
|
|
||||||
flex: 1; padding: 6px; font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wishes-empty {
|
|
||||||
font-size: 13px; color: var(--text-muted); text-align: center; padding: 32px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 900px) {
|
|
||||||
.quad-grid { grid-template-columns: 1fr; grid-template-rows: auto; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ═══════════════════════════════════════════
|
/* ═══════════════════════════════════════════
|
||||||
SVG icons helpers
|
SVG icons helpers
|
||||||
@@ -1574,8 +1319,6 @@ body {
|
|||||||
:root { --sidebar-w: 240px; }
|
:root { --sidebar-w: 240px; }
|
||||||
.main-content { padding: 20px 24px; }
|
.main-content { padding: 20px 24px; }
|
||||||
.daily-grid { grid-template-columns: 1fr; }
|
.daily-grid { grid-template-columns: 1fr; }
|
||||||
.weekly-overview { flex-direction: column; gap: 16px; text-align: center; }
|
|
||||||
.week-days-grid { grid-template-columns: repeat(4, 1fr); }
|
|
||||||
.history-grid { grid-template-columns: 1fr; }
|
.history-grid { grid-template-columns: 1fr; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1683,6 +1426,46 @@ body {
|
|||||||
padding: 32px 0;
|
padding: 32px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 900px) {
|
/* 勤学打卡卡片 - 单行样式 */
|
||||||
.quad-grid { grid-template-columns: 1fr; grid-template-rows: auto; }
|
#study-cards { display: flex; flex-direction: column; gap: 8px; }
|
||||||
}
|
.study-card { position:relative; display:flex; align-items:center; gap:12px; padding:10px 14px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--card); transition:all 0.15s; }
|
||||||
|
.study-card:hover { border-color:var(--primary); box-shadow:var(--shadow); }
|
||||||
|
.study-card.checked { border-color:var(--success); background:var(--success-light); }
|
||||||
|
.study-card-info { display:flex; align-items:center; gap:8px; flex:1; }
|
||||||
|
.study-card-name { font-size:13px; color:var(--text); font-weight:500; }
|
||||||
|
.study-card-count { font-size:12px; color:var(--text-muted); font-weight:600; background:var(--bg); border-radius:50%; width:24px; height:24px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
|
||||||
|
.study-card.checked .study-card-count { background:var(--success); color:#FFF; }
|
||||||
|
.study-card-btn { padding:5px 12px; border:1px solid var(--primary); border-radius:var(--radius-sm); background:transparent; color:var(--primary); font-size:12px; font-weight:500; cursor:pointer; transition:all 0.15s; font-family:inherit; white-space:nowrap; }
|
||||||
|
.study-card-btn:hover { background:var(--primary); color:#FFF; }
|
||||||
|
.study-card-btn.done { background:var(--success-light); color:var(--success); border-color:var(--success); cursor:default; }
|
||||||
|
.study-card-del { display:none; }
|
||||||
|
#panel-daily.editing-study .study-card-del { display:flex; align-items:center; justify-content:center; position:absolute; top:50%; transform:translateY(-50%); right:54px; border:none; background:var(--danger-light); color:var(--danger); cursor:pointer; font-size:14px; width:22px; height:22px; border-radius:50%; line-height:1; }
|
||||||
|
#panel-daily.editing-study .study-card-del:hover { background:var(--danger); color:#FFF; }
|
||||||
|
.edit-only-study { display: none; }
|
||||||
|
#panel-daily.editing-study .edit-only-study { display: flex; }
|
||||||
|
|
||||||
|
/* 编辑模式下显示删除按钮 */
|
||||||
|
.btn-del { display: none; }
|
||||||
|
.card.editing .btn-del { display: inline-flex; }
|
||||||
|
|
||||||
|
/* 本周日程 */
|
||||||
|
.morning-calendar { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
|
||||||
|
.morning-calendar-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
|
||||||
|
.cal-task-item { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; font-size: 13px; color: var(--text-dim); line-height: 1.5; border-bottom: 1px solid var(--bg); }
|
||||||
|
.cal-task-item:last-child { border-bottom: none; }
|
||||||
|
.cal-task-dot { flex-shrink: 0; font-size: 14px; margin-top: 1px; }
|
||||||
|
|
||||||
|
/* 拖拽排序 */
|
||||||
|
.drag-handle { display: none; cursor: grab; color: var(--text-muted); font-size: 14px; user-select: none; padding: 0 4px; line-height: 1; letter-spacing: -2px; }
|
||||||
|
.card.editing .drag-handle { display: block; }
|
||||||
|
.item-row.dragging, .evening-row.dragging { opacity: 0.5; }
|
||||||
|
.item-row.drag-over, .evening-row.drag-over { border-color: var(--primary) !important; background: var(--primary-light); }
|
||||||
|
.evening-drag { position: absolute; left: 6px; top: 8px; }
|
||||||
|
|
||||||
|
/* 任务备注 */
|
||||||
|
.btn-note-toggle { display: inline-flex; background: none; border: none; cursor: pointer; font-size: 14px; padding: 2px 4px; border-radius: 4px; transition: all 0.15s; flex-shrink: 0; }
|
||||||
|
.btn-note-toggle:hover { background: var(--bg); }
|
||||||
|
.btn-note-toggle.has-note { color: var(--primary); }
|
||||||
|
.item-note { display: none; width: 100%; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; font-family: inherit; color: var(--text); background: var(--bg); resize: vertical; min-height: 28px; box-sizing: border-box; margin-top: 6px; }
|
||||||
|
.item-note:focus { outline: none; border-color: var(--primary); }
|
||||||
|
.item-row { flex-wrap: wrap; }
|
||||||
|
|||||||
@@ -71,4 +71,8 @@
|
|||||||
<symbol id="icon-star" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
<symbol id="icon-star" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
||||||
<path d="M11.48 3.499a.562.562 0 0 1 1.04 0l2.125 5.111a.563.563 0 0 0 .475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 0 0-.182.557l1.285 5.385a.562.562 0 0 1-.84.61l-4.725-2.885a.563.563 0 0 0-.586 0L6.982 20.54a.562.562 0 0 1-.84-.61l1.285-5.386a.562.562 0 0 0-.182-.557l-4.204-3.602a.563.563 0 0 1 .321-.988l5.518-.442a.563.563 0 0 0 .475-.345L11.48 3.5Z"/>
|
<path d="M11.48 3.499a.562.562 0 0 1 1.04 0l2.125 5.111a.563.563 0 0 0 .475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 0 0-.182.557l1.285 5.385a.562.562 0 0 1-.84.61l-4.725-2.885a.563.563 0 0 0-.586 0L6.982 20.54a.562.562 0 0 1-.84-.61l1.285-5.386a.562.562 0 0 0-.182-.557l-4.204-3.602a.563.563 0 0 1 .321-.988l5.518-.442a.563.563 0 0 0 .475-.345L11.48 3.5Z"/>
|
||||||
</symbol>
|
</symbol>
|
||||||
|
<!-- 备注 -->
|
||||||
|
<symbol id="icon-file-text" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
||||||
|
<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M10 9H8"/><path d="M16 13H8"/><path d="M16 17H8"/>
|
||||||
|
</symbol>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.6 KiB |
@@ -6,7 +6,6 @@
|
|||||||
<title>紫微 · 磁场管理</title>
|
<title>紫微 · 磁场管理</title>
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
||||||
<script>window.__INITIAL_STATS__ = {{ initial_stats | safe }};</script>
|
<script>window.__INITIAL_STATS__ = {{ initial_stats | safe }};</script>
|
||||||
<script>window.__INITIAL_WISHES__ = {{ initial_wishes | safe }};</script>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{% include "icons.html" %}
|
{% include "icons.html" %}
|
||||||
@@ -34,19 +33,38 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 备注编辑弹窗 -->
|
||||||
|
<div class="sync-modal-overlay" id="note-modal" style="display:none">
|
||||||
|
<div class="sync-modal" style="max-width:720px">
|
||||||
|
<div class="sync-modal-header">
|
||||||
|
<h3 id="note-modal-title">备注</h3>
|
||||||
|
<button class="sync-modal-close" onclick="closeNoteModal()">×</button>
|
||||||
|
</div>
|
||||||
|
<div style="padding:16px">
|
||||||
|
<textarea id="note-modal-textarea" style="width:100%; min-height:300px; padding:12px; border:1px solid var(--border); border-radius:8px; font-size:14px; font-family:inherit; line-height:1.6; resize:vertical; box-sizing:border-box" placeholder="写点备注…"></textarea>
|
||||||
|
</div>
|
||||||
|
<div class="sync-modal-footer">
|
||||||
|
<button class="btn-wish-cancel" onclick="closeNoteModal()">取消</button>
|
||||||
|
<button class="btn-wish-save" onclick="saveNoteModal()">保存</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="app-layout">
|
<div class="app-layout">
|
||||||
|
|
||||||
<!-- ═══ 左侧边栏 ═══ -->
|
<!-- ═══ 左侧边栏 ═══ -->
|
||||||
<aside class="sidebar">
|
<aside class="sidebar">
|
||||||
|
|
||||||
<!-- 用户信息 -->
|
<!-- 用户信息 -->
|
||||||
<div class="sidebar-user">
|
<div class="sidebar-user" id="sidebar-user-menu" onclick="toggleUserMenu(event)">
|
||||||
<div class="user-avatar">{{ username[0] }}</div>
|
<div class="user-avatar">{{ username[0] }}</div>
|
||||||
<span class="user-name">{{ username }}</span>
|
<span class="user-name">{{ username }}</span>
|
||||||
<a href="/logout" class="btn-logout-icon" title="退出登录" onclick="return confirm('确定退出登录?')">
|
<div class="user-dropdown" id="user-dropdown" style="display:none">
|
||||||
<svg class="icon-sm"><use href="#icon-logout"/></svg>
|
<a class="user-dropdown-item" href="/logout" onclick="return confirm('确定退出登录?')">
|
||||||
|
<svg class="icon-sm"><use href="#icon-logout"/></svg> 退出登录
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 功能入口 -->
|
<!-- 功能入口 -->
|
||||||
<nav class="sidebar-nav">
|
<nav class="sidebar-nav">
|
||||||
@@ -54,14 +72,6 @@
|
|||||||
<svg class="icon-md"><use href="#icon-calendar"/></svg>
|
<svg class="icon-md"><use href="#icon-calendar"/></svg>
|
||||||
<span class="nav-label">打卡</span>
|
<span class="nav-label">打卡</span>
|
||||||
</a>
|
</a>
|
||||||
<a class="nav-item" data-panel="weekly" onclick="switchPanel('weekly')">
|
|
||||||
<svg class="icon-md"><use href="#icon-chart-bar"/></svg>
|
|
||||||
<span class="nav-label">评分</span>
|
|
||||||
</a>
|
|
||||||
<a class="nav-item" data-panel="wishes" onclick="switchPanel('wishes')">
|
|
||||||
<svg class="icon-md"><use href="#icon-star"/></svg>
|
|
||||||
<span class="nav-label">心愿</span>
|
|
||||||
</a>
|
|
||||||
<a class="nav-item" data-panel="history" onclick="switchPanel('history')">
|
<a class="nav-item" data-panel="history" onclick="switchPanel('history')">
|
||||||
<svg class="icon-md"><use href="#icon-list-bullet"/></svg>
|
<svg class="icon-md"><use href="#icon-list-bullet"/></svg>
|
||||||
<span class="nav-label">记录</span>
|
<span class="nav-label">记录</span>
|
||||||
@@ -123,14 +133,14 @@
|
|||||||
<svg class="icon-sm"><use href="#icon-chevron-right"/></svg>
|
<svg class="icon-sm"><use href="#icon-chevron-right"/></svg>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="cal-weeks" id="cal-weeks"></div>
|
<div class="cal-week-rows" id="cal-weeks"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 右侧:Tab + 内容 -->
|
<!-- 右侧:Tab + 内容 -->
|
||||||
<div class="daily-main">
|
<div class="daily-main">
|
||||||
<div class="daily-tabs">
|
<div class="daily-tabs">
|
||||||
<button class="daily-tab active" data-tab="morning" onclick="switchDailyTab(this)">
|
<button class="daily-tab active" data-tab="morning" onclick="switchDailyTab(this)">
|
||||||
<svg class="icon-sm"><use href="#icon-sun"/></svg> 早间立志
|
<svg class="icon-sm"><use href="#icon-sun"/></svg> 本周重点
|
||||||
</button>
|
</button>
|
||||||
<button class="daily-tab" data-tab="evening" onclick="switchDailyTab(this)">
|
<button class="daily-tab" data-tab="evening" onclick="switchDailyTab(this)">
|
||||||
<svg class="icon-sm"><use href="#icon-magnifying-glass"/></svg> 责善改过
|
<svg class="icon-sm"><use href="#icon-magnifying-glass"/></svg> 责善改过
|
||||||
@@ -144,17 +154,24 @@
|
|||||||
<div class="card-head">
|
<div class="card-head">
|
||||||
<div class="card-head-left">
|
<div class="card-head-left">
|
||||||
<svg class="icon-h2"><use href="#icon-sun"/></svg>
|
<svg class="icon-h2"><use href="#icon-sun"/></svg>
|
||||||
<h3>早间立志</h3>
|
<h3>本周重点</h3>
|
||||||
</div>
|
</div>
|
||||||
<button class="btn-edit-toggle" onclick="toggleEditMode(this)" title="编辑">
|
<button class="btn-edit-toggle" onclick="toggleEditMode(this)" title="编辑">
|
||||||
<svg class="icon-sm"><use href="#icon-pencil"/></svg>
|
<svg class="icon-sm"><use href="#icon-pencil"/></svg>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<p class="card-desc">本周最重要的 1~3 件事</p>
|
<p class="card-desc">本周最重要的事</p>
|
||||||
<div id="morning-list"></div>
|
<div id="morning-list"></div>
|
||||||
<button class="btn-add edit-only" onclick="addMorning()">
|
<button class="btn-add edit-only" onclick="addMorning()">
|
||||||
<svg class="icon-sm"><use href="#icon-plus"/></svg> 增加一条
|
<svg class="icon-sm"><use href="#icon-plus"/></svg> 增加一条
|
||||||
</button>
|
</button>
|
||||||
|
<div class="morning-calendar" id="morning-calendar" style="display:none">
|
||||||
|
<div class="morning-calendar-head">
|
||||||
|
<svg class="icon-sm"><use href="#icon-calendar"/></svg>
|
||||||
|
<span>本周日程</span>
|
||||||
|
</div>
|
||||||
|
<div id="morning-calendar-list"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card card-evening daily-card" data-card="evening">
|
<div class="card card-evening daily-card" data-card="evening">
|
||||||
<div class="card-head">
|
<div class="card-head">
|
||||||
@@ -174,52 +191,25 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="card card-study daily-card" data-card="study">
|
<div class="card card-study daily-card" data-card="study">
|
||||||
<div class="card-head">
|
<div class="card-head">
|
||||||
|
<div class="card-head-left">
|
||||||
<svg class="icon-h2"><use href="#icon-book-open"/></svg>
|
<svg class="icon-h2"><use href="#icon-book-open"/></svg>
|
||||||
<h3>勤学打卡</h3>
|
<h3>勤学打卡</h3>
|
||||||
</div>
|
</div>
|
||||||
|
<button class="btn-edit-toggle" id="study-edit-toggle" onclick="toggleStudyEdit()" title="编辑">
|
||||||
|
<svg class="icon-sm"><use href="#icon-pencil"/></svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<p class="card-desc">本周修行清单</p>
|
<p class="card-desc">本周修行清单</p>
|
||||||
<div id="study-list"></div>
|
<div id="study-cards"></div>
|
||||||
|
<button class="btn-add edit-only-study" onclick="addStudyItem()" style="margin-top:10px">
|
||||||
|
<svg class="icon-sm"><use href="#icon-plus"/></svg> 增加习惯
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /daily-main -->
|
</div><!-- /daily-main -->
|
||||||
</div><!-- /daily-layout -->
|
</div><!-- /daily-layout -->
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- ── 每周评分面板 ── -->
|
|
||||||
<section class="panel" id="panel-weekly">
|
|
||||||
<div class="panel-header">
|
|
||||||
<h2>每周评分</h2>
|
|
||||||
</div>
|
|
||||||
<div class="week-nav">
|
|
||||||
<button class="btn-nav" onclick="changeWeek(-1)">
|
|
||||||
<svg class="icon-nav"><use href="#icon-chevron-left"/></svg> 上周
|
|
||||||
</button>
|
|
||||||
<span id="week-label">--</span>
|
|
||||||
<button class="btn-nav" onclick="changeWeek(1)">
|
|
||||||
下周 <svg class="icon-nav"><use href="#icon-chevron-right"/></svg>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="weekly-overview">
|
|
||||||
<div class="score-circle">
|
|
||||||
<svg viewBox="0 0 120 120" class="score-svg">
|
|
||||||
<circle cx="60" cy="60" r="50" fill="none" stroke="#E5E7EB" stroke-width="8"/>
|
|
||||||
<circle cx="60" cy="60" r="50" fill="none" stroke="#4A6CF7" stroke-width="8"
|
|
||||||
stroke-dasharray="314" stroke-dashoffset="314" stroke-linecap="round"
|
|
||||||
class="score-ring" transform="rotate(-90,60,60)"/>
|
|
||||||
</svg>
|
|
||||||
<div class="score-inner">
|
|
||||||
<span class="score-num" id="weekly-score">--</span>
|
|
||||||
<span class="score-unit">分</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="score-meta">
|
|
||||||
<span class="score-text" id="score-text">选择一周查看评分</span>
|
|
||||||
<div class="score-stats" id="score-stats"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="week-days-grid" class="week-days-grid"></div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<!-- ── 历史记录面板 ── -->
|
<!-- ── 历史记录面板 ── -->
|
||||||
<section class="panel" id="panel-history">
|
<section class="panel" id="panel-history">
|
||||||
<div class="panel-header">
|
<div class="panel-header">
|
||||||
@@ -228,56 +218,6 @@
|
|||||||
<div id="history-grid" class="history-grid"></div>
|
<div id="history-grid" class="history-grid"></div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- ── 心愿清单面板 ── -->
|
|
||||||
<section class="panel" id="panel-wishes">
|
|
||||||
<div class="panel-header">
|
|
||||||
<h2>心愿清单</h2>
|
|
||||||
<button class="btn-edit-toggle" id="wishes-edit-toggle" onclick="toggleWishesEdit(this)" title="编辑">
|
|
||||||
<svg class="icon-sm"><use href="#icon-pencil"/></svg>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<!-- 新增表单 -->
|
|
||||||
<div class="wish-form" id="wish-form" style="display:none">
|
|
||||||
<input type="text" id="wish-name" placeholder="心愿名称…" maxlength="50">
|
|
||||||
<div class="wish-form-row">
|
|
||||||
<select id="wish-quadrant">
|
|
||||||
<option value="重要紧急">重要紧急</option>
|
|
||||||
<option value="重要不紧急" selected>重要不紧急</option>
|
|
||||||
<option value="紧急不重要">紧急不重要</option>
|
|
||||||
<option value="不紧急不重要">不紧急不重要</option>
|
|
||||||
</select>
|
|
||||||
<input type="date" id="wish-deadline">
|
|
||||||
</div>
|
|
||||||
<div class="wish-form-actions">
|
|
||||||
<button class="btn-wish-save" onclick="addWish()">添加</button>
|
|
||||||
<button class="btn-wish-cancel" onclick="hideWishForm()">取消</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<button class="btn-add edit-only" id="wishes-add-btn" onclick="showWishForm()" style="margin-bottom:16px">
|
|
||||||
<svg class="icon-sm"><use href="#icon-plus"/></svg> 新增心愿
|
|
||||||
</button>
|
|
||||||
<!-- 四象限网格 -->
|
|
||||||
<div class="quad-grid">
|
|
||||||
<div class="quad-cell" data-quadrant="重要紧急" id="quad-重要紧急">
|
|
||||||
<div class="quad-title">重要 & 紧急</div>
|
|
||||||
<div class="quad-list" id="quad-list-重要紧急"></div>
|
|
||||||
</div>
|
|
||||||
<div class="quad-cell" data-quadrant="重要不紧急" id="quad-重要不紧急">
|
|
||||||
<div class="quad-title">重要 & 不紧急</div>
|
|
||||||
<div class="quad-list" id="quad-list-重要不紧急"></div>
|
|
||||||
</div>
|
|
||||||
<div class="quad-cell" data-quadrant="紧急不重要" id="quad-紧急不重要">
|
|
||||||
<div class="quad-title">紧急 & 不重要</div>
|
|
||||||
<div class="quad-list" id="quad-list-紧急不重要"></div>
|
|
||||||
</div>
|
|
||||||
<div class="quad-cell" data-quadrant="不紧急不重要" id="quad-不紧急不重要">
|
|
||||||
<div class="quad-title">不紧急 & 不重要</div>
|
|
||||||
<div class="quad-list" id="quad-list-不紧急不重要"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="wishes-empty" id="wishes-empty" style="display:none">暂无心愿,点击上方按钮添加</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<!-- ── 蓝图面板 ── -->
|
<!-- ── 蓝图面板 ── -->
|
||||||
<section class="panel" id="panel-blueprint">
|
<section class="panel" id="panel-blueprint">
|
||||||
<div class="panel-header">
|
<div class="panel-header">
|
||||||
|
|||||||
Reference in New Issue
Block a user