文档管理-下载和预览url变动
This commit is contained in:
parent
88307ad548
commit
e8b25d4455
@ -109,4 +109,12 @@ export function selectNodesByProjectId(queryParams:any) {
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
params:queryParams
|
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 Page from '@/components/Pagination/page.vue';
|
||||||
import AudioPlayer from '@/components/file/preview/AudioPlayer.vue';
|
import AudioPlayer from '@/components/file/preview/AudioPlayer.vue';
|
||||||
import { batchDeleteReq } from "@/api/file-operator";
|
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 ZUpload from '@/components/file/ZUpload.vue'
|
||||||
import useFileUpload from "@/components/file/file/useFileUpload";
|
import useFileUpload from "@/components/file/file/useFileUpload";
|
||||||
import useHeaderStorageList from "@/components/header/useHeaderStorageList";
|
import useHeaderStorageList from "@/components/header/useHeaderStorageList";
|
||||||
@ -587,7 +587,10 @@ function xiafile(row: any) {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
window.open(row.url);
|
sdLocalUrl({ id: row.id }).then((res: any) => {
|
||||||
|
window.open(res.data.url);
|
||||||
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@ -690,17 +693,30 @@ 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') {
|
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
|
title1.value = row.fileName
|
||||||
ViewfileUrl.value = row.url
|
geturl(row, true)
|
||||||
isViewfile.value = true
|
|
||||||
fileType.value = getFileExtension(row.fileName)
|
|
||||||
} else {
|
} else {
|
||||||
row.fileType = getFileType(row.fileName)
|
row.fileType = getFileType(row.fileName)
|
||||||
filePreview.value = row
|
filePreview.value = row
|
||||||
localStorage.setItem('videorow', JSON.stringify(row));
|
geturl(row, false)
|
||||||
openRow(row)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
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) {
|
function getFileExtension(filename: any) {
|
||||||
// 获取点号在文件名中的位置(从后往前查找)
|
// 获取点号在文件名中的位置(从后往前查找)
|
||||||
const lastIndex = filename.lastIndexOf('.');
|
const lastIndex = filename.lastIndexOf('.');
|
||||||
|
Loading…
Reference in New Issue
Block a user