Commit 060cca27 060cca27fd7a4348801fa564c9f9adcd7022c5ed by zhanghao

commit

1 parent 83441aac
1 <template xmlns:el-col="http://www.w3.org/1999/html">
2 <div>
3 <br/>
4 <span>查询接口测试用例验证结果</span>
5 <el-table
6 :data="bigdataReports"
7 border
8 style="width: 100%"
9 :row-class-name="tableRowClassName"
10 :header-cell-style="{background: 'deepskyblue', color: 'snow'}">
11 <el-table-column
12 prop="method"
13 label="接口名称"
14 min-width="3">
15 </el-table-column>
16 <el-table-column
17 prop="tcDescribe"
18 label="测试用例"
19 min-width="5">
20 </el-table-column>
21 <el-table-column
22 prop="result"
23 label="执行结果"
24 min-width="1">
25 </el-table-column>
26 </el-table>
27 </div>
28 </template>
29
30 <style>
31 .el-table .warning-row {
32 background: LightPink;
33 }
34 .el-table .success-row {
35 background: darkseagreen;
36 }
37 .el-table .pass-row {
38 background: yellow;
39 }
40 </style>
41
42 <script>
43 export default {
44 data() {
45 return {
46 project: this.$route.query.project,
47 bigdataReports: []
48 }
49 },
50 mounted() {
51 this.activity()
52 },
53 methods: {
54 tableRowClassName({row, rowIndex}) {
55 if (row.tcFail > 0) {
56 return 'warning-row';
57 }
58 if (row.tcFail == 0 && row.tcSuccess == 0) {
59 return 'pass-row';
60 }
61 return 'success-row';
62 },
63 activity() {
64 const loading = this.$loading({
65 lock: true,
66 text: '加载中...',
67 spinner: 'el-icon-loading',
68 background: 'rgba(0, 0, 0, 0.7)'
69 });
70 let config = {
71 headers: {
72 'Content-Type': 'application/x-www-form-urlencoded'
73 }
74 }
75 this.$http.get('/bigdata/bigdataReport?'+this.$qs.stringify({
76 project: this.project
77 }),config).then((res)=>{
78 console.log(res.data)
79 this.bigdataReports=res.data.bigdataReports
80 loading.close();
81 }).catch(error=>{
82 console.log(error);
83 loading.close();
84 this.$message({
85 showClose: true,
86 message: '服务器处理失败,请核对参数!',
87 type: 'error'
88 });
89 })
90 }
91 }
92 }
93 </script>
...@@ -116,6 +116,33 @@ ...@@ -116,6 +116,33 @@
116 </el-form> 116 </el-form>
117 </el-col> 117 </el-col>
118 </el-row> 118 </el-row>
119 <el-row style="margin-bottom: 15px; margin-top: 5px">
120 <el-col :span="8">
121 <el-form ref="bigdataReport" :model="bigdataReport" label-width="0px">
122 <el-card class="darkred" shadow="always">
123 <div slot="header" class="clearfix">
124 <span>查询接口测试用例验证结果</span>
125 </div>
126 <div class="text item">
127 <el-form-item>
128 <el-select v-model="bigdataReport.project" placeholder="请选择项目">
129 <el-option
130 v-for="item in projectOptions"
131 :key="item.value"
132 :label="item.label"
133 :value="item.value">
134 </el-option>
135 </el-select>
136 </el-form-item>
137 <div style="margin: 15px 0;"></div>
138 <el-form-item>
139 <el-button round @click="bigdataReportSubmit">查询验证结果</el-button>
140 </el-form-item>
141 </div>
142 </el-card>
143 </el-form>
144 </el-col>
145 </el-row>
119 </div> 146 </div>
120 </template> 147 </template>
121 148
...@@ -223,6 +250,13 @@ ...@@ -223,6 +250,13 @@
223 value: '1', 250 value: '1',
224 label: '线上环境' 251 label: '线上环境'
225 }], 252 }],
253 bigdataReport: {
254 project: []
255 },
256 projectOptions: [{
257 value: 'com.chinabr.test.testcase.bigdata.HuoDongRuKou',
258 label: '活动入口优化'
259 }]
226 } 260 }
227 }, 261 },
228 mounted() { 262 mounted() {
...@@ -271,6 +305,11 @@ ...@@ -271,6 +305,11 @@
271 endDate: this.bizDataResponse.showdate[1], 305 endDate: this.bizDataResponse.showdate[1],
272 type: this.bizDataResponse.huanjing.toString()}}) 306 type: this.bizDataResponse.huanjing.toString()}})
273 window.open(href, '_blank') 307 window.open(href, '_blank')
308 },
309 bigdataReportSubmit() {
310 const {href} = this.$router.resolve({ name:'bigdataReport', query:
311 { project: this.bigdataReport.project.toString()}})
312 window.open(href, '_blank')
274 } 313 }
275 } 314 }
276 } 315 }
......
...@@ -27,6 +27,7 @@ import toolData from '@/page/toolData' ...@@ -27,6 +27,7 @@ import toolData from '@/page/toolData'
27 import methodCount from '@/page/methodCount' 27 import methodCount from '@/page/methodCount'
28 import bizDataCount from '@/page/bizDataCount' 28 import bizDataCount from '@/page/bizDataCount'
29 import bizDataResponse from '@/page/bizDataResponse' 29 import bizDataResponse from '@/page/bizDataResponse'
30 import bigdataReport from '@/page/bigdataReport'
30 31
31 Vue.use(Router) 32 Vue.use(Router)
32 33
...@@ -204,6 +205,14 @@ export default new Router({ ...@@ -204,6 +205,14 @@ export default new Router({
204 } 205 }
205 }, 206 },
206 { 207 {
208 path: '/bigdataReport',
209 component: bigdataReport,
210 name: 'bigdataReport',
211 meta: {
212 title: '测试工具平台'
213 }
214 },
215 {
207 path: '/selectActCount', 216 path: '/selectActCount',
208 component: selectActCount, 217 component: selectActCount,
209 name: 'selectActCount', 218 name: 'selectActCount',
......