<script setup name="projectReview">
import { h, onMounted, reactive, ref } from 'vue'
import { list } from '@/http/apis/performanceEvaluation/projectReview'
const tableListRef = ref(),
  column = reactive([
    {
      label: '序号',
      type: 'index',
      width: '80'
    },
    {
      label: '评价计划',
      key: 'name',
      prop: 'name',
      minWidth: '200'
    },
    {
      label: '复评分组',
      key: 'reAppraisalGroupName',
      prop: 'reAppraisalGroupName',
      width: '240'
    },
    {
      label: '备注',
      key: 'remark',
      prop: 'remark',
      width: '100',
      render: row => h('span', row.remark || '-')
    },
    {
      label: '操作',
      slot: 'action',
      fixed: 'right',
      width: '80'
    }
  ]),
  data = ref([]),
  total = ref(1),
  getTableData = async (pageParams = tableListRef.value.pageParams) => {
    const res = await list({
      ...pageParams
    })
    data.value = res.data.records
    total.value = res.data.total
  }
onMounted(() => {
  getTableData()
})
</script>

<template>
  <div>
    <el-card>
      <template #header>列表</template>
      <table-list
        ref="tableListRef"
        :column="column"
        :data="data"
        :total="total"
        @get-table-data="getTableData"
      >
        <template #action="{ scope }">
          <a @click="$router.push({name:'reviewProjectList',query:{id:scope.row.id,title:scope.row.name+'-'+scope.row.reAppraisalGroupName,reAppraisalGroupId:scope.row.reAppraisalGroupId}})">复评</a>
        </template>
      </table-list>
    </el-card>
  </div>
</template>
