<template>
  <div class="basic-target" v-loading="loading">
    <search :type="1" />
    <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="分值"
        min-width="60"
        align="center"
        prop="points"
      ></el-table-column>

      <el-table-column
        label="区牵头单位"
        min-width="95 "
        align="center"
        prop="leaderUnit"
      ></el-table-column>

      <el-table-column label="牵头部门" min-width="80" align="center">
        <template slot-scope="{ row }">
          <span>{{ row.leaderDeptList | formatList }}</span>
        </template>
      </el-table-column>

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

      <el-table-column label="责任领导" min-width="80" align="center">
        <template slot-scope="{ row }">
          {{ row.leaderPrincipalList | formatList }}
        </template>
      </el-table-column>
      <el-table-column label="操作" width="125" align="center">
        <el-link
          @click="edit"
          icon="el-icon-edit"
          type="primary"
          :underline="false"
          >申请</el-link
        >
      </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()"
    />
    <el-dialog
      title="申请成为配合部门"
      :visible.sync="showEdit"
      width="400px"
      custom-class="ele-dialog-form"
      :lock-scroll="false"
      :destroy-on-close="true"
      @closed="form = {}"
    >
      <el-form
        :model="form"
        label-width="82px"
        width="400px"
        :lock-scroll="false"
        :destroy-on-close="true"
        @closed="form = {}"
      >
        <el-form-item label="申请理由：">
          <el-input
            type="textarea"
            placeholder="请输入申请理由"
            :rows="5"
          ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer">
        <el-button @click="showEdit = false">取消</el-button>&nbsp;
        <el-button type="primary" @click="save">保存</el-button>
      </div>
    </el-dialog>
  </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() {},
    edit() {
      this.showEdit = true;
    },
    save() {},
  },
  filters: {
    formatList(val) {
      if (val) {
        return val.join(",");
      }
    },
  },
};
</script>

<style>
</style>