perf: 移动端只读文件

This commit is contained in:
kuaifan 2022-06-10 10:25:06 +08:00
parent 7c287f6ae5
commit dbb1033911
3 changed files with 29 additions and 7 deletions

View File

@ -336,7 +336,7 @@
class="page-file-drawer"
:beforeClose="fileBeforeClose"
:mask-closable="false">
<FilePreview v-if="fileInfo.permission === 0" :file="fileInfo"/>
<FilePreview v-if="isPreview" :file="fileInfo"/>
<FileContent v-else ref="fileContent" v-model="fileShow" :file="fileInfo"/>
</DrawerOverlay>
@ -586,6 +586,10 @@ export default {
return array;
},
isPreview() {
return this.windowSmall || this.fileInfo.permission === 0
},
isParentShare() {
const {navigator} = this;
return !!navigator.find(({share}) => share);

View File

@ -43,7 +43,7 @@ export default {
return this.$route.query ? $A.runNum(this.$route.query.history_id) : 0;
},
isPreview() {
return this.code || this.historyId > 0 || (this.fileInfo && this.fileInfo.permission === 0)
return this.windowSmall || this.code || this.historyId > 0 || (this.fileInfo && this.fileInfo.permission === 0)
},
pageName() {
let name = this.fileInfo ? this.fileInfo.name : '';

View File

@ -163,6 +163,14 @@
display: flex;
}
.teditor-wrapper {
.tox-editor-header {
.tox-toolbar--scrolling {
flex-wrap: wrap;
}
}
}
.mdeditor-box {
position: relative;
width: 100%;
@ -301,6 +309,21 @@
}
.content-body {
overflow: hidden;
.teditor-wrapper {
.tox-editor-header,
.tox-statusbar {
display: none;
}
}
.teditor-loadedstyle {
.tox-menubar,
.tox-toolbar-overlord {
padding: 0;
}
.tox-sidebar-wrap {
margin: 0;
}
}
.markdown-preview-warp {
flex: 1;
overflow: auto;
@ -323,11 +346,6 @@
.content-body {
min-width: 768px;
overflow-x: auto;
.tox {
.tox-toolbar--scrolling {
flex-wrap: wrap;
}
}
.teditor-loadedstyle {
.tox-menubar,
.tox-toolbar-overlord {