|
|
@@ -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}`); |
|
|
|
}, |
|
|
|