<template>
  <div class="task-table">
    <el-table
      :data="dataList"
      border
      highlight-current-row
      :height="tableHeight"
      v-loading="loading"
    >
      <el-table-column type="index" label="序号" align="center">
      </el-table-column>
      <template v-if="type == 1 || type == 2">
        <el-table-column
          label="一级指标"
          min-width="150"
          align="center"
          prop="quota1"
        ></el-table-column>
        <el-table-column
          label="二级指标"
          min-width="150"
          align="center"
          prop="quota2"
        ></el-table-column>
      </template>
      <el-table-column
        label="考核指标"
        min-width="150"
        align="center"
        prop=""
      ></el-table-column>
      <el-table-column
        label="考核内容和计分细则"
        min-width="200"
        align="center"
        prop="content"
      ></el-table-column>
      <el-table-column
        v-if="type == 1"
        label="分值"
        min-width="60"
        align="center"
        prop="points"
      ></el-table-column>
      <el-table-column
        v-if="type == 2"
        label="封顶分值"
        min-width="60"
        align="center"
      ></el-table-column>
      <el-table-column
        v-if="type == 1 || type == 3"
        label="预计扣分"
        min-width="60"
        align="center"
        prop="expectedPoints"
      ></el-table-column>
      <el-table-column
        v-if="type == 2"
        label="预计加分"
        min-width="60"
        align="center"
      ></el-table-column>
      <el-table-column
        label="区牵头单位"
        min-width="80"
        align="center"
        prop="leaderUnit"
      >
        <template slot-scope="{ row }">
          <pre>{{ row.leaderUnit }}</pre>
        </template>
      </el-table-column>
      <el-table-column
        label="牵头部门"
        min-width="80"
        align="center"
        prop="leaderDept"
      ></el-table-column>
      <el-table-column
        label="责任领导"
        min-width="80"
        align="center"
        prop="leaderPrincipal"
      ></el-table-column>
      <el-table-column
        label="备注"
        align="center"
        min-width="150"
        prop="note"
      ></el-table-column>
    </el-table>
    <el-pagination
      :current-page.sync="page.page"
      :page-size="page.limit"
      :total="count"
      :background="true"
      layout="total, prev, pager, next, jumper"
      :pager-count="5"
      class="ele-pagination-circle"
    />
    <!-- @current-change="getDataList()" -->
  </div>
</template>

<script>
export default {
  props: {
    dataList: {
      type: Array,
      default() {
        return [];
      },
    },
    type: {
      type: Number,
      default() {
        return 1;
      },
    },
    count: {
      type: [Number, String],
      default() {
        return 0;
      },
    },
    loading: {
      type: Boolean,
      default() {
        return false;
      },
    },
    page: {
      type: Object,
      default() {
        return {
          page: 1,
          limit: 10,
        };
      },
    },
  },
  data() {
    return {
      tableHeight: document.documentElement.clientHeight - 470,
    };
  },
};
</script>

<style>
</style>