<script setup name="expertVerification">
import { h, onMounted, reactive, ref } from 'vue'
import { list } from '@/http/apis/performanceEvaluation/expertVerification'
const tableListRef = ref(),
  column = reactive([
    {
      label: '序号',
      type: 'index',
      width: '80'
    },
    {
      label: '评价计划',
      key: 'name',
      prop: 'name'
    },
    {
      label: '备注',
      key: 'remark',
      prop: 'remark',
      render: row => h('span', row.remark || '-')
    },
    {
      label: '操作',
      slot: 'action',
      fixed: 'right',
      width: '80'
    }
  ]),
  data = ref([]),
  total = ref(0),
  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:'checkProjectList',query:{id:scope.row.id,title:scope.row.name+'-'+scope.row.verifyGroupName,verifyGroupId:scope.row.verifyGroupId}})">核查</a>
        </template>
      </table-list>
    </el-card>
  </div>
</template>
