commit
Showing
3 changed files
with
123 additions
and
0 deletions
src/page/bizDataCount.vue
0 → 100644
| 1 | <template xmlns:el-col="http://www.w3.org/1999/html"> | ||
| 2 | <div> | ||
| 3 | <br/> | ||
| 4 | <span>根据接口名查询请求参数</span> | ||
| 5 | <el-table | ||
| 6 | :data="bizDataCounts" | ||
| 7 | border | ||
| 8 | style="width: 100%" | ||
| 9 | :header-cell-style="{background: 'deepskyblue', color: 'snow'}"> | ||
| 10 | <el-table-column | ||
| 11 | prop="bizData" | ||
| 12 | label="请求参数" | ||
| 13 | min-width="4"> | ||
| 14 | </el-table-column> | ||
| 15 | <el-table-column | ||
| 16 | prop="sumcount" | ||
| 17 | label="接口累计调用次数" | ||
| 18 | min-width="1"> | ||
| 19 | </el-table-column> | ||
| 20 | <el-table-column | ||
| 21 | prop="maxtime" | ||
| 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 | beginDate: this.$route.query.beginDate, | ||
| 35 | endDate: this.$route.query.endDate, | ||
| 36 | bizDataCounts: [] | ||
| 37 | } | ||
| 38 | }, | ||
| 39 | mounted() { | ||
| 40 | this.activity() | ||
| 41 | }, | ||
| 42 | methods: { | ||
| 43 | activity() { | ||
| 44 | const loading = this.$loading({ | ||
| 45 | lock: true, | ||
| 46 | text: '加载中...', | ||
| 47 | spinner: 'el-icon-loading', | ||
| 48 | background: 'rgba(0, 0, 0, 0.7)' | ||
| 49 | }); | ||
| 50 | let config = { | ||
| 51 | headers: { | ||
| 52 | 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 53 | } | ||
| 54 | } | ||
| 55 | this.$http.get('/bigdata/bizDataCount?'+this.$qs.stringify({ | ||
| 56 | method: this.name, | ||
| 57 | beginDate: this.beginDate, | ||
| 58 | endDate: this.endDate | ||
| 59 | }),config).then((res)=>{ | ||
| 60 | console.log(res.data) | ||
| 61 | this.bizDataCounts=res.data.bizDataCounts | ||
| 62 | loading.close(); | ||
| 63 | }).catch(error=>{ | ||
| 64 | console.log(error); | ||
| 65 | loading.close(); | ||
| 66 | this.$message({ | ||
| 67 | showClose: true, | ||
| 68 | message: '服务器处理失败,请核对参数!', | ||
| 69 | type: 'error' | ||
| 70 | }); | ||
| 71 | }) | ||
| 72 | } | ||
| 73 | } | ||
| 74 | } | ||
| 75 | </script> |
| ... | @@ -26,6 +26,34 @@ | ... | @@ -26,6 +26,34 @@ |
| 26 | </el-card> | 26 | </el-card> |
| 27 | </el-form> | 27 | </el-form> |
| 28 | </el-col> | 28 | </el-col> |
| 29 | <el-col :span="8"> | ||
| 30 | <el-form ref="bizDataCount" :model="bizDataCount" label-width="0px"> | ||
| 31 | <el-card class="darkred" shadow="always"> | ||
| 32 | <div slot="header" class="clearfix"> | ||
| 33 | <span>根据接口名查询请求参数</span> | ||
| 34 | </div> | ||
| 35 | <div class="text item"> | ||
| 36 | <el-form-item> | ||
| 37 | <el-input placeholder="请输入接口方法名method" v-model="bizDataCount.name" clearable></el-input> | ||
| 38 | </el-form-item> | ||
| 39 | <el-form-item> | ||
| 40 | <el-date-picker | ||
| 41 | v-model="bizDataCount.showdate" | ||
| 42 | type="datetimerange" | ||
| 43 | value-format="yyyy-MM-dd HH:mm:ss" | ||
| 44 | range-separator="至" | ||
| 45 | start-placeholder="开始日期" | ||
| 46 | end-placeholder="结束日期"> | ||
| 47 | </el-date-picker> | ||
| 48 | </el-form-item> | ||
| 49 | <div style="margin: 15px 0;"></div> | ||
| 50 | <el-form-item> | ||
| 51 | <el-button round @click="bizDataCountSubmit">查询参数</el-button> | ||
| 52 | </el-form-item> | ||
| 53 | </div> | ||
| 54 | </el-card> | ||
| 55 | </el-form> | ||
| 56 | </el-col> | ||
| 29 | </el-row> | 57 | </el-row> |
| 30 | </div> | 58 | </div> |
| 31 | </template> | 59 | </template> |
| ... | @@ -100,6 +128,10 @@ | ... | @@ -100,6 +128,10 @@ |
| 100 | return { | 128 | return { |
| 101 | methodCount: { | 129 | methodCount: { |
| 102 | showdate: '' | 130 | showdate: '' |
| 131 | }, | ||
| 132 | bizDataCount: { | ||
| 133 | name: '', | ||
| 134 | showdate: '' | ||
| 103 | } | 135 | } |
| 104 | } | 136 | } |
| 105 | }, | 137 | }, |
| ... | @@ -130,6 +162,13 @@ | ... | @@ -130,6 +162,13 @@ |
| 130 | const {href} = this.$router.resolve({ name:'methodCount', query: | 162 | const {href} = this.$router.resolve({ name:'methodCount', query: |
| 131 | {beginDate: this.methodCount.showdate[0], endDate: this.methodCount.showdate[1]}}) | 163 | {beginDate: this.methodCount.showdate[0], endDate: this.methodCount.showdate[1]}}) |
| 132 | window.open(href, '_blank') | 164 | window.open(href, '_blank') |
| 165 | }, | ||
| 166 | bizDataCountSubmit() { | ||
| 167 | const {href} = this.$router.resolve({ name:'bizDataCount', query: | ||
| 168 | { name: this.methodCount.name, | ||
| 169 | beginDate: this.methodCount.showdate[0], | ||
| 170 | endDate: this.methodCount.showdate[1]}}) | ||
| 171 | window.open(href, '_blank') | ||
| 133 | } | 172 | } |
| 134 | } | 173 | } |
| 135 | } | 174 | } | ... | ... |
| ... | @@ -25,6 +25,7 @@ import chouJiang from '@/page/chouJiang' | ... | @@ -25,6 +25,7 @@ import chouJiang from '@/page/chouJiang' |
| 25 | import selectActCount from '@/page/selectActCount' | 25 | 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 | 29 | ||
| 29 | Vue.use(Router) | 30 | Vue.use(Router) |
| 30 | 31 | ||
| ... | @@ -186,6 +187,14 @@ export default new Router({ | ... | @@ -186,6 +187,14 @@ export default new Router({ |
| 186 | } | 187 | } |
| 187 | }, | 188 | }, |
| 188 | { | 189 | { |
| 190 | path: '/bizDataCount', | ||
| 191 | component: bizDataCount, | ||
| 192 | name: 'bizDataCount', | ||
| 193 | meta: { | ||
| 194 | title: '测试工具平台' | ||
| 195 | } | ||
| 196 | }, | ||
| 197 | { | ||
| 189 | path: '/selectActCount', | 198 | path: '/selectActCount', |
| 190 | component: selectActCount, | 199 | component: selectActCount, |
| 191 | name: 'selectActCount', | 200 | name: 'selectActCount', | ... | ... |
-
Please register or sign in to post a comment