fix(测试跟踪): 修复UI关联用例中执行结果下拉选项的顺序

--bug=1018856 --user=刘瑶 【测试跟踪】测试计划-UI测试用例列表/关联用例/关联用例-高级搜索3个地方的执行结果状态显示及搜索返回不符 https://www.tapd.cn/55049933/s/1278393
This commit is contained in:
nathan.liu 2022-10-26 16:38:46 +08:00 committed by nathanliu2022
parent 7b63d3a4ac
commit 8d843d9dcd
3 changed files with 18 additions and 3 deletions

View File

@ -282,9 +282,9 @@ export const UI_SCENARIO_RESULT = {
options: [OPERATORS.IN, OPERATORS.NOT_IN]
},
options: [
{text: 'Pending', value: 'PENDING'},
{text: 'Success', value: 'SUCCESS'},
{text: 'Error', value: 'ERROR'},
{text: 'Success', value: 'SUCCESS'},
{text: 'Pending', value: 'PENDING'},
],
props: { // 尾部控件的props一般为element ui控件的props
multiple: true

View File

@ -58,9 +58,12 @@
<el-link type="success" @click="showReport(row)" v-if="row.lastResult === 'Success' || row.lastResult === 'SUCCESS'">
{{ $t('api_test.automation.success') }}
</el-link>
<el-link type="danger" @click="showReport(row)" v-if="row.lastResult === 'Fail' || row.lastResult === 'FAIL'">
<el-link type="danger" @click="showReport(row)" v-else-if="row.lastResult === 'Fail' || row.lastResult === 'FAIL' || row.lastResult === 'ERROR'">
{{ $t('api_test.automation.fail') }}
</el-link>
<el-link type="info" v-else-if="row.lastResult === 'PENDING' || row.lastResult === 'UnExecute' || !row.lastResult">
{{ $t('api_test.home_page.detail_card.unexecute') }}
</el-link>
</template>
</el-table-column>
<el-table-column prop="passRate" :label="$t('api_test.automation.passing_rate')"

View File

@ -357,6 +357,18 @@ export default {
},
search() {
initCondition(this.condition, this.condition.selectAll);
if(this.condition && this.condition.filters && this.condition.filters.last_result){
if(this.condition.filters.last_result.length > 0){
//PENDING
if(this.condition.filters.last_result.includes("PENDING")){
this.condition.filters.last_result = [...this.condition.filters.last_result, "UnExecute"]
}
//ERROR
if(this.condition.filters.last_result.includes("ERROR")){
this.condition.filters.last_result = [...this.condition.filters.last_result, "FAIL"]
}
}
}
this.loading = true;
this.condition.moduleIds = this.selectNodeIds;
if (this.clickType) {