fix: 列表页去掉解析状态列+友好时间显示(几分钟前/几小时前)

This commit is contained in:
mediabot-pt
2026-07-02 11:17:00 +08:00
parent 62ed20291f
commit 80fd828d1d

View File

@@ -8,47 +8,46 @@
<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">
<el-table-column label="站点名称" min-width="130">
<template #default="scope">
<span class="text-xs">{{ (scope.row.names||[]).join(' / ') || '-' }}</span>
<span>{{ scope.row.names?.join(' / ') || scope.row.siteId }}</span>
</template>
</el-table-column>
<el-table-column label="版本" width="70">
<el-table-column label="版本" width="60" align="center">
<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>
<el-tag v-if="scope.row.latestVersion" size="small" type="primary">v{{ scope.row.latestVersion }}</el-tag>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="更新/发布" width="140">
<el-table-column label="提交" width="80" align="center">
<template #default="scope">
<span v-if="scope.row.configUpdatedAt || scope.row.lastSubmitted" class="text-xs" style="color:#909399">
{{ fmt(scope.row.configUpdatedAt) }} / {{ fmt(scope.row.configPublishedAt) }}
<span>{{ scope.row.pages?.length || 0 }}页·{{ scope.row.totalResults || 0 }}次</span>
</template>
</el-table-column>
<el-table-column label="更新 / 发布" width="180">
<template #default="scope">
<span v-if="scope.row.configUpdatedAt" style="font-size:12px;color:#909399">
{{ friendlyTime(scope.row.configUpdatedAt) }}
</span>
<span v-else style="font-size:12px;color:#909399">-</span>
<br>
<span v-if="scope.row.configPublishedAt" style="font-size:12px;color:#909399">
{{ friendlyTime(scope.row.configPublishedAt) }}
</span>
<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">
<el-table-column label="待审核" width="70" align="center">
<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>
<span v-else style="color:#909399">0</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<el-table-column label="最近提交" width="140">
<template #default="scope">
<span style="font-size:12px;color:#909399">{{ friendlyTime(scope.row.lastSubmitted) || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="80" align="center">
<template #default="scope">
<el-button size="small" type="primary" @click="$router.push(`/access-results/check/${scope.row.siteId}`)">
校验
@@ -66,7 +65,17 @@ import { Refresh } from '@element-plus/icons-vue'
const loading = ref(false)
const sites = ref([])
const fmt = (t) => t ? t.substring(5,16).replace('T',' ') : null
const friendlyTime = (t) => {
if (!t) return null
const d = new Date(t), now = new Date()
const diffMs = now - d, diffMin = Math.floor(diffMs / 60000), diffH = Math.floor(diffMs / 3600000), diffD = Math.floor(diffMs / 86400000)
if (diffMin < 1) return '刚刚'
if (diffMin < 60) return diffMin + '分钟前'
if (diffH < 24) return diffH + '小时前'
if (diffD < 30) return diffD + '天前'
return d.toISOString().substring(0, 10)
}
const fetchAll = async () => {
loading.value = true