bizDataByUid.vue 2.07 KB
<template xmlns:el-col="http://www.w3.org/1999/html">
  <div>
    <br/>
    <span>根据UID查询接口response</span>
    <el-table
      :data="bizDataResponseUids"
      border
      style="width: 100%"
      :header-cell-style="{background: 'deepskyblue', color: 'snow'}">
      <el-table-column
        prop="method"
        label="接口名称"
        min-width="2">
      </el-table-column>
      <el-table-column
        prop="bizData"
        label="请求参数"
        min-width="3">
      </el-table-column>
      <el-table-column
        prop="response"
        label="接口返回值"
        min-width="5">
      </el-table-column>
      <el-table-column
        prop="timestamp"
        label="最近一次调用时间"
        min-width="1">
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        uid: this.$route.query.uid,
        beginDate: this.$route.query.beginDate,
        endDate: this.$route.query.endDate,
        type: this.$route.query.type,
        bizDataResponseUids: []
      }
    },
    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/bizDataByUid?'+this.$qs.stringify({
          uid: this.uid,
          beginDate: this.beginDate,
          endDate: this.endDate,
          type: this.type
        }),config).then((res)=>{
          console.log(res.data)
          this.bizDataResponseUids=res.data.bizDataResponseUids
          loading.close();
        }).catch(error=>{
          console.log(error);
          loading.close();
          this.$message({
            showClose: true,
            message: '服务器处理失败,请核对参数!',
            type: 'error'
          });
        })
      }
    }
  }
</script>