diff --git a/src/services/system.js b/src/services/system.js index 8977f5bb..6916d619 100644 --- a/src/services/system.js +++ b/src/services/system.js @@ -172,6 +172,7 @@ const system = { // const maybeFile = fileList.find(iFile => `${iFile.archName}${iFile.extension ? `.${iFile.extension}` : ''}` === extensionedFileName); uploadFile.FileSize = +size; uploadFile.IpfsCid = hash; + delete uploadFile.Id; const res = await fetchApi(`file/${maybeFile ? 'updateFile' : 'addFile'}`, uploadFile); wrapErrorHint(res); if(res.Code !== 0) return; diff --git a/src/views/main_web/workspace/components/file-item.vue b/src/views/main_web/workspace/components/file-item.vue index c2c023f1..bd4b0e80 100644 --- a/src/views/main_web/workspace/components/file-item.vue +++ b/src/views/main_web/workspace/components/file-item.vue @@ -162,8 +162,7 @@ {{ file.version }} {{file.nodeName}} - {{loadingState.loadProgress}} - + @@ -233,7 +232,6 @@ export default { return file.folderId === currentFolder.id; }, localIpfsCid() { - console.log(this.localFileHashMap, this.fileStoreKey, this.localFileHashMap[this.fileStoreKey]); return this.localFileHashMap[this.fileStoreKey]; }, isWorking() { @@ -242,11 +240,12 @@ export default { // 判断显示待下载的图层 showDownloadMask() { if(this.fileIsLoading) return false; + if(!this.isInWorkFolder) return !this.fileInLocal; + // if(!this.fileInLocal) return true; + // 当前工作节点下 其他人更新过的文件 + if(this.otherUserIsWorking) return false; if(!this.fileInLocal) return true; - if(this.isInWorkFolder) { // 当前工作节点下 其他人更新过的文件 - return (this.fileIsDifferent && this.file.modifyUserId !== this.currentUserId); - } - return false; + return this.fileIsDifferent && this.file.modifyUserId !== this.currentUserId; }, fileIsDifferent() { const { ipfsCid } = this.file; @@ -256,7 +255,6 @@ export default { localFileIsLatest() { const { ipfsCid } = this.file; const localIpfsCid = this.localIpfsCid; - console.log(localIpfsCid, ipfsCid); return localIpfsCid && localIpfsCid === ipfsCid; }, fileIsLoading() { diff --git a/src/views/main_web/workspace/workspace.new.vue b/src/views/main_web/workspace/workspace.new.vue index e01bcf99..babde1fd 100644 --- a/src/views/main_web/workspace/workspace.new.vue +++ b/src/views/main_web/workspace/workspace.new.vue @@ -381,7 +381,7 @@ export default { this.onSocketFileChangeDetected.bind(this), (localWorkspacePrefix) => { this.localWorkspacePrefix = localWorkspacePrefix;}, errorEvent => { notify.error('本地网关通讯失败'); } ); - // this.intervalTask(); + this.intervalTask(); }, destroyed: function () { window.removeEventListener("scroll", this.onscroll); @@ -540,7 +540,7 @@ export default { this.currentFolder = folder; this.breadcrumbFolderList.push(folder); this.clearCurrentFolderFiles(); - this.fetchFolderFileList(); + this.fetchFolderFiles(); }, /** * 当前工作点击 @@ -685,7 +685,7 @@ export default { return; } // 插入上传队列 - if(!this.uploadFileList.find(f => f === uploadFile)) { + if(!this.uploadFileList.find(f => f.id === uploadFile.id)) { this.uploadFileList.push(uploadFile); } }, @@ -760,6 +760,7 @@ export default { file.workStatus = NOT_WORKING; this.addLocalFileRecord(fileKey, IpfsCid); this.removeFileLoadingState(fileId); + this.workFileList = this.workFileList.map(iFile => iFile.id === file.id ? { ...iFile, ipfsCid: IpfsCid, workStatus: NOT_WORKING } : iFile); }, (progressData) => { const { process, hash, size, currentSize, unit } = progressData;