commit
Showing
3 changed files
with
95 additions
and
13 deletions
src/page/methodCount.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="methodCounts" | ||
| 7 | border | ||
| 8 | style="width: 100%" | ||
| 9 | :header-cell-style="{background: 'deepskyblue', color: 'snow'}"> | ||
| 10 | <el-table-column | ||
| 11 | prop="method" | ||
| 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 | showdate: this.$route.query.showdate, | ||
| 34 | methodCounts: [] | ||
| 35 | } | ||
| 36 | }, | ||
| 37 | mounted() { | ||
| 38 | this.activity() | ||
| 39 | }, | ||
| 40 | methods: { | ||
| 41 | activity() { | ||
| 42 | const loading = this.$loading({ | ||
| 43 | lock: true, | ||
| 44 | text: '加载中...', | ||
| 45 | spinner: 'el-icon-loading', | ||
| 46 | background: 'rgba(0, 0, 0, 0.7)' | ||
| 47 | }); | ||
| 48 | let config = { | ||
| 49 | headers: { | ||
| 50 | 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 51 | } | ||
| 52 | } | ||
| 53 | this.$http.get('/bigdata/methodCount?'+this.$qs.stringify({ | ||
| 54 | showdate: this.showdate | ||
| 55 | }),config).then((res)=>{ | ||
| 56 | console.log(res.data) | ||
| 57 | this.methodCounts=res.data.methodCounts | ||
| 58 | loading.close(); | ||
| 59 | }).catch(error=>{ | ||
| 60 | console.log(error); | ||
| 61 | loading.close(); | ||
| 62 | this.$message({ | ||
| 63 | showClose: true, | ||
| 64 | message: '服务器处理失败,请核对参数!', | ||
| 65 | type: 'error' | ||
| 66 | }); | ||
| 67 | }) | ||
| 68 | } | ||
| 69 | } | ||
| 70 | } | ||
| 71 | </script> |
| ... | @@ -2,21 +2,24 @@ | ... | @@ -2,21 +2,24 @@ |
| 2 | <div> | 2 | <div> |
| 3 | <el-row style="margin-bottom: 15px; margin-top: 5px"> | 3 | <el-row style="margin-bottom: 15px; margin-top: 5px"> |
| 4 | <el-col :span="8"> | 4 | <el-col :span="8"> |
| 5 | <el-form ref="smsCode" :model="smsCode" 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> |
| 12 | <el-input placeholder="请输入手机号" v-model="smsCode.phone" clearable></el-input> | 12 | <el-date-picker |
| 13 | </el-form-item> | 13 | v-model="methodCount.showdate" |
| 14 | <el-form-item> | 14 | type="date" |
| 15 | <el-input placeholder="请输入验证码" v-model="smsCode.code" clearable></el-input> | 15 | placeholder="选择日期" |
| 16 | format="yyyy 年 MM 月 dd 日" | ||
| 17 | value-format="yyyy-MM-dd"> | ||
| 18 | </el-date-picker> | ||
| 16 | </el-form-item> | 19 | </el-form-item> |
| 17 | <div style="margin: 15px 0;"></div> | 20 | <div style="margin: 15px 0;"></div> |
| 18 | <el-form-item> | 21 | <el-form-item> |
| 19 | <el-button round @click="smsCodeSubmit">设置验证码</el-button> | 22 | <el-button round @click="methodCountSubmit">查询接口概况</el-button> |
| 20 | </el-form-item> | 23 | </el-form-item> |
| 21 | </div> | 24 | </div> |
| 22 | </el-card> | 25 | </el-card> |
| ... | @@ -94,9 +97,8 @@ | ... | @@ -94,9 +97,8 @@ |
| 94 | export default { | 97 | export default { |
| 95 | data() { | 98 | data() { |
| 96 | return { | 99 | return { |
| 97 | smsCode: { | 100 | methodCount: { |
| 98 | phone: '', | 101 | showdate: '' |
| 99 | code: 1111 | ||
| 100 | } | 102 | } |
| 101 | } | 103 | } |
| 102 | }, | 104 | }, |
| ... | @@ -123,9 +125,9 @@ | ... | @@ -123,9 +125,9 @@ |
| 123 | type: 'success' | 125 | type: 'success' |
| 124 | }); | 126 | }); |
| 125 | }, | 127 | }, |
| 126 | apiTestSubmit() { | 128 | methodCountSubmit() { |
| 127 | const {href} = this.$router.resolve({ name:'apiTest2', query: | 129 | const {href} = this.$router.resolve({ name:'methodCount', query: |
| 128 | {method: this.apiTest.method, biz_data: this.apiTest.biz_data, phone: this.apiTest.phone, path: this.apiTest.path.toString(), type: this.apiTest.huanjing.toString()}}) | 130 | {showdate: this.methodCount.showdate}}) |
| 129 | window.open(href, '_blank') | 131 | window.open(href, '_blank') |
| 130 | } | 132 | } |
| 131 | } | 133 | } | ... | ... |
| ... | @@ -24,6 +24,7 @@ import testHouLi from '@/page/testHouLi' | ... | @@ -24,6 +24,7 @@ import testHouLi from '@/page/testHouLi' |
| 24 | import chouJiang from '@/page/chouJiang' | 24 | 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 | 28 | ||
| 28 | Vue.use(Router) | 29 | Vue.use(Router) |
| 29 | 30 | ||
| ... | @@ -177,6 +178,14 @@ export default new Router({ | ... | @@ -177,6 +178,14 @@ export default new Router({ |
| 177 | } | 178 | } |
| 178 | }, | 179 | }, |
| 179 | { | 180 | { |
| 181 | path: '/methodCount', | ||
| 182 | component: methodCount, | ||
| 183 | name: 'methodCount', | ||
| 184 | meta: { | ||
| 185 | title: '测试工具平台' | ||
| 186 | } | ||
| 187 | }, | ||
| 188 | { | ||
| 180 | path: '/selectActCount', | 189 | path: '/selectActCount', |
| 181 | component: selectActCount, | 190 | component: selectActCount, |
| 182 | name: 'selectActCount', | 191 | name: 'selectActCount', | ... | ... |
-
Please register or sign in to post a comment