Commit 2483e35d 2483e35dd330de2c70f6b87c5e389fba1f23c142 by 张浩

commit

1 parent 3bfe6101
<template xmlns:el-col="http://www.w3.org/1999/html">
<div>
<br/>
<span>接口调用概况</span>
<el-table
:data="methodCounts"
border
style="width: 100%"
:header-cell-style="{background: 'deepskyblue', color: 'snow'}">
<el-table-column
prop="method"
label="接口名称"
min-width="4">
</el-table-column>
<el-table-column
prop="sumcount"
label="总调用次数"
min-width="1">
</el-table-column>
<el-table-column
prop="maxtime"
label="最后调用时间"
min-width="2">
</el-table-column>
</el-table>
</div>
</template>
<script>
export default {
data() {
return {
showdate: this.$route.query.showdate,
methodCounts: []
}
},
mounted() {
this.activity()
},
methods: {
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/methodCount?'+this.$qs.stringify({
showdate: this.showdate
}),config).then((res)=>{
console.log(res.data)
this.methodCounts=res.data.methodCounts
loading.close();
}).catch(error=>{
console.log(error);
loading.close();
this.$message({
showClose: true,
message: '服务器处理失败,请核对参数!',
type: 'error'
});
})
}
}
}
</script>
......@@ -2,21 +2,24 @@
<div>
<el-row style="margin-bottom: 15px; margin-top: 5px">
<el-col :span="8">
<el-form ref="smsCode" :model="smsCode" label-width="0px">
<el-form ref="methodCount" :model="methodCount" label-width="0px">
<el-card class="darkred" shadow="always">
<div slot="header" class="clearfix">
<span>设置短信验证码</span>
<span>查询指定日期的接口调用概况</span>
</div>
<div class="text item">
<el-form-item>
<el-input placeholder="请输入手机号" v-model="smsCode.phone" clearable></el-input>
</el-form-item>
<el-form-item>
<el-input placeholder="请输入验证码" v-model="smsCode.code" clearable></el-input>
<el-date-picker
v-model="methodCount.showdate"
type="date"
placeholder="选择日期"
format="yyyy 年 MM 月 dd 日"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
<div style="margin: 15px 0;"></div>
<el-form-item>
<el-button round @click="smsCodeSubmit">设置验证码</el-button>
<el-button round @click="methodCountSubmit">查询接口概况</el-button>
</el-form-item>
</div>
</el-card>
......@@ -94,9 +97,8 @@
export default {
data() {
return {
smsCode: {
phone: '',
code: 1111
methodCount: {
showdate: ''
}
}
},
......@@ -123,9 +125,9 @@
type: 'success'
});
},
apiTestSubmit() {
const {href} = this.$router.resolve({ name:'apiTest2', query:
{method: this.apiTest.method, biz_data: this.apiTest.biz_data, phone: this.apiTest.phone, path: this.apiTest.path.toString(), type: this.apiTest.huanjing.toString()}})
methodCountSubmit() {
const {href} = this.$router.resolve({ name:'methodCount', query:
{showdate: this.methodCount.showdate}})
window.open(href, '_blank')
}
}
......
......@@ -24,6 +24,7 @@ import testHouLi from '@/page/testHouLi'
import chouJiang from '@/page/chouJiang'
import selectActCount from '@/page/selectActCount'
import toolData from '@/page/toolData'
import methodCount from '@/page/methodCount'
Vue.use(Router)
......@@ -177,6 +178,14 @@ export default new Router({
}
},
{
path: '/methodCount',
component: methodCount,
name: 'methodCount',
meta: {
title: '测试工具平台'
}
},
{
path: '/selectActCount',
component: selectActCount,
name: 'selectActCount',
......