diff --git a/frontend/src/business/components/api/test/components/ApiAssertionText.vue b/frontend/src/business/components/api/test/components/ApiAssertionText.vue
index 9916f71637..20bc6840c6 100644
--- a/frontend/src/business/components/api/test/components/ApiAssertionText.vue
+++ b/frontend/src/business/components/api/test/components/ApiAssertionText.vue
@@ -4,19 +4,19 @@
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
diff --git a/frontend/src/business/components/api/test/components/ApiKeyValue.vue b/frontend/src/business/components/api/test/components/ApiKeyValue.vue
index ed90e30d78..12aff27318 100644
--- a/frontend/src/business/components/api/test/components/ApiKeyValue.vue
+++ b/frontend/src/business/components/api/test/components/ApiKeyValue.vue
@@ -12,8 +12,21 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -31,45 +44,33 @@
items: Array
},
+ data() {
+ return {
+ kv: new KeyValue()
+ }
+ },
+
methods: {
add: function () {
- this.items.push(new KeyValue());
+ if (this.kv.key || this.kv.value) {
+ this.items.push(this.kv);
+ this.kv = new KeyValue();
+ }
},
remove: function (index) {
this.items.splice(index, 1);
- if (this.items.length === 0) {
- this.add();
- }
},
check: function () {
- let isNeedCreate = true;
let removeIndex = -1;
this.items.forEach((item, index) => {
if (!item.key && !item.value) {
- // 多余的空行
- if (index !== this.items.length - 1) {
- removeIndex = index;
- }
- // 没有空行,需要创建空行
- isNeedCreate = false;
+ removeIndex = index;
}
});
- if (isNeedCreate) {
- this.add();
- }
if (removeIndex !== -1) {
this.remove(removeIndex);
}
// TODO 检查key重复
- },
- isDisable: function (index) {
- return this.items.length - 1 === index;
- }
- },
-
- created() {
- if (this.items.length === 0) {
- this.add();
}
}
}
diff --git a/frontend/src/business/components/api/test/components/ApiRequestConfig.vue b/frontend/src/business/components/api/test/components/ApiRequestConfig.vue
index 9746e52699..7e6f87a15d 100644
--- a/frontend/src/business/components/api/test/components/ApiRequestConfig.vue
+++ b/frontend/src/business/components/api/test/components/ApiRequestConfig.vue
@@ -11,7 +11,7 @@
-
+
复制请求
删除请求
diff --git a/frontend/src/business/components/api/test/components/ApiRequestForm.vue b/frontend/src/business/components/api/test/components/ApiRequestForm.vue
index 0ddf3375e9..34b0791f57 100644
--- a/frontend/src/business/components/api/test/components/ApiRequestForm.vue
+++ b/frontend/src/business/components/api/test/components/ApiRequestForm.vue
@@ -1,20 +1,20 @@
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -30,7 +30,7 @@
-
+
TODO
diff --git a/frontend/src/business/components/api/test/components/ApiScenarioConfig.vue b/frontend/src/business/components/api/test/components/ApiScenarioConfig.vue
index 99e50313f0..7b9d508e10 100644
--- a/frontend/src/business/components/api/test/components/ApiScenarioConfig.vue
+++ b/frontend/src/business/components/api/test/components/ApiScenarioConfig.vue
@@ -18,14 +18,13 @@
-
+
-
-
+
+
diff --git a/frontend/src/business/components/api/test/components/ApiScenarioForm.vue b/frontend/src/business/components/api/test/components/ApiScenarioForm.vue
index 59c0de6f83..52c1d2769e 100644
--- a/frontend/src/business/components/api/test/components/ApiScenarioForm.vue
+++ b/frontend/src/business/components/api/test/components/ApiScenarioForm.vue
@@ -1,7 +1,7 @@
-
+