<template>
  <div>
    <EasyDataList :data-source-name="dataSourceName" :diy-colums="columns"
                  :action-props="{showExportBtn:false,showAddBtn:false}"
                  :table-props="{isOperate: false}"
                  @handleCurrentChange="handleCurrentChange">

    </EasyDataList>
  </div>
</template>
<script lang="jsx">
import EasyDataList from "../../packages/EasyDataList/EasyDataList.vue";

export default {
  name: 'InterfaceChoose',
  components: {EasyDataList},
  data() {
    return {
      dataSourceName: 'interface_info',
      currentData: {}, //选中的数据
      columns: [
        {
          label: 'Id',
          prop: 'id',
        }, {
          label: '接口名称',
          prop: 'keyInfoObject.api_name',
        },
        {
          label: '分类',
          prop: 'keyInfoObject.api_group.label',
          formatter: this.classifyFmt
        },
      ]
    }
  },
  methods: {
    getData() {
      return {value: this.currentData.id, label: this.currentData.keyInfoObject.api_name};
    },
    handleCurrentChange(row) {
      this.currentData = row
    }
  }
}
</script>
