From 8ddf891c50f3c2340bf50ea0597378b076917d08 Mon Sep 17 00:00:00 2001 From: zhengzhou Date: Tue, 13 Apr 2021 13:17:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=9B=9E=E5=B7=A5=E4=BD=9C=E4=B8=AD?= =?UTF-8?q?=E7=8A=B6=E6=80=81=20=E6=B7=BB=E5=8A=A0=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E6=8C=89=E9=92=AE=20=E6=9B=B4=E6=96=B0=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=B8=BA=E4=B8=8B=E8=BD=BD=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=20(#11)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/components/plain-folder-list.vue | 2 +- .../components/file-explorer/index.vue | 49 ++++++------ .../workspace/components/file-item.vue | 78 ++++++++++++------- 3 files changed, 76 insertions(+), 53 deletions(-) diff --git a/src/views/main_web/project/components/plain-folder-list.vue b/src/views/main_web/project/components/plain-folder-list.vue index 0c3343e2..e1b31d2b 100644 --- a/src/views/main_web/project/components/plain-folder-list.vue +++ b/src/views/main_web/project/components/plain-folder-list.vue @@ -197,7 +197,7 @@ export default { methods: { //判断是否存在可嵌套节点 canNest(folder) { - console.log(folder); + // console.log(folder); return true; // let len = this.nestNodeList.length; // for (let i = 0; i < len; i++) { diff --git a/src/views/main_web/workspace/components/file-explorer/index.vue b/src/views/main_web/workspace/components/file-explorer/index.vue index c4412c6b..95fb64d5 100644 --- a/src/views/main_web/workspace/components/file-explorer/index.vue +++ b/src/views/main_web/workspace/components/file-explorer/index.vue @@ -1922,12 +1922,12 @@ export default { if(isCooperationFile) { system.clientOpenFileWith(filePath); return; } // 将文件状态设置为编辑中 - // const flagRes = await services.changeFileWorkStatus(fileId, 2); - // if(flagRes.Code !== 0) return; - // file.workStatus = 2; - // file.modifyUserId = sessionStorage.userId; + const flagRes = await services.changeFileWorkStatus(fileId, 2); + if(flagRes.Code !== 0) return; + file.workStatus = 2; + file.modifyUserId = sessionStorage.userId; system.clientOpenFileWith(filePath); - // this.fetchFolderFiles(); + this.fetchFolderFiles(); }, /** * 点击文件事件:直接打开文件 @@ -1935,38 +1935,37 @@ export default { fileClick: async function (file) { //debugger; if(!this.isClient) return; - // const { archName, extension, id: fileId, nodeName } = file; + const { archName, extension, id: fileId, nodeName } = file; // const folderName = nodeName || this.currentFolder.folderName; const localWorkspacePrefix = this.localWorkspacePrefix; - // const isCooperationFile = !!nodeName; + const isCooperationFile = !!nodeName; // const fileStoreKey = `${folderName}${isCooperationFile ? '\\协作文件': ''}\\${archName}${extension ? `.${extension}` : ''}`; const fileStoreKey = getFileStoreKey(file, this.currentNodeFolder); if(!this.localFileHashMap[fileStoreKey]) return; const filePath = `${localWorkspacePrefix}\\${fileStoreKey}`; - // if(!isCooperationFile && (file.workStatus === 2 && sessionStorage.userId !== file.modifyUserId)) { + if(!isCooperationFile && (file.workStatus === 2 && sessionStorage.userId !== file.modifyUserId)) { // console.log("1111") - // this.$notify({ - // type:["warning"], - // title:"暂不能打开此文件", - // message:`${file.modifyName}正在编辑此文件,请在“工作中”标识消失后再尝试打开。` - // }) - // return; - // } + this.$notify({ + type:["warning"], + title:"暂不能打开此文件", + message:`${file.modifyName}正在编辑此文件,请在“工作中”标识消失后再尝试打开。` + }) + return; + } - // // 若文件在协作文件中,则不更改状态 - // if(isCooperationFile) { system.openFile(filePath); return; } - // // 将文件状态设置为编辑中 - - // if(file.workStatus !== 2) { - // file.workStatus = 2; - // const flagRes = await services.changeFileWorkStatus(fileId, 2); - // if(flagRes.Code !== 0) return; - // } + // 若文件在协作文件中,则不更改状态 + if(isCooperationFile) { system.openFile(filePath); return; } + // 将文件状态设置为编辑中 + if(file.workStatus !== 2) { + file.workStatus = 2; + const flagRes = await services.changeFileWorkStatus(fileId, 2); + if(flagRes.Code !== 0) return; + } file.modifyUserId = sessionStorage.userId; system.openFile(filePath); - // this.fetchFolderFiles(); + this.fetchFolderFiles(); }, /** * 右键菜单 diff --git a/src/views/main_web/workspace/components/file-item.vue b/src/views/main_web/workspace/components/file-item.vue index fbf2a68d..cbc69ac5 100644 --- a/src/views/main_web/workspace/components/file-item.vue +++ b/src/views/main_web/workspace/components/file-item.vue @@ -15,14 +15,14 @@ v-if="!oneOf(file.extension, imgExtensionList) && !oneOf(file.extension, VideoExtensionList)" class="defultImage-mid" :class="`${file.extension}-mid ${ - fileIsLoading || showDownloadMask ? 'toumin' : '' + fileIsLoading || (isInWorkFolder && otherUserIsWorking) ? 'toumin' : '' } ${!oneOf(file.extension,filePreviewList) ? '':''} ` " />
@@ -39,6 +39,12 @@