| | |
| | | console.log('取消预览') |
| | | }); |
| | | return |
| | | } |
| | | }else if(ext == 'pdf' || ext == 'jpg' ){ |
| | | window.open(`${import.meta.env.VITE_APP_BASE_API}/${path}`, '_blank'); |
| | | }else{ |
| | | try { |
| | | // 1. 获取文件 |
| | | const response = await fetch(import.meta.env.VITE_APP_BASE_API + '/' + path); |
| | |
| | | await renderAsync(arrayBuffer, win.document.getElementById('container')); |
| | | |
| | | } catch (error) { |
| | | console.error('预览失败:', error); |
| | | alert(`预览失败: ${error.message}`); |
| | | } |
| | | } |
| | | } |
| | | const getList = async () => { |
| | | loading.value = true |
| | | const res = await getStandardTemp(data.queryParams) |