refactor: 列表页+详情页优化(站点名版本+搜索过滤+错误高亮+全部收起)
This commit is contained in:
@@ -63,8 +63,15 @@
|
||||
</div>
|
||||
|
||||
<!-- 右侧:URL卡片 -->
|
||||
<div style="flex:1;overflow:auto;display:flex;flex-direction:column;gap:8px;min-height:0">
|
||||
<el-card v-for="page in pages" :key="page.url" shadow="hover" size="small">
|
||||
<div style="flex:1;overflow:auto;display:flex;flex-direction:column;min-height:0">
|
||||
<!-- 搜索 + 全部收起 -->
|
||||
<div style="display:flex;gap:8px;align-items:center;margin-bottom:4px;flex-shrink:0">
|
||||
<el-input v-model="urlFilter" size="small" placeholder="搜索URL..." clearable style="flex:1" />
|
||||
<el-button v-if="expanded.size>0" size="small" @click="expanded.clear()">全部收起</el-button>
|
||||
</div>
|
||||
|
||||
<div style="display:flex;flex-direction:column;gap:8px;overflow:auto">
|
||||
<el-card v-for="page in filteredPages" :key="page.url" shadow="hover" size="small">
|
||||
<template #header>
|
||||
<div style="display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px">
|
||||
<div style="display:flex;align-items:center;gap:8px">
|
||||
@@ -112,13 +119,14 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div v-else-if="page.parsed" style="color:#e6a23c;font-size:12px;padding:4px 0">
|
||||
<div v-else-if="page.parsed" style="background:#fef0f0;color:#f56c6c;font-size:12px;padding:6px 8px;border-radius:4px;white-space:pre-wrap;word-break:break-all">
|
||||
{{ page.parsed.message || '解析失败' }}
|
||||
</div>
|
||||
<div v-else style="color:#909399;font-size:12px;padding:4px 0">未解析</div>
|
||||
</el-card>
|
||||
|
||||
<div v-if="pages.length===0 && !loading" style="text-align:center;padding:60px;color:#909399">暂无访问结果</div>
|
||||
<div v-if="filteredPages.length===0 && !loading" style="text-align:center;padding:60px;color:#909399">暂无访问结果</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -140,7 +148,7 @@ import { Loading } from '@element-plus/icons-vue'
|
||||
const route = useRoute()
|
||||
const siteId = route.params.siteId
|
||||
|
||||
const loading = ref(false), parseLoading = ref(false), scriptExpanded = ref(true), historyVersion = ref(null)
|
||||
const loading = ref(false), parseLoading = ref(false), scriptExpanded = ref(true), historyVersion = ref(null), urlFilter = ref('')
|
||||
const selectedConfigId = ref(null), selectedConfig = ref(null)
|
||||
const scriptContent = ref(''), saving = ref(false), approving = ref(false), rejecting = ref(false)
|
||||
const allConfigVersions = ref([]), allResults = ref([])
|
||||
@@ -149,6 +157,11 @@ const rawVisible = ref(false), rawLoading = ref(false), rawContent = ref('')
|
||||
|
||||
const totalResults = computed(() => allResults.value.length)
|
||||
|
||||
const filteredPages = computed(() => {
|
||||
const f = urlFilter.value.toLowerCase()
|
||||
return f ? pages.value.filter(p => p.url.toLowerCase().includes(f)) : pages.value
|
||||
})
|
||||
|
||||
const pages = computed(() => {
|
||||
const map = new Map()
|
||||
for (const r of allResults.value) {
|
||||
|
||||
Reference in New Issue
Block a user