fix(接口测试): 接口首页不同协议的用例跳转

--user=郭雨琦
--bug=1014073
【接口测试】首页-过去7天测试计划失败用例TOP10,非HTTP的接口也会跳到HTTP页面
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001014073
This commit is contained in:
guoyuqi 2022-06-15 16:34:04 +08:00 committed by fit2-zhao
parent 96fac03f5e
commit f9e0fcb708
2 changed files with 24 additions and 17 deletions

View File

@ -80,26 +80,33 @@ export default {
this.$emit('redirectPage', 'testPlanEdit', null, param);
break;
case "apiCase":
this.$get('/api/definition/get/' + param.id, (response) => {
let api = response.data;
if (!api) {
this.$get('/api/testcase/findById/' + param.id, (response) => {
let apiCase = response.data;
if (!apiCase) {
this.$message.error(this.$t('commons.api_case') + this.$t('commons.not_exist'))
} else {
if (param.protocol === 'dubbo://') {
param.protocol = 'DUBBO'
}
definitionData = this.$router.resolve({
name: 'ApiDefinition',
params: {
redirectID: getUUID(),
dataType: "api",
dataSelectRange: 'edit:' + param.id,
projectId: getCurrentProjectID(),
type: api.protocol,
workspaceId: getCurrentWorkspaceId(),
this.$get('/api/definition/get/' + apiCase.apiDefinitionId, (response) => {
let api = response.data;
if (api) {
this.$message.error(this.$t('api_test.home_page.api_details_card.title') + this.$t('commons.not_exist'))
} else {
if (param.protocol === 'dubbo://') {
param.protocol = 'DUBBO'
}
definitionData = this.$router.resolve({
name: 'ApiDefinition',
params: {
redirectID: getUUID(),
dataType: "api",
dataSelectRange: 'edit:' + param.id,
projectId: getCurrentProjectID(),
type: api.protocol,
workspaceId: getCurrentWorkspaceId(),
}
});
window.open(definitionData.href, '_blank');
}
});
window.open(definitionData.href, '_blank');
}
});
break;

View File

@ -30,7 +30,7 @@
<span v-if="!data.isEdit" class="node-icon">
<i class="el-icon-folder"/>
</span>
<el-tooltip class="item" effect="dark" :content="data.name" placement="top-start" open-delay="1000">
<el-tooltip class="item" effect="dark" :content="data.name" placement="top-start" :open-delay="1000">
<span v-if="!data.isEdit" class="node-title" v-text="data.name"/>
</el-tooltip>