优化评查详情提示框的提示条件

This commit is contained in:
2025-04-27 18:10:12 +08:00
parent 9a22e9092f
commit 53e82f9159
10 changed files with 69 additions and 38 deletions
+4 -5
View File
@@ -15,6 +15,7 @@ import { updateDocumentAuditStatus } from "~/api/evaluation_points/rules-files";
import { toastService } from "~/components/ui/Toast";
import { messageService } from "~/components/ui/MessageModal";
import { loadingBarService } from "~/components/ui/LoadingBar";
import { DOCUMENT_URL } from "~/api/client";
// 导入样式
export function links() {
@@ -376,8 +377,7 @@ export default function DocumentsIndex() {
// 下载文档
const handleDownload = async (path: string) => {
try {
const urlBefore = 'http://172.18.0.100:9000/docauditai/';
const downloadUrl = `${urlBefore}${path}`;
const downloadUrl = `${DOCUMENT_URL}${path}`;
// 使用fetch获取文件内容
const response = await fetch(downloadUrl);
@@ -419,7 +419,7 @@ export default function DocumentsIndex() {
toastService.warning("文件正在处理中,无法删除");
return;
}
messageService.show({
title: "确认删除",
message: `确定要删除文档"${name}"吗?`,
@@ -511,8 +511,7 @@ export default function DocumentsIndex() {
return;
}
const urlBefore = 'http://172.18.0.100:9000/docauditai/';
const downloadUrl = `${urlBefore}${doc.path}`;
const downloadUrl = `${DOCUMENT_URL}${doc.path}`;
// 获取文件内容
const response = await fetch(downloadUrl);
+3 -3
View File
@@ -9,6 +9,7 @@ import { getDocumentTypes } from "~/api/document-types/document-types";
import { FileTag } from "~/components/ui/FileTag";
import { toastService } from "~/components/ui/Toast";
import { Document, Page , pdfjs } from "react-pdf";
import { DOCUMENT_URL } from "~/api/client";
pdfjs.GlobalWorkerOptions.workerSrc = '/pdf.worker.js';
@@ -302,7 +303,7 @@ export default function DocumentEdit() {
return (
<div className="preview-content relative overflow-y-auto max-h-[1000px]">
<Document
file={'http://172.18.0.100:9000/docauditai/'+document.path}
file={DOCUMENT_URL + document.path}
onLoadSuccess={onDocumentLoadSuccess}
onLoadError={(error) => {
console.error("PDF加载错误:", error);
@@ -394,8 +395,7 @@ export default function DocumentEdit() {
// 在新窗口打开文档预览
const openPreview = () => {
const urlBefore = 'http://172.18.0.100:9000/docauditai/'
const previewUrl = `${urlBefore}${document.path}`;
const previewUrl = `${DOCUMENT_URL}${document.path}`;
window.open(previewUrl, '_blank');
};
+2 -2
View File
@@ -17,6 +17,7 @@ import {
} from "~/api/evaluation_points/rules-files";
import { getDocumentTypes } from "~/api/document-types/document-types";
import { toastService } from "~/components/ui/Toast";
import { DOCUMENT_URL } from "~/api/client";
export const links = () => [
{ rel: "stylesheet", href: rulesFilesStyles }
@@ -240,8 +241,7 @@ export default function RulesFiles() {
// 下载文件
const handleDownload = async (path: string) => {
try {
const urlBefore = 'http://172.18.0.100:9000/docauditai/';
const downloadUrl = `${urlBefore}${path}`;
const downloadUrl = `${DOCUMENT_URL}${path}`;
// 使用fetch获取文件内容
const response = await fetch(downloadUrl);