diff --git a/src/components/uploadDicomAndNonedicom/nonedicomFile.vue b/src/components/uploadDicomAndNonedicom/nonedicomFile.vue index a928bdbf..e6cb9311 100644 --- a/src/components/uploadDicomAndNonedicom/nonedicomFile.vue +++ b/src/components/uploadDicomAndNonedicom/nonedicomFile.vue @@ -643,9 +643,10 @@ export default { if (!this.uploadVisible) return let file = this.fileList.filter((item) => item.id === arr[index].id)[0] file.status = 1 + console.log(file) let path = `/${this.$route.query.trialId}/TaskImage/${ this.currentRow.SubjectId - }/${this.currentRow.VisitTaskId}/${new Date().getTime()}${file.name + }/${this.currentRow.VisitTaskId}/${this.$guid()}${file.name .substring(file.name.lastIndexOf('.')) .toLocaleLowerCase()}` console.log(path) diff --git a/src/main.js b/src/main.js index b1998a3e..2b9c83bb 100644 --- a/src/main.js +++ b/src/main.js @@ -145,6 +145,12 @@ Vue.config.productionTip = false Vue.prototype.$upload = () => { _vm.$forceUpdate() } +Vue.prototype.$guid = () => { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { + var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); + return v.toString(16); + }); +} Vue.prototype.fileToBlob = (file) => { // 创建 FileReader 对象 const reader = new FileReader() diff --git a/src/views/trials/trials-panel/visit/crc-upload/components/uploadNonDicomFiles.vue b/src/views/trials/trials-panel/visit/crc-upload/components/uploadNonDicomFiles.vue index c4a4eb80..1a042dcb 100644 --- a/src/views/trials/trials-panel/visit/crc-upload/components/uploadNonDicomFiles.vue +++ b/src/views/trials/trials-panel/visit/crc-upload/components/uploadNonDicomFiles.vue @@ -949,7 +949,7 @@ export default { file.status = 1 let path = `/${this.trialId}/Image/${this.data.SubjectId}/${ this.data.Id - }/${new Date().getTime()}${file.name + }/${this.$guid()}${file.name .substring(file.name.lastIndexOf('.')) .toLocaleLowerCase()}` const fileData = await this.fileToBlob(file.file)