<template>
  <div class="app-container" ref="main">
    <div ref="search">
      <el-form
        :model="queryParams"
        ref="queryForm"
        size="small"
        :inline="true"
        class="search-container"
      >
        <el-form-item prop="name">
          <el-input
            v-model="queryParams.input"
            placeholder="请输入关键字"
            clearable
          >
            <div class="search-btn" slot="append">
              <i class="el-icon-search"></i>
            </div>
          </el-input>
        </el-form-item>
      </el-form>
    </div>

    <div class="book-main" :style="{ height: tableHeigth + 'px' }">
      <div v-for="(item, index) in 10" :key="index">
        <el-image
          style="width: 100%; height: 87%"
          src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
          fit="cover"
        ></el-image>
        <div class="operate">
          <div>高级</div>
          <div class="right-operate">
            <div class="operate-item">
              <el-button type="text" size="mini" style="color: #909399"
                >查看</el-button
              >
            </div>
            <div class="operate-item">
              <el-button
                type="text"
                size="mini"
                style="color: #e6a23c; margin: 0 10px"
                >修改</el-button
              >
            </div>
            <div class="operate-item">
              <el-button type="text" size="mini" style="color: #f56c6c"
                >删除</el-button
              >
            </div>
          </div>
        </div>
      </div>
    </div>
    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableHeigth: 0,
      queryParams: {},
      loading: false,
      tableData: [],
      total: 1,
      queryParams: {
        pageNum: 0,
        pageSize: 10,
      },
    };
  },
  created() {
    // //给表格一个固定值
    this.$nextTick(() => {
      this.tableHeigth =
        this.$refs.main.offsetHeight - this.$refs.search.offsetHeight - 100;
      console.log(this.$refs.search.offsetHeight, "高度");
    });
  },
  methods: {
    getList() {},
  },
};
</script>
<style lang="scss" scoped>
// @import "@/assets/styles/myTable.scss";
// @import "@/assets/styles/element-variables.scss";
::v-deep .search-container {
  .el-form-item__content {
    width: 550px;
  }
  .el-input-group__append {
    padding-left: 15px !important;
    padding-right: 15px !important;
    background: #f8414d !important;
    border-color: #f8414d !important;
    .search-btn {
      color: #fff !important;
    }
  }
}
.book-main {
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  & > div {
    flex-basis: calc(20% - 20px);
    margin: 10px; /* 设置元素之间的间距 */
    display: flex;
    flex-direction: column;
    box-shadow: 0px 3px 15px 0px rgba(184, 184, 184, 0.22);
    border-radius: 10px;
    overflow: hidden;
    .operate {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 10px;
      .right-operate {
        display: flex;
        align-items: center;
        justify-content: center;
      }
      .operate-item {
        text-align: center;
        font-size: 14px;
        color: #8a8585;
        cursor: pointer;
      }
    }
  }
}
</style>
