<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>

    <el-table
      v-loading="loading"
      :data="tableData"
      :height="tableHeigth + 'px'"
    >
      <el-table-column label="序号" align="center" prop="id" width="55" />
      <el-table-column label="参与活动" align="center" prop="name" />
      <el-table-column label="参与人员" align="center" prop="type" />
      <el-table-column label="服务活动时长" align="center" prop="cover" />
      <el-table-column label="状态" align="center" prop="content" />
      <el-table-column
        label="发证时间"
        align="center"
        prop="datetime"
        width="180"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.datetime, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
      >
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:certificates:edit']"
            >修改</el-button
          >
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:certificates:remove']"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>
    <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;
    }
  }
}
</style>
