<!--调用统计 -->
<template>
  <div style="position: relative">
    <div class="topBox">
       <div class="title">调用统计</div>
  <div class="statistics">
    <div class="item">
      <div>调用接口数</div>
      <div><span>0</span> 个</div>
    </div>
    <div class="item">
      <div>调用总量</div>
      <div><span>0</span>次</div>
    </div>
    <div class="item">
      <div>调用失败</div>
      <div><span>0</span>次</div>
    </div>
  </div>
    </div>
    <div class="tableBox" :style="{ height: tableHeight }">
      
             <el-form
        ref="myDataSetPage"
        :model="myDataSetPage"
        label-width="75px"
        :size="defaultFormItemSize"
        label-position="right"
        @submit.native.prevent
      >
        <filter-box :item-width="350" @search="search()" @reset="onReset">
          <el-form-item label-width="0px">
             <el-button class="add" type="primary" icon="el-icon-plus" :size="defaultFormItemSize">创建模型</el-button>
          </el-form-item>
              <el-form-item label-width="0px">
            <el-button
              class="add"
              type="info"
              icon="el-icon-plus"
              :size="defaultFormItemSize"
              >删除</el-button
            >
          </el-form-item>
          <el-form-item
            label="模型名称"
            prop="formFilter.modelName"
            label-width="120px"
          >
            <el-input
              class="filter-item"
              v-model="myDataSetPage.formFilter.modelName"
              :clearable="true"
              placeholder="模型名称"
            />
          </el-form-item>
        </filter-box>
      </el-form>
      <vxe-table
        border
        show-header-overflow
        show-overflow
        :row-config="{ isHover: true }"
        :data="tableData"
        min-height="96"
      >
        <vxe-column field="serveName" title="服务名称"></vxe-column>
        <vxe-column field="otalCallVolume" title="调用总量"></vxe-column>
        <vxe-column field="callFailure" title="调用失败"></vxe-column>
        <vxe-column field="failureRate" title="失败率"></vxe-column>
        <vxe-column field="operation" title="操作">
          <!-- <template slot-scope="scope">
              <el-button
                type="text"
                :size="defaultFormItemSize"
                @click="dataImport(scope.row)"
                >导入</el-button
              >
              <el-button
                type="text"
                :size="defaultFormItemSize"
                @click="del(scope.row)"
                >删除</el-button
              >
            </template> -->
        </vxe-column>
      </vxe-table>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex';
export default {
  data () {
    return {
      myDataSetPage: {
        formFilter: {
          modelName: ''
        }
      },
      tableData: [
        {
          id: 10001,
          name: 'Test1',
          role: 'Develop',
          sex: 'Man',
          age: 28,
          address: 'test abc'
        }
      ]
    };
  },

  components: {},

  computed: {
    ...mapGetters(['getMainContextHeight']),
    tableHeight () {
      return this.getMainContextHeight - 95 + 'px';
    }
  },

  mounted () {
    
  },

  methods: {
    resize (e) {
      setTimeout(() => {
        this.collapseHeight = e.height
      }, 300);
    },
    onReset () {
      
    },
    search () {}
  }
};
</script>
<style lang="scss" scoped>
@import "@/assets/style/element-variables.scss";
.topBox{
  background-color: white;
  width: 100%;
  height: 130px;
  margin-bottom: 16px;
        .title {
    color: $--color-text-primary;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
        padding: 20px 20px 10px 20px;
  }
}
.statistics{
  display: flex;
   justify-content: space-between;
   padding: 0 20px 0 20px;
  .item{
    text-align: center;
    span{
      font-size: 18px;
      margin-right:5px;
      
    }
   div:first-child{
    margin-bottom: 10px;
    }
  }
}
.tableBox {
  background-color: white;
  width: 100%;
  padding: 20px;
  overflow: auto;
  .add {
    margin-bottom: 20px;
  }
}

</style>
