fix(接口测试): 修复用例跳转报错问题

--bug=1014469 --user=赵勇 【接口测试】测试报告中某些用例删除,点击删除的case标题,页面会报错; https://www.tapd.cn/55049933/s/1192451
This commit is contained in:
fit2-zhao 2022-06-30 14:13:38 +08:00 committed by f2c-ci-robot[bot]
parent f3e2d99fc3
commit 765d64224a
7 changed files with 21 additions and 10 deletions

View File

@ -623,8 +623,8 @@ export default {
},
editScenario(row) {
if (!row) {
this.activeName === 'default'
this.$error("跳转的应场景已经删除!");
this.activeName = 'default';
this.$error(this.$t('api_test.scenario_jump_message'));
return;
}
const index = this.tabs.find(p => p.currentScenario.id === row.id && p.currentScenario.copy === row.copy);

View File

@ -679,9 +679,8 @@
return;
}
this.loading = true;
this.report.projectId = this.projectId;
let url = "/api/scenario/report/update";
this.result = this.$post(url, this.report, response => {
let url = "/api/scenario/report/reName";
this.result = this.$post(url, {id: this.report.id,name: this.report.name,reportType: this.report.reportType }, response => {
this.$success(this.$t('commons.save_success'));
this.loading = false;
this.$emit('refresh');

View File

@ -439,14 +439,14 @@ export default {
}
}
this.getEnv();
},
mounted() {
this.init();
//
if (this.$route.query.caseId) {
this.activeDom = 'middle';
}
},
mounted() {
this.init();
},
methods: {
setEnvironment(data) {
if (data) {

View File

@ -500,14 +500,20 @@ export default {
// tab
this.condition.versionId = this.currentVersion;
this.initTable();
this.getVersionOptions();
this.checkVersionEnable();
},
mounted() {
//
if (this.$route.query.caseId) {
this.$get('/api/testcase/findById/' + this.$route.query.caseId, (response) => {
if(!response.data){
this.$error(this.$t('api_test.case_jump_message'));
return;
}
this.handleTestCase(response.data);
});
}
this.getVersionOptions();
this.checkVersionEnable();
},
watch: {
selectNodeIds() {

View File

@ -1133,6 +1133,8 @@ export default {
hours: "H",
},
api_test: {
case_jump_message: "The jump use case has been removed",
scenario_jump_message: "The jumped scene has been deleted",
is_continue: "Is continue",
creator: "Creator",
save_and_run: "Save and Run",

View File

@ -1142,6 +1142,8 @@ export default {
hours: "时",
},
api_test: {
case_jump_message: "跳转的用例已经删除!",
scenario_jump_message: "跳转的场景已经删除!",
is_continue: "是否继续",
creator: "创建人",
save_and_run: "保存并执行",

View File

@ -1139,6 +1139,8 @@ export default {
hours: "時",
},
api_test: {
case_jump_message: "跳轉的用例已經刪除!",
scenario_jump_message: "跳轉的場景已經刪除!",
is_continue: "是否繼續",
creator: "創建人",
save_and_run: "保存並執行",