<template>
  <div class="app-container">
    <el-table v-loading="loading" :data="list" border>
      <el-table-column label="考核名称" prop="ASS_NAME" show-overflow-tooltip min-width="180" />
      <el-table-column label="文件标题" prop="FILE_TITL" show-overflow-tooltip min-width="200" />
      <el-table-column label="提交单位" prop="ENTER_UNIT" width="160" />
      <el-table-column label="总分" prop="TOTAL_POINTS" width="80" />
      <el-table-column label="通过线" prop="ACCEPTANCE_LINE" width="80" />
      <el-table-column label="提交时间" prop="ENTER_TM" width="120" />
      <el-table-column label="附件" width="100">
        <template #default="{row}">
          <el-link v-if="row.FILE_PATH" :href="row.FILE_PATH" target="_blank" type="primary">查看</el-link>
          <span v-else>-</span>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue'
import { getMethodFile } from '@/api/hzz/assess'

const loading = ref(false)
const list = ref([])

onMounted(async () => {
  loading.value = true
  try {
    // 默认查询太湖流域考核文件
    const res = await getMethodFile('', new Date().toISOString().slice(0, 10))
    list.value = res.data || []
  } catch { /* 接口可能未就绪 */ }
  finally { loading.value = false }
})
</script>
