隐藏上传文件入口,交叉评查的文件查看添加防抖点击,升级pdf加载组件版本优化清晰度
This commit is contained in:
@@ -207,7 +207,7 @@ export default function CrossCheckingUpload() {
|
||||
const [taskInfo, setTaskInfo] = useState({
|
||||
name: '',
|
||||
date: '',
|
||||
type: '市局交叉评查',
|
||||
type: '市局间交叉评查',
|
||||
});
|
||||
// 步骤2状态
|
||||
const [groupChecked, setGroupChecked] = useState<string[]>(userInfo?.user_id ? [`user_${userInfo.user_id}`] : []);
|
||||
@@ -681,13 +681,15 @@ export default function CrossCheckingUpload() {
|
||||
</div>
|
||||
<div className="form-group">
|
||||
<label htmlFor="task-type">任务类型</label>
|
||||
<input
|
||||
<select
|
||||
id="task-type"
|
||||
className="form-input"
|
||||
className="form-select"
|
||||
value={taskInfo.type}
|
||||
onChange={e => setTaskInfo({ ...taskInfo, type: e.target.value })}
|
||||
placeholder="请输入任务类型"
|
||||
/>
|
||||
>
|
||||
<option value="市局间交叉评查">市局间交叉评查</option>
|
||||
<option value="区局间交叉评查">区局间交叉评查</option>
|
||||
</select>
|
||||
</div>
|
||||
<div className="flex justify-between items-center mt-6">
|
||||
<Button
|
||||
|
||||
@@ -375,8 +375,8 @@ export default function DocumentEdit() {
|
||||
{/* 渲染PDF页面组件 */}
|
||||
<Page
|
||||
pageNumber={i} // 当前页码
|
||||
renderTextLayer={true} // 启用文本层,使文本可选择
|
||||
renderAnnotationLayer={true} // 启用注释层,显示PDF内置注释
|
||||
renderTextLayer={false} // 停用文本层,使文本可选择
|
||||
renderAnnotationLayer={false} // 停用注释层,显示PDF内置注释
|
||||
className="border border-gray-300 shadow-md" // 添加边框和阴影样式
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -25,6 +25,7 @@ import {
|
||||
} from "~/api/files/files-upload";
|
||||
import { updateDocumentAuditStatus } from "~/api/evaluation_points/rules-files";
|
||||
import { links as fileTypeTagLinks } from "~/components/ui/FileTypeTag";
|
||||
import { useRevalidator} from "react-router-dom";
|
||||
|
||||
export function links() {
|
||||
return [
|
||||
@@ -34,11 +35,11 @@ export function links() {
|
||||
}
|
||||
|
||||
// 面包屑导航
|
||||
export const handle = {
|
||||
breadcrumb: () => {
|
||||
return '上传文件'
|
||||
}
|
||||
}
|
||||
// export const handle = {
|
||||
// breadcrumb: () => {
|
||||
// return '上传文件'
|
||||
// }
|
||||
// }
|
||||
|
||||
export const meta: MetaFunction = () => {
|
||||
return [
|
||||
@@ -286,6 +287,10 @@ export async function loader({ request }: LoaderFunctionArgs) {
|
||||
|
||||
// 文件上传页面组件
|
||||
export default function FilesUpload() {
|
||||
|
||||
const [isNavigating, setIsNavigating] = useState(false)
|
||||
const revalidator = useRevalidator()
|
||||
|
||||
// 获取 sessionStorage 中的 reviewType 值
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const [reviewType, setReviewType] = useState<string | null>(null);
|
||||
@@ -2083,6 +2088,14 @@ export default function FilesUpload() {
|
||||
)
|
||||
}
|
||||
];
|
||||
|
||||
// 返回上一级防抖处理
|
||||
const handleBackClick = () =>{
|
||||
if(isNavigating) return;
|
||||
setIsNavigating(true)
|
||||
navigate(-1)
|
||||
revalidator.revalidate()
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
@@ -2090,6 +2103,7 @@ export default function FilesUpload() {
|
||||
{/* 页面头部 */}
|
||||
<div className="page-header">
|
||||
<h2 className="page-title">待审核文件上传</h2>
|
||||
<button className="ant-btn ant-btn-default flex items-center my-2" onClick={()=>handleBackClick()}><i className="ri-arrow-left-line"></i>{isNavigating ? '返回中...' : '返回'}</button>
|
||||
</div>
|
||||
|
||||
{/* 文件类型选择和上传表单 */}
|
||||
|
||||
@@ -325,8 +325,8 @@ export default function Documents() {
|
||||
<div className="text-center text-gray-500 text-sm mb-2">第 {i} 页</div>
|
||||
<Page
|
||||
pageNumber={i}
|
||||
renderTextLayer={true}
|
||||
renderAnnotationLayer={true}
|
||||
renderTextLayer={false}
|
||||
renderAnnotationLayer={false}
|
||||
className="border border-gray-300 shadow-md"
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user