diff --git a/frontend/src/business/components/api/definition/ApiDefinition.vue b/frontend/src/business/components/api/definition/ApiDefinition.vue
index 9418af867a..ce2f5d5a9e 100644
--- a/frontend/src/business/components/api/definition/ApiDefinition.vue
+++ b/frontend/src/business/components/api/definition/ApiDefinition.vue
@@ -999,7 +999,6 @@ export default {
.ms-api-div {
overflow-y: auto;
- height: calc(100vh - 125px)
}
/deep/ .el-main {
diff --git a/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue b/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue
index b9afa880d7..645488d42a 100644
--- a/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue
+++ b/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue
@@ -33,7 +33,7 @@
-
+
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 3dc1a2d867..5e5bb2c252 100644
--- a/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue
+++ b/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue
@@ -161,7 +161,9 @@ export default {
//默认最大化
this.$nextTick(() => {
- this.$refs.testCaseDrawer.setfullScreen();
+ if (this.$refs.testCaseDrawer) {
+ this.$refs.testCaseDrawer.setfullScreen();
+ }
});
},
add(api) {
@@ -225,8 +227,10 @@ export default {
}
}
}
- let item = this.apiCaseList[index];
- this.$refs.apiCaseItem[index].saveTestCase(item, hideAlert);
+ if (this.apiCaseList && this.apiCaseList.length !== 0) {
+ let item = this.apiCaseList[index];
+ this.$refs.apiCaseItem[index].saveTestCase(item, hideAlert);
+ }
},
saveApiAndCase(api) {
if (api && api.url) {
@@ -489,11 +493,14 @@ export default {
this.condition.apiDefinitionId = this.api.id;
this.result = this.$post("/api/testcase/list", this.condition, response => {
let data = response.data;
- if (data) {
+ if (data && data.length > 0) {
data.forEach(apiCase => {
this.formatCase(apiCase);
});
this.apiCaseList = data;
+ } else {
+ this.$warning(this.$t('commons.please_add_api_case'));
+ return;
}
});
}
diff --git a/frontend/src/business/components/common/components/MsMainContainer.vue b/frontend/src/business/components/common/components/MsMainContainer.vue
index e27b3388b5..05715c6213 100644
--- a/frontend/src/business/components/common/components/MsMainContainer.vue
+++ b/frontend/src/business/components/common/components/MsMainContainer.vue
@@ -5,16 +5,15 @@
diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js
index bcd9224dc5..2f3f9c3fa2 100644
--- a/frontend/src/i18n/en-US.js
+++ b/frontend/src/i18n/en-US.js
@@ -237,6 +237,7 @@ export default {
no_corresponding: "No corresponding",
code_template: "code template",
api_case: "Api Case",
+ please_add_api_case: "Please add api case",
scenario_case: "Scenario Case",
task_center: "Task center",
task_close: "Put away",
diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js
index 52f7f3dd43..7bf87e7de0 100644
--- a/frontend/src/i18n/zh-CN.js
+++ b/frontend/src/i18n/zh-CN.js
@@ -238,6 +238,7 @@ export default {
no_corresponding: "无对应的",
code_template: "代码模版",
api_case: "接口用例",
+ please_add_api_case: "请先添加接口用例",
scenario_case: "场景用例",
task_center: "任务中心",
task_close: "收起",
diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js
index c187287903..654a6cf185 100644
--- a/frontend/src/i18n/zh-TW.js
+++ b/frontend/src/i18n/zh-TW.js
@@ -238,6 +238,7 @@ export default {
no_corresponding: "無對應的",
code_template: "代碼模版",
api_case: "接口用例",
+ please_add_api_case: "请先添加接口用例",
scenario_case: "場景用例",
task_center: "任務中心",
task_close: "收起",