fix(接口测试): 修复场景报告页面link进入场景模块信息缺失的缺陷

--bug=1013398 --user=王孝刚 【接口测试】github#13809.
切换项目后,从报告中点击场景用例link进入场景用例页面,页面显示模块信息丢失
https://www.tapd.cn/55049933/s/1172963
This commit is contained in:
wxg0103 2022-06-02 18:31:52 +08:00 committed by f2c-ci-robot[bot]
parent 3ef1982aad
commit 08e6bb223d
2 changed files with 19 additions and 16 deletions

View File

@ -219,12 +219,12 @@ export default {
let scenarioId = selectParamArr[1];
//
let url = "/api/automation/list/" + 1 + "/" + 1;
this.$post(url, {id: scenarioId}, response => {
this.$post(url, {id: scenarioId}, async response => {
let data = response.data;
if (data != null) {
//
if (this.moduleOptions && JSON.stringify(this.moduleOptions) === '{}') {
this.$refs.nodeTree.list();
if (this.moduleOptions && this.moduleOptions.length === 0) {
await this.$refs.nodeTree.list();
}
if (data.listObject && data.listObject.length > 0) {
let row = data.listObject[0];

View File

@ -182,20 +182,23 @@
return;
}
}
this.result = this.$get(url, response => {
if (response.data != undefined && response.data != null) {
this.data = response.data;
this.data.forEach(node => {
node.name = node.name === '未规划场景' ? this.$t('api_test.automation.unplanned_scenario') : node.name
buildTree(node, {path: ''});
});
this.$emit('setModuleOptions', this.data);
this.$emit('setNodeTree', this.data);
if (this.$refs.nodeTree) {
this.$refs.nodeTree.filter(this.condition.filterText);
return new Promise((resolve) => {
this.result = this.$get(url, response => {
if (response.data != undefined && response.data != null) {
this.data = response.data;
this.data.forEach(node => {
node.name = node.name === '未规划场景' ? this.$t('api_test.automation.unplanned_scenario') : node.name
buildTree(node, {path: ''});
});
this.$emit('setModuleOptions', this.data);
this.$emit('setNodeTree', this.data);
if (this.$refs.nodeTree) {
this.$refs.nodeTree.filter(this.condition.filterText);
}
}
}
});
});
resolve();
})
},
edit(param) {
param.projectId = this.projectId;