<template>
  <div class="container-box">
    <div class="search-box">
      <el-form
        :inline="true"
        ref="searchForm"
        :model="searchForm"
        class="demo-form-inline"
        label-width="auto"
        size="mini"
      >
        <el-form-item label="Panel">
          <el-input v-model="searchForm.a" placeholder="请输入Panel"></el-input>
        </el-form-item>
        <el-form-item label="检测平台">
          <el-input
            v-model="searchForm.b"
            placeholder="请输入检测平台"
          ></el-input>
        </el-form-item>

        <el-form-item>
          <el-button type="success" icon="el-icon-search" @click="searchClick"
            >搜索</el-button
          >
          <el-button type="warning" icon="el-icon-refresh" @click="resetClick"
            >重置</el-button
          >
        </el-form-item>
      </el-form>
    </div>
    <div class="list-box">
      <el-table :data="tableData" style="width: 100%" size="mini" border>
        <el-table-column prop="a" label="Panel名称"></el-table-column>
        <el-table-column prop="b" label="检测平台"></el-table-column>
        <el-table-column prop="c" label="基因版本"></el-table-column>
        <el-table-column prop="d" label="位点数目"></el-table-column>
        <el-table-column prop="e" label="描述"></el-table-column>
        <el-table-column label="操作">
          <el-button size="mini" type="text" class="detail-btn">
            <router-link :to="{ path: '/geneMgmt/SPN' }">详情</router-link>
          </el-button>
        </el-table-column>
      </el-table>
      <div class="page-box">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :page-sizes="[20, 50, 100]"
          layout="total, sizes, prev, pager, next, jumper"
          :current-page="form.page"
          :page-size="form.pagesize"
          :total="total"
        >
        </el-pagination>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      searchForm: {
        a: '',
        b: ''
      },
      tableData: [
        {
          id: 1,
          a: 'test_1',
          b: 'illumina',
          c: 'ARS-UCD1.2',
          d: '1011',
          e: '--'
        },
        {
          id: 2,
          a: 'test_2',
          b: 'illumina',
          c: 'ARS-UCD1.2',
          d: '2365',
          e: '--'
        },
        {
          id: 3,
          a: 'test_3',
          b: 'illumina',
          c: 'ARS-UCD1.2',
          d: '2589',
          e: '--'
        },
        {
          id: 4,
          a: 'test_4',
          b: 'illumina',
          c: 'ARS-UCD1.2',
          d: '4568',
          e: '--'
        },
        {
          id: 5,
          a: 'test_5',
          b: 'illumina',
          c: 'ARS-UCD1.2',
          d: '2587',
          e: '--'
        },
        {
          id: 6,
          a: 'test_6',
          b: 'illumina',
          c: 'ARS-UCD1.2',
          d: '1452',
          e: '--'
        },
        {
          id: 7,
          a: 'test_7',
          b: 'illumina',
          c: 'ARS-UCD1.2',
          d: '7854',
          e: '--'
        },
        {
          id: 8,
          a: 'test_8',
          b: 'illumina',
          c: 'ARS-UCD1.2',
          d: '5894',
          e: '--'
        },
        {
          id: 9,
          a: 'test_9',
          b: 'illumina',
          c: 'ARS-UCD1.2',
          d: '3354',
          e: '--'
        }
      ],
      form: {
        page: 1,
        pagesize: 20
      },
      total: 9
    }
  },
  methods: {
    // 搜索
    searchClick() {},
    // 重置
    resetClick() {
      for (const key in this.searchForm) {
        this.searchForm[key] = ''
      }
    },
    // 条
    handleSizeChange(val) {
      this.form.pagesize = parseInt(val)
    },
    // 页
    handleCurrentChange(val) {
      this.form.page = parseInt(val)
    },
    download(id) {}
  }
}
</script>

<style lang="less" scoped>
.container-box {
  min-height: calc(100vh - 84px);
  padding: 15px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  .search-box {
    background: #fff;
    border-radius: 6px;
    padding: 10px 15px;
    margin-bottom: 25px;
  }
  .list-box {
    flex: 1;
    background: #fff;
    border-radius: 6px;
    padding: 10px 15px;
    .detail-btn {
      color: #67c23a;
    }
    .page-box {
      margin-top: 10px;
    }
  }
}
.el-form-item {
  margin-bottom: 0px;
  margin-right: 20px;
}
// table
/deep/.el-table th.el-table__cell {
  background-color: #f5f7fa;
}
/deep/ .cell {
  font-weight: normal;
}
</style>
