diff --git a/src/services/system.js b/src/services/system.js index bfb4540e..1105d20e 100644 --- a/src/services/system.js +++ b/src/services/system.js @@ -174,8 +174,8 @@ const system = { /** * 通知系统进入当前的工作空间 */ - entryProject: safeCall(async (projName, accountName, fileChangeHandler, initHandler, socketInsHandler, errorHandler = identity) => { - const response = await requestBySocket(io('init'), [accountName, projName].join('|')); + entryProject: safeCall(async (projName, accountId, accountName, fileChangeHandler, initHandler, socketInsHandler, errorHandler = identity) => { + const response = await requestBySocket(io('init'), [accountName, accountId, projName].join('|')); initHandler(response.data); const watchSocket = io('subscriptionFileChange'); watchSocket.on('open', () => { 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 f162aaaf..d6e20889 100644 --- a/src/views/main_web/workspace/components/file-explorer/index.vue +++ b/src/views/main_web/workspace/components/file-explorer/index.vue @@ -13,7 +13,6 @@ :key="file.id" :file="file" :clientDownLoad="clientDownLoad" - :showFileMilestone="showFileMilestone" :nodeFolder="currentNodeFolder" :currentFolder="currentFolder" @commitFile="showCommitWindow" @@ -42,7 +41,6 @@ :file="file" :tempRightFileId="tempRightFileId" :clientDownLoad="clientDownLoad" - :showFileMilestone="showFileMilestone" :nodeFolder="currentNodeFolder" :currentFolder="currentFolder" @dblclickFile="fileClick(file)" @@ -108,7 +106,6 @@ :key="file.id" :file="file" :clientDownLoad="clientDownLoad" - :showFileMilestone="showFileMilestone" :nodeFolder="currentNodeFolder" :currentFolder="currentFolder" :localFileHashMap="localFileHashMap" @@ -122,7 +119,6 @@ :key="file.id" :file="file" :clientDownLoad="clientDownLoad" - :showFileMilestone="showFileMilestone" :nodeFolder="currentNodeFolder" :currentFolder="currentFolder" @commitFile="showCommitWindow" @@ -230,7 +226,6 @@ :file="file" :tempRightFileId="tempRightFileId" :clientDownLoad="clientDownLoad" - :showFileMilestone="showFileMilestone" :nodeFolder="currentNodeFolder" :currentFolder="currentFolder" @dblclickFile="fileClick(file)" @@ -633,7 +628,7 @@ export default { this.fetchFolderFiles(); system.entryProject( - sessionStorage.projName, sessionStorage.accountName, + sessionStorage.projName, sessionStorage.accountId, sessionStorage.accountName, this.onSocketFileChangeDetected.bind(this), (localWorkspacePrefix) => { this.localWorkspacePrefix = localWorkspacePrefix;}, socketIns => { this.socketIns = socketIns; }, @@ -1792,27 +1787,28 @@ export default { const isConflict = (fileLocalIpfsCid && status == "1" && myLocalIpfsCid !== ipfsCid); console.log(isConflict); - if(isConflict) { - // const text = `${file.modifyName}编辑过您的文件,是继续我上次编辑还是打开${file.modifyName}的编辑?`; - const text = `${file.modifyName}更新了文件,请选择协同版本。`; - this.$confirm(text, "", { - confirmButtonText: "继续提交我的版本", - cancelButtonText: '保留对方版本', - showClose: true, - type: "warning", - customClass: 'conflit-message-box', - }).then(() => { - //点击继续我的编辑 -> 继续完成本次版本的提交 相当于忽略别人编辑过的版本 - this.commitFile(false); - }) - .catch((err)=> { - //点击了打开XXX的编辑 -> 完成本次版本提交 - //但是本次版本提交updateFile(服务端)传递的 historyCurrentIpfsCid 不是websocket接口返回的 而是文件的ipfscid(别人编辑的版本) - this.commitFile(true); - }); - } else { - this.commitFile(false); - } + // if(isConflict) { + // // const text = `${file.modifyName}编辑过您的文件,是继续我上次编辑还是打开${file.modifyName}的编辑?`; + // const text = `${file.modifyName}更新了文件,请选择协同版本。`; + // this.$confirm(text, "", { + // confirmButtonText: "继续提交我的版本", + // cancelButtonText: '保留对方版本', + // showClose: true, + // type: "warning", + // customClass: 'conflit-message-box', + // }).then(() => { + // //点击继续我的编辑 -> 继续完成本次版本的提交 相当于忽略别人编辑过的版本 + // this.commitFile(false); + // }) + // .catch((err)=> { + // //点击了打开XXX的编辑 -> 完成本次版本提交 + // //但是本次版本提交updateFile(服务端)传递的 historyCurrentIpfsCid 不是websocket接口返回的 而是文件的ipfscid(别人编辑的版本) + // this.commitFile(true); + // }); + // } else { + // this.commitFile(false); + // } + this.commitFile(isConflict); this.isShowCommitJudgeWindow = false; this.commitFileControlIpfsCid = ''; this.comitJudgeCom = null; @@ -1971,28 +1967,6 @@ export default { system.openFile(filePath); // this.fetchFolderFiles(); }, - /** - * 设置历史文件界面 - */ - showFileMilestone: function (file) { - // todo 待修正,思考是否可以放到file组件中去 - debugger; - if (file.status == 1 && file.modifyUserID != sessionStorage.userId) { - this.$notify({ - message: "其他人编辑中,不能设置历史文件", - type: "warning", - offset: 100, - duration: 5000, - }); - return; - } - this.currentMilestone=file; - this.dialogFileHistory = true; - //返回与该文件同名的所有文件并把自己过滤掉 - this.listMilestones=this.getMilstoneFile(file); - console.log(this.listMilestones) - this.currentArchID = file.archID; - }, /** * 右键菜单 */ diff --git a/src/views/main_web/workspace/components/file-item.vue b/src/views/main_web/workspace/components/file-item.vue index c1e1370e..25d8ee9a 100644 --- a/src/views/main_web/workspace/components/file-item.vue +++ b/src/views/main_web/workspace/components/file-item.vue @@ -144,6 +144,7 @@