diff --git a/frontend/src/business/components/api/automation/ApiAutomation.vue b/frontend/src/business/components/api/automation/ApiAutomation.vue index a6e7d3eb3c..b218ed83ed 100644 --- a/frontend/src/business/components/api/automation/ApiAutomation.vue +++ b/frontend/src/business/components/api/automation/ApiAutomation.vue @@ -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); diff --git a/frontend/src/business/components/api/automation/report/ApiReportDetail.vue b/frontend/src/business/components/api/automation/report/ApiReportDetail.vue index e34e2e166a..69c79291a9 100644 --- a/frontend/src/business/components/api/automation/report/ApiReportDetail.vue +++ b/frontend/src/business/components/api/automation/report/ApiReportDetail.vue @@ -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'); diff --git a/frontend/src/business/components/api/definition/ApiDefinition.vue b/frontend/src/business/components/api/definition/ApiDefinition.vue index 62476e356e..913cef3fd4 100644 --- a/frontend/src/business/components/api/definition/ApiDefinition.vue +++ b/frontend/src/business/components/api/definition/ApiDefinition.vue @@ -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) { diff --git a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue index 9c08b56355..8fbd9bd714 100644 --- a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue +++ b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue @@ -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() { diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index a954edc8bd..9f24dc2e7c 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -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", diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 9d9a4ed94c..38395a50c5 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -1142,6 +1142,8 @@ export default { hours: "时", }, api_test: { + case_jump_message: "跳转的用例已经删除!", + scenario_jump_message: "跳转的场景已经删除!", is_continue: "是否继续", creator: "创建人", save_and_run: "保存并执行", diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index a4005e74d4..09ae0021c7 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -1139,6 +1139,8 @@ export default { hours: "時", }, api_test: { + case_jump_message: "跳轉的用例已經刪除!", + scenario_jump_message: "跳轉的場景已經刪除!", is_continue: "是否繼續", creator: "創建人", save_and_run: "保存並執行",