<template>
  <div>
  <el-button   type="button" size="mini"  @click="handleFilter()">刷新</el-button>
       <data-table :loadPage ="loadList"
                    :api="api"
                    :border="true" :stripe="true"
                    :menuFlag="false"
                    :handleFlag.sync="handleFlag"
                    :showSelection="true"
                    :queryParas="queryParas"
                    :sourceData.sync="formTableData.sourceData"
                    :loadCount.sync="loadCount"
                    :columns="columns">
           <template slot="requestParams" slot-scope="scope">
            <el-input v-model="scope.data.row.requestParams" />
          </template>
          <template slot="responseParams" slot-scope="scope">
            <el-input v-model="scope.data.row.responseParams" />
          </template>
       </data-table>
 </div>
</template>

<script>
import { DataTable, authButton, btnUpload } from 'newepoch-components'
import tracemgrApi from '@/api/tracemgrApi'
import * as format from '@/filters/index'

export default {
  components: {
    DataTable,
    authButton,
    btnUpload,
    tracemgrApi,
    format
  },
  data () {
    return {
      loadList: 'getList',
      loadCount: 0,
      formTableData: {
        sourceData: []
      },
      columns: [
        {
          prop: 'addTime',
          align: 'center',
          label: '请求时间',
          showOverflowTooltip: true
        },
        {
          prop: 'method',
          align: 'center',
          label: '请求外部接口',
          showOverflowTooltip: true
        }, {
          slot: true,
          prop: 'requestParams',
          align: 'center',
          label: '请求参数',
          showOverflowTooltip: true
        }, {
          slot: true,
          prop: 'responseParams',
          align: 'center',
          label: '响应参数',
          showOverflowTooltip: true
        }
      ],
      queryParas: {
        pageIndex: 1,
        pageSize: 10
      },
      componentList: [
      ]
    }
  },
  computed: {
    api () {
      return tracemgrApi['commonApi']
    }
  },
  mounted: function () {
    this.handleFilter()
  },
  methods: {
    handleFilter () {
      this.loadCount = this.loadCount + 1
    }
  }
}
</script>
