隐藏上传文件入口,交叉评查的文件查看添加防抖点击,升级pdf加载组件版本优化清晰度
This commit is contained in:
@@ -8,6 +8,7 @@ import { DOCUMENT_URL } from '~/api/axios-client';
|
||||
|
||||
// 设置worker路径为public目录下的worker文件
|
||||
// 使用已经下载的兼容版本 (pdfjs-dist v2.12.313)
|
||||
// 2025/09/28 使用新版本的pdfjs-dist v4.8.69
|
||||
pdfjs.GlobalWorkerOptions.workerSrc = '/pdf.worker.js';
|
||||
|
||||
// 导入统一的ReviewPoint类型
|
||||
@@ -324,8 +325,8 @@ export function FilePreview({ fileContent, activeReviewPointResultId, targetPage
|
||||
<div
|
||||
className="page-wrapper"
|
||||
style={{
|
||||
transform: `scale(${zoomFactor})`, // 根据zoomLevel应用缩放
|
||||
transformOrigin: 'top center', // 缩放原点设置为顶部中心
|
||||
// transform: `scale(${zoomFactor})`, // 根据zoomLevel应用缩放
|
||||
// transformOrigin: 'top center', // 缩放原点设置为顶部中心
|
||||
position: 'relative', // 相对定位,作为评查点高亮的定位参考
|
||||
display: 'inline-block', // 内联块级元素,宽度由内容决定
|
||||
margin: '0 auto', // 水平居中
|
||||
@@ -334,8 +335,10 @@ export function FilePreview({ fileContent, activeReviewPointResultId, targetPage
|
||||
{/* 渲染PDF页面组件 */}
|
||||
<Page
|
||||
pageNumber={i} // 当前页码
|
||||
renderTextLayer={true} // 启用文本层,使文本可选择
|
||||
renderAnnotationLayer={true} // 启用注释层,显示PDF内置注释
|
||||
scale={zoomLevel / 100}
|
||||
devicePixelRatio={window.devicePixelRatio || 1} //根据设备像素比渲染
|
||||
renderTextLayer={false} // 停用文本层,使文本可选择
|
||||
renderAnnotationLayer={false} // 停用注释层,显示PDF内置注释
|
||||
className="border border-gray-300 shadow-md" // 添加边框和阴影样式
|
||||
/>
|
||||
|
||||
@@ -405,7 +408,8 @@ export function FilePreview({ fileContent, activeReviewPointResultId, targetPage
|
||||
style={{
|
||||
...styles.pdfContainer,
|
||||
// 当缩放大于100%时设置最小宽度,确保出现横向滚动条
|
||||
minWidth: zoomLevel > 100 ? `${zoomLevel}%` : '100%',
|
||||
// minWidth: zoomLevel > 100 ? `${zoomLevel}%` : '100%',
|
||||
width: '100%',
|
||||
overflow: 'visible'
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user