From 1832a9d339d0efe239be97b8161ad416b27dffc4 Mon Sep 17 00:00:00 2001 From: jmal Date: Fri, 17 Jul 2020 10:33:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=8F=B3=E9=94=AE=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E6=96=B0=E5=BB=BA=E6=96=87=E4=BB=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Breadcrumb/FilePathNav.vue | 1 - src/components/ShowFile/ShowFile.vue | 14 ++++---------- src/components/preview/SimTextPreview.vue | 11 +++++++---- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/components/Breadcrumb/FilePathNav.vue b/src/components/Breadcrumb/FilePathNav.vue index e163aa5..99a16ca 100644 --- a/src/components/Breadcrumb/FilePathNav.vue +++ b/src/components/Breadcrumb/FilePathNav.vue @@ -31,7 +31,6 @@ export default { }, watch: { path(path){ - console.log('path', path) this.pathList = [{folder:'',path: '/'}] let list = path.split('/').filter((item)=>item.length>0) list.forEach((pathName,index)=>{ diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index 5ca9043..65c7cca 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -823,11 +823,6 @@ this.stompClient.unsubscribe() } }, - // watch: { - // fileList: function (newValue,oldValue) { - // console.log(newValue,oldValue) - // } - // }, directives: { // 注册一个局部的自定义指令 v-focus focus: { @@ -861,7 +856,6 @@ this.stompClient = ws.stompClient.subscribe('/user/queue/update', (msg) => { let fileDoc = JSON.parse(msg.body) const url = msg.headers.url - console.log('onmessage.url', url, fileDoc) let index = this.fileList.findIndex(file=>file.id === fileDoc.id) if('updateFile' === url){ if(index > -1){ @@ -1524,7 +1518,10 @@ this.textPreviewVisible = true this.$message.success(`新建文件成功`) - this.newTextFileDialog = false + const that = this + setTimeout(function () { + that.newTextFileDialog = false + },200) }).catch(()=>{ }) @@ -2178,7 +2175,6 @@ }, 1000) }, hide() { - console.log('菜单隐藏了') const that = this this.isJustHideMenus = true setTimeout(function() { @@ -2188,7 +2184,6 @@ }, // 全局右键菜单操作 contextmenuClick(operation) { - console.log(operation) switch (operation) { case 'vmode-list': this.grid=true;this.changeVmode() @@ -2460,7 +2455,6 @@ }).then((res) => { data.newFolder = false data.id = res.data.id - console.log(data) }).catch(() => { window.event.preventDefault() window.event.stopPropagation() diff --git a/src/components/preview/SimTextPreview.vue b/src/components/preview/SimTextPreview.vue index a23bf76..806b712 100644 --- a/src/components/preview/SimTextPreview.vue +++ b/src/components/preview/SimTextPreview.vue @@ -204,7 +204,6 @@ }, watch: { //监听file的变化,进行相应的操作即可 file(file) { - console.log('watch file',file) if(!file.path){ return } @@ -239,7 +238,6 @@ if(!file.id){ request = 'previewTextByPath' } - console.log(request,file) api[request]({ shareId: this.shareId, fileId: file.id, @@ -252,16 +250,21 @@ this.textPreviewVisible = true this.content = res.data.contentText + let pathname = res.data.path.substring(1,res.data.path.length)+res.data.name + if('previewTextByPath' === request){ + pathname = `/${res.data.path}/${res.data.name}` + } + // 加载tabs this.editableTabs.push({ title: res.data.name, copyTitle: res.data.name, language: this.getEditorLanguage(res.data.suffix), status: undefined,//标签状态 - name: res.data.path.substring(1,res.data.path.length)+res.data.name, + name: pathname, content: res.data.contentText }) - this.editableTabsValue = res.data.path.substring(1,res.data.path.length)+res.data.name + this.editableTabsValue = pathname // 界面的渲染后的初始化工作 this.$nextTick(()=>{