refactor: 列表页+详情页优化(站点名版本+搜索过滤+错误高亮+全部收起)

This commit is contained in:
mediabot-pt
2026-07-02 11:06:19 +08:00
parent 741eae236c
commit 07eb7c95b0
2 changed files with 44 additions and 26 deletions

View File

@@ -7,41 +7,48 @@
</div>
<el-table :data="sites" v-loading="loading" stripe size="small" empty-text="暂无访问记录">
<el-table-column prop="siteId" label="站点ID" width="130" />
<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">
<el-tag size="small" type="info">{{ scope.row.pages?.length || 0 }}</el-tag>
<span class="text-xs">{{ scope.row.pages?.length || 0 }}页 · {{ scope.row.totalResults || 0 }}次</span>
</template>
</el-table-column>
<el-table-column label="总次数" width="80">
<el-table-column label="解析状态" min-width="140">
<template #default="scope">
<span class="text-xs">{{ scope.row.totalResults }}</span>
</template>
</el-table-column>
<el-table-column label="验证进度" min-width="220">
<template #default="scope">
<div style="display:flex;gap:6px;align-items:center;flex-wrap:wrap">
<el-tag size="small" type="success">{{ scope.row.validCount }} 有效</el-tag>
<el-tag size="small" type="danger">{{ scope.row.invalidCount }} 无效</el-tag>
<el-tag size="small" type="warning">{{ scope.row.uncheckedCount }} 待验</el-tag>
<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="80">
<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="160">
<el-table-column label="最近提交" width="140">
<template #default="scope">
<span class="text-xs">{{ scope.row.lastSubmitted || '-' }}</span>
<span class="text-xs">{{ scope.row.lastSubmitted?.substring(5,16) || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="180">
<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>
@@ -59,10 +66,8 @@ const sites = ref([])
const fetchAll = async () => {
loading.value = true
try {
const r = await api.accessResults.summary()
sites.value = r.data || []
} catch { ElMessage.error('获取汇总失败') }
try { sites.value = (await api.accessResults.summary()).data || [] }
catch { ElMessage.error('获取汇总失败') }
finally { loading.value = false }
}