commit
Showing
3 changed files
with
132 additions
and
2 deletions
src/page/bizDataResponse.vue
0 → 100644
| 1 | <template xmlns:el-col="http://www.w3.org/1999/html"> | ||
| 2 | <div> | ||
| 3 | <br/> | ||
| 4 | <span>根据接口名、请求参数,查询response</span> | ||
| 5 | <el-table | ||
| 6 | :data="bizDataResponses" | ||
| 7 | border | ||
| 8 | style="width: 100%" | ||
| 9 | :header-cell-style="{background: 'deepskyblue', color: 'snow'}"> | ||
| 10 | <el-table-column | ||
| 11 | prop="uid" | ||
| 12 | label="用户UID" | ||
| 13 | min-width="1">~q | ||
| 14 | </el-table-column> | ||
| 15 | <el-table-column | ||
| 16 | prop="response" | ||
| 17 | label="接口返回值" | ||
| 18 | min-width="4"> | ||
| 19 | </el-table-column> | ||
| 20 | <el-table-column | ||
| 21 | prop="timestamp" | ||
| 22 | label="最近一次调用时间" | ||
| 23 | min-width="2"> | ||
| 24 | </el-table-column> | ||
| 25 | </el-table> | ||
| 26 | </div> | ||
| 27 | </template> | ||
| 28 | |||
| 29 | <script> | ||
| 30 | export default { | ||
| 31 | data() { | ||
| 32 | return { | ||
| 33 | name: this.$route.query.name, | ||
| 34 | bizdata: this.$route.query.bizdata, | ||
| 35 | beginDate: this.$route.query.beginDate, | ||
| 36 | endDate: this.$route.query.endDate, | ||
| 37 | bizDataResponses: [] | ||
| 38 | } | ||
| 39 | }, | ||
| 40 | mounted() { | ||
| 41 | this.activity() | ||
| 42 | }, | ||
| 43 | methods: { | ||
| 44 | activity() { | ||
| 45 | const loading = this.$loading({ | ||
| 46 | lock: true, | ||
| 47 | text: '加载中...', | ||
| 48 | spinner: 'el-icon-loading', | ||
| 49 | background: 'rgba(0, 0, 0, 0.7)' | ||
| 50 | }); | ||
| 51 | let config = { | ||
| 52 | headers: { | ||
| 53 | 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 54 | } | ||
| 55 | } | ||
| 56 | this.$http.get('/bigdata/bizDataResponse?'+this.$qs.stringify({ | ||
| 57 | method: this.name, | ||
| 58 | biz_data: this.bizdata, | ||
| 59 | beginDate: this.beginDate, | ||
| 60 | endDate: this.endDate | ||
| 61 | }),config).then((res)=>{ | ||
| 62 | console.log(res.data) | ||
| 63 | this.bizDataResponses=res.data.bizDataResponses | ||
| 64 | loading.close(); | ||
| 65 | }).catch(error=>{ | ||
| 66 | console.log(error); | ||
| 67 | loading.close(); | ||
| 68 | this.$message({ | ||
| 69 | showClose: true, | ||
| 70 | message: '服务器处理失败,请核对参数!', | ||
| 71 | type: 'error' | ||
| 72 | }); | ||
| 73 | }) | ||
| 74 | } | ||
| 75 | } | ||
| 76 | } | ||
| 77 | </script> |
| ... | @@ -5,7 +5,7 @@ | ... | @@ -5,7 +5,7 @@ |
| 5 | <el-form ref="methodCount" :model="methodCount" label-width="0px"> | 5 | <el-form ref="methodCount" :model="methodCount" label-width="0px"> |
| 6 | <el-card class="darkred" shadow="always"> | 6 | <el-card class="darkred" shadow="always"> |
| 7 | <div slot="header" class="clearfix"> | 7 | <div slot="header" class="clearfix"> |
| 8 | <span>查询指定日期的接口调用概况</span> | 8 | <span>查询接口调用概况</span> |
| 9 | </div> | 9 | </div> |
| 10 | <div class="text item"> | 10 | <div class="text item"> |
| 11 | <el-form-item> | 11 | <el-form-item> |
| ... | @@ -30,7 +30,7 @@ | ... | @@ -30,7 +30,7 @@ |
| 30 | <el-form ref="bizDataCount" :model="bizDataCount" label-width="0px"> | 30 | <el-form ref="bizDataCount" :model="bizDataCount" label-width="0px"> |
| 31 | <el-card class="darkred" shadow="always"> | 31 | <el-card class="darkred" shadow="always"> |
| 32 | <div slot="header" class="clearfix"> | 32 | <div slot="header" class="clearfix"> |
| 33 | <span>根据接口名查询请求参数</span> | 33 | <span>查询接口请求参数</span> |
| 34 | </div> | 34 | </div> |
| 35 | <div class="text item"> | 35 | <div class="text item"> |
| 36 | <el-form-item> | 36 | <el-form-item> |
| ... | @@ -54,6 +54,37 @@ | ... | @@ -54,6 +54,37 @@ |
| 54 | </el-card> | 54 | </el-card> |
| 55 | </el-form> | 55 | </el-form> |
| 56 | </el-col> | 56 | </el-col> |
| 57 | <el-col :span="8"> | ||
| 58 | <el-form ref="bizDataResponse" :model="bizDataResponse" label-width="0px"> | ||
| 59 | <el-card class="darkred" shadow="always"> | ||
| 60 | <div slot="header" class="clearfix"> | ||
| 61 | <span>查询接口response</span> | ||
| 62 | </div> | ||
| 63 | <div class="text item"> | ||
| 64 | <el-form-item> | ||
| 65 | <el-input placeholder="请输入接口方法名method" v-model="bizDataResponse.name" clearable></el-input> | ||
| 66 | </el-form-item> | ||
| 67 | <el-form-item> | ||
| 68 | <el-input placeholder="请输入接口请求参数biz_data" v-model="bizDataResponse.bizdata" clearable></el-input> | ||
| 69 | </el-form-item> | ||
| 70 | <el-form-item> | ||
| 71 | <el-date-picker | ||
| 72 | v-model="bizDataResponse.showdate" | ||
| 73 | type="datetimerange" | ||
| 74 | value-format="yyyy-MM-dd HH:mm:ss" | ||
| 75 | range-separator="至" | ||
| 76 | start-placeholder="开始日期" | ||
| 77 | end-placeholder="结束日期"> | ||
| 78 | </el-date-picker> | ||
| 79 | </el-form-item> | ||
| 80 | <div style="margin: 15px 0;"></div> | ||
| 81 | <el-form-item> | ||
| 82 | <el-button round @click="bizDataResponseSubmit">查询Response</el-button> | ||
| 83 | </el-form-item> | ||
| 84 | </div> | ||
| 85 | </el-card> | ||
| 86 | </el-form> | ||
| 87 | </el-col> | ||
| 57 | </el-row> | 88 | </el-row> |
| 58 | </div> | 89 | </div> |
| 59 | </template> | 90 | </template> |
| ... | @@ -132,6 +163,11 @@ | ... | @@ -132,6 +163,11 @@ |
| 132 | bizDataCount: { | 163 | bizDataCount: { |
| 133 | name: '', | 164 | name: '', |
| 134 | showdate: '' | 165 | showdate: '' |
| 166 | }, | ||
| 167 | bizDataResponse: { | ||
| 168 | name: '', | ||
| 169 | bizdata: '', | ||
| 170 | showdate: '' | ||
| 135 | } | 171 | } |
| 136 | } | 172 | } |
| 137 | }, | 173 | }, |
| ... | @@ -169,6 +205,14 @@ | ... | @@ -169,6 +205,14 @@ |
| 169 | beginDate: this.bizDataCount.showdate[0], | 205 | beginDate: this.bizDataCount.showdate[0], |
| 170 | endDate: this.bizDataCount.showdate[1]}}) | 206 | endDate: this.bizDataCount.showdate[1]}}) |
| 171 | window.open(href, '_blank') | 207 | window.open(href, '_blank') |
| 208 | }, | ||
| 209 | bizDataResponseSubmit() { | ||
| 210 | const {href} = this.$router.resolve({ name:'bizDataResponse', query: | ||
| 211 | { name: this.bizDataCount.name, | ||
| 212 | bizdata: this.bizDataCount.bizdata, | ||
| 213 | beginDate: this.bizDataCount.showdate[0], | ||
| 214 | endDate: this.bizDataCount.showdate[1]}}) | ||
| 215 | window.open(href, '_blank') | ||
| 172 | } | 216 | } |
| 173 | } | 217 | } |
| 174 | } | 218 | } | ... | ... |
| ... | @@ -26,6 +26,7 @@ import selectActCount from '@/page/selectActCount' | ... | @@ -26,6 +26,7 @@ import selectActCount from '@/page/selectActCount' |
| 26 | import toolData from '@/page/toolData' | 26 | 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 | 30 | ||
| 30 | Vue.use(Router) | 31 | Vue.use(Router) |
| 31 | 32 | ||
| ... | @@ -195,6 +196,14 @@ export default new Router({ | ... | @@ -195,6 +196,14 @@ export default new Router({ |
| 195 | } | 196 | } |
| 196 | }, | 197 | }, |
| 197 | { | 198 | { |
| 199 | path: '/bizDataResponse', | ||
| 200 | component: bizDataResponse, | ||
| 201 | name: 'bizDataResponse', | ||
| 202 | meta: { | ||
| 203 | title: '测试工具平台' | ||
| 204 | } | ||
| 205 | }, | ||
| 206 | { | ||
| 198 | path: '/selectActCount', | 207 | path: '/selectActCount', |
| 199 | component: selectActCount, | 208 | component: selectActCount, |
| 200 | name: 'selectActCount', | 209 | name: 'selectActCount', | ... | ... |
-
Please register or sign in to post a comment