From 5ec969c2f92874f9728b0f6b291c034329305aa9 Mon Sep 17 00:00:00 2001 From: caiyiling <1321909229@qq.com> Date: Sat, 8 Feb 2025 11:30:07 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=B8=B4=E5=BA=8A=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=A1=A5=E5=85=85=E8=8B=B1=E6=96=87=E6=A8=A1=E6=9D=BF=E5=8F=8A?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ClinicalDataConfig.vue | 25 ++++- .../template/components/ClinicalDataForm.vue | 65 +++++++++++++ .../personnel-manage/components/site.vue | 4 + .../components/clinicalDataForm.vue | 91 +++++++++++++++++-- .../trial-config/components/processConfig.vue | 15 ++- .../reading-period/components/AddOrEditCD.vue | 3 +- .../components/ClinicalData.vue | 9 +- .../subject/reading-period/index.vue | 4 +- 8 files changed, 196 insertions(+), 20 deletions(-) diff --git a/src/views/dictionary/template/components/ClinicalDataConfig.vue b/src/views/dictionary/template/components/ClinicalDataConfig.vue index 9fda81a4..21bf65ff 100644 --- a/src/views/dictionary/template/components/ClinicalDataConfig.vue +++ b/src/views/dictionary/template/components/ClinicalDataConfig.vue @@ -109,6 +109,15 @@ {{ scope.row.FileName }} + + + {{ scope.row.EnFileName }} + + + 下载 + + 下载 @@ -258,8 +277,8 @@ export default { }).catch(() => { this.loading = false }) }) }, - handleDownloadTpl(row) { - window.open(this.OSSclientConfig.basePath + row.Path, '_blank') + handleDownloadTpl(path) { + window.open(this.OSSclientConfig.basePath + path, '_blank') }, // 排序 handleSortByColumn(column) { diff --git a/src/views/dictionary/template/components/ClinicalDataForm.vue b/src/views/dictionary/template/components/ClinicalDataForm.vue index 719c700d..4834c181 100644 --- a/src/views/dictionary/template/components/ClinicalDataForm.vue +++ b/src/views/dictionary/template/components/ClinicalDataForm.vue @@ -113,6 +113,34 @@ + + + + 选择 + + (必须是doc/docx格式) + + + + + @@ -160,6 +188,8 @@ export default { UploadRole: null, FileName: '', Path: '', + EnFileName: '', + EnPath: '', IsEnable: true, CriterionEnumList: [] }, @@ -173,6 +203,7 @@ export default { loading: false, btnLoading: false, fileList: [], + enFileList: [], systemCriterionSelectList: [] } }, @@ -195,6 +226,14 @@ export default { } ] } + if (this.data.EnPath) { + this.enFileList = [ + { + name: this.data.EnFileName, + path: this.data.EnPath + } + ] + } } }, save() { @@ -249,6 +288,32 @@ export default { handleExceed(files, fileList) { this.$message.warning(`只允许上传一个文件`) }, + beforeUploadEnFile(file) { + // 检测文件类型是否符合要求 + if (this.checkFileSuffix(file.name)) { + this.enFileList = [] + return true + } else { + this.$alert('(必须是doc/docx格式)') + + return false + } + }, + async handleUploadEnFile(param) { + this.loading = true + var fileBlob = await this.fileToBlob(param.file) + const res = await this.OSSclient.put(`/System/ClinicalDataTemplate/${param.file.name}`, fileBlob) + this.form.EnFileName = res.name + this.form.EnPath = this.$getObjectName(res.url) + let file = { name: res.name, path: this.$getObjectName(res.url), url:this.$getObjectName(res.url) } + this.enFileList.push(file) + this.loading = false + }, + handleRemoveEnFile() { + this.enFileList = [] + this.form.EnPath = '' + this.form.EnFileName = '' + }, checkFileSuffix(fileName) { var typeArr = ['doc', 'docx'] var extendName = fileName.substring(fileName.lastIndexOf('.') + 1).toLocaleLowerCase() diff --git a/src/views/trials/trials-panel/setting/personnel-manage/components/site.vue b/src/views/trials/trials-panel/setting/personnel-manage/components/site.vue index 5a9e1ada..fb398151 100644 --- a/src/views/trials/trials-panel/setting/personnel-manage/components/site.vue +++ b/src/views/trials/trials-panel/setting/personnel-manage/components/site.vue @@ -194,6 +194,7 @@ { this.listLoading = false diff --git a/src/views/trials/trials-panel/setting/trial-config/components/clinicalDataForm.vue b/src/views/trials/trials-panel/setting/trial-config/components/clinicalDataForm.vue index c115996c..72903e97 100644 --- a/src/views/trials/trials-panel/setting/trial-config/components/clinicalDataForm.vue +++ b/src/views/trials/trials-panel/setting/trial-config/components/clinicalDataForm.vue @@ -145,6 +145,37 @@ + + + + + + {{ + $t('trials:processCfg:button:select') + }} + + + {{ $t('system:tip:file:docx') }} + + + +