docs: 更新健康咨询三端PRD文档,新增截图规范与md-viewer图片支持
- 重写员工端PRD,按业务流程重新组织,页面与弹窗穿插介绍 - 补充应急APP专家端/小助手端PRD缺失页面和共享模块说明 - 更新管理后台PRD咨询须知双Tab设计描述 - 员工端PRD新增25张页面截图(Playwright自动截取) - md-viewer.html支持图片相对路径自动补全和尺寸限制 - 项目背景.md新增PRD截图规范(7.4节),PRD更新时机改为用户主动触发 - CLAUDE.md精简去重,文档规范统一指向项目背景.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -47,6 +47,7 @@ body { font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica
|
||||
.content blockquote p { color: var(--text-secondary); margin: 0; }
|
||||
.content strong { color: var(--text-primary); }
|
||||
.content hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
|
||||
.content img { max-width: 375px; height: auto; border-radius: 8px; border: 1px solid var(--border); margin: 8px 0; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -134,9 +135,18 @@ if (filePath) {
|
||||
wrap.innerHTML = '';
|
||||
wrap.appendChild(iframe);
|
||||
} else {
|
||||
/* 计算 Markdown 文件所在目录,用于重写图片相对路径 */
|
||||
const mdBase = filePath.substring(0, filePath.lastIndexOf('/') + 1);
|
||||
const content = document.getElementById('content');
|
||||
if (typeof marked !== 'undefined') {
|
||||
content.innerHTML = marked.parse(md);
|
||||
/* 将图片相对路径补全为基于 Markdown 文件目录的路径 */
|
||||
content.querySelectorAll('img').forEach(img => {
|
||||
const src = img.getAttribute('src');
|
||||
if (src && !src.startsWith('http') && !src.startsWith('/') && !src.startsWith('data:')) {
|
||||
img.src = mdBase + src;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
content.innerHTML = '<pre style="white-space:pre-wrap;font-size:14px;line-height:1.8">' + md.replace(/</g,'<').replace(/>/g,'>') + '</pre>';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user