<template>
  <div class="basic-target" v-loading="loading">
    <search :type="1" />
    <div class="operating">
      <el-button size="small" type="primary">导入</el-button>
      <el-button size="small" type="primary">导出</el-button>
    </div>
    <el-table
      :data="dataList"
      border
      highlight-current-row
      :height="tableHeight"
      ref="table"
    >
      <el-table-column type="index" label="序号" align="center" width="50">
      </el-table-column>
      <el-table-column
        label="一级指标"
        min-width="80"
        align="center"
        prop="quota1"
      ></el-table-column>

      <el-table-column
        label="二级指标"
        min-width="80"
        align="center"
        prop="quota2"
      ></el-table-column>

      <el-table-column
        label="考核内容和计分细则"
        align="center"
        min-width="400"
        prop="content"
      ></el-table-column>
      <el-table-column
        label="小条内容"
        align="center"
        min-width="150"
        prop="content"
      ></el-table-column>
      <el-table-column
        label="分值"
        width="50"
        align="center"
        prop="points"
      ></el-table-column>

      <el-table-column
        label="区牵头单位"
        width="80 "
        align="center"
        prop="leaderUnit"
      >
        <template slot-scope="{ row }">
          <pre>{{ row.leaderUnit }}</pre>
        </template>
      </el-table-column>
      <el-table-column label="第一牵头部门" width="120" align="center">
        <template slot-scope="{ row }">
          <pre>{{ row.leaderDeptList | formatList }}</pre>
        </template>
      </el-table-column>
      <el-table-column label="责任领导" width="80" align="center">
        <template slot-scope="{ row }">
          <pre>{{ row.leaderPrincipalList | formatList }}</pre>
        </template>
      </el-table-column>
      <el-table-column label="牵头部门" width="100" align="center">
        <template slot-scope="{ row }">
          <span>
            <pre>{{ row.leaderDeptList | formatList }}</pre>
          </span>
        </template>
      </el-table-column>

      <el-table-column label="责任领导" width="80" align="center">
        <template slot-scope="{ row }">
          <pre>{{ row.leaderPrincipalList | formatList }}</pre>
        </template>
      </el-table-column>
      <el-table-column label="配合部门" width="100" align="center">
        <template slot-scope="{ row }">
          <span>
            <pre>{{ row.leaderDeptList | formatList }}</pre>
          </span>
        </template>
      </el-table-column>

      <el-table-column label="责任领导" width="80" align="center">
        <template slot-scope="{ row }">
          <pre>{{ row.leaderPrincipalList | formatList }}</pre>
        </template>
      </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"
      :flat="true"
      @current-change="getDataList()"
    />
  </div>
</template>

<script>
import search from "../../search";
export default {
  components: {
    search,
  },
  data() {
    return {
      dataList: [[]],
      tableHeight: document.documentElement.clientHeight - 355,
      page: {
        page: 1,
        limit: Math.floor(
          (document.documentElement.clientHeight - 355 - 45) / 45
        ),
      },
      count: 0,
      showEdit: false,
      loading: false,
      form: {},
    };
  },
  methods: {
    getDataList() {},
    save() {},
  },
  filters: {
    formatList(val) {
      if (val) {
        return val.join("\n");
      }
    },
  },
};
</script>

<style>
</style>