Skip to content

Commit

Permalink
清理一些废弃代码注释
Browse files Browse the repository at this point in the history
  • Loading branch information
1037827920 authored May 16, 2024
2 parents 68828b9 + bb1ef35 commit aa883b1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 33 deletions.
5 changes: 1 addition & 4 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -313,16 +313,13 @@ export default {
this.content = sessionStorage.getItem(this.nowTabKey) ?? '';
this.notepadContent = this.content;
// console.log(this.notepadContent);
} else if (type == "PDFViewer") {
} else if (type == "PDFViewer") {s
this.componentChange(type);
// 切换pdf的base64
//this.changePdfUrl(sessionStorage.getItem(this.nowTabKey) ?? '');
//TOOD::后端和本地预览的source格式不一样导致冲突
let source = 'data:application/pdf;base64,' + sessionStorage.getItem(this.nowTabKey) ?? ''
this.changeFlag = Date.now();
this.pdfSource = source;
//this.pdfSource = source;
} else if (type == "CodeMirror") {
this.componentChange(type);
} else if (type == "HomePage") {
Expand Down
19 changes: 0 additions & 19 deletions frontend/src/components/PDFLoader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,6 @@ export default {
else {
this.fileList.push({ name: file.name, status: 'ready', uid: file.uid });
this.file = file; // 在这里获取到文件对象,并保存在data属性中
//上传前开始预览pdf
// console.log("尝试预览");
// const reader = new FileReader();
// reader.readAsDataURL(file);
// reader.onload = () => {
// let pdfBase64 = reader.result;
// this.$emit('pdfView', file.name, pdfBase64, '1');
// }
// //获取后端pdf文件的base64流
// this.getFileType(file.name);
// console.log(this.getFileType(file.name));
// //处理路径
// let filePath = this.getPdfPath(file.name);
// client.logger.info("文件路径", filePath);
// //使用文件名作为参数去请求接口
// let ret = await client.callApi('SelectFile', {selectedTitle: file.name, filePath: filePath, fileType: pdf});
// if(ret.isSucc) {
// }
}
return false; // 阻止文件自动上传
},
Expand Down
12 changes: 2 additions & 10 deletions frontend/src/components/PDFViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,14 @@ export default {
VuePdfEmbed
},
props: ['pdfSource', 'changeFlag'],
// props: {
// pdfSource: {
// type: String,
// require: true
// },
// changeFlag: 0
// },
setup(props) {
const refresh = ref(0);
watch(() => props.changeFlag, () => {
//console.log("fresh");
nextTick(update);
})
function update() {
//console.log(pdfState.pdfSource)
pdfState.pdfSource = props.pdfSource
refresh.value++;
}
Expand All @@ -37,7 +30,6 @@ export default {
pdfNum: 1,
pdfPages: 1,
});
//console.log("2222222"+props.pdfSource);
return {
refresh,
pdfState,
Expand Down

0 comments on commit aa883b1

Please sign in to comment.