Commit 060cca27 060cca27fd7a4348801fa564c9f9adcd7022c5ed by zhanghao

commit

1 parent 83441aac
<template xmlns:el-col="http://www.w3.org/1999/html">
<div>
<br/>
<span>查询接口测试用例验证结果</span>
<el-table
:data="bigdataReports"
border
style="width: 100%"
:row-class-name="tableRowClassName"
:header-cell-style="{background: 'deepskyblue', color: 'snow'}">
<el-table-column
prop="method"
label="接口名称"
min-width="3">
</el-table-column>
<el-table-column
prop="tcDescribe"
label="测试用例"
min-width="5">
</el-table-column>
<el-table-column
prop="result"
label="执行结果"
min-width="1">
</el-table-column>
</el-table>
</div>
</template>
<style>
.el-table .warning-row {
background: LightPink;
}
.el-table .success-row {
background: darkseagreen;
}
.el-table .pass-row {
background: yellow;
}
</style>
<script>
export default {
data() {
return {
project: this.$route.query.project,
bigdataReports: []
}
},
mounted() {
this.activity()
},
methods: {
tableRowClassName({row, rowIndex}) {
if (row.tcFail > 0) {
return 'warning-row';
}
if (row.tcFail == 0 && row.tcSuccess == 0) {
return 'pass-row';
}
return 'success-row';
},
activity() {
const loading = this.$loading({
lock: true,
text: '加载中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
let config = {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}
this.$http.get('/bigdata/bigdataReport?'+this.$qs.stringify({
project: this.project
}),config).then((res)=>{
console.log(res.data)
this.bigdataReports=res.data.bigdataReports
loading.close();
}).catch(error=>{
console.log(error);
loading.close();
this.$message({
showClose: true,
message: '服务器处理失败,请核对参数!',
type: 'error'
});
})
}
}
}
</script>
......@@ -116,6 +116,33 @@
</el-form>
</el-col>
</el-row>
<el-row style="margin-bottom: 15px; margin-top: 5px">
<el-col :span="8">
<el-form ref="bigdataReport" :model="bigdataReport" label-width="0px">
<el-card class="darkred" shadow="always">
<div slot="header" class="clearfix">
<span>查询接口测试用例验证结果</span>
</div>
<div class="text item">
<el-form-item>
<el-select v-model="bigdataReport.project" placeholder="请选择项目">
<el-option
v-for="item in projectOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<div style="margin: 15px 0;"></div>
<el-form-item>
<el-button round @click="bigdataReportSubmit">查询验证结果</el-button>
</el-form-item>
</div>
</el-card>
</el-form>
</el-col>
</el-row>
</div>
</template>
......@@ -223,6 +250,13 @@
value: '1',
label: '线上环境'
}],
bigdataReport: {
project: []
},
projectOptions: [{
value: 'com.chinabr.test.testcase.bigdata.HuoDongRuKou',
label: '活动入口优化'
}]
}
},
mounted() {
......@@ -271,6 +305,11 @@
endDate: this.bizDataResponse.showdate[1],
type: this.bizDataResponse.huanjing.toString()}})
window.open(href, '_blank')
},
bigdataReportSubmit() {
const {href} = this.$router.resolve({ name:'bigdataReport', query:
{ project: this.bigdataReport.project.toString()}})
window.open(href, '_blank')
}
}
}
......
......@@ -27,6 +27,7 @@ import toolData from '@/page/toolData'
import methodCount from '@/page/methodCount'
import bizDataCount from '@/page/bizDataCount'
import bizDataResponse from '@/page/bizDataResponse'
import bigdataReport from '@/page/bigdataReport'
Vue.use(Router)
......@@ -204,6 +205,14 @@ export default new Router({
}
},
{
path: '/bigdataReport',
component: bigdataReport,
name: 'bigdataReport',
meta: {
title: '测试工具平台'
}
},
{
path: '/selectActCount',
component: selectActCount,
name: 'selectActCount',
......