+
-
+
@@ -176,6 +176,7 @@
contentsHide: false,
defalutLanguage: 'redis',
lineWrapping: false,
+ moblie: false,
options: {
fontSize: 14,
contextmenu: true,
@@ -254,6 +255,7 @@
return
}
this.editableTabs = []
+ this.checkMobile()
this.checkReadOnly(file.userId)
this.loadEditorSize()
this.loading = this.$message({
@@ -541,13 +543,23 @@
containerResize() {
this.loadEditorSize()
},
+ checkMobile() {
+ if (!this.$pc) {
+ this.moblie = true
+ } else {
+ this.moblie = false
+ }
+ },
checkReadOnly(fileUserId){
if(this.$store.state.user.token && this.$store.state.user.userId === fileUserId){
this.options.readOnly = false
}
- if(this.options.readOnly){
- this.editorWidth += this.contentsWidth
- this.contentsHide = true
+ console.log(this.options.readOnly, this.moblie)
+ if(this.options.readOnly || this.moblie){
+ this.$nextTick(()=> {
+ this.editorWidth += this.contentsWidth
+ this.contentsHide = true
+ })
}
},
loadEditorSize(){
@@ -863,6 +875,7 @@
.el-dialog__header {
padding: 5px 20px 5px;
+ overflow: hidden;
.el-dialog__headerbtn {
top: 12px;
diff --git a/src/views/home/mobile/index.vue b/src/views/home/mobile/index.vue
index 0d5710f..23675f8 100644
--- a/src/views/home/mobile/index.vue
+++ b/src/views/home/mobile/index.vue
@@ -231,6 +231,7 @@
+
@@ -246,10 +247,13 @@
import fileConfig from "@/utils/file-config";
import ImageViewer from "@/components/preview/ImageViewer";
import VideoPreview from "@/components/preview/VideoPreview";
+ import SimTextPreview from "@/components/preview/SimTextPreview";
+ import {suffix} from "@/utils/file-type";
let pinyin = require("pinyin");
export default {
components: {
+ SimTextPreview,
VideoPreview,
ImageViewer, IconFile,
},
@@ -335,6 +339,8 @@
imagePreviewVisible: false,
videoPreviewRow: {},
videoPreviewVisible: false,
+ textPreviewVisible: false,
+ textPreviewRow: {},
};
},
mounted(){
@@ -973,6 +979,12 @@
this.imagePreviewRow = row
return
}
+ if (suffix.simText.includes(row.suffix)) {
+ // 文本文件
+ this.textPreviewRow = row
+ this.textPreviewVisible = true
+ return
+ }
if (row.contentType.indexOf('video') > -1) {
// 视频文件
this.videoPreviewVisible = true
@@ -1126,7 +1138,6 @@
}
-
+