非dicom文件名生成guid
continuous-integration/drone/push Build is passing Details

uat_us
DESKTOP-6C3NK6N\WXS 2024-09-06 20:23:19 +08:00
parent e043e85630
commit ccf3b823d8
3 changed files with 9 additions and 2 deletions

View File

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

View File

@ -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()

View File

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