commit
Showing
3 changed files
with
149 additions
and
0 deletions
src/page/bizDataByUid.vue
0 → 100644
| 1 | <template xmlns:el-col="http://www.w3.org/1999/html"> | ||
| 2 | <div> | ||
| 3 | <br/> | ||
| 4 | <span>根据UID查询接口response</span> | ||
| 5 | <el-table | ||
| 6 | :data="bizDataResponseUids" | ||
| 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="2"> | ||
| 14 | </el-table-column> | ||
| 15 | <el-table-column | ||
| 16 | prop="bizData" | ||
| 17 | label="请求参数" | ||
| 18 | min-width="3"> | ||
| 19 | </el-table-column> | ||
| 20 | <el-table-column | ||
| 21 | prop="response" | ||
| 22 | label="接口返回值" | ||
| 23 | min-width="5"> | ||
| 24 | </el-table-column> | ||
| 25 | <el-table-column | ||
| 26 | prop="timestamp" | ||
| 27 | label="最近一次调用时间" | ||
| 28 | min-width="1"> | ||
| 29 | </el-table-column> | ||
| 30 | </el-table> | ||
| 31 | </div> | ||
| 32 | </template> | ||
| 33 | |||
| 34 | <script> | ||
| 35 | export default { | ||
| 36 | data() { | ||
| 37 | return { | ||
| 38 | uid: this.$route.query.uid, | ||
| 39 | beginDate: this.$route.query.beginDate, | ||
| 40 | endDate: this.$route.query.endDate, | ||
| 41 | type: this.$route.query.type, | ||
| 42 | bizDataResponseUids: [] | ||
| 43 | } | ||
| 44 | }, | ||
| 45 | mounted() { | ||
| 46 | this.activity() | ||
| 47 | }, | ||
| 48 | methods: { | ||
| 49 | activity() { | ||
| 50 | const loading = this.$loading({ | ||
| 51 | lock: true, | ||
| 52 | text: '加载中...', | ||
| 53 | spinner: 'el-icon-loading', | ||
| 54 | background: 'rgba(0, 0, 0, 0.7)' | ||
| 55 | }); | ||
| 56 | let config = { | ||
| 57 | headers: { | ||
| 58 | 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 59 | } | ||
| 60 | } | ||
| 61 | this.$http.get('/bigdata/bizDataByUid?'+this.$qs.stringify({ | ||
| 62 | uid: this.uid, | ||
| 63 | beginDate: this.beginDate, | ||
| 64 | endDate: this.endDate, | ||
| 65 | type: this.type | ||
| 66 | }),config).then((res)=>{ | ||
| 67 | console.log(res.data) | ||
| 68 | this.bizDataResponseUids=res.data.bizDataResponseUids | ||
| 69 | loading.close(); | ||
| 70 | }).catch(error=>{ | ||
| 71 | console.log(error); | ||
| 72 | loading.close(); | ||
| 73 | this.$message({ | ||
| 74 | showClose: true, | ||
| 75 | message: '服务器处理失败,请核对参数!', | ||
| 76 | type: 'error' | ||
| 77 | }); | ||
| 78 | }) | ||
| 79 | } | ||
| 80 | } | ||
| 81 | } | ||
| 82 | </script> |
| ... | @@ -142,6 +142,44 @@ | ... | @@ -142,6 +142,44 @@ |
| 142 | </el-card> | 142 | </el-card> |
| 143 | </el-form> | 143 | </el-form> |
| 144 | </el-col> | 144 | </el-col> |
| 145 | <el-col :span="8"> | ||
| 146 | <el-form ref="bizDataByUid" :model="bizDataByUid" label-width="0px"> | ||
| 147 | <el-card class="darkred" shadow="always"> | ||
| 148 | <div slot="header" class="clearfix"> | ||
| 149 | <span>根据UID查询接口response</span> | ||
| 150 | </div> | ||
| 151 | <div class="text item"> | ||
| 152 | <el-form-item> | ||
| 153 | <el-input placeholder="请输入UID" v-model="bizDataByUid.uid" clearable></el-input> | ||
| 154 | </el-form-item> | ||
| 155 | <el-form-item> | ||
| 156 | <el-date-picker | ||
| 157 | v-model="bizDataByUid.showdate" | ||
| 158 | type="datetimerange" | ||
| 159 | value-format="yyyy-MM-dd HH:mm:ss" | ||
| 160 | range-separator="至" | ||
| 161 | start-placeholder="开始日期" | ||
| 162 | end-placeholder="结束日期"> | ||
| 163 | </el-date-picker> | ||
| 164 | </el-form-item> | ||
| 165 | <el-form-item> | ||
| 166 | <el-select v-model="bizDataByUid.huanjing" placeholder="请选择执行环境"> | ||
| 167 | <el-option | ||
| 168 | v-for="item in bizDataByUidOptions" | ||
| 169 | :key="item.value" | ||
| 170 | :label="item.label" | ||
| 171 | :value="item.value"> | ||
| 172 | </el-option> | ||
| 173 | </el-select> | ||
| 174 | </el-form-item> | ||
| 175 | <div style="margin: 15px 0;"></div> | ||
| 176 | <el-form-item> | ||
| 177 | <el-button round @click="bizDataByUidSubmit">查询参数</el-button> | ||
| 178 | </el-form-item> | ||
| 179 | </div> | ||
| 180 | </el-card> | ||
| 181 | </el-form> | ||
| 182 | </el-col> | ||
| 145 | </el-row> | 183 | </el-row> |
| 146 | </div> | 184 | </div> |
| 147 | </template> | 185 | </template> |
| ... | @@ -250,6 +288,18 @@ | ... | @@ -250,6 +288,18 @@ |
| 250 | value: '1', | 288 | value: '1', |
| 251 | label: '线上环境' | 289 | label: '线上环境' |
| 252 | }], | 290 | }], |
| 291 | bizDataByUid: { | ||
| 292 | uid: '', | ||
| 293 | showdate: '', | ||
| 294 | huanjing: [] | ||
| 295 | }, | ||
| 296 | bizDataByUidOptions: [{ | ||
| 297 | value: '0', | ||
| 298 | label: '测试环境' | ||
| 299 | }, { | ||
| 300 | value: '1', | ||
| 301 | label: '线上环境' | ||
| 302 | }], | ||
| 253 | bigdataReport: { | 303 | bigdataReport: { |
| 254 | project: [{ | 304 | project: [{ |
| 255 | project_value: '', | 305 | project_value: '', |
| ... | @@ -307,6 +357,14 @@ | ... | @@ -307,6 +357,14 @@ |
| 307 | type: this.bizDataResponse.huanjing.toString()}}) | 357 | type: this.bizDataResponse.huanjing.toString()}}) |
| 308 | window.open(href, '_blank') | 358 | window.open(href, '_blank') |
| 309 | }, | 359 | }, |
| 360 | bizDataByUidSubmit() { | ||
| 361 | const {href} = this.$router.resolve({ name:'bizDataByUid', query: | ||
| 362 | { uid: this.bizDataByUid.uid, | ||
| 363 | beginDate: this.bizDataByUid.showdate[0], | ||
| 364 | endDate: this.bizDataByUid.showdate[1], | ||
| 365 | type: this.bizDataByUid.huanjing.toString()}}) | ||
| 366 | window.open(href, '_blank') | ||
| 367 | }, | ||
| 310 | bigdataReportSubmit() { | 368 | bigdataReportSubmit() { |
| 311 | const {href} = this.$router.resolve({ name:'bigdataReport', query: | 369 | const {href} = this.$router.resolve({ name:'bigdataReport', query: |
| 312 | { project: this.bigdataReport.project.toString()}}) | 370 | { project: this.bigdataReport.project.toString()}}) | ... | ... |
| ... | @@ -28,6 +28,7 @@ import methodCount from '@/page/methodCount' | ... | @@ -28,6 +28,7 @@ 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 | import bigdataReport from '@/page/bigdataReport' |
| 31 | import bizDataByUid from '@/page/bizDataByUid' | ||
| 31 | 32 | ||
| 32 | Vue.use(Router) | 33 | Vue.use(Router) |
| 33 | 34 | ||
| ... | @@ -205,6 +206,14 @@ export default new Router({ | ... | @@ -205,6 +206,14 @@ export default new Router({ |
| 205 | } | 206 | } |
| 206 | }, | 207 | }, |
| 207 | { | 208 | { |
| 209 | path: '/bizDataByUid', | ||
| 210 | component: bizDataByUid, | ||
| 211 | name: 'bizDataByUid', | ||
| 212 | meta: { | ||
| 213 | title: '测试工具平台' | ||
| 214 | } | ||
| 215 | }, | ||
| 216 | { | ||
| 208 | path: '/bigdataReport', | 217 | path: '/bigdataReport', |
| 209 | component: bigdataReport, | 218 | component: bigdataReport, |
| 210 | name: 'bigdataReport', | 219 | name: 'bigdataReport', | ... | ... |
-
Please register or sign in to post a comment