refactor: 测试计划报告-接口性能测试用例列表及测试结果高度等样式优化

This commit is contained in:
chenjianxing 2021-09-23 15:45:50 +08:00 committed by jianxing
parent 87dc4c5087
commit 9ce872e90f
6 changed files with 162 additions and 136 deletions

View File

@ -238,4 +238,12 @@ export default {
/deep/ .padding-col {
padding: 5px;
}
/deep/ .el-scrollbar {
height: 100%;
}
/deep/ .el-card .ms-table {
cursor: pointer;
}
</style>

View File

@ -3,50 +3,52 @@
<el-row class="scenario-info">
<el-col class="padding-col" :span="7">
<el-card>
<ms-table v-loading="result.loading"
:show-select-all="false"
:screen-height="null"
:enable-selection="false"
:highlight-current-row="true"
@refresh="getScenarioApiCase"
@handleRowClick="rowClick"
:data="apiCases">
<el-scrollbar>
<ms-table v-loading="result.loading"
:show-select-all="false"
:screen-height="null"
:enable-selection="false"
:highlight-current-row="true"
@refresh="getScenarioApiCase"
@handleRowClick="rowClick"
:data="apiCases">
<ms-table-column
:width="80"
:label="$t('commons.id')"
prop="num">
</ms-table-column>
<ms-table-column
:width="80"
:label="$t('commons.id')"
prop="num">
</ms-table-column>
<ms-table-column
:label="$t('commons.name')"
prop="name">
</ms-table-column>
<ms-table-column
:label="$t('commons.name')"
prop="name">
</ms-table-column>
<ms-table-column
:label="'创建人'"
prop="creatorName"/>
<ms-table-column
:label="'创建人'"
prop="creatorName"/>
<ms-table-column
:label="$t('test_track.case.priority')"
:width="80"
prop="priority">
<template v-slot:default="scope">
<priority-table-item :value="scope.row.priority" ref="priority"/>
</template>
</ms-table-column>
<ms-table-column
:label="$t('test_track.case.priority')"
:width="80"
prop="priority">
<template v-slot:default="scope">
<priority-table-item :value="scope.row.priority" ref="priority"/>
</template>
</ms-table-column>
<ms-table-column
:width="80"
:label="'执行结果'"
prop="lastResult">
<template v-slot:default="scope">
<status-table-item v-if="scope.row.execResult === 'success'" :value="'Pass'"/>
<status-table-item v-if="scope.row.execResult === 'error'" :value="'Failure'"/>
<status-table-item v-if="scope.row.execResult != 'error' && scope.row.execResult != 'success'" :value="'Prepare'"/>
</template>
</ms-table-column>
</ms-table>
<ms-table-column
:width="80"
:label="'执行结果'"
prop="lastResult">
<template v-slot:default="scope">
<status-table-item v-if="scope.row.execResult === 'success'" :value="'Pass'"/>
<status-table-item v-if="scope.row.execResult === 'error'" :value="'Failure'"/>
<status-table-item v-if="scope.row.execResult != 'error' && scope.row.execResult != 'success'" :value="'Prepare'"/>
</template>
</ms-table-column>
</ms-table>
</el-scrollbar>
</el-card>
</el-col>
<el-col class="padding-col" :span="17" v-if="apiCases.length > 0">
@ -167,4 +169,13 @@ export default {
</script>
<style scoped>
.el-card >>> .el-card__body {
height: 600px;
}
/deep/ .text-container .pane {
height: 550px !important;
}
</style>

View File

@ -28,6 +28,8 @@ export default {
textStyle: {
lineHeight: 30,
fontSize: 16,
fontWeight: 500,
color: 'gray'
},
subtextStyle: {
height: 30,

View File

@ -2,50 +2,52 @@
<el-row class="scenario-info">
<el-col class="padding-col" :span="8">
<el-card>
<ms-table v-loading="result.loading"
:show-select-all="false"
:screen-height="null"
:enable-selection="false"
:highlight-current-row="true"
@refresh="getScenarioApiCase"
@handleRowClick="rowClick"
:data="scenarioCases">
<el-scrollbar>
<ms-table v-loading="result.loading"
:show-select-all="false"
:screen-height="null"
:enable-selection="false"
:highlight-current-row="true"
@refresh="getScenarioApiCase"
@handleRowClick="rowClick"
:data="scenarioCases">
<ms-table-column
:width="80"
:label="$t('commons.id')"
prop="customNum">
</ms-table-column>
<ms-table-column
:label="$t('commons.name')"
prop="name">
</ms-table-column>
<ms-table-column
:label="'创建人'"
prop="creatorName"/>
<ms-table-column
:label="$t('test_track.case.priority')"
:width="80">
<template v-slot:default="scope">
<priority-table-item :value="scope.row.level" ref="priority"/>
</template>
</ms-table-column>
<ms-table-column
:width="70"
:label="'步骤数'"
prop="stepTotal">
</ms-table-column>
<ms-table-column
:width="80"
:label="'执行结果'"
prop="lastResult">
<template v-slot:default="{row}">
<status-table-item v-if="row.lastResult === 'Success'" :value="'Pass'"/>
<status-table-item v-if="row.lastResult === 'Fail'" :value="'Failure'"/>
<status-table-item v-if="row.lastResult != 'Fail' && row.lastResult != 'Success'" :value="'Prepare'"/>
</template>
</ms-table-column>
</ms-table>
<ms-table-column
:width="80"
:label="$t('commons.id')"
prop="customNum">
</ms-table-column>
<ms-table-column
:label="$t('commons.name')"
prop="name">
</ms-table-column>
<ms-table-column
:label="'创建人'"
prop="creatorName"/>
<ms-table-column
:label="$t('test_track.case.priority')"
:width="80">
<template v-slot:default="scope">
<priority-table-item :value="scope.row.level" ref="priority"/>
</template>
</ms-table-column>
<ms-table-column
:width="70"
:label="'步骤数'"
prop="stepTotal">
</ms-table-column>
<ms-table-column
:width="80"
:label="'执行结果'"
prop="lastResult">
<template v-slot:default="{row}">
<status-table-item v-if="row.lastResult === 'Success'" :value="'Pass'"/>
<status-table-item v-if="row.lastResult === 'Fail'" :value="'Failure'"/>
<status-table-item v-if="row.lastResult != 'Fail' && row.lastResult != 'Success'" :value="'Prepare'"/>
</template>
</ms-table-column>
</ms-table>
</el-scrollbar>
</el-card>
</el-col>
<el-col :span="16" v-if="scenarioCases && scenarioCases.length > 0">
@ -156,12 +158,11 @@ export default {
padding-right: 0px;
}
.scenario-info {
height: 625px;
.el-card >>> .el-card__body {
height: 600px;
}
.ms-main-container {
height: 612px;
/deep/ .ms-main-container {
height: 620px !important;
}
</style>

View File

@ -1,16 +1,12 @@
<template>
<el-row class="scenario-info">
<el-col :span="7" class="padding-col">
<el-card>
<load-failure-result :is-db="isDb" @rowClick="getReport" :is-all="true" :share-id="shareId" :is-share="isShare" :is-template="isTemplate"
:report="report" :plan-id="planId" @setSize="setAllSize"/>
</el-card>
<load-failure-result :class="{'init-height': !showResponse}" :is-db="isDb" @rowClick="getReport" :is-all="true" :share-id="shareId" :is-share="isShare" :is-template="isTemplate"
:report="report" :plan-id="planId" @setSize="setAllSize"/>
</el-col>
<el-col :span="17" class="padding-col">
<el-card v-show="showResponse">
<load-case-report-view :is-plan-report="true" :share-id="shareId" :is-share="isShare"
<load-case-report-view :is-plan-report="true" :share-id="shareId" :is-share="isShare" v-show="showResponse"
:plan-report-template="response" :report-id="reportId" ref="loadCaseReportView"/>
</el-card>
<div class="empty" v-show="!showResponse">内容为空</div>
</el-col>
</el-row>
@ -90,5 +86,7 @@ export default {
</script>
<style scoped>
.init-height >>> .el-card__body {
height: 600px !important;
}
</style>

View File

@ -1,47 +1,51 @@
<template>
<el-table
row-key="id"
@row-click="rowClick"
:highlight-current-row="true"
:data="loadTestCases">
<el-table-column
prop="num"
:label="$t('commons.id')"
show-overflow-tooltip>
<template v-slot:default="{row}">
{{row.isCustomNum ? row.customNum : row.num }}
</template>
</el-table-column>
<el-table-column
prop="name"
:label="$t('commons.name')"
show-overflow-tooltip>
</el-table-column>
<el-card>
<el-scrollbar>
<el-table
row-key="id"
@row-click="rowClick"
:highlight-current-row="true"
:data="loadTestCases">
<el-table-column
prop="num"
:label="$t('commons.id')"
show-overflow-tooltip>
<template v-slot:default="{row}">
{{row.isCustomNum ? row.customNum : row.num }}
</template>
</el-table-column>
<el-table-column
prop="name"
:label="$t('commons.name')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="userName"
:label="$t('commons.create_user')">
</el-table-column>
<el-table-column
prop="userName"
:label="$t('commons.create_user')">
</el-table-column>
<el-table-column
prop="status"
column-key="status"
:label="$t('test_track.plan_view.execute_result')">
<template v-slot:default="{row}">
<el-tag size="mini" type="danger" v-if="row.status === 'error'">
{{ row.status }}
</el-tag>
<el-tag size="mini" type="success" v-else-if="row.status === 'success'">
{{ row.status }}
</el-tag>
<el-tag size="mini" v-else-if="row.status === 'run'">
{{ row.status }}
</el-tag>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column
prop="status"
column-key="status"
:label="$t('test_track.plan_view.execute_result')">
<template v-slot:default="{row}">
<el-tag size="mini" type="danger" v-if="row.status === 'error'">
{{ row.status }}
</el-tag>
<el-tag size="mini" type="success" v-else-if="row.status === 'success'">
{{ row.status }}
</el-tag>
<el-tag size="mini" v-else-if="row.status === 'run'">
{{ row.status }}
</el-tag>
<span v-else>-</span>
</template>
</el-table-column>
</el-table>
</el-table>
</el-scrollbar>
</el-card>
</template>
<script>
@ -127,5 +131,7 @@ export default {
</script>
<style scoped>
.el-card >>> .el-card__body {
height: 860px;
}
</style>