保存进度

This commit is contained in:
2025-11-30 14:59:27 +08:00
parent 835e812d4e
commit 8e97044faa
4 changed files with 70 additions and 12 deletions

View File

@@ -1738,6 +1738,7 @@
"integrity": "sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@types/lodash": "*"
}
@@ -1748,6 +1749,7 @@
"integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"undici-types": "~7.16.0"
}
@@ -1795,6 +1797,7 @@
"integrity": "sha512-lJi3PfxVmo0AkEY93ecfN+r8SofEqZNGByvHAI3GBLrvt1Cw6H5k1IM02nSzu0RfUafr2EvFSw0wAsZgubNplQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@typescript-eslint/scope-manager": "8.47.0",
"@typescript-eslint/types": "8.47.0",
@@ -2288,6 +2291,7 @@
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
"dev": true,
"license": "MIT",
"peer": true,
"bin": {
"acorn": "bin/acorn"
},
@@ -2765,6 +2769,7 @@
"integrity": "sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.8.0",
"@eslint-community/regexpp": "^4.12.1",
@@ -3524,14 +3529,16 @@
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true,
"license": "MIT"
"license": "MIT",
"peer": true
},
"node_modules/lodash-es": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz",
"integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==",
"dev": true,
"license": "MIT"
"license": "MIT",
"peer": true
},
"node_modules/lodash-unified": {
"version": "1.0.3",
@@ -4067,6 +4074,7 @@
"integrity": "sha512-N+7WK20/wOr7CzA2snJcUSSNTCzeCGUTFY3OgeQP3mZ1aj9NMQ0mSTXwlrnd89j33zzQJGqIN52GIOmYrfq46A==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"chokidar": "^4.0.0",
"immutable": "^5.0.2",
@@ -4226,6 +4234,7 @@
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"devOptional": true,
"license": "Apache-2.0",
"peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@@ -4274,6 +4283,7 @@
"integrity": "sha512-NL8jTlbo0Tn4dUEXEsUg8KeyG/Lkmc4Fnzb8JXN/Ykm9G4HNImjtABMJgkQoVjOBN/j2WAwDTRytdqJbZsah7w==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"esbuild": "^0.25.0",
"fdir": "^6.5.0",
@@ -4355,6 +4365,7 @@
"resolved": "https://registry.npmmirror.com/vue/-/vue-3.5.24.tgz",
"integrity": "sha512-uTHDOpVQTMjcGgrqFPSb8iO2m1DUvo+WbGqoXQz8Y1CeBYQ0FXf2z1gLRaBtHjlRz7zZUBHxjVB5VTLzYkvftg==",
"license": "MIT",
"peer": true,
"dependencies": {
"@vue/compiler-dom": "3.5.24",
"@vue/compiler-sfc": "3.5.24",
@@ -4378,6 +4389,7 @@
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"peer": true,
"bin": {
"vue-demi-fix": "bin/vue-demi-fix.js",
"vue-demi-switch": "bin/vue-demi-switch.js"
@@ -4404,6 +4416,7 @@
"integrity": "sha512-CydUvFOQKD928UzZhTp4pr2vWz1L+H99t7Pkln2QSPdvmURT0MoC4wUccfCnuEaihNsu9aYYyk+bep8rlfkUXw==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"debug": "^4.4.0",
"eslint-scope": "^8.2.0",

View File

@@ -14,13 +14,13 @@ interface RegulatoryData {
release_year: string;
regulatory_name: string;
comment: string;
regulatory_files: null | RegulatoryFile[];
regulatory_files: RegulatoryFile[];
}
interface RegulatoryFile {
regulatory_file_name: string;
file_url: string;
local_file_path: null | string;
local_file_path: string;
file_type: string;
}

View File

@@ -115,7 +115,7 @@ Copyright © CPIC All rights reserved
</el-upload>
</el-dialog>
<el-dialog
v-model="ui.showPreviewDialog" :close-on-click-model="false"
v-model="ui.isPDF" :close-on-click-model="false"
:close-on-press-escape="false"
:show-close="true"
align-center
@@ -127,13 +127,31 @@ Copyright © CPIC All rights reserved
style="height:calc(100vh - 100px);"
@error="errorHandle"
/>
</el-dialog>
<el-dialog
v-model="ui.isDOCX" :close-on-click-model="false"
:close-on-press-escape="false"
:show-close="true"
align-center
title="文件预览"
width="1024px"
>
<VueOfficeDocx
v-if="ui.isDOCX" :src="ui.fileURL"
style="height:calc(100vh - 100px);"
@error="errorHandle"
/>
</el-dialog>
<el-dialog
v-model="ui.isXLSX" :close-on-click-model="false"
:close-on-press-escape="false"
:show-close="true"
align-center
title="文件预览"
width="1024px"
>
<VueOfficeExcel
v-if="ui.isXLSX" :src="ui.fileURL"
:src="ui.fileURL"
style="height:calc(100vh - 100px);"
@error="errorHandle"
/>
@@ -152,6 +170,11 @@ import VueOfficePdf from "@vue-office/pdf";
import VueOfficeDocx from "@vue-office/docx";
import VueOfficeExcel from "@vue-office/excel";
//引入相关样式
import "@vue-office/pdf/lib/index.css";
import "@vue-office/docx/lib/index.css";
import "@vue-office/excel/lib/index.css";
interface UI{
showUI: boolean;
showUploadDialog: boolean;
@@ -189,10 +212,10 @@ export default {
regulatory_files: [],
},
showFileList: false,
isPDF: true,
isPDF: false,
isDOCX: false,
isXLSX: false,
fileURL: "http://10.39.0.1:8080/regulatory/%E4%BF%A1%E6%81%AF%E6%8A%80%E6%9C%AF%E9%83%A8/test.pdf",
fileURL: "",
});
const headerCellStyle = reactive(
@@ -239,7 +262,29 @@ export default {
const onPreviewUploadedFile = ( rowId: number ): void =>
{
ui.showPreviewDialog = true;
// ui.showPreviewDialog = true;
ui.fileURL = ui.newRegulatory.regulatory_files[rowId]?.file_url + "/" + ui.newRegulatory.regulatory_files[rowId]?.regulatory_file_name;
console.log( "完整路径:", ui.fileURL );
ui.isDOCX = false;
ui.isPDF = false;
ui.isXLSX = false;
switch ( ui.newRegulatory.regulatory_files[rowId].file_type )
{
case "WPS文档":
ui.isDOCX = true;
break;
case "WPS表格":
ui.isXLSX = true;
break;
case "PDF文档":
ui.isPDF = true;
break;
default:
break;
}
};
/**
@@ -292,7 +337,7 @@ export default {
regulatory_file_name: response.fileList[0].fileName ?? "",
local_file_path: response.fileList[0]?.absoluteFilePath ?? "",
file_type: getFileType( response.fileList[0]?.fileName ),
file_url: API_URL.URL_PREFIX + response.fileList[0]?.relativeFilePath,
file_url: API_URL.URL_PREFIX + "/" + response.fileList[0]?.relativeFilePath,
};
ui.newRegulatory.regulatory_files?.push( uploadedFile );

View File

@@ -41,8 +41,8 @@ export default {
const ui = reactive({
showUI: true,
isPDF: false,
isDocx: true,
isXlsx: false,
isDocx: false,
isXlsx: true,
fileURLPDF: "http://10.39.0.1:8080/regulatory/%E4%BF%A1%E6%81%AF%E6%8A%80%E6%9C%AF%E9%83%A8/%E5%85%B3%E4%BA%8E%E5%8D%B0%E5%8F%91%E3%80%8A%E5%A4%AA%E5%B9%B3%E6%B4%8B%E4%BA%A7%E9%99%A9%E5%8E%A6%E9%97%A8%E5%88%86%E5%85%AC%E5%8F%B8IT%E8%B5%84%E4%BA%A7%E7%AE%A1%E7%90%86%E5%8A%9E%E6%B3%95%E3%80%8B%EF%BC%882019%E5%B9%B4%E4%BF%AE%E8%AE%A2%EF%BC%89%E7%9A%84%E9%80%9A%E7%9F%A5/%E5%8E%A6%E5%A4%AA%E4%BF%9D%E4%BA%A7%E5%8F%91%E3%80%902019%E3%80%9146%E5%8F%B7%E5%85%B3%E4%BA%8E%E5%8D%B0%E5%8F%91%E3%80%8A%E5%A4%AA%E5%B9%B3%E6%B4%8B%E4%BA%A7%E9%99%A9%E5%8E%A6%E9%97%A8%E5%88%86%E5%85%AC%E5%8F%B8IT%E8%B5%84%E4%BA%A7%E7%AE%A1%E7%90%86%E5%8A%9E%E6%B3%95%E3%80%8B%EF%BC%882019%E5%B9%B4%E4%BF%AE%E8%AE%A2%EF%BC%89%E7%9A%84%E9%80%9A%E7%9F%A5.pdf",
fileURLDocx: "http://10.39.0.1:8080/regulatory/%E4%BF%A1%E6%81%AF%E6%8A%80%E6%9C%AF%E9%83%A8/%E5%85%B3%E4%BA%8E%E5%8D%B0%E5%8F%91%E3%80%8A%E5%A4%AA%E5%B9%B3%E6%B4%8B%E4%BA%A7%E9%99%A9%E5%8E%A6%E9%97%A8%E5%88%86%E5%85%AC%E5%8F%B8%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91%E9%9C%80%E6%B1%82%E7%AE%A1%E7%90%86%E5%8A%9E%E6%B3%95%EF%BC%882020%E5%B9%B4%E4%BF%AE%E8%AE%A2%EF%BC%89%E3%80%8B%E7%9A%84%E9%80%9A%E7%9F%A5/%E9%99%84%E4%BB%B62%EF%BC%9A%E4%B8%9A%E5%8A%A1%E9%9C%80%E6%B1%82%E8%AF%B4%E6%98%8E%E4%B9%A6.docx",
fileURLXlsx: "http://10.39.0.1:8080/regulatory/%E4%BF%A1%E6%81%AF%E6%8A%80%E6%9C%AF%E9%83%A8/%E5%85%B3%E4%BA%8E%E5%8D%B0%E5%8F%91%E3%80%8A%E5%A4%AA%E5%B9%B3%E6%B4%8B%E4%BA%A7%E9%99%A9%E5%8E%A6%E9%97%A8%E5%88%86%E5%85%AC%E5%8F%B8%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91%E9%9C%80%E6%B1%82%E7%AE%A1%E7%90%86%E5%8A%9E%E6%B3%95%EF%BC%882020%E5%B9%B4%E4%BF%AE%E8%AE%A2%EF%BC%89%E3%80%8B%E7%9A%84%E9%80%9A%E7%9F%A5/%E9%99%84%E4%BB%B64%EF%BC%9A%E5%88%86%E5%85%AC%E5%8F%B8%E8%87%AA%E5%BB%BA%E7%B3%BB%E7%BB%9F%E9%83%A8%E7%BD%B2%E6%83%85%E5%86%B5%E7%99%BB%E8%AE%B0%E8%A1%A8.xlsx",