fix(接口定义): 修改默认模块
This commit is contained in:
parent
61f7a82371
commit
e0182038b9
|
@ -243,7 +243,7 @@ public class ApiAutomationService {
|
|||
scenario.setUserId(request.getUserId());
|
||||
}
|
||||
if (StringUtils.isEmpty(request.getApiScenarioModuleId()) || StringUtils.isEmpty(request.getModulePath())) {
|
||||
scenario.setApiScenarioModuleId("root");
|
||||
scenario.setApiScenarioModuleId("default-module");
|
||||
scenario.setModulePath("/默认模块");
|
||||
}
|
||||
return scenario;
|
||||
|
|
|
@ -264,7 +264,7 @@ public class ApiDefinitionService {
|
|||
test.setTags(request.getTags());
|
||||
if (StringUtils.isEmpty(request.getModulePath()) || StringUtils.isEmpty(request.getModuleId())) {
|
||||
test.setModulePath("/默认模块");
|
||||
test.setModuleId("root");
|
||||
test.setModuleId("default-module");
|
||||
}
|
||||
apiDefinitionMapper.updateByPrimaryKeySelective(test);
|
||||
return test;
|
||||
|
@ -292,7 +292,7 @@ public class ApiDefinitionService {
|
|||
test.setModuleId(request.getModuleId());
|
||||
if (StringUtils.isEmpty(request.getModulePath()) || StringUtils.isEmpty(request.getModuleId())) {
|
||||
test.setModulePath("/默认模块");
|
||||
test.setModuleId("root");
|
||||
test.setModuleId("default-module");
|
||||
}
|
||||
test.setResponse(JSONObject.toJSONString(request.getResponse()));
|
||||
test.setEnvironmentId(request.getEnvironmentId());
|
||||
|
@ -605,7 +605,7 @@ public class ApiDefinitionService {
|
|||
for (int i = 0; i < data.size(); i++) {
|
||||
ApiDefinitionWithBLOBs item = data.get(i);
|
||||
if (StringUtils.isEmpty(item.getModuleId()) || StringUtils.isEmpty(item.getModulePath())) {
|
||||
item.setModuleId("root");
|
||||
item.setModuleId("default-module");
|
||||
item.setModulePath("/默认模块");
|
||||
}
|
||||
if (item.getName().length() > 255) {
|
||||
|
|
|
@ -296,7 +296,7 @@
|
|||
}
|
||||
let api = {
|
||||
status: "Underway", method: "GET", userId: getCurrentUser().id,
|
||||
url: "", protocol: this.currentProtocol, environmentId: "", moduleId: 'root', modulePath: "/" + this.$t("commons.module_title")
|
||||
url: "", protocol: this.currentProtocol, environmentId: "", moduleId: 'default-module', modulePath: "/" + this.$t("commons.module_title")
|
||||
};
|
||||
if (this.nodeTree && this.nodeTree.length > 0) {
|
||||
api.moduleId = this.nodeTree[0].id;
|
||||
|
|
|
@ -275,7 +275,7 @@
|
|||
}
|
||||
},
|
||||
addModule(row) {
|
||||
this.saveApi(row, "root");
|
||||
this.saveApi(row, "default-module");
|
||||
},
|
||||
saveApi(row, module) {
|
||||
let data = this.api;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
:condition="condition"
|
||||
:current-module="currentModule"
|
||||
:is-read-only="isReadOnly"
|
||||
:moduleOptions="extendTreeNodes"
|
||||
:moduleOptions="data"
|
||||
@exportAPI="exportAPI"
|
||||
@saveAsEdit="saveAsEdit"
|
||||
@refreshTable="$emit('refreshTable')"
|
||||
|
@ -62,7 +62,6 @@
|
|||
},
|
||||
data: [],
|
||||
currentModule: {},
|
||||
extendTreeNodes: [],
|
||||
}
|
||||
},
|
||||
props: {
|
||||
|
@ -131,17 +130,17 @@
|
|||
this.result = this.$get(url, response => {
|
||||
if (response.data != undefined && response.data != null) {
|
||||
this.data = response.data;
|
||||
this.extendTreeNodes = [];
|
||||
this.extendTreeNodes.unshift({
|
||||
"id": "root",
|
||||
this.data.unshift({
|
||||
"id": "default-module",
|
||||
"name": this.$t('commons.module_title'),
|
||||
"level": 0,
|
||||
"children": this.data,
|
||||
"path": "/" + this.$t('commons.module_title'),
|
||||
"children": [],
|
||||
});
|
||||
this.extendTreeNodes.forEach(node => {
|
||||
this.data.forEach(node => {
|
||||
buildTree(node, {path: ''});
|
||||
});
|
||||
this.$emit('setModuleOptions', this.extendTreeNodes);
|
||||
this.$emit('setModuleOptions', this.data);
|
||||
this.$emit('setNodeTree', this.data);
|
||||
if (this.$refs.nodeTree) {
|
||||
this.$refs.nodeTree.filter(this.condition.filterText);
|
||||
|
|
|
@ -92,7 +92,7 @@ export default {
|
|||
allLabel: {
|
||||
type: String,
|
||||
default() {
|
||||
return this.$t('commons.module_title');
|
||||
return this.$t("commons.all_label.case");
|
||||
}
|
||||
},
|
||||
nameLimit: {
|
||||
|
|
Loading…
Reference in New Issue