From ee553a89921041785320bae2bfeffee533ac193f Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 6 Sep 2022 17:43:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=87=8D=E6=96=B0=E4=B8=8A=E4=BC=A0csv?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1016598 --user=王孝刚 【接口测试】github#17676,2.1版本本地上传方式,重新上传csv报错 https://www.tapd.cn/55049933/s/1239618 --- .../scenario/variable/CsvFileUpload.vue | 24 ++++++++++++++++--- .../components/environment/CsvFileUpload.vue | 2 ++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/variable/CsvFileUpload.vue b/frontend/src/business/components/api/automation/scenario/variable/CsvFileUpload.vue index 3ef5fca8cb..4bf3034502 100644 --- a/frontend/src/business/components/api/automation/scenario/variable/CsvFileUpload.vue +++ b/frontend/src/business/components/api/automation/scenario/variable/CsvFileUpload.vue @@ -28,7 +28,9 @@ - {{ $t('permission.project_file.associated_files') }} + {{ + $t('permission.project_file.associated_files') + }} @@ -103,7 +105,14 @@ export default { if (this.file && this.file.file) { files.push(this.file.file); } - let request = {id: getUUID(), csv: true, resourceId: this.file.id, moduleId: moduleId, projectId: getCurrentProjectID(), fileName: this.file.name}; + let request = { + id: getUUID(), + csv: true, + resourceId: this.file.id, + moduleId: moduleId, + projectId: getCurrentProjectID(), + fileName: this.file.name + }; this.$fileUpload("/file/metadata/dump/file", null, files, request, (response) => { this.$success(this.$t("organization.integration.successful_operation")); }); @@ -125,7 +134,14 @@ export default { this.$warning(this.$t('variables.cvs_info')); return; } - let file = {name: item.name, id: getUUID(), fileId: item.id, storage: "FILE_REF", projectId: item.projectId, fileType: item.type}; + let file = { + name: item.name, + id: getUUID(), + fileId: item.id, + storage: "FILE_REF", + projectId: item.projectId, + fileType: item.type + }; this.parameter.files.push(file); }) }, @@ -177,12 +193,14 @@ export default { callback: (action) => { if (action === 'confirm') { this.$refs.upload.handleRemove(file); + this.$refs.uploadLocal.handleRemove(file); for (let i = 0; i < this.parameter.files.length; i++) { let paramFileName = this.parameter.files[i].name ? this.parameter.files[i].name : this.parameter.files[i].file.name; if (fileName === paramFileName) { this.parameter.files.splice(i, 1); this.$refs.upload.handleRemove(file); + this.$refs.uploadLocal.handleRemove(file); break; } } diff --git a/frontend/src/business/components/api/test/components/environment/CsvFileUpload.vue b/frontend/src/business/components/api/test/components/environment/CsvFileUpload.vue index 251ae423f6..cd9ec5e05f 100644 --- a/frontend/src/business/components/api/test/components/environment/CsvFileUpload.vue +++ b/frontend/src/business/components/api/test/components/environment/CsvFileUpload.vue @@ -176,12 +176,14 @@ export default { callback: (action) => { if (action === 'confirm') { this.$refs.upload.handleRemove(file); + this.$refs.uploadLocal.handleRemove(file); for (let i = 0; i < this.parameter.files.length; i++) { let paramFileName = this.parameter.files[i].name ? this.parameter.files[i].name : this.parameter.files[i].file.name; if (fileName === paramFileName) { this.parameter.files.splice(i, 1); this.$refs.upload.handleRemove(file); + this.$refs.uploadLocal.handleRemove(file); break; } }