revive 4 years ago
parent
commit
05097eaceb
3 changed files with 11 additions and 11 deletions
  1. +1
    -0
      src/services/system.js
  2. +6
    -8
      src/views/main_web/workspace/components/file-item.vue
  3. +4
    -3
      src/views/main_web/workspace/workspace.new.vue

+ 1
- 0
src/services/system.js View File

@@ -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;


+ 6
- 8
src/views/main_web/workspace/components/file-item.vue View File

@@ -162,8 +162,7 @@
{{ file.version }}
</span>
<span v-if="!isInWorkFolder" class="yiyunwenjian_infodesc">{{file.nodeName}}</span>
<span class="yiyunwenjian_infodesc">{{loadingState.loadProgress}}</span>
<!-- <span class="yiyunwenjian_infodesc">{{loadingState.loadProgress}}</span> -->
</div>
</div>
</el-tooltip>
@@ -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() {


+ 4
- 3
src/views/main_web/workspace/workspace.new.vue View File

@@ -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;


Loading…
Cancel
Save