From b9f72d03868d85ec8bb469fc0417f2d0c91c0685 Mon Sep 17 00:00:00 2001 From: kim131 <1035828775@qq.com> Date: Sat, 21 Nov 2020 16:09:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=E5=88=A0?= =?UTF-8?q?=E9=99=A4ipfscid=E6=9C=AC=E5=9C=B0hash=E6=98=A0=E5=B0=84=20?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=96=87=E4=BB=B6=E5=89=AF=E6=9C=AC=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=97=B6=E5=88=86=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main_web/workspace/components/file-item.vue | 2 +- src/views/main_web/workspace/workspace.new.vue | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/views/main_web/workspace/components/file-item.vue b/src/views/main_web/workspace/components/file-item.vue index dcc65ffb..25144fc6 100644 --- a/src/views/main_web/workspace/components/file-item.vue +++ b/src/views/main_web/workspace/components/file-item.vue @@ -327,7 +327,7 @@ export default { }, deleteFileClick() { this.isFileRightMenuVisible = false; - this.$emit('deleteFileClick', this.file.id, this.file.createUserId, this.file.archName); + this.$emit('deleteFileClick', this.file.id, this.file.createUserId, this.file.archName, this.file.ipfsCid); } }, watch: { diff --git a/src/views/main_web/workspace/workspace.new.vue b/src/views/main_web/workspace/workspace.new.vue index ed803895..f4695e4e 100644 --- a/src/views/main_web/workspace/workspace.new.vue +++ b/src/views/main_web/workspace/workspace.new.vue @@ -1153,7 +1153,14 @@ export default { tempName = targetFile.archName + ` - 副本(${ ++ nowNum})`; isExists = this.workFileList.find(file => file.archName === tempName); } - copyFile.archName = tempName; + let hour = '0' + new Date().getHours(); + let minute ='0' + new Date().getMinutes(); + let seconds = '0' + new Date().getSeconds(); + hour = hour.substr(hour.length-2); + minute = minute.substr(minute.length-2); + seconds = seconds.substr(seconds.length-2); + + copyFile.archName = tempName + '-' + hour + minute + seconds; copyFile.modifyUserId = sessionStorage.userId; copyFile.modifyTime = new Date(); copyFile.createUserId = sessionStorage.userId; @@ -1163,7 +1170,7 @@ export default { const addFileRes = await services.addFile(copyFile); this.fetchFolderFiles(); }, - deleteFileClick(fileId, createUserId, archName) { + deleteFileClick(fileId, createUserId, archName, ipfscid) { var thisApp = this; if (createUserId != sessionStorage.userId) { thisApp.$notify({ @@ -1189,6 +1196,12 @@ export default { offset: 100, duration: 2500, }); + for(let key in thisApp.localFileHashMap) { + if(thisApp.localFileHashMap[key] === ipfscid) { + delete thisApp.localFileHashMap[key]; + break; + } + } thisApp.fetchFolderFiles(); } })