feat: 列表页加更新/发布时间列 + summary接口补充字段
This commit is contained in:
@@ -12,11 +12,15 @@ import java.util.List;
|
|||||||
public class SiteAccessSummaryDTO {
|
public class SiteAccessSummaryDTO {
|
||||||
|
|
||||||
private String siteId;
|
private String siteId;
|
||||||
|
private List<String> names;
|
||||||
|
private String latestVersion;
|
||||||
private int totalResults;
|
private int totalResults;
|
||||||
private int validCount;
|
private int validCount;
|
||||||
private int invalidCount;
|
private int invalidCount;
|
||||||
private int uncheckedCount;
|
private int uncheckedCount;
|
||||||
private int pendingConfigCount;
|
private int pendingConfigCount;
|
||||||
private LocalDateTime lastSubmitted;
|
private LocalDateTime lastSubmitted;
|
||||||
|
private LocalDateTime configUpdatedAt;
|
||||||
|
private LocalDateTime configPublishedAt;
|
||||||
private List<AccessPageSummaryDTO> pages;
|
private List<AccessPageSummaryDTO> pages;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,6 +160,18 @@ public class AccessResultServiceImpl implements AccessResultService {
|
|||||||
s.setValidCount(0);
|
s.setValidCount(0);
|
||||||
s.setInvalidCount(0);
|
s.setInvalidCount(0);
|
||||||
s.setUncheckedCount(0);
|
s.setUncheckedCount(0);
|
||||||
|
// 站点名称
|
||||||
|
try {
|
||||||
|
Site siteObj = siteMapper.selectBySiteId(k);
|
||||||
|
if (siteObj != null) s.setNames(siteObj.getNames());
|
||||||
|
} catch (Exception ignored) {}
|
||||||
|
// 配置信息
|
||||||
|
SiteConfig latest = siteConfigMapper.selectLatestBySiteId(k);
|
||||||
|
if (latest != null) {
|
||||||
|
s.setLatestVersion(latest.getVersion());
|
||||||
|
s.setConfigUpdatedAt(latest.getUpdatedAt());
|
||||||
|
s.setConfigPublishedAt(latest.getCreatedAt());
|
||||||
|
}
|
||||||
return s;
|
return s;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,14 @@
|
|||||||
<span v-else class="text-xs" style="color:#909399">-</span>
|
<span v-else class="text-xs" style="color:#909399">-</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="更新/发布" width="140">
|
||||||
|
<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>
|
||||||
|
<span v-else class="text-xs" style="color:#909399">-</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="页面数" width="100">
|
<el-table-column label="页面数" width="100">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span class="text-xs">{{ scope.row.pages?.length || 0 }}页 · {{ scope.row.totalResults || 0 }}次</span>
|
<span class="text-xs">{{ scope.row.pages?.length || 0 }}页 · {{ scope.row.totalResults || 0 }}次</span>
|
||||||
@@ -40,11 +48,6 @@
|
|||||||
<span v-else class="text-xs" style="color:#909399">0</span>
|
<span v-else class="text-xs" style="color:#909399">0</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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">
|
<el-table-column label="操作" width="100">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button size="small" type="primary" @click="$router.push(`/access-results/check/${scope.row.siteId}`)">
|
<el-button size="small" type="primary" @click="$router.push(`/access-results/check/${scope.row.siteId}`)">
|
||||||
@@ -63,6 +66,7 @@ import { Refresh } from '@element-plus/icons-vue'
|
|||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const sites = ref([])
|
const sites = ref([])
|
||||||
|
const fmt = (t) => t ? t.substring(5,16).replace('T',' ') : null
|
||||||
|
|
||||||
const fetchAll = async () => {
|
const fetchAll = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
|
|||||||
Reference in New Issue
Block a user