Commit 96b45d51 authored by 以墨为白's avatar 以墨为白 🎧

pdf

parent 21f07b64
......@@ -626,15 +626,19 @@ export default {
// window.open(path_srt);
// window.open(`api/rest/file/pdf/DocumentPDF?objectName=${row.file.uuid}`);
getBlob(`api/rest/file/pdf/DocumentPDF?objectName=${row.file.uuid}`).then(res => {
get(`api/rest/file/exists?bucket=DocumentPDF&filename=${row.file.uuid}`).then(res => {
if (res) {
window.open(`api/rest/file/pdf/DocumentPDF?objectName=${row.file.uuid}`);
}).catch(err => {
post("api/rest/file/path?bucket=Document&filename=" + row.file.uuid).then(res => {
} else {
return post("api/rest/file/path?bucket=Document&filename=" + row.file.uuid);
}
}).then(res => {
if (res) {
window.open(`./onlyoffice.html?url=${encodeURIComponent(res)}&fileType=${row.file.type}&filename=${row.name}`);
}
}).catch(err => {
this.$message("预览失败");
});
});
}
},
//table_全文搜索预览
......
......@@ -620,15 +620,19 @@ export default {
// window.open(path_srt);
// window.open(`api/rest/file/pdf/DocumentPDF?objectName=${row.file.uuid}`);
getBlob(`api/rest/file/pdf/DocumentPDF?objectName=${row.file.uuid}`).then(res => {
get(`api/rest/file/exists?bucket=DocumentPDF&filename=${row.file.uuid}`).then(res => {
if (res) {
window.open(`api/rest/file/pdf/DocumentPDF?objectName=${row.file.uuid}`);
}).catch(err => {
post("api/rest/file/path?bucket=Document&filename=" + row.file.uuid).then(res => {
} else {
return post("api/rest/file/path?bucket=Document&filename=" + row.file.uuid);
}
}).then(res => {
if (res) {
window.open(`./onlyoffice.html?url=${encodeURIComponent(res)}&fileType=${row.file.type}&filename=${row.name}`);
}
}).catch(err => {
this.$message("预览失败");
});
});
}
},
//table_全文搜索预览
......
......@@ -549,21 +549,19 @@ export default {
// "/" +
// row.file.uuid;
// window.open(path_srt);
getBlob(`api/rest/file/pdf/DocumentPDF?objectName=${row.file.uuid}`).then(res => {
get(`api/rest/file/exists?bucket=DocumentPDF&filename=${row.file.uuid}`).then(res => {
if (res) {
window.open(`api/rest/file/pdf/DocumentPDF?objectName=${row.file.uuid}`);
}).catch(err => {
post("api/rest/file/path?bucket=Document&filename=" + row.file.uuid).then(res => {
} else {
return post("api/rest/file/path?bucket=Document&filename=" + row.file.uuid);
}
}).then(res => {
if (res) {
window.open(`./onlyoffice.html?url=${encodeURIComponent(res)}&fileType=${row.file.type}&filename=${row.name}`);
}
}).catch(err => {
this.$message("预览失败");
});
});
// window.open(`api/rest/file/pdf/DocumentPDF?objectName=${row.file.uuid}`);
// post("api/rest/file/path?bucket=Document&filename=" + row.file.uuid).then(res => {
// // window.open(`./onlyoffice.html?url=${encodeURIComponent(res)}&fileType=docx&filename=${row.name}`);
// }).catch(err => {
// });
}
},
//table_全文搜索预览
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment