<!--模型压缩 -->
<template>
  <div style="position: relative">
    <div class="topBox">
       <div class="title">模型压缩</div>
        <div class="instructions">通过量化、稀疏化等方法在尽量减少精度损失的前提下，降低AI加速卡资源占用，提高推理速度。</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="数据集名称或id"
            prop="formFilter.dataName"
            label-width="120px"
          >
            <el-input
              class="filter-item"
              v-model="myDataSetPage.formFilter.dataName"
              :clearable="true"
              placeholder="数据集名称或id"
            />
          </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="taskName" title="任务名称"></vxe-column>
        <vxe-column field="taskState" title="任务状态"></vxe-column>
        <vxe-column field="sourceModel" title="源模型"></vxe-column>
        <vxe-column field="compressedModel" title="压缩后模型"></vxe-column>
        <vxe-column field="creationTime" 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: {
          dataName: ''
        }
      },
      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);
    }
  }
};
</script>
<style lang="scss" scoped>
@import "@/assets/style/element-variables.scss";
.topBox{
  background-color: white;
  width: 100%;
  height: 95px;
  margin-bottom: 16px;
        .title {
    color: $--color-text-primary;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
        padding: 20px 20px 10px 20px;
  }
}
.instructions {

  padding: 0px 20px 20px 20px;

  .describe {
    color: $--color-text-secondary;
    margin-bottom: 16px;
  }
  .itemTitle {
    color: $--color-text-primary;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
  }
  .head-index {
    font-size: 24px;
    color: #e8e9eb;
    line-height: 32px;
  }
  .itemDescribe {
    width: 170px;
    color: $--color-text-secondary;
  }
  .img {
    height: 72px;
    width: 140px;
  }
}
.tableBox {
  background-color: white;
  width: 100%;
  padding: 20px;
  .add {
    margin-bottom: 20px;
  }
}

</style>
