feat(场景自动化,测试用例): 默认选中树节点添加对应功能
This commit is contained in:
parent
d3fccb25d6
commit
a3b1c4f4d5
|
@ -127,7 +127,6 @@
|
|||
'$route'(to, from) { // 路由改变时,把接口定义界面中的 ctrl s 保存快捷键监听移除
|
||||
if (to.path.indexOf('/api/automation') == -1) {
|
||||
if (this.$refs && this.$refs.autoScenarioConfig) {
|
||||
// console.log(this.$refs.autoScenarioConfig);
|
||||
this.$refs.autoScenarioConfig.forEach(item => {
|
||||
item.removeListener();
|
||||
});
|
||||
|
@ -189,7 +188,15 @@
|
|||
let label = this.$t('api_test.automation.add_scenario');
|
||||
let name = getUUID().substring(0, 8);
|
||||
this.activeName = name;
|
||||
this.tabs.push({label: label, name: name, currentScenario: {apiScenarioModuleId: "root", id: getUUID()}});
|
||||
let currentScenario = {
|
||||
apiScenarioModuleId: "root", id: getUUID(),
|
||||
modulePath: "/" + this.$t("commons.module_title")
|
||||
};
|
||||
if (this.nodeTree && this.nodeTree.length > 0) {
|
||||
currentScenario.apiScenarioModuleId = this.nodeTree[0].id;
|
||||
currentScenario.modulePath = this.nodeTree[0].path;
|
||||
}
|
||||
this.tabs.push({label: label, name: name, currentScenario: currentScenario});
|
||||
}
|
||||
if (tab.name === 'edit') {
|
||||
let label = this.$t('api_test.automation.add_scenario');
|
||||
|
|
|
@ -296,8 +296,12 @@
|
|||
}
|
||||
let api = {
|
||||
status: "Underway", method: "GET", userId: getCurrentUser().id,
|
||||
url: "", protocol: this.currentProtocol, environmentId: "", moduleId: 'root',
|
||||
url: "", protocol: this.currentProtocol, environmentId: "", moduleId: 'root', modulePath: "/" + this.$t("commons.module_title")
|
||||
};
|
||||
if (this.nodeTree && this.nodeTree.length > 0) {
|
||||
api.moduleId = this.nodeTree[0].id;
|
||||
api.modulePath = this.nodeTree[0].path;
|
||||
}
|
||||
this.handleTabsEdit(this.$t('api_test.definition.request.title'), e, api);
|
||||
},
|
||||
handleTabClose() {
|
||||
|
|
|
@ -415,6 +415,10 @@ export default {
|
|||
};
|
||||
});
|
||||
}, 1000);
|
||||
if(this.selectNode && this.selectNode.data){
|
||||
this.form.module = this.selectNode.data.id;
|
||||
this.form.nodePath = this.selectNode.data.path;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
treeNodes() {
|
||||
|
@ -738,7 +742,6 @@ export default {
|
|||
}*/
|
||||
this.tableType='edit';
|
||||
this.$emit("refresh",this.form);
|
||||
console.log(response.data)
|
||||
this.form.id=response.data
|
||||
if (this.type === 'add' || this.type === 'copy') {
|
||||
param.id = response.data;
|
||||
|
|
Loading…
Reference in New Issue