🎨优化移动端office文件预览
This commit is contained in:
parent
c6a7d5e3be
commit
6f78ca47ab
@ -121,8 +121,8 @@ export default {
|
|||||||
this.docEditor = null
|
this.docEditor = null
|
||||||
}
|
}
|
||||||
this.fileUrl = window.location.origin + fileConfig.previewUrl(this.$store.state.user.name, this.file, this.$store.getters.token)
|
this.fileUrl = window.location.origin + fileConfig.previewUrl(this.$store.state.user.name, this.file, this.$store.getters.token)
|
||||||
if(this.readOnly){
|
if(this.readOnly && window.shareId){
|
||||||
this.fileUrl = window.location.origin + fileConfig.publicPreviewUrl(this.file.id, window.shareId);
|
this.fileUrl = window.location.origin + fileConfig.publicPreviewUrl(this.file.id, window.shareId)
|
||||||
}
|
}
|
||||||
let fileKey = `${new Date(this.file.updateDate).getTime()}-${this.file.id}`
|
let fileKey = `${new Date(this.file.updateDate).getTime()}-${this.file.id}`
|
||||||
|
|
||||||
@ -187,16 +187,28 @@ export default {
|
|||||||
},
|
},
|
||||||
onAppReady() {
|
onAppReady() {
|
||||||
this.$emit('onReady')
|
this.$emit('onReady')
|
||||||
|
console.log('onAppReady')
|
||||||
},
|
},
|
||||||
onDocumentReady() {
|
onDocumentReady() {
|
||||||
|
console.log('onDocumentReady')
|
||||||
let parentDoc = document.querySelector('.component-only-office')
|
let parentDoc = document.querySelector('.component-only-office')
|
||||||
let doc = parentDoc.getElementsByTagName('iframe')[0].contentWindow.document
|
let doc = parentDoc.getElementsByTagName('iframe')[0].contentWindow.document
|
||||||
|
|
||||||
|
if (!this.$pc) {
|
||||||
|
parentDoc.style.top = '5rem'
|
||||||
|
doc.querySelector('.navbar.main-navbar.navbar-with-logo').style.height = '0'
|
||||||
|
let editorNavbar = doc.getElementById("editor-navbar")
|
||||||
|
console.log(editorNavbar)
|
||||||
|
// editorNavbar.style.display = 'none'
|
||||||
|
}
|
||||||
|
|
||||||
let logo = doc.querySelector('.extra .logo')
|
let logo = doc.querySelector('.extra .logo')
|
||||||
// 隐藏logo,about
|
// 隐藏logo,about
|
||||||
logo.style.display = 'none'
|
logo.style.display = 'none'
|
||||||
let about = doc.getElementById('left-btn-about')
|
let about = doc.getElementById('left-btn-about')
|
||||||
about.style.display = 'none'
|
about.style.display = 'none'
|
||||||
this.saveBtnDoc = doc.getElementById('slot-btn-dt-save').getElementsByTagName('button')[0]
|
this.saveBtnDoc = doc.getElementById('slot-btn-dt-save').getElementsByTagName('button')[0]
|
||||||
|
|
||||||
},
|
},
|
||||||
onDocumentStateChange() {
|
onDocumentStateChange() {
|
||||||
this.saved = this.saveBtnDoc.classList.contains('disabled')
|
this.saved = this.saveBtnDoc.classList.contains('disabled')
|
||||||
|
|||||||
@ -224,8 +224,8 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.fileUrl = window.location.origin + fileConfig.previewUrl(this.$store.state.user.name, this.file, this.$store.getters.token)
|
this.fileUrl = window.location.origin + fileConfig.previewUrl(this.$store.state.user.name, this.file, this.$store.getters.token)
|
||||||
if(this.readOnly){
|
if(this.readOnly && window.shareId){
|
||||||
this.fileUrl = window.location.origin + fileConfig.publicPreviewUrl(this.file.id, window.shareId);
|
this.fileUrl = window.location.origin + fileConfig.publicPreviewUrl(this.file.id, window.shareId)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user