diff --git a/src/views/zy/zyInfo/StudentZyInfoList.vue b/src/views/zy/zyInfo/StudentZyInfoList.vue index 42e9f7e..cb24365 100644 --- a/src/views/zy/zyInfo/StudentZyInfoList.vue +++ b/src/views/zy/zyInfo/StudentZyInfoList.vue @@ -362,14 +362,14 @@ async function handleShangchuan(record) { function handlePreview(record) { const parts = record.stuFilePath.split('.'); const filetype = parts[parts.length - 1]; - if(filetype=='jpg' || filetype=='png' || filetype=='jpeg' || filetype=='xls' || filetype=='xlsx' || filetype=='text' ){ + if(filetype=='jpg' || filetype=='png' || filetype=='jpeg' || filetype=='xls' || filetype=='xlsx' || filetype=='text' || filetype=='doc' || filetype=='docx' || filetype=='pdf'){ var file = baseApiUrl + "/"+record.stuFilePath; console.log('🤬', file); window.open('https://jxdd.nenu.edu.cn/onlinePreview/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file))); - }else if(filetype=='doc' || filetype=='docx' || filetype=='pdf'){ - var url2 = getFileAccessHttpUrl(record.stuPdfPath); - let url = baseApiUrl + '/generic/web/viewer.html?file=' + encodeURIComponent(url2); - window.open(url, '_blank'); + // }else if(filetype=='doc' || filetype=='docx' || filetype=='pdf'){ + // var url2 = getFileAccessHttpUrl(record.stuPdfPath); + // let url = baseApiUrl + '/generic/web/viewer.html?file=' + encodeURIComponent(url2); + // window.open(url, '_blank'); }else{ createMessage.error('暂不支持该文件预览!'); } diff --git a/src/views/zy/zyInfo/ZyInfoV2List.vue b/src/views/zy/zyInfo/ZyInfoV2List.vue index 3232806..02b552b 100644 --- a/src/views/zy/zyInfo/ZyInfoV2List.vue +++ b/src/views/zy/zyInfo/ZyInfoV2List.vue @@ -318,14 +318,6 @@ - - - @@ -930,32 +922,14 @@ function handleDown(text) { //预览 function yulanFile(record) { console.log('🙇‍♀️', record); - if (record.pdfPath) { - var url2 = getFileAccessHttpUrl(record.pdfPath); - let url = baseApiUrl + '/generic/web/viewer.html?file=' + encodeURIComponent(url2); - window.open(url, '_blank'); + const parts = record.filePath.split('.'); + const filetype = parts[parts.length - 1]; + if(filetype=='jpg' || filetype=='png' || filetype=='jpeg' || filetype=='xls' || filetype=='xlsx' || filetype=='text' || filetype=='doc' || filetype=='docx' || filetype=='pdf'){ + var file = baseApiUrl + "/"+record.filePath; + console.log('🤬', file); + window.open('https://jxdd.nenu.edu.cn/onlinePreview/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file))); } else { - const parts = record.filePath.split('.'); - const filetype = parts[parts.length - 1]; - if (filetype == 'jpg' || filetype == 'png' || filetype == 'jpeg' || filetype == 'xls' || filetype == 'xlsx' || filetype == 'text') { - imgvisible.value = true; - var url2 = getFileAccessHttpUrl(record.filePath); - console.log('👀', url2); - ylimgurl.value = url2; - // var file = baseApiUrl + "/"+record.filePath; - // console.log('🤬', file); - // window.open('https://jxdd.nenu.edu.cn/onlinePreview/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file))); - - // var url2 = getFileAccessHttpUrl(record.filePath); - // let url = baseApiUrl + '/generic/web/viewer.html?file=' + encodeURIComponent(url2); - // window.open(url, '_blank'); - } else if (filetype == 'doc' || filetype == 'docx' || filetype == 'pdf') { - var url2 = getFileAccessHttpUrl(record.pdfPath); - let url = baseApiUrl + '/generic/web/viewer.html?file=' + encodeURIComponent(url2); - window.open(url, '_blank'); - } else { - createMessage.error('当前作业不支持预览,请下载后查阅!'); - } + createMessage.error('当前作业不支持预览,请下载后查阅!'); } } //驳回 diff --git a/src/views/zy/zyInfoStudent/components/ZyInfoStudentPiyueForm.vue b/src/views/zy/zyInfoStudent/components/ZyInfoStudentPiyueForm.vue index 1974665..71df1fc 100644 --- a/src/views/zy/zyInfoStudent/components/ZyInfoStudentPiyueForm.vue +++ b/src/views/zy/zyInfoStudent/components/ZyInfoStudentPiyueForm.vue @@ -86,6 +86,7 @@ import { useGlobSetting } from '/@/hooks/setting'; import { getFileAccessHttpUrl } from '/@/utils/common/compUtils'; import { getToken } from '/@/utils/auth'; + import { encryptByBase64 } from '/@/utils/cipher'; const props = defineProps({ formDisabled: { type: Boolean, default: false }, @@ -199,9 +200,12 @@ function rotateImage2() { showType.value = '2'; }else if(filetype=='doc' || filetype=='docx' || filetype=='pdf'){ showType.value = '1'; - var file2 = getFileAccessHttpUrl(record.pdfPath); - let url2 = baseApiUrl + '/generic/web/viewer.html?file=' + encodeURIComponent(file2); - ylurl.value = url2; + // var file2 = getFileAccessHttpUrl(record.pdfPath); + // let url2 = baseApiUrl + '/generic/web/viewer.html?file=' + encodeURIComponent(file2); + var file3 = baseApiUrl + "/"+record.filePath; + let url3 = 'https://jxdd.nenu.edu.cn/onlinePreview/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file3)); + + ylurl.value = url3; }else if(filetype=='mp4'|| filetype=='avi'|| filetype=='mp3'|| filetype=='wav'){ showType.value = '3';