未验证 提交 8a9de415 编写于 作者: 泰斯特Test's avatar 泰斯特Test 提交者: GitHub

Merge pull request #12 from nogit/master

report-view-color-fix
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<!--报告详情--> <!--报告详情-->
<el-dialog title="报告详情" width="97%" v-loading="detailLoading" :visible.sync="isReportDetailShow" :close-on-click-modal="false"> <el-dialog title="报告详情" width="97%" v-loading="detailLoading" :visible.sync="isReportDetailShow" :close-on-click-modal="false">
<div style="height:700px;overflow:auto;overflow-x:hidden;border: 1px solid #e6e6e6"> <div style="height:700px;overflow:auto;overflow-x:hidden;border: 1px solid #e6e6e6">
<el-table height="700" :data="testReportDetail" :row-class-name="reportsTableRow" :header-cell-style="reportHeaderColor" :row-style="reportRowStyle" v-loading="listLoading" style="width: 100%;"> <el-table height="700" :data="testReportDetail" :row-class-name="reportsTableRow" :header-cell-style="reportHeaderColor" v-loading="listLoading" style="width: 100%;">
<el-table-column prop="testBaseInfo.name" label="用例名称" min-width="30%" sortable show-overflow-tooltip> <el-table-column prop="testBaseInfo.name" label="用例名称" min-width="30%" sortable show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column prop="testBaseInfo.requestMethod" label="请求方法" min-width="15%" sortable show-overflow-tooltip> <el-table-column prop="testBaseInfo.requestMethod" label="请求方法" min-width="15%" sortable show-overflow-tooltip>
...@@ -294,16 +294,13 @@ ...@@ -294,16 +294,13 @@
}) })
}, },
// 修改table tr行的背景色 // 修改table tr行的背景色
reportRowStyle({ row, rowIndex }){ reportsTableRow({ row, rowIndex }){
if (row.status.toString() === 'ok') if (row.status.toString() === 'ok')
return 'background-color: #33CC00;color: #fff;font-weight: 500;' return 'bg1-row reportsTableRow'
else { else {
return 'background-color: #FF3333;color: #fff;font-weight: 500;' return 'bg2-row reportsTableRow'
} }
}, },
reportsTableRow({ row, rowIndex }){
return 'reportsTableRow';
},
// 修改table header的背景色 // 修改table header的背景色
reportHeaderColor({ row, column, rowIndex, columnIndex }) { reportHeaderColor({ row, column, rowIndex, columnIndex }) {
if (rowIndex === 0) { if (rowIndex === 0) {
...@@ -358,4 +355,14 @@ ...@@ -358,4 +355,14 @@
.el-table .el-table__body .reportsTableRow:hover>td { .el-table .el-table__body .reportsTableRow:hover>td {
background-color: deepskyblue; background-color: deepskyblue;
} }
.el-table .bg1-row{
background-color: #33CC00;
color: #fff;
font-weight: 500;
}
.el-table .bg2-row{
background-color: #FF3333;
color: #fff;
font-weight: 500;
}
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册