From 85e320910e9c11b8469b511ca876b52fbba7ebe4 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Sun, 27 Sep 2020 15:09:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=B7=E6=B1=82=E5=A4=B4=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/java/io/metersphere/xpack | 2 +- .../api/test/components/ApiKeyValue.vue | 10 +---- .../api/test/components/ApiScenarioForm.vue | 2 +- .../test/components/ApiScenarioVariables.vue | 39 ++----------------- frontend/src/business/components/xpack | 2 +- 5 files changed, 9 insertions(+), 46 deletions(-) diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index c2dacf960c..cf6b065263 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit c2dacf960cdb1ed35664bdd3432120b1203b73d8 +Subproject commit cf6b06526324326a563d933e07118fac014a63b4 diff --git a/frontend/src/business/components/api/test/components/ApiKeyValue.vue b/frontend/src/business/components/api/test/components/ApiKeyValue.vue index 1872d88f8b..5cd862e449 100644 --- a/frontend/src/business/components/api/test/components/ApiKeyValue.vue +++ b/frontend/src/business/components/api/test/components/ApiKeyValue.vue @@ -5,7 +5,7 @@
- + @@ -19,6 +19,7 @@ show-word-limit/> + @@ -42,7 +43,6 @@ keyPlaceholder: String, valuePlaceholder: String, description: String, - isShowEnable: Boolean, items: Array, isReadOnly: { type: Boolean, @@ -52,7 +52,6 @@ }, data() { return { - // checkedValues: [] } }, computed: { @@ -66,11 +65,6 @@ methods: { remove: function (index) { - if (this.isShowEnable) { - // 移除勾选内容 - let checkIndex = this.checkedValues.indexOf(this.items[index].uuid); - checkIndex != -1 ? this.checkedValues.splice(checkIndex, 1) : this.checkedValues; - } // 移除整行输入控件及内容 this.items.splice(index, 1); this.$emit('change', this.items); diff --git a/frontend/src/business/components/api/test/components/ApiScenarioForm.vue b/frontend/src/business/components/api/test/components/ApiScenarioForm.vue index 63177173ca..636b65b6f7 100644 --- a/frontend/src/business/components/api/test/components/ApiScenarioForm.vue +++ b/frontend/src/business/components/api/test/components/ApiScenarioForm.vue @@ -29,7 +29,7 @@ - diff --git a/frontend/src/business/components/api/test/components/ApiScenarioVariables.vue b/frontend/src/business/components/api/test/components/ApiScenarioVariables.vue index 6725d8fc30..236b3b2555 100644 --- a/frontend/src/business/components/api/test/components/ApiScenarioVariables.vue +++ b/frontend/src/business/components/api/test/components/ApiScenarioVariables.vue @@ -5,8 +5,8 @@
- - + @@ -41,10 +41,6 @@ type: Boolean, default: false }, - isShowEnable: { - type: Boolean, - default: false - }, showVariable: { type: Boolean, default: true @@ -52,16 +48,10 @@ }, data() { return { - checkedValues: [] } }, methods: { remove: function (index) { - if (this.isShowEnable) { - // 移除勾选内容 - let checkIndex = this.checkedValues.indexOf(this.items[index].uuid); - checkIndex != -1 ? this.checkedValues.splice(checkIndex, 1) : this.checkedValues; - } this.items.splice(index, 1); this.$emit('change', this.items); }, @@ -69,10 +59,6 @@ let isNeedCreate = true; let removeIndex = -1; this.items.forEach((item, index) => { - // 启用行赋值 - if (this.isShowEnable) { - item.enable = this.checkedValues.indexOf(item.uuid) != -1 ? true : false; - } if (!item.name && !item.value) { // 多余的空行 if (index !== this.items.length - 1) { @@ -83,20 +69,11 @@ } }); if (isNeedCreate) { - // 往后台送入的复选框值布尔值 - if (this.isShowEnable) { - this.items[this.items.length - 1].enable = true; - // v-model 选中状态 - this.checkedValues.push(this.items[this.items.length - 1].uuid); - } - this.items.push(new KeyValue()); + this.items.push(new KeyValue({enable: true})); } this.$emit('change', this.items); // TODO 检查key重复 }, - uuid: function () { - return (((1 + Math.random()) * 0x100000) | 0).toString(16).substring(1); - }, isDisable: function (index) { return this.items.length - 1 === index; } @@ -104,15 +81,7 @@ created() { if (this.items.length === 0) { - this.items.push(new KeyValue()); - }else if (this.isShowEnable) { - this.items.forEach((item, index) => { - let uuid = this.uuid(); - item.uuid = uuid; - if (item.enable) { - this.checkedValues.push(uuid); - } - }) + this.items.push(new KeyValue({enable: true})); } } } diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index cc38137a69..06d935cd1d 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit cc38137a69a0f20fadece9c0f9f50a9468c4ace9 +Subproject commit 06d935cd1d22ab36f09763745c2aff8ad3fb08c1