非dicom文件名生成guid
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
e043e85630
commit
ccf3b823d8
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue