diff --git a/frontend/src/business/components/api/definition/ApiDefinition.vue b/frontend/src/business/components/api/definition/ApiDefinition.vue
index a394f1ca61..4f6293dec4 100644
--- a/frontend/src/business/components/api/definition/ApiDefinition.vue
+++ b/frontend/src/business/components/api/definition/ApiDefinition.vue
@@ -63,7 +63,7 @@
-
@@ -215,6 +215,10 @@
this.apiTabs = tabs.filter(tab => tab.name !== targetName);
this.refresh();
},
+ //创建左侧树的根目录模块
+ createRootModel(){
+ this.$refs.nodeTree.createRootModel();
+ },
handleTabsEdit(targetName, action, api) {
if (!getCurrentProjectID()) {
this.$warning(this.$t('commons.check_project_tip'));
diff --git a/frontend/src/business/components/api/definition/components/ApiConfig.vue b/frontend/src/business/components/api/definition/components/ApiConfig.vue
index 2f3ef68ada..393c6e780a 100644
--- a/frontend/src/business/components/api/definition/components/ApiConfig.vue
+++ b/frontend/src/business/components/api/definition/components/ApiConfig.vue
@@ -2,16 +2,16 @@
-
-
-
-
@@ -75,6 +75,9 @@
this.$emit('runTest', data);
})
},
+ createRootModelInTree(){
+ this.$emit("createRootModel");
+ },
getMaintainerOptions() {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
diff --git a/frontend/src/business/components/api/definition/components/complete/BasisApi.vue b/frontend/src/business/components/api/definition/components/complete/BasisApi.vue
index 13544bc4da..e964545917 100644
--- a/frontend/src/business/components/api/definition/components/complete/BasisApi.vue
+++ b/frontend/src/business/components/api/definition/components/complete/BasisApi.vue
@@ -11,7 +11,17 @@
-
+
+
+
+
+
+
+ {{$t('api_test.definition.select_comp.no_data')}},
+ {{$t('api_test.definition.select_comp.add_data')}}
+
+
+
@@ -115,7 +125,10 @@
this.$emit('callback');
}
})
- }
+ },
+ createModules(){
+ this.$emit("createRootModelInTree");
+ },
}
}
diff --git a/frontend/src/business/components/api/definition/components/complete/EditCompleteDubboApi.vue b/frontend/src/business/components/api/definition/components/complete/EditCompleteDubboApi.vue
index 84380d6fa3..fb8a41a3ce 100644
--- a/frontend/src/business/components/api/definition/components/complete/EditCompleteDubboApi.vue
+++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteDubboApi.vue
@@ -16,7 +16,7 @@
-
+
@@ -71,7 +71,10 @@
this.basisData.request = this.request;
this.$emit('runTest', this.basisData);
}
- }
+ },
+ createRootModelInTree(){
+ this.$emit("createRootModelInTree");
+ },
},
computed: {}
diff --git a/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue b/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue
index 9648a9bbb3..1561e5484b 100644
--- a/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue
+++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue
@@ -36,7 +36,17 @@
-
+
+
+
+
+
+
+ {{$t('api_test.definition.select_comp.no_data')}},
+ {{$t('api_test.definition.select_comp.add_data')}}
+
+
+
@@ -96,6 +106,7 @@
import {REQ_METHOD, API_STATUS} from "../../model/JsonData";
import MsJsr233Processor from "../processor/Jsr233Processor";
import {KeyValue} from "../../model/ApiTestModel";
+ // import {append} from "./../../../../track/common/NodeTree";
export default {
name: "MsAddCompleteHttpApi",
@@ -161,6 +172,9 @@
}
})
},
+ createModules(){
+ this.$emit("createRootModelInTree");
+ },
getPath(id) {
if (id === null) {
return null;
diff --git a/frontend/src/business/components/api/definition/components/complete/EditCompleteSQLApi.vue b/frontend/src/business/components/api/definition/components/complete/EditCompleteSQLApi.vue
index 54bc58ea4e..4ca16a2d0b 100644
--- a/frontend/src/business/components/api/definition/components/complete/EditCompleteSQLApi.vue
+++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteSQLApi.vue
@@ -15,7 +15,7 @@
-
+
@@ -70,6 +70,9 @@
this.$emit('runTest', this.basisData);
}
},
+ createRootModelInTree(){
+ this.$emit("createRootModelInTree");
+ },
},
}
diff --git a/frontend/src/business/components/api/definition/components/complete/EditCompleteTCPApi.vue b/frontend/src/business/components/api/definition/components/complete/EditCompleteTCPApi.vue
index 5e24359337..6d26a4da03 100644
--- a/frontend/src/business/components/api/definition/components/complete/EditCompleteTCPApi.vue
+++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteTCPApi.vue
@@ -15,7 +15,7 @@
-
+
@@ -70,7 +70,10 @@
this.basisData.request = this.request;
this.$emit('runTest', this.basisData);
}
- }
+ },
+ createRootModelInTree(){
+ this.$emit("createRootModelInTree");
+ },
},
}
diff --git a/frontend/src/business/components/api/definition/components/module/ApiModule.vue b/frontend/src/business/components/api/definition/components/module/ApiModule.vue
index cb9844960a..73e221ba19 100644
--- a/frontend/src/business/components/api/definition/components/module/ApiModule.vue
+++ b/frontend/src/business/components/api/definition/components/module/ApiModule.vue
@@ -176,6 +176,13 @@
this.$emit("nodeSelectEvent", node, nodeIds, pNodes);
}
},
+ //创建根目录的模块---供父类使用
+ createRootModel(){
+ let dataArr = this.$refs.nodeTree.extendTreeNodes;
+ if(dataArr.length>0){
+ this.$refs.nodeTree.append({},dataArr[0]);
+ }
+ },
exportAPI() {
this.$emit('exportAPI');
},
diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js
index bfd52faaa2..ea681e8867 100644
--- a/frontend/src/i18n/en-US.js
+++ b/frontend/src/i18n/en-US.js
@@ -505,6 +505,10 @@ export default {
api_case_status: "Ise case status",
api_case_passing_rate: "Use case pass rate",
create_tip: "Note: Detailed interface information can be filled out on the edit page",
+ select_comp:{
+ no_data:"No Data",
+ add_data:"Add Data"
+ },
request: {
grade_info: "Filter by rank",
run_env: "Operating environment",
diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js
index cf5240928b..e5af616f2e 100644
--- a/frontend/src/i18n/zh-CN.js
+++ b/frontend/src/i18n/zh-CN.js
@@ -503,6 +503,10 @@ export default {
api_case_status: "用例状态",
api_case_passing_rate: "用例通过率",
create_tip: "注: 详细的接口信息可以在编辑页面填写",
+ select_comp:{
+ no_data:"无数据",
+ add_data:"去添加"
+ },
request: {
grade_info: "按等级筛选",
run_env: "运行环境",
diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js
index a0aee26147..aa11d8a947 100644
--- a/frontend/src/i18n/zh-TW.js
+++ b/frontend/src/i18n/zh-TW.js
@@ -503,6 +503,10 @@ export default {
api_case_status: "用例狀態",
api_case_passing_rate: "用例通過率",
create_tip: "註: 詳細的接口信息可以在編輯頁面填寫",
+ select_comp:{
+ no_data:"無數據",
+ add_data:"去添加"
+ },
request: {
grade_info: "按等級筛选",
run_env: "運行環境",