From b02868245b8994a5d378db8427a595ec6072919f Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Wed, 24 Mar 2021 10:15:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):=20?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E6=89=A7=E8=A1=8Cdubbo=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=E4=B8=8D=E5=BC=BA=E5=88=B6=E9=80=89=E6=8B=A9=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../definition/components/case/ApiCaseItem.vue | 15 ++++++++------- .../definition/components/case/ApiCaseList.vue | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) 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 2d1ef42868..214901efcd 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue @@ -129,9 +129,10 @@ import MsJmxStep from "../step/JmxStep"; import ApiResponseComponent from "../../../automation/scenario/component/ApiResponseComponent"; import ShowMoreBtn from "../../../../track/case/components/ShowMoreBtn"; + const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/); - const esbDefinition = (requireComponent!=null&&requireComponent.keys().length) > 0 ? requireComponent("./apidefinition/EsbDefinition.vue") : {}; - const esbDefinitionResponse = (requireComponent!=null&&requireComponent.keys().length) > 0 ? requireComponent("./apidefinition/EsbDefinitionResponse.vue") : {}; + const esbDefinition = (requireComponent != null && requireComponent.keys().length) > 0 ? requireComponent("./apidefinition/EsbDefinition.vue") : {}; + const esbDefinitionResponse = (requireComponent != null && requireComponent.keys().length) > 0 ? requireComponent("./apidefinition/EsbDefinitionResponse.vue") : {}; export default { name: "ApiCaseItem", @@ -157,7 +158,7 @@ return { result: {}, grades: [], - showXpackCompnent:false, + showXpackCompnent: false, isReadOnly: false, selectedEvent: Object, priorities: PRIORITY, @@ -198,7 +199,7 @@ isCaseEdit: Boolean, }, created() { - if (requireComponent != null && JSON.stringify(esbDefinition) != '{}'&& JSON.stringify(esbDefinitionResponse) != '{}') { + if (requireComponent != null && JSON.stringify(esbDefinition) != '{}' && JSON.stringify(esbDefinitionResponse) != '{}') { this.showXpackCompnent = true; } }, @@ -224,7 +225,7 @@ }); }, singleRun(data) { - if (!this.environment) { + if (this.api.protocol != "DUBBO" && this.api.protocol != "dubbo://" && !this.environment) { this.$warning(this.$t('api_test.environment.select_environment')); return; } @@ -316,10 +317,10 @@ } } - if(tmp.request.esbDataStruct != null){ + if (tmp.request.esbDataStruct != null) { tmp.esbDataStruct = JSON.stringify(tmp.request.esbDataStruct); } - if(tmp.request.backEsbDataStruct != null){ + if (tmp.request.backEsbDataStruct != null) { tmp.backEsbDataStruct = JSON.stringify(tmp.request.backEsbDataStruct); } diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue index cdc7166ee4..91d409047f 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue @@ -280,7 +280,7 @@ }, singleRun(row) { - if (!this.environment) { + if (this.currentApi.protocol != "DUBBO" && this.currentApi.protocol != "dubbo://" && !this.environment) { this.$warning(this.$t('api_test.environment.select_environment')); return; } @@ -298,7 +298,7 @@ }, batchRun() { - if (!this.environment) { + if (this.currentApi.protocol != "DUBBO" && this.currentApi.protocol != "dubbo://" && !this.environment) { this.$warning(this.$t('api_test.environment.select_environment')); return; }