测试计划-测试用例快捷修改状态

This commit is contained in:
chenjianxing 2020-06-01 13:37:13 +08:00
parent c7f0d842ef
commit 107abf98b0
2 changed files with 36 additions and 3 deletions

View File

@ -1,12 +1,12 @@
<template>
<div>
<span>
<ms-tag v-if="value == 'Prepare'" type="info" :content="$t('test_track.plan.plan_status_prepare')"/>
<ms-tag v-if="value == 'Underway'" type="primary" :content="$t('test_track.plan.plan_status_running')"/>
<ms-tag v-if="value == 'Pass'" type="success" :content="$t('test_track.plan_view.pass')"/>
<ms-tag v-if="value == 'Failure'" type="danger" :content="$t('test_track.plan_view.failure')"/>
<ms-tag v-if="value == 'Blocking'" type="warning" :content="$t('test_track.plan_view.blocking')"/>
<ms-tag v-if="value == 'Skip'" type="info" :content="$t('test_track.plan_view.skip')"/>
</div>
</span>
</template>
<script>

View File

@ -87,7 +87,25 @@
column-key="status"
:label="$t('test_track.plan_view.execute_result')">
<template v-slot:default="scope">
<status-table-item :value="scope.row.status"/>
<el-dropdown class="test-case-status" @command="statusChange">
<span class="el-dropdown-link">
<status-table-item :value="scope.row.status"/>
</span>
<el-dropdown-menu slot="dropdown" chang>
<el-dropdown-item :command="{id: scope.row.id, status: 'Pass'}">
{{$t('test_track.plan_view.pass')}}
</el-dropdown-item>
<el-dropdown-item :command="{id: scope.row.id, status: 'Failure'}">
{{$t('test_track.plan_view.failure')}}
</el-dropdown-item>
<el-dropdown-item :command="{id: scope.row.id, status: 'Blocking'}">
{{$t('test_track.plan_view.blocking')}}
</el-dropdown-item>
<el-dropdown-item :command="{id: scope.row.id, status: 'Skip'}">
{{$t('test_track.plan_view.skip')}}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
@ -328,6 +346,16 @@
openTestReport() {
this.$refs.testReporTtemplateList.open();
},
statusChange(param) {
this.$post('/test/plan/case/edit' , param, () => {
for (let i = 0; i < this.tableData.length; i++) {
if (this.tableData[i].id == param.id) {
this.tableData[i].status = param.status;
break;
}
}
});
},
getTestPlanById() {
if (this.planId) {
this.$post('/test/plan/get/' + this.planId, {}, response => {
@ -361,4 +389,9 @@
margin-left: 10px;
width: 240px;
}
.test-case-status {
cursor:pointer;
}
</style>