Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

15 Zeilen
2.7 KiB

  1. import fs from 'node:fs';
  2. import path from 'node:path';
  3. import videos from '../../unreal_tran_web/src/features/virtual-training-scripts/narration-video-manifest.js';
  4. const dir=path.resolve('reports/bridge-lecture-polish-20260915');
  5. const changed=JSON.parse(fs.readFileSync(path.join(dir,'regenerated.json'),'utf8'));
  6. const esc=s=>String(s).replaceAll('&','&amp;').replaceAll('<','&lt;').replaceAll('"','&quot;');
  7. const tests=['local','lan','test'].filter(name=>fs.existsSync(path.join(dir,name,'result.json')));
  8. let html=`<!doctype html><html lang="zh-CN"><meta charset="utf-8"><title>桥梁数字教员讲解修正验收</title><style>body{font:15px/1.7 system-ui;margin:32px;color:#173b35;background:#f1f6f5}main{max-width:1200px;margin:auto}section,article{background:white;padding:20px;border:1px solid #cee0dc;border-radius:12px;margin:16px 0}h1{font-size:26px}h2{font-size:20px}video{width:180px;aspect-ratio:3/4;display:block;background:#eee}article{display:flex;gap:24px}a{color:#087c69}small{color:#5c716b}pre{white-space:pre-wrap}img{max-width:100%}</style><main><h1>桥梁数字教员讲解修正验收 · 2026-09-15</h1><section>四套任务共39段讲解,6段重新生成。默认视频模式,等待场景加载完成后播放;保留语音切换与旧文件。右上角按内容自动排列,移除“三维实时交互”角标。公开浮窗显示真实教员头像,移除阴影和头像绿点。<p>验证:${tests.map(t=>`<a href="${t}/result.json">${t} 浏览器回归</a> <a href="${t}/delivery.json">文件校验</a>`).join(' · ')}。另通过前端构建、14项脚本契约测试、562项Java测试、2项公开头像接口测试。</p></section><h2>本次重新生成的6段</h2>`;
  9. for(const item of changed){const src=path.relative(dir,path.resolve('../unreal_tran_web/public'+item.url)).replaceAll('\\','/');html+=`<article><video src="${esc(src)}" controls preload="metadata"></video><div><b>${esc(item.code)} · 第${item.number}步</b><p>${esc(item.text)}</p><small>${item.duration}s · 已替换 · 原文件保留</small></div></article>`}
  10. html+='<h2>当前39段讲解清单</h2>';
  11. for(const script of videos.scripts){html+=`<section><h2>${esc(script.code)} · ${esc(script.title||script.id)}</h2><ol>`;for(const clip of script.steps){const src=path.relative(dir,path.resolve('../unreal_tran_web/public'+clip.url)).replaceAll('\\','/');html+=`<li><a href="${esc(src)}">${esc(clip.expectedTitle)}</a>:${esc(clip.text)}</li>`}html+='</ol></section>'}
  12. if(fs.existsSync(path.join(dir,'test/TASK-VIRTUAL-008.png')))html+='<section><h2>测试环境</h2><img src="test/TASK-VIRTUAL-008.png"><img src="test/widget.png"></section>';
  13. html+='</main></html>';fs.writeFileSync(path.join(dir,'index.html'),html);
  14. console.log('Report updated');