+
@@ -69,7 +73,6 @@ export default {
data() {
return {
loadContent: 0,
- loadIng: 0,
contentDetail: null,
loadPreview: true,
}
@@ -96,6 +99,10 @@ export default {
},
computed: {
+ contentLoad() {
+ return this.loadContent > 0 || this.previewLoad;
+ },
+
isPreview() {
return this.contentDetail && this.contentDetail.preview === true;
},
@@ -128,7 +135,6 @@ export default {
this.contentDetail = $A.cloneJSON(this.file);
return;
}
- this.loadIng++;
this.loadContent++;
this.$store.dispatch("call", {
url: 'file/content',
@@ -136,12 +142,10 @@ export default {
id: this.code || this.file.id,
},
}).then(({data}) => {
- this.loadIng--;
this.loadContent--;
this.contentDetail = data.content;
}).catch(({msg}) => {
$A.modalError(msg);
- this.loadIng--;
this.loadContent--;
})
},
diff --git a/resources/assets/sass/pages/components/file-content.scss b/resources/assets/sass/pages/components/file-content.scss
index 99f1a56c..dc6052d9 100644
--- a/resources/assets/sass/pages/components/file-content.scss
+++ b/resources/assets/sass/pages/components/file-content.scss
@@ -1,4 +1,5 @@
-.file-content {
+.file-content,
+.file-preview {
position: absolute;
top: 0;
left: 0;
@@ -54,9 +55,6 @@
color: #000000;
}
}
- .ivu-tag {
- margin-left: 4px;
- }
}
.header-user {
margin-right: 24px;
@@ -206,6 +204,51 @@
}
}
}
+
+.file-preview {
+ .edit-header {
+ .header-title {
+ display: flex;
+ align-items: center;
+
+ .ivu-tag {
+ margin-left: 6px;
+ padding: 0 6px;
+ line-height: 20px;
+ }
+
+ .refresh {
+ display: flex;
+ align-items: center;
+ margin-left: 6px;
+
+ .common-loading {
+ margin: 2px;
+ width: 16px;
+ height: 16px;
+ }
+
+ > i {
+ opacity: 0.6;
+ font-size: 20px;
+ cursor: pointer;
+ transition: all 0.2s;
+ &:hover {
+ opacity: 1;
+ }
+ }
+ }
+ }
+ }
+ .content-body {
+ overflow: hidden;
+ .markdown-preview-warp {
+ flex: 1;
+ overflow: auto;
+ }
+ }
+}
+
.luckysheet-input-box {
z-index: 99999 !important;
}
@@ -215,7 +258,7 @@
overflow: auto;
.edit-header,
.content-body {
- min-width: 1200px;
+ min-width: 900px;
}
}
}