diff --git a/Web/src/views/system/file/index.vue b/Web/src/views/system/file/index.vue index ea73a141..e80d2285 100644 --- a/Web/src/views/system/file/index.vue +++ b/Web/src/views/system/file/index.vue @@ -124,13 +124,13 @@ - + - + - + @@ -169,6 +169,7 @@ const editRef = ref>(); const fileTreeRef = ref>(); const state = reactive({ + loading: false, queryParams: { fileName: undefined, filePath: undefined, @@ -330,6 +331,7 @@ const handleNodeChange = async (node: any) => { // 打开Pdf预览页面 const showPreviewDialog = async (row: any) => { + state.loading = true; if (row.suffix == '.pdf') { state.fileName = `【${row.fileName}${row.suffix}】`; state.pdfUrl = fetchFileUrl(row); @@ -365,8 +367,14 @@ const handleEdit = (row: any) => { }; // 文件渲染完成 -const handleRendered = () => {}; +const handleRendered = () => { + state.loading = false; +}; // 文件渲染失败 -const handleError = () => {}; +const handleError = () => { + ElMessage.error('预览失败'); + state.loading = false; + state.docxVisible = false; +};