From 34488a2ac2136d93d29f2ccf1d919cc1e31f54eb Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 Nov 2020 15:36:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=96=E6=8B=BD=E6=96=87=E4=BB=B6=E6=97=B6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BF=AE=E6=94=B9=E5=B7=A5=E4=BD=9C=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/main_web/workspace/workspace.new.vue | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/views/main_web/workspace/workspace.new.vue b/src/views/main_web/workspace/workspace.new.vue index f3f71ce0..d4702a1f 100644 --- a/src/views/main_web/workspace/workspace.new.vue +++ b/src/views/main_web/workspace/workspace.new.vue @@ -480,8 +480,26 @@ export default { onfileDragStart(file, e) { this.stopPropagation(e); if(!this.isClient) return; + const { nodeName, id: fileId } = file; + const isCooperationFile = !!nodeName; const fileStoreKey = getFileStoreKey(file, this.currentNodeFolder); + // 本地没文件,不能拖拽 if(!this.localFileHashMap[fileStoreKey]) return; + + if(!isCooperationFile) { + if(file.workStatus === WORKING && sessionStorage.userId !== file.modifyUserId) { // 同节点其他人正在操作的文件不能拖拽 + return; + } + services.changeFileWorkStatus(fileId, WORKING) + .then(flagRes => { + if(flagRes.Code !== 0) return; + file.workStatus = WORKING; + file.modifyUserId = sessionStorage.userId; + this.fetchFolderFiles(); + }); + } + // 协作文件可以打开 + const { ipcRenderer } = global.electron; ipcRenderer.invoke('project-file-dnd', `${this.localWorkspacePrefix}\\${fileStoreKey}`); },