From 7ff424ad65a6cb36e5fe50b4115a49f9351f6027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E9=A3=9E?= Date: Mon, 22 Jan 2024 11:44:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E8=BD=BDbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/CommonTemplate/index.vue | 8 +-- .../template/components/CriterionFormItem.vue | 18 +++--- .../template/components/CriterionsConfig.vue | 2 +- src/views/resumeInfo/components/Resume.vue | 1 + .../enrollment/components/Approval.vue | 12 ++-- .../enrollment/components/Confirmation.vue | 12 ++-- .../enrollment/components/Selection.vue | 20 ++++--- .../enrollment/components/Submission.vue | 12 ++-- .../dicoms/components/Fusion/QuestionItem.vue | 20 +++---- .../dicoms/components/QuestionItem.vue | 20 +++---- .../customize/CustomizeQuestionFormItem.vue | 4 +- .../customize/CustomizeQuestionItem.vue | 20 +++---- .../none-dicoms/components/FormItem.vue | 20 +++---- .../components/QuestionFormItem.vue | 60 ++++++++++++------- .../components/QuestionTableFormItem.vue | 22 +++---- .../trial-config/components/processConfig.vue | 9 +-- 16 files changed, 120 insertions(+), 140 deletions(-) diff --git a/src/views/dictionary/attachment/components/CommonTemplate/index.vue b/src/views/dictionary/attachment/components/CommonTemplate/index.vue index 78419497..8e9e6fe1 100644 --- a/src/views/dictionary/attachment/components/CommonTemplate/index.vue +++ b/src/views/dictionary/attachment/components/CommonTemplate/index.vue @@ -201,10 +201,10 @@ export default { }, // 下载 handleDownload(row) { - this.loading = true - DownloadCommonDoc(row.Code).then(data => { - this.loading = false - }).catch(() => { this.loading = false }) + window.open(this.OSSclientConfig.basePath + row.Path) + // DownloadCommonDoc(row.Code).then(data => { + // this.loading = false + // }).catch(() => { this.loading = false }) }, // 编辑 handleEdit(row) { diff --git a/src/views/dictionary/template/components/CriterionFormItem.vue b/src/views/dictionary/template/components/CriterionFormItem.vue index 222b7f4e..efb01afe 100644 --- a/src/views/dictionary/template/components/CriterionFormItem.vue +++ b/src/views/dictionary/template/components/CriterionFormItem.vue @@ -320,7 +320,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'), @@ -331,16 +331,12 @@ export default { }) 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/dictionary/template/components/CriterionsConfig.vue b/src/views/dictionary/template/components/CriterionsConfig.vue index a2593066..bff628c8 100644 --- a/src/views/dictionary/template/components/CriterionsConfig.vue +++ b/src/views/dictionary/template/components/CriterionsConfig.vue @@ -349,7 +349,7 @@ export default { }, handleConfig(row) { this.rowData = { ...row } - this.config.title = `${this.$fd('LesionType', row.LesionType)}:表格问题` + this.config.title = `${this.$fd('LesionType', row.LesionType)}:${this.$t('trials:readingUnit:qsList:title:tableQs')}` this.config.visible = true }, // 查询 diff --git a/src/views/resumeInfo/components/Resume.vue b/src/views/resumeInfo/components/Resume.vue index 6babd5ac..99f28dd6 100644 --- a/src/views/resumeInfo/components/Resume.vue +++ b/src/views/resumeInfo/components/Resume.vue @@ -75,6 +75,7 @@ export default { preview(index, row) { const filePath = row.FullPath if (filePath) { + console.log(this.OSSclientConfig.basePath + filePath) window.open(this.OSSclientConfig.basePath + filePath, '_blank') } }, diff --git a/src/views/trials/trials-panel/attachments/enrollment/components/Approval.vue b/src/views/trials/trials-panel/attachments/enrollment/components/Approval.vue index ff64e656..eabfc1b0 100644 --- a/src/views/trials/trials-panel/attachments/enrollment/components/Approval.vue +++ b/src/views/trials/trials-panel/attachments/enrollment/components/Approval.vue @@ -26,14 +26,7 @@ sortable="custom" > @@ -109,6 +102,9 @@ export default { }, created() { this.initPage() }, methods: { + go(path) { + window.open(path) + }, initPage() { this.getList() }, diff --git a/src/views/trials/trials-panel/attachments/enrollment/components/Confirmation.vue b/src/views/trials/trials-panel/attachments/enrollment/components/Confirmation.vue index ddd24a33..2884b453 100644 --- a/src/views/trials/trials-panel/attachments/enrollment/components/Confirmation.vue +++ b/src/views/trials/trials-panel/attachments/enrollment/components/Confirmation.vue @@ -37,14 +37,7 @@ sortable="custom" > @@ -124,6 +117,9 @@ export default { }, created() { this.initPage() }, methods: { + go(path) { + window.open(path) + }, initPage() { this.getList() }, diff --git a/src/views/trials/trials-panel/attachments/enrollment/components/Selection.vue b/src/views/trials/trials-panel/attachments/enrollment/components/Selection.vue index 9c85b374..6e6c2db2 100644 --- a/src/views/trials/trials-panel/attachments/enrollment/components/Selection.vue +++ b/src/views/trials/trials-panel/attachments/enrollment/components/Selection.vue @@ -124,14 +124,15 @@ sortable="custom" > @@ -299,6 +300,9 @@ export default { }, created() { this.initPage() }, methods: { + go(path) { + window.open(path) + }, initPage() { this.getList() store.dispatch('global/getHospital') diff --git a/src/views/trials/trials-panel/attachments/enrollment/components/Submission.vue b/src/views/trials/trials-panel/attachments/enrollment/components/Submission.vue index 9fd13cea..5827918d 100644 --- a/src/views/trials/trials-panel/attachments/enrollment/components/Submission.vue +++ b/src/views/trials/trials-panel/attachments/enrollment/components/Submission.vue @@ -47,14 +47,7 @@ min-width="120" > @@ -168,6 +161,9 @@ export default { }, created() { this.initPage() }, methods: { + go(path) { + window.open(path) + }, initPage() { this.getList() }, diff --git a/src/views/trials/trials-panel/reading/dicoms/components/Fusion/QuestionItem.vue b/src/views/trials/trials-panel/reading/dicoms/components/Fusion/QuestionItem.vue index fb45fac8..1ddd5548 100644 --- a/src/views/trials/trials-panel/reading/dicoms/components/Fusion/QuestionItem.vue +++ b/src/views/trials/trials-panel/reading/dicoms/components/Fusion/QuestionItem.vue @@ -325,7 +325,7 @@ export default { locateAnnotation(question) { this.$emit('locateAnnotation', question) }, - uploadScreenshot(param) { + async uploadScreenshot(param) { if (!this.visitTaskId) return const loading = this.$loading({ target: document.querySelector('.ecrf-wrapper'), @@ -334,18 +334,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/reading/dicoms/components/QuestionItem.vue b/src/views/trials/trials-panel/reading/dicoms/components/QuestionItem.vue index 1729a1f0..d767269c 100644 --- a/src/views/trials/trials-panel/reading/dicoms/components/QuestionItem.vue +++ b/src/views/trials/trials-panel/reading/dicoms/components/QuestionItem.vue @@ -376,7 +376,7 @@ export default { locateAnnotation(question) { this.$emit('locateAnnotation', question) }, - uploadScreenshot(param) { + async uploadScreenshot(param) { if (!this.visitTaskId) return const loading = this.$loading({ target: document.querySelector('.ecrf-wrapper'), @@ -385,18 +385,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/reading/dicoms/customize/CustomizeQuestionFormItem.vue b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionFormItem.vue index 9200d9b7..adac806a 100644 --- a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionFormItem.vue +++ b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionFormItem.vue @@ -207,7 +207,7 @@ :class="{disabled:fileList.length >= question.ImageCount}" > - 上传附件 + {{this.$t('common:button:upload')}} @@ -680,7 +680,7 @@ export default { }, openAddTableCol(row, index) { 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 if (!index && index !== 0) { diff --git a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionItem.vue b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionItem.vue index 536e5c80..1dbabdb0 100644 --- a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionItem.vue +++ b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionItem.vue @@ -264,7 +264,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('.el-button'), @@ -272,18 +272,12 @@ export default { lock: true, 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: `/api/${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/reading/none-dicoms/components/FormItem.vue b/src/views/trials/trials-panel/reading/none-dicoms/components/FormItem.vue index d2b8e707..32fbab6f 100644 --- a/src/views/trials/trials-panel/reading/none-dicoms/components/FormItem.vue +++ b/src/views/trials/trials-panel/reading/none-dicoms/components/FormItem.vue @@ -266,7 +266,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'), @@ -275,18 +275,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/reading-unit/components/QuestionFormItem.vue b/src/views/trials/trials-panel/setting/reading-unit/components/QuestionFormItem.vue index e13dedde..ba07e7b2 100644 --- a/src/views/trials/trials-panel/setting/reading-unit/components/QuestionFormItem.vue +++ b/src/views/trials/trials-panel/setting/reading-unit/components/QuestionFormItem.vue @@ -230,7 +230,7 @@ :visible.sync="imgVisible" width="600px" > - +
{{ $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) {