fix(接口自动化): 解决编辑页面报错问题

--user=郭雨琦 接口自动化
This commit is contained in:
guoyuqi 2021-11-23 11:33:26 +08:00 committed by 刘瑞斌
parent 16bd959e36
commit 9626266047
4 changed files with 34 additions and 7 deletions

View File

@ -1715,7 +1715,9 @@ export default {
return new Promise((resolve) => {
let url = '/api/definition/get/' + id;
this.$get(url, response => {
if(response.data&&response.data.num){
resolve(response.data.num);
}
});
});
},
@ -1723,7 +1725,9 @@ export default {
return new Promise((resolve) => {
let url = '/api/testcase/get/' + id;
this.$get(url, response => {
if(response.data&&response.data.num){
resolve(response.data.num);
}
});
});
},
@ -1731,7 +1735,9 @@ export default {
return new Promise((resolve) => {
let url = '/api/automation/getApiScenario/' + id;
this.$get(url, response => {
if(response.data&&response.data.num){
resolve(response.data.num);
}
});
});
}

View File

@ -22,7 +22,7 @@
<span>{{ data.name }}</span>
</el-tooltip>
<el-tag size="mini" v-if="data.method && !data.pluginId" style="margin-left: 1rem">{{ getMethod() }}</el-tag>
<slot name = "afterTitle" v-if="data.num"/>
<slot name = "afterTitle"/>
</span>
</slot>

View File

@ -16,8 +16,13 @@
<span class="ms-tag ms-step-name-api">{{ getProjectName(request.projectId) }}</span>
</template>
<template v-slot:afterTitle>
<span v-if="request.refType==='API'||request.refType==='CASE'" @click = "clickResource(request)">{{" ID: "+request.num+""}}</span>
<template v-slot:afterTitle v-if="request.refType==='API'|| request.refType==='CASE'">
<span v-if="request.num" @click = "clickResource(request)">{{" ID: "+request.num+""}}</span>
<span v-else >
<el-tooltip class="ms-num" effect="dark" :content="request.refType==='API'?$t('api_test.automation.scenario.api_none'):$t('api_test.automation.scenario.case_none')" placement="top">
<i class="el-icon-warning"/>
</el-tooltip>
</span>
</template>
<template v-slot:behindHeaderLeft>
@ -719,4 +724,10 @@ export default {
border-color: #EE6161;
color: white;
}
.ms-num{
margin-left: 1rem;
font-size: 15px;
color: #de9d1c;
}
</style>

View File

@ -16,7 +16,12 @@
title='场景'>
<template v-slot:afterTitle>
<span @click = "clickResource(scenario)">{{" ID: "+scenario.num+""}}</span>
<span v-if="scenario.num" @click = "clickResource(scenario)">{{" ID: "+scenario.num+""}}</span>
<span v-else >
<el-tooltip class="ms-num" effect="dark" :content="$t('api_test.automation.scenario.num_none')" placement="top">
<i class="el-icon-warning"/>
</el-tooltip>
</span>
</template>
<template v-slot:behindHeaderLeft>
@ -314,4 +319,9 @@ export default {
.ms-test-running {
color: #6D317C;
}
.ms-num{
margin-left: 1rem;
font-size: 15px;
color: #de9d1c;
}
</style>