diff --git a/project/短视频脚本创作/V1.0/mcn-work-shop/dsh-data.js b/project/短视频脚本创作/V1.0/mcn-work-shop/dsh-data.js index 904e4fd..291b8df 100644 --- a/project/短视频脚本创作/V1.0/mcn-work-shop/dsh-data.js +++ b/project/短视频脚本创作/V1.0/mcn-work-shop/dsh-data.js @@ -311,13 +311,18 @@ function getStats() { }; } -// 最近 AI 写剧本(首页快捷卡片):status=done 且有内容,按 id 倒序取前 N 条 +// 最近 AI 写剧本(首页快捷卡片):status=done 且有内容,按 id 倒序取前 N 条; +// score = 该脚本最新一条已完成 AI 复盘(script_review type='ai')的总分,无复盘则为 null function listRecentScripts(limit = 4) { const d = getDb(); if (!d) return []; const n = Math.max(1, Math.min(Number(limit) || 4, 20)); return d.prepare(` SELECT r.id, r.title, r.script_text, r.created_time, r.video_id, r.account_id, - h.account_name, v.video_title + h.account_name, v.video_title, + (SELECT sr.total FROM script_review sr + WHERE sr.type='ai' AND sr.rewrite_id = r.id AND sr.status='done' + AND sr.total IS NOT NULL AND sr.total <> '' + ORDER BY sr.id DESC LIMIT 1) AS score FROM rewrite_log r LEFT JOIN hot_accounts h ON h.id = r.account_id LEFT JOIN account_videos v ON v.id = r.video_id diff --git a/project/短视频脚本创作/V1.0/mcn-work-shop/public/app.js b/project/短视频脚本创作/V1.0/mcn-work-shop/public/app.js index 38683da..7cdaa3d 100644 --- a/project/短视频脚本创作/V1.0/mcn-work-shop/public/app.js +++ b/project/短视频脚本创作/V1.0/mcn-work-shop/public/app.js @@ -424,15 +424,24 @@ async function loadRecentScripts() { const items = (d.items || []); if (!items.length) { el.innerHTML = '暂无 AI 写剧本'; return; } _recentScriptsCache = {}; + // 评分徽章配色与诊断页一致:≥75 绿 / ≥60 橙 / <60 红 + const scoreColor = (v) => (v >= 75 ? '#3a9e6d' : v >= 60 ? '#d99a2b' : '#d9534f'); el.innerHTML = items.map((s) => { _recentScriptsCache[s.id] = s; const title = cleanTitle(s.title || s.video_title) || '未命名剧本'; const meta = [s.account_name, s.created_time ? fmtDate(s.created_time) : ''].filter(Boolean).join(' | '); const preview = previewLines(s.script_text, 5); + // 有 AI 复盘评分 → 卡片右下角徽章;无评分不显示 + const sc = Number(s.score); + const scoreBadge = (s.score !== null && s.score !== undefined && s.score !== '' && Number.isFinite(sc)) + ? `评分 ${sc % 1 === 0 ? sc : sc.toFixed(1)}` : ''; return ``; }).join(''); el.querySelectorAll('.recent-card').forEach((b) => b.addEventListener('click', () => { diff --git a/project/短视频脚本创作/V1.0/mcn-work-shop/public/index.html b/project/短视频脚本创作/V1.0/mcn-work-shop/public/index.html index 467b5d3..87d612f 100644 --- a/project/短视频脚本创作/V1.0/mcn-work-shop/public/index.html +++ b/project/短视频脚本创作/V1.0/mcn-work-shop/public/index.html @@ -4,7 +4,7 @@