fix_接口定义_卡片跳转

This commit is contained in:
wxg0103 2021-10-26 19:21:24 +08:00 committed by 刘瑞斌
parent bddf0568eb
commit a74e9adcbc
3 changed files with 17 additions and 12 deletions

View File

@ -717,8 +717,9 @@
<select id="scenarioList" resultType="io.metersphere.api.dto.scenario.Scenario"> <select id="scenarioList" resultType="io.metersphere.api.dto.scenario.Scenario">
select DISTINCT t1.id select DISTINCT t1.id
from api_scenario t1 from api_scenario t1
join api_scenario_reference_id t2 on t1.id = t2.api_scenario_id join api_scenario_reference_id t2 on t1.id = t2.api_scenario_id and t1.`status` !='Trash'
join api_test_case t3 on t2.reference_id = t3.id and t2.reference_type = 'REF' join api_test_case t3
on t2.reference_id = t3.id and t2.reference_type = 'REF'
where t3.api_definition_id = #{apiDefinitionId} where t3.api_definition_id = #{apiDefinitionId}
and t3.`status`!='Trash' and t3.`status`!='Trash'
</select> </select>

View File

@ -383,6 +383,7 @@ export default {
}); });
}, },
'$route'(to, from) { // ctrl s '$route'(to, from) { // ctrl s
window.location.reload();
if (to.path.indexOf('/api/definition') === -1) { if (to.path.indexOf('/api/definition') === -1) {
if (this.$refs && this.$refs.apiConfig) { if (this.$refs && this.$refs.apiConfig) {
this.$refs.apiConfig.forEach(item => { this.$refs.apiConfig.forEach(item => {
@ -390,7 +391,7 @@ export default {
}); });
} }
} }
} },
}, },
created() { created() {
this.getEnv(); this.getEnv();

View File

@ -4,19 +4,21 @@
<el-table-column prop="num" :label="$t('api_test.home_page.new_case_list.table_coloum.index')" width="100" <el-table-column prop="num" :label="$t('api_test.home_page.new_case_list.table_coloum.index')" width="100"
show-overflow-tooltip> show-overflow-tooltip>
<template v-slot:default="{row}"> <template v-slot:default="{row}">
<el-link type="num" @click="redirect(row.apiType,row.num)"> <span type="num" @click="redirect(row.apiType,row.id)">
{{ row.num }} {{ row.num }}
</el-link> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" :label="$t('api_test.home_page.new_case_list.table_coloum.api_name')" width="150"> <el-table-column prop="name" :label="$t('api_test.home_page.new_case_list.table_coloum.api_name')"
show-overflow-tooltip width="170">
<template v-slot:default="{row}"> <template v-slot:default="{row}">
<el-link type="name" @click="redirect(row.apiType,row.name)"> <span type="name" @click="redirect(row.apiType,row.id)">
{{ row.name }} {{ row.name }}
</el-link> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="path" :label="$t('api_test.home_page.new_case_list.table_coloum.path')" width="150"> <el-table-column prop="path" :label="$t('api_test.home_page.new_case_list.table_coloum.path')" width="170"
show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column prop="status" :label="$t('api_test.home_page.new_case_list.table_coloum.api_status')"> <el-table-column prop="status" :label="$t('api_test.home_page.new_case_list.table_coloum.api_status')">
@ -32,7 +34,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="caseTotal" :label="$t('api_test.home_page.new_case_list.table_coloum.relation_case')" <el-table-column prop="caseTotal" :label="$t('api_test.home_page.new_case_list.table_coloum.relation_case')"
width="150"> width="100">
<template v-slot:default="{row}"> <template v-slot:default="{row}">
<el-link type="info" @click="redirect(row.caseType,row.id)"> <el-link type="info" @click="redirect(row.caseType,row.id)">
{{ row.caseTotal }} {{ row.caseTotal }}
@ -40,7 +42,8 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="scenarioTotal" <el-table-column prop="scenarioTotal"
:label="$t('api_test.home_page.new_case_list.table_coloum.relation_scenario')"> :label="$t('api_test.home_page.new_case_list.table_coloum.relation_scenario')"
width="100">
<template v-slot:default="{row}"> <template v-slot:default="{row}">
<el-link type="info" @click="redirect(row.scenarioType,row.ids)"> <el-link type="info" @click="redirect(row.scenarioType,row.ids)">
{{ row.scenarioTotal }} {{ row.scenarioTotal }}
@ -196,7 +199,7 @@ export default {
redirect(pageType, param) { redirect(pageType, param) {
switch (pageType) { switch (pageType) {
case "api": case "api":
this.$emit('redirectPage', 'api', 'api', 'apiList:' + param); this.$router.push('/api/definition?resourceId=' + param)
break; break;
case "apiCase": case "apiCase":
this.$emit('redirectPage', 'api', 'apiTestCase', 'singleList:' + param); this.$emit('redirectPage', 'api', 'apiTestCase', 'singleList:' + param);