feat: C端支持溯源节点视频播放,后台节点支持上传视频

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Nixevol
2026-06-28 22:02:58 +08:00
co-authored by Cursor
parent 94d3ce18de
commit f47ed0233e
5 changed files with 51 additions and 7 deletions
+20 -1
View File
@@ -70,7 +70,17 @@
<div class="tl-meta muted">{{ [fmtDate(n.occurredAt), n.location].filter(Boolean).join(' · ') }}</div>
<div v-if="n.description" class="tl-desc">{{ n.description }}</div>
<div v-if="n.media?.length" class="tl-media">
<img v-for="(m, j) in n.media" :key="j" :src="m.url" @click="openLightbox(m.url)" />
<template v-for="(m, j) in n.media" :key="j">
<video
v-if="isVideo(m)"
:src="m.url"
class="tl-video"
controls
playsinline
preload="metadata"
/>
<img v-else :src="m.url" @click="openLightbox(m.url)" />
</template>
</div>
</div>
</div>
@@ -160,6 +170,9 @@ function ellipsis(s?: string) {
if (!s) return '-';
return s.length > 16 ? `${s.slice(0, 8)}…${s.slice(-6)}` : s;
}
function isVideo(m: { type?: string; url?: string }) {
return m.type === 'video' || /\.(mp4|webm|mov|m4v)$/i.test(m.url || '');
}
function openLightbox(url: string) {
lightbox.value = url;
}
@@ -405,6 +418,12 @@ watch(
object-fit: cover;
border-radius: 8px;
}
.tl-video {
width: 100%;
max-height: 220px;
border-radius: 8px;
background: #000;
}
.cert-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);