Files
par/web/src/views/AccessResults.vue

76 lines
3.2 KiB
Vue

<template>
<div>
<h2>适配验证</h2>
<el-card style="margin-top: 20px">
<div style="margin-bottom: 12px">
<el-button @click="fetchAll" :icon="Refresh">刷新</el-button>
</div>
<el-table :data="sites" v-loading="loading" stripe size="small" empty-text="暂无访问记录">
<el-table-column prop="siteId" label="站点ID" width="110" />
<el-table-column label="站点名称" width="150">
<template #default="scope">
<span class="text-xs">{{ (scope.row.names||[]).join(' / ') || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="版本" width="70">
<template #default="scope">
<el-tag v-if="scope.row.latestVersion" size="small" type="primary">{{ scope.row.latestVersion }}</el-tag>
<span v-else class="text-xs" style="color:#909399">-</span>
</template>
</el-table-column>
<el-table-column label="页面数" width="100">
<template #default="scope">
<span class="text-xs">{{ scope.row.pages?.length || 0 }}页 · {{ scope.row.totalResults || 0 }}次</span>
</template>
</el-table-column>
<el-table-column label="解析状态" min-width="140">
<template #default="scope">
<div style="display:flex;gap:4px;align-items:center">
<el-tag v-if="scope.row.validCount" size="small" type="success">✓{{ scope.row.validCount }}</el-tag>
<el-tag v-if="scope.row.invalidCount" size="small" type="danger">✗{{ scope.row.invalidCount }}</el-tag>
<el-tag v-if="scope.row.uncheckedCount" size="small" type="warning">○{{ scope.row.uncheckedCount }}</el-tag>
<span v-if="!scope.row.validCount && !scope.row.invalidCount && !scope.row.uncheckedCount" class="text-xs" style="color:#909399">未解析</span>
</div>
</template>
</el-table-column>
<el-table-column label="待审核" width="70">
<template #default="scope">
<el-tag v-if="scope.row.pendingConfigCount" size="small" type="danger">{{ scope.row.pendingConfigCount }}</el-tag>
<span v-else class="text-xs" style="color:#909399">0</span>
</template>
</el-table-column>
<el-table-column label="最近提交" width="140">
<template #default="scope">
<span class="text-xs">{{ scope.row.lastSubmitted?.substring(5,16) || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template #default="scope">
<el-button size="small" type="primary" @click="$router.push(`/access-results/check/${scope.row.siteId}`)">
校验
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script setup>
import api from '../api'
import { Refresh } from '@element-plus/icons-vue'
const loading = ref(false)
const sites = ref([])
const fetchAll = async () => {
loading.value = true
try { sites.value = (await api.accessResults.summary()).data || [] }
catch { ElMessage.error('获取汇总失败') }
finally { loading.value = false }
}
onMounted(fetchAll)
</script>