From 07b58b41c5e7d6be32a7a427d5a5cb3fc368d04e Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Tue, 9 Nov 2021 14:17:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):=20cs?= =?UTF-8?q?v=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/config/KafkaConfig.java | 4 +- .../scenario/variable/CsvFileUpload.vue | 219 ++++++++++-------- .../scenario/variable/VariableList.vue | 30 ++- 3 files changed, 151 insertions(+), 102 deletions(-) diff --git a/backend/src/main/java/io/metersphere/config/KafkaConfig.java b/backend/src/main/java/io/metersphere/config/KafkaConfig.java index 61e8f7e699..c424fef520 100644 --- a/backend/src/main/java/io/metersphere/config/KafkaConfig.java +++ b/backend/src/main/java/io/metersphere/config/KafkaConfig.java @@ -7,9 +7,9 @@ import org.springframework.kafka.config.TopicBuilder; @Configuration public class KafkaConfig { // 执行内容监听 - public final static String EXEC_TOPIC = "ms-automation-exec-topic"; + public final static String EXEC_TOPIC = "ms-automation-exec-topic123"; //执行结果回传 - public static final String TOPICS = "ms-api-exec-topic"; + public static final String TOPICS = "ms-api-exec-topic123"; @Bean public NewTopic apiExecTopic() { 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 69cb63c0b2..8c0c50e238 100644 --- a/frontend/src/business/components/api/automation/scenario/variable/CsvFileUpload.vue +++ b/frontend/src/business/components/api/automation/scenario/variable/CsvFileUpload.vue @@ -1,125 +1,152 @@ diff --git a/frontend/src/business/components/api/automation/scenario/variable/VariableList.vue b/frontend/src/business/components/api/automation/scenario/variable/VariableList.vue index d1ab9a5265..b762bded21 100644 --- a/frontend/src/business/components/api/automation/scenario/variable/VariableList.vue +++ b/frontend/src/business/components/api/automation/scenario/variable/VariableList.vue @@ -200,7 +200,7 @@ export default { if (data) { let keyValues = this._handleBatchVars(data); keyValues.forEach(item => { - this.format(this.headers,item); + this.format(this.headers, item); }); } }, @@ -229,7 +229,7 @@ export default { } }, handleClick(command) { - this.editData = {delimiter: ",",quotedData: 'false'}; + this.editData = {delimiter: ",", quotedData: 'false'}; this.editData.type = command; this.addParameters(this.editData); }, @@ -298,10 +298,32 @@ export default { this.$warning("请选择一条数据删除"); return; } + let message = ""; ids.forEach(row => { - const index = this.variables.findIndex(d => d.id === row); - this.variables.splice(index, 1); + const v = this.variables.find(d => d.id === row); + if (v && v.type === 'CSV' && v.name) { + message += v.name + ";"; + } }); + if (message !== "") { + message = message.substr(0, message.length - 1); + this.$alert('是否确认删除CSV:【 ' + message + " 】?", '', { + confirmButtonText: this.$t('commons.confirm'), + callback: (action) => { + if (action === 'confirm') { + ids.forEach(row => { + const index = this.variables.findIndex(d => d.id === row); + this.variables.splice(index, 1); + }); + } + } + }); + } else { + ids.forEach(row => { + const index = this.variables.findIndex(d => d.id === row); + this.variables.splice(index, 1); + }); + } this.selection = []; this.editData = {type: "CONSTANT"}; },