fix(测试跟踪): 修复测试报告、任务中心状态显示不一致的缺陷

--bug=1013357 --user=王孝刚 【通用设置】测试计划报告-接口测试报告和任务中心报告-running
+stopped字体大小写和颜色不一致 https://www.tapd.cn/55049933/s/1161910
This commit is contained in:
wxg0103 2022-05-23 11:09:35 +08:00 committed by f2c-ci-robot[bot]
parent cd2f3b5997
commit 2730922faa
3 changed files with 46 additions and 26 deletions

View File

@ -1,25 +1,25 @@
<template> <template>
<div> <div>
<el-tag size="mini" type="info" v-if="row.status === 'Starting'"> <el-tag size="mini" type="info" v-if="row.status === 'Starting'">
{{ getStatus(row.status) }} {{ showStatus(row.status) }}
</el-tag> </el-tag>
<el-tag size="mini" type="primary" effect="plain" v-else-if="row.status === 'Running'"> <el-tag size="mini" type="primary" effect="plain" v-else-if="row.status === 'Running'">
{{ getStatus(row.status) }} {{ showStatus(row.status) }}
</el-tag> </el-tag>
<el-tag size="mini" type="success" v-else-if="getStatus(row.status) === 'success'"> <el-tag size="mini" type="success" v-else-if="getStatus(row.status) === 'success'">
{{ getStatus(row.status) }} {{ showStatus(row.status) }}
</el-tag> </el-tag>
<el-tag size="mini" type="warning" v-else-if="row.status === 'Reporting'"> <el-tag size="mini" type="warning" v-else-if="row.status === 'Reporting'">
{{ getStatus(row.status) }} {{ showStatus(row.status) }}
</el-tag> </el-tag>
<el-tag size="mini" type="danger" v-else-if="getStatus(row.status) === 'error'"> <el-tag size="mini" type="danger" v-else-if="getStatus(row.status) === 'error'">
{{ getStatus(row.status) }} {{ showStatus(row.status) }}
</el-tag> </el-tag>
<el-tag size="mini" type="danger" style="background-color: #F6972A; color: #FFFFFF" v-else-if="row.status === 'errorReportResult'"> <el-tag size="mini" type="danger" style="background-color: #F6972A; color: #FFFFFF" v-else-if="row.status === 'errorReportResult'">
{{ $t('error_report_library.option.name') }} {{ $t('error_report_library.option.name') }}
</el-tag> </el-tag>
<el-tag v-else size="mini" type="info"> <el-tag v-else size="mini" type="info">
{{ getStatus(row.status) }} {{ showStatus(row.status) }}
</el-tag> </el-tag>
</div> </div>
</template> </template>
@ -31,10 +31,14 @@
props: { props: {
row: Object row: Object
}, },
methods:{ methods: {
getStatus(status){ getStatus(status) {
return status.toLowerCase(); return status.toLowerCase();
},
showStatus(status) {
return status.toLowerCase()[0].toUpperCase() + status.toLowerCase().substr(1);
} }
} }
} }
</script> </script>

View File

@ -111,20 +111,28 @@
<el-col :span="4"> <el-col :span="4">
<span v-if="item.executionStatus && item.executionStatus.toLowerCase() === 'error'" <span v-if="item.executionStatus && item.executionStatus.toLowerCase() === 'error'"
class="ms-task-error"> class="ms-task-error">
error Error
</span> </span>
<span v-else-if="item.executionStatus && item.executionStatus.toLowerCase() === 'success'" <span v-else-if="item.executionStatus && item.executionStatus.toLowerCase() === 'success'"
class="ms-task-success"> class="ms-task-success">
success Success
</span> </span>
<span v-else-if="item.executionStatus && item.executionStatus.toLowerCase() === 'stop'"> <span v-else-if="item.executionStatus && item.executionStatus.toLowerCase() === 'stop'"
stopped class="ms-task-stopped">
Stopped
</span> </span>
<span v-else-if="item.executionStatus && item.executionStatus.toLowerCase() === 'errorreportresult'" class="ms-task-error-report-status"> <span v-else-if="item.executionStatus && item.executionStatus.toLowerCase() === 'errorreportresult'"
class="ms-task-error-report-status">
{{ $t('error_report_library.option.name') }} {{ $t('error_report_library.option.name') }}
</span> </span>
<span v-else-if="item.executionStatus && item.executionStatus.toLowerCase() === 'running'"
class="ms-task-running">
Running
</span>
<span v-else> <span v-else>
{{ item.executionStatus ? item.executionStatus.toLowerCase() : item.executionStatus }} {{
item.executionStatus ? item.executionStatus.toLowerCase()[0].toUpperCase() + item.executionStatus.toLowerCase().substr(1) : item.executionStatus
}}
</span> </span>
</el-col> </el-col>
</el-row> </el-row>
@ -182,16 +190,16 @@ export default {
], ],
runStatus: [ runStatus: [
{id: '', label: this.$t('api_test.definition.document.data_set.all')}, {id: '', label: this.$t('api_test.definition.document.data_set.all')},
{id: 'saved', label: 'saved'}, {id: 'saved', label: 'Saved'},
{id: 'starting', label: 'starting'}, {id: 'starting', label: 'Starting'},
{id: 'running', label: 'running'}, {id: 'running', label: 'Running'},
{id: 'reporting', label: 'reporting'}, {id: 'reporting', label: 'Reporting'},
{id: 'completed', label: 'completed'}, {id: 'completed', label: 'Completed'},
{id: 'error', label: 'error'}, {id: 'error', label: 'Error'},
{id: 'success', label: 'success'}, {id: 'success', label: 'Success'},
{id: 'waiting', label: 'waiting'}, {id: 'waiting', label: 'Waiting'},
{id: 'fail', label: 'fail'}, {id: 'fail', label: 'Fail'},
{id: 'stop', label: 'stopped'} {id: 'stop', label: 'Stopped'}
], ],
condition: {triggerMode: "", executionStatus: ""}, condition: {triggerMode: "", executionStatus: ""},
maintainerOptions: [], maintainerOptions: [],
@ -548,6 +556,14 @@ export default {
color: #67C23A; color: #67C23A;
} }
.ms-task-stopped {
color: #909399;
}
.ms-task-running {
color: #783887;
}
.ms-task-name-width { .ms-task-name-width {
display: inline-block; display: inline-block;
overflow-x: hidden; overflow-x: hidden;

View File

@ -81,11 +81,11 @@
sortable sortable
:label="$t('commons.status')"> :label="$t('commons.status')">
<template v-slot:default="scope"> <template v-slot:default="scope">
<ms-tag v-if="scope.row.status == 'RUNNING'" type="success" effect="plain" :content="'Running'"/> <ms-tag v-if="scope.row.status == 'RUNNING'" type="primary" effect="plain" :content="'Running'"/>
<ms-tag <ms-tag
v-else-if="scope.row.status == 'COMPLETED'||scope.row.status == 'SUCCESS'||scope.row.status == 'FAILED'" v-else-if="scope.row.status == 'COMPLETED'||scope.row.status == 'SUCCESS'||scope.row.status == 'FAILED'"
type="info" effect="plain" :content="'Completed'"/> type="info" effect="plain" :content="'Completed'"/>
<ms-tag v-else type="effect" effect="plain" :content="scope.row.status"/> <ms-tag v-else type="info" effect="plain" :content="scope.row.status"/>
</template> </template>
</ms-table-column> </ms-table-column>