fix(工作台): 视频拆解/视频分析字段映射修正闭环

- server.js 入库映射对齐 dsh 语义:content.json→source.content_json、analysis.json→source.analysis_json(视频拆解 tab)、*拆解分析.md→account_video_analysis(视频分析 tab)
- 清理 6 条俊希错位 account_video_analysis + 白昼小熊 id13 归位 source47.analysis_json
- 重跑入库验证:俊希 6 条 analysis_json 均写入、account_video_analysis 12 条=王微斯拆解分析(语义正确)
- 王微斯视频三 tab 验证通过(视频脚本/视频拆解/视频分析各就其位)
- 临时脚本已清理
This commit is contained in:
maogeigei committed 2026-09-01 10:34:07 +08:00
1 parent b34929e7db
commit 818d00a28c
4 files changed
+26 -12

No files matched your search

@@ -3,9 +3,12 @@
'use strict';
const fmt = (v) => (v == null || v === '') ? '-' : String(v);
/* 过万数字以"万"为单位,保留一位小数(如 57141 → 5.7万) */
/* 过万数字以"万"为单位,保留一位小数(如 57141 → 5.7万);已是"x.x万"文本(like_display 抖音原生格式)直接透传(09-01 修复:旧实现 Number('7.8万')=NaN→'-') */
const fmtWan = (v) => {
const n = Number(v);
if (v == null || v === '') return '-';
const s = String(v).trim();
if (s.includes('万')) return s;
const n = Number(s);
if (!Number.isFinite(n) || n <= 0) return '-';
return n >= 10000 ? (n / 10000).toFixed(1) + '万' : String(n);
};
@@ -295,11 +298,11 @@ async function renderAccountDetail(view, id) {
<td>${fmt(v.publish_time)}</td>
<td class="td-id"><a class="link" href="#/video/${v.id}" title="查看视频分析详情">${esc(v.aweme_id || '-')}</a></td>
<td class="cell-content">${v.video_url ? `<a class="title-plain" data-ext="${esc(v.video_url)}" title="在新标签打开视频">${esc(cleanTitle(v.video_title) || '-')}</a>` : esc(cleanTitle(v.video_title) || '-')}</td>
<td>${fmt(v.like_display || v.like_count)}</td>
<td>${fmtWan(v.like_display || v.like_count)}</td>
<td>${fmtWan(v.comment_count)}</td>
<td>${fmtWan(v.share_count)}</td>
<td>${fmtDuration(v.duration)}</td>
<td class="cell-act"><button class="btn btn-sm ${(v.has_source || v.has_analysis) ? 'btn-view' : ''}" data-rewrite='${esc(JSON.stringify({ name: acc.account_name, title: cleanTitle(v.video_title), aweme: v.aweme_id, parsed: !!(v.has_source || v.has_analysis) }))}'>AI改写</button></td>
<td class="cell-act"><button class="btn btn-sm ${(v.has_source || v.has_analysis) ? 'btn-view' : ''}" data-rewrite='${esc(JSON.stringify({ name: acc.account_name, title: cleanTitle(v.video_title), aweme: v.aweme_id, parsed: !!(v.has_source || v.has_analysis) }))}'>AI写作</button></td>
</tr>`).join('');
const tabBtns = [['info', '账号信息'], ['persona', '账号设定'], ['analysis', '数据分析']].map(([k, label]) => `<button class="tab ${tab === k ? 'tab-active' : ''}" data-tab="${k}">${label}</button>`).join('');
let panel = '';