文档管理-下载和预览url变动
This commit is contained in:
parent
88307ad548
commit
e8b25d4455
@ -110,3 +110,11 @@ export function selectNodesByProjectId(queryParams:any) {
|
||||
params:queryParams
|
||||
});
|
||||
}
|
||||
//获取文档管理url
|
||||
export function sdLocalUrl(queryParams:any) {
|
||||
return request({
|
||||
url: '/specialDocument/sd_files/sdLocalUrl',
|
||||
method: 'post',
|
||||
params:queryParams
|
||||
});
|
||||
}
|
@ -13,7 +13,7 @@ import { Search } from '@element-plus/icons-vue'
|
||||
import Page from '@/components/Pagination/page.vue';
|
||||
import AudioPlayer from '@/components/file/preview/AudioPlayer.vue';
|
||||
import { batchDeleteReq } from "@/api/file-operator";
|
||||
import { projectList, selectNodesByProjectId, documentUploadById, obtainInformationAsync, getNodesTree, addNodes, updateNodes, deleteNodesById, getFilesPage, addFiles, updateFiles, deleteFilesById, deleteFilesByIds, specialScanById } from "@/api/document";
|
||||
import { projectList, selectNodesByProjectId, documentUploadById, obtainInformationAsync, getNodesTree, addNodes, updateNodes, deleteNodesById, getFilesPage, addFiles, updateFiles, deleteFilesById, deleteFilesByIds, specialScanById,sdLocalUrl } from "@/api/document";
|
||||
import ZUpload from '@/components/file/ZUpload.vue'
|
||||
import useFileUpload from "@/components/file/file/useFileUpload";
|
||||
import useHeaderStorageList from "@/components/header/useHeaderStorageList";
|
||||
@ -587,7 +587,10 @@ function xiafile(row: any) {
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
window.open(row.url);
|
||||
sdLocalUrl({ id: row.id }).then((res: any) => {
|
||||
window.open(res.data.url);
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
|
||||
@ -690,16 +693,29 @@ function openPreview(row: any) {
|
||||
// }
|
||||
if (getFileExtension(row.fileName) == 'pdf' || getFileExtension(row.fileName) == 'xlsx' || getFileExtension(row.fileName) == 'xls' || getFileExtension(row.fileName) == 'docx' || getFileExtension(row.fileName) == 'doc' || getFileExtension(row.fileName) == 'bin') {
|
||||
title1.value = row.fileName
|
||||
ViewfileUrl.value = row.url
|
||||
isViewfile.value = true
|
||||
fileType.value = getFileExtension(row.fileName)
|
||||
geturl(row, true)
|
||||
} else {
|
||||
row.fileType = getFileType(row.fileName)
|
||||
filePreview.value = row
|
||||
geturl(row, false)
|
||||
}
|
||||
|
||||
}
|
||||
function geturl(row: any, pan: any) {
|
||||
sdLocalUrl({ id: row.id }).then((res: any) => {
|
||||
if (pan) {
|
||||
ViewfileUrl.value = res.data.url
|
||||
isViewfile.value = true
|
||||
fileType.value = getFileExtension(row.fileName)
|
||||
} else {
|
||||
filePreview.value.url = res.data.url
|
||||
filePreview.value.type = res.data.type
|
||||
localStorage.setItem('videorow', JSON.stringify(row));
|
||||
openRow(row)
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
function getFileExtension(filename: any) {
|
||||
// 获取点号在文件名中的位置(从后往前查找)
|
||||
|
Loading…
Reference in New Issue
Block a user