{{ $t('trials:readingUnit:qsList:message:loading') }}...
@@ -626,27 +626,47 @@ export default {
setFormItemData(obj) {
this.$emit('setFormItemData', obj)
},
- uploadScreenshot(param) {
- if (!this.visitTaskId) return
- const loading = this.$loading({
- target: document.querySelector('.ecrf-wrapper'),
- fullscreen: false,
- lock: true,
- text: 'Loading',
- spinner: 'el-icon-loading'
- })
- const formData = new FormData()
- formData.append('file', param.file)
- uploadReadingAnswerImage(this.$route.query.trialId, this.visitTaskId, formData).then(res => {
- if (res.IsSuccess) {
- this.fileList.push({ url: `${res.Result.Path}` })
- this.urls.push(res.Result.Path)
- this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '' })
- }
+ async uploadScreenshot(param) {
+ console.log(this.visitTaskId)
+ if (!this.visitTaskId) {
+ const loading = this.$loading({
+ target: document.querySelector('.ecrf-wrapper'),
+ fullscreen: false,
+ lock: true,
+ text: 'Loading',
+ spinner: 'el-icon-loading'
+ })
+ var file = await this.fileToBlob(param.file)
+ const res = await this.OSSclient.put(`/${this.trialId}/ReadAttachment/preview/${param.file.name}`, file)
+ this.fileList.push({ name: param.file.name, url: this.$getObjectName(res.url) })
+ this.urls.push(this.$getObjectName(res.url))
+ this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '' })
loading.close()
- }).catch(() => {
+ } else {
+ const loading = this.$loading({
+ target: document.querySelector('.ecrf-wrapper'),
+ fullscreen: false,
+ lock: true,
+ text: 'Loading',
+ spinner: 'el-icon-loading'
+ })
+ var file = await this.fileToBlob(param.file)
+ const res = await this.OSSclient.put(`/${this.trialId}/ReadAttachment/${this.subjectId}/${this.visitTaskId}/${param.file.name}`, file)
+ this.fileList.push({ name: param.file.name, url: this.$getObjectName(res.url) })
+ this.urls.push(this.$getObjectName(res.url))
+ this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '' })
loading.close()
- })
+ }
+ // uploadReadingAnswerImage(this.$route.query.trialId, this.visitTaskId, formData).then(res => {
+ // if (res.IsSuccess) {
+ // this.fileList.push({ url: `${res.Result.Path}` })
+ // this.urls.push(res.Result.Path)
+ // this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '' })
+ // }
+ // loading.close()
+ // }).catch(() => {
+ // loading.close()
+ // })
},
handleBeforeUpload(file) {
// 检测文件类型是否符合要求
diff --git a/src/views/trials/trials-panel/setting/reading-unit/components/QuestionTableFormItem.vue b/src/views/trials/trials-panel/setting/reading-unit/components/QuestionTableFormItem.vue
index 4219fefc..d4a1f1c5 100644
--- a/src/views/trials/trials-panel/setting/reading-unit/components/QuestionTableFormItem.vue
+++ b/src/views/trials/trials-panel/setting/reading-unit/components/QuestionTableFormItem.vue
@@ -266,7 +266,7 @@ export default {
},
openAddTableCol(row) {
this.addOrEdit.visible = true
- this.addOrEdit.title = row.QuestionName + '表格问题'
+ this.addOrEdit.title = row.QuestionName + this.$t('trials:readingUnit:qsList:title:tableQs')
this.QuestionsList = row.TableQuestions.Questions
this.AnswersList = row.TableQuestions.Answers
this.QuestionsForm = {}
@@ -316,7 +316,7 @@ export default {
setFormItemData(obj) {
this.$emit('setFormItemData', obj)
},
- uploadScreenshot(param) {
+ async uploadScreenshot(param) {
if (!this.visitTaskId) return
const loading = this.$loading({
target: document.querySelector('.ecrf-wrapper'),
@@ -325,18 +325,12 @@ export default {
text: 'Loading',
spinner: 'el-icon-loading'
})
- const formData = new FormData()
- formData.append('file', param.file)
- uploadReadingAnswerImage(this.$route.query.trialId, this.visitTaskId, formData).then(res => {
- if (res.IsSuccess) {
- this.fileList.push({ url: `${res.Result.Path}` })
- this.urls.push(res.Result.Path)
- this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '' })
- }
- loading.close()
- }).catch(() => {
- loading.close()
- })
+ var file = await this.fileToBlob(param.file)
+ const res = await this.OSSclient.put(`/${this.trialId}/ReadAttachment/${this.subjectId}/${this.visitTaskId}/${param.file.name}`, file)
+ this.fileList.push({ name: param.file.name, url: this.$getObjectName(res.url) })
+ this.urls.push(this.$getObjectName(res.url))
+ this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '' })
+ loading.close()
},
handleBeforeUpload(file) {
// 检测文件类型是否符合要求
diff --git a/src/views/trials/trials-panel/setting/trial-config/components/processConfig.vue b/src/views/trials/trials-panel/setting/trial-config/components/processConfig.vue
index f9c30fb5..9e7389ce 100644
--- a/src/views/trials/trials-panel/setting/trial-config/components/processConfig.vue
+++ b/src/views/trials/trials-panel/setting/trial-config/components/processConfig.vue
@@ -1431,10 +1431,11 @@ export default {
})
},
handleDownloadTpl(row) {
- this.listLoading = true
- DownloadTrialClinicalFile(row.Id).then(data => {
- this.listLoading = false
- }).catch(() => { this.listLoading = false })
+ window.open(this.OSSclientConfig.basePath + row.Path)
+ // this.listLoading = true
+ // DownloadTrialClinicalFile(row.Id).then(data => {
+ // this.listLoading = false
+ // }).catch(() => { this.listLoading = false })
},
handleSelectable(row) {
if (!row.IsApply) {