From cc4571f98c5838f7d707d463f2408b5dd5fd1c8a Mon Sep 17 00:00:00 2001 From: jmal Date: Sat, 5 Aug 2023 20:06:02 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/preview/SimTextPreview.vue | 67 +++++++++++++---------- 1 file changed, 37 insertions(+), 30 deletions(-) diff --git a/src/components/preview/SimTextPreview.vue b/src/components/preview/SimTextPreview.vue index 5fb3a55..3e66ce8 100644 --- a/src/components/preview/SimTextPreview.vue +++ b/src/components/preview/SimTextPreview.vue @@ -55,16 +55,16 @@ 保存所有 - - - - - - - - - - + + +
-
+
-
+
- + editable.name === pathname) const tab = this.editableTabs[currentIndex] @@ -590,7 +591,7 @@ that.dialogWidth = dialogWidth + moveX that.editorWidth = editorWidth + moveX that.editorHieght = editorHieght + (endY - startY) - that.loadConterSize() + that.loadContentSize() } } // 鼠标松开事件 @@ -714,7 +715,7 @@ fileName: row.name, username: this.$store.state.user.name } - api.previewTextByPath(params).then((res)=>{ + api.previewTextByPath(params).then(()=>{ this.loading.close() // 添加一个tab let tab = { @@ -797,11 +798,7 @@ this.loadEditorSize() }, checkMobile() { - if (!this.$pc) { - this.moblie = true - } else { - this.moblie = false - } + this.moblie = !this.$pc; }, checkReadOnly(fileUserId){ if(this.$store.state.user.token && this.$store.state.user.userId === fileUserId){ @@ -827,12 +824,12 @@ this.editorWidth = this.dialogWidth - this.contentsWidth } this.editorHieght = document.body.clientHeight * this.dialogWidthPercent - 76 - this.loadConterSize() + this.loadContentSize() }, - loadConterSize(){ - let conter = document.querySelector('.editor-resize .editor-resize-conter'); - if(conter){ - conter.style.marginTop = ((this.editorHieght+26)/2 - conter.clientHeight/2) + 'px' + loadContentSize(){ + let content = document.querySelector('.editor-resize .editor-resize-conter'); + if(content){ + content.style.marginTop = ((this.editorHieght+26)/2 - content.clientHeight/2) + 'px' } }, handleClose(done) { @@ -866,6 +863,7 @@ } }, closeDialog() { + this.previewMode = false this.textPreviewVisible = false this.$emit('update:status', this.textPreviewVisible) this.isSaveDialogVisible = false @@ -1037,8 +1035,10 @@ this.clickTab() }, clickTab() { - // this.editorWidth += 0.001 - // this.editorHieght += 0.001 + this.editorWidth += 0.001 + this.editorHieght += 0.001 + // 加载历史版本 + this.$refs.historyPopover.loadHistoryPathList(this.editableTabsValue) }, removeTab(targetName) { let tabs = this.editableTabs; @@ -1534,13 +1534,20 @@ .nwse-resize { z-index: 99999; position: fixed; - width: 15px; - background: #00000000; + width: 12px; + margin-left: 3px; + background: #f0f0f0; height: 15px; margin-top: -15px; float: right; cursor: nwse-resize; } + .nwse-resize::before { + content: "⠿"; + display: inline-block; + padding-right: 5px; + vertical-align: middle; + } .el-button--small.is-circle { padding: 9px 9px; }