From d7b000050521b87fec307933a9689002d148949d Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Mon, 6 Sep 2021 13:18:23 +0800 Subject: [PATCH] =?UTF-8?q?fix=20(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):?= =?UTF-8?q?=20case=E5=8E=86=E5=8F=B2=E6=95=B0=E6=8D=AE=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/json/JSONSchemaGenerator.java | 2 +- .../definition/components/body/ApiBody.vue | 353 ++++++++++-------- .../components/case/ApiCaseItem.vue | 10 +- .../request/http/ApiHttpRequestForm.vue | 10 + 4 files changed, 204 insertions(+), 171 deletions(-) diff --git a/backend/src/main/java/io/metersphere/commons/json/JSONSchemaGenerator.java b/backend/src/main/java/io/metersphere/commons/json/JSONSchemaGenerator.java index 0d4a5dc4a7..1da44e78a8 100644 --- a/backend/src/main/java/io/metersphere/commons/json/JSONSchemaGenerator.java +++ b/backend/src/main/java/io/metersphere/commons/json/JSONSchemaGenerator.java @@ -109,7 +109,7 @@ public class JSONSchemaGenerator { concept.put(propertyName, analyzeEnumProperty(object)); } else if (propertyObjType.equals("string")) { // 先设置空值 - concept.put(propertyName, null); + concept.put(propertyName, ""); if (object.has("format")) { String propertyFormat = object.get("format").getAsString(); if (propertyFormat.equals("date-time")) { diff --git a/frontend/src/business/components/api/definition/components/body/ApiBody.vue b/frontend/src/business/components/api/definition/components/body/ApiBody.vue index a6c2ef1818..4758851de7 100644 --- a/frontend/src/business/components/api/definition/components/body/ApiBody.vue +++ b/frontend/src/business/components/api/definition/components/body/ApiBody.vue @@ -27,211 +27,232 @@
- {{$t("commons.batch_add")}} + {{ $t("commons.batch_add") }} - +
- - + +
- +
- +
- - + - diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue index af1cb80c71..83478a7b00 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue @@ -181,12 +181,12 @@ import {TYPE_TO_C} from "@/business/components/api/automation/scenario/Setting"; export default { name: "ApiCaseItem", filters: { - ellipsis (value) { + ellipsis(value) { if (!value) { return ''; } if (value.length > 20) { - return value.slice(0,20) + '...' + return value.slice(0, 20) + '...' } return value } @@ -432,8 +432,10 @@ export default { if (tmp.tags instanceof Array) { tmp.tags = JSON.stringify(tmp.tags); } - tmp.clazzName = TYPE_TO_C.get(tmp.type); - this.sort(tmp.hashTree); + if (tmp.request) { + tmp.request.clazzName = TYPE_TO_C.get(tmp.request.type); + this.sort(tmp.request.hashTree); + } this.result = this.$fileUpload(url, null, bodyFiles, tmp, (response) => { let data = response.data; row.id = data.id; diff --git a/frontend/src/business/components/api/definition/components/request/http/ApiHttpRequestForm.vue b/frontend/src/business/components/api/definition/components/request/http/ApiHttpRequestForm.vue index 5ede845710..634db1891f 100644 --- a/frontend/src/business/components/api/definition/components/request/http/ApiHttpRequestForm.vue +++ b/frontend/src/business/components/api/definition/components/request/http/ApiHttpRequestForm.vue @@ -67,6 +67,11 @@ + + + + + @@ -93,6 +98,7 @@ import MsApiAdvancedConfig from "./ApiAdvancedConfig"; import MsJsr233Processor from "../../../../automation/scenario/component/Jsr233Processor"; import ApiDefinitionStepButton from "../components/ApiDefinitionStepButton"; + import {hasPermission} from '@/common/js/utils'; export default { name: "MsApiHttpRequestForm", @@ -176,6 +182,10 @@ }, methods: { + hasPermission, + createTestData(){ + + }, remove(row) { let index = this.request.hashTree.indexOf(row); this.request.hashTree.splice(index, 1);