feat:完成智能追踪UI
parent
89cbb1c348
commit
aee88680f0
@ -0,0 +1,10 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获取取证快照列表
|
||||
export const getEvidenceSnapshotList = (params) => {
|
||||
return request({
|
||||
url: '/evidenceSnapshot/list',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,176 @@
|
||||
<template>
|
||||
<div class="algorithm-section">
|
||||
<div class="section-header">
|
||||
<el-icon class="section-icon"><Cpu /></el-icon>
|
||||
<span>算法类型</span>
|
||||
</div>
|
||||
<div class="algorithm-grid">
|
||||
<div
|
||||
v-for="algo in algorithmList"
|
||||
:key="algo.id"
|
||||
class="algo-card"
|
||||
:class="{ active: modelValue === algo.id }"
|
||||
@click="handleSelect(algo.id)"
|
||||
>
|
||||
<div class="algo-icon-wrap">
|
||||
<el-icon :size="22"><component :is="algo.icon" /></el-icon>
|
||||
</div>
|
||||
<span class="algo-name">{{ algo.name }}</span>
|
||||
<p class="algo-desc">{{ algo.desc }}</p>
|
||||
<div class="algo-check" v-if="modelValue === algo.id">
|
||||
<el-icon><Check /></el-icon>
|
||||
</div>
|
||||
<div class="algo-close-hint" v-if="modelValue === algo.id">关闭算法</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const props = defineProps({
|
||||
algorithmList: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
modelValue: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
|
||||
const handleSelect = (algoId) => {
|
||||
if (props.modelValue === algoId) {
|
||||
// 再次点击已选中的算法 → 关闭算法
|
||||
emit('update:modelValue', '')
|
||||
ElMessage.info('算法已关闭')
|
||||
} else {
|
||||
emit('update:modelValue', algoId)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@use '@/styles/variables.scss' as *;
|
||||
|
||||
.algorithm-section {
|
||||
background: #fff;
|
||||
border-radius: 12px;
|
||||
padding: 20px 24px;
|
||||
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
|
||||
border: 1px solid $border-lighter;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 14px;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: $text-primary;
|
||||
|
||||
.section-icon {
|
||||
color: $tracking-primary;
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
.algorithm-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.algo-card {
|
||||
position: relative;
|
||||
background: #f8fafc;
|
||||
border: 1.5px solid $border-lighter;
|
||||
border-radius: 10px;
|
||||
padding: 16px 12px 14px;
|
||||
cursor: pointer;
|
||||
transition: all 0.25s ease;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
|
||||
&:hover {
|
||||
border-color: $tracking-primary;
|
||||
background: #f0f4f8;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba($tracking-primary, 0.1);
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: linear-gradient(135deg, rgba($tracking-primary, 0.08), rgba($tracking-primary, 0.03));
|
||||
border-color: $tracking-primary;
|
||||
box-shadow: 0 0 0 3px rgba($tracking-primary, 0.08);
|
||||
|
||||
.algo-icon-wrap {
|
||||
background: $tracking-primary;
|
||||
color: #fff;
|
||||
}
|
||||
.algo-name { color: $tracking-primary; }
|
||||
}
|
||||
|
||||
.algo-icon-wrap {
|
||||
width: 42px; height: 42px;
|
||||
border-radius: 10px;
|
||||
background: rgba($tracking-primary, 0.08);
|
||||
color: $tracking-primary;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 0 auto 10px;
|
||||
transition: all 0.25s ease;
|
||||
}
|
||||
|
||||
.algo-name {
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: $text-primary;
|
||||
margin-bottom: 4px;
|
||||
transition: color 0.25s ease;
|
||||
}
|
||||
|
||||
.algo-desc {
|
||||
font-size: 11px;
|
||||
color: $text-secondary;
|
||||
margin: 0;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.algo-check {
|
||||
position: absolute;
|
||||
top: 6px; right: 6px;
|
||||
width: 20px; height: 20px;
|
||||
border-radius: 50%;
|
||||
background: $tracking-primary;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.algo-close-hint {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
font-size: 10px;
|
||||
color: #e6a23c;
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s ease;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&:hover .algo-close-hint {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,227 @@
|
||||
<template>
|
||||
<div class="snapshot-section">
|
||||
<div class="section-header">
|
||||
<el-icon class="section-icon"><Picture /></el-icon>
|
||||
<span>取证快照</span>
|
||||
<span class="snapshot-count">{{ snapshots.length }} 张</span>
|
||||
</div>
|
||||
<div v-if="loading" class="snapshot-loading">
|
||||
<el-icon class="is-loading" :size="36"><Loading /></el-icon>
|
||||
<p>加载取证快照...</p>
|
||||
</div>
|
||||
<div v-else class="snapshot-carousel-wrapper">
|
||||
<el-carousel
|
||||
v-if="snapshots.length"
|
||||
:interval="4000"
|
||||
indicator-position="none"
|
||||
arrow="always"
|
||||
height="100%"
|
||||
class="snapshot-carousel"
|
||||
>
|
||||
<el-carousel-item v-for="item in snapshots" :key="item.id">
|
||||
<div class="snapshot-card">
|
||||
<div class="snapshot-image">
|
||||
<img :src="filehttp + item.imageUrl" :alt="item.name || '快照'" />
|
||||
</div>
|
||||
<div class="snapshot-info">
|
||||
<div class="info-row">
|
||||
<el-icon><Picture /></el-icon>
|
||||
<span class="info-label">场景类型</span>
|
||||
<span class="info-value">{{ item.sceneType || '--' }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<el-icon><Document /></el-icon>
|
||||
<span class="info-label">文件名称</span>
|
||||
<span class="info-value" :title="item.name">{{ item.name || '--' }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<el-icon><Clock /></el-icon>
|
||||
<span class="info-label">取证时间</span>
|
||||
<span class="info-value">{{ item.time }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-carousel-item>
|
||||
</el-carousel>
|
||||
<div v-else class="snapshot-empty">
|
||||
<el-icon :size="48"><Picture /></el-icon>
|
||||
<p>暂无取证快照</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { getEvidenceSnapshotList } from '@/api/smart-tracking'
|
||||
import filehttp from '@/utils/filehttp'
|
||||
|
||||
const snapshots = ref([])
|
||||
const loading = ref(false)
|
||||
|
||||
const fetchSnapshots = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await getEvidenceSnapshotList({
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
sceneType: 'Anomaly_Recognition'
|
||||
})
|
||||
const list = res.data?.list || []
|
||||
snapshots.value = list.map(item => ({
|
||||
id: item.id,
|
||||
name: item.fileName,
|
||||
sceneType: item.sceneType,
|
||||
time: item.shotTime || item.createTime,
|
||||
imageUrl: item.url
|
||||
}))
|
||||
} catch (error) {
|
||||
console.error('获取取证快照失败:', error)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchSnapshots()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@use '@/styles/variables.scss' as *;
|
||||
|
||||
.snapshot-section {
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
border-radius: 12px;
|
||||
padding: 20px 24px;
|
||||
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
|
||||
border: 1px solid $border-lighter;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
|
||||
.snapshot-count {
|
||||
margin-left: auto;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: $text-secondary;
|
||||
}
|
||||
}
|
||||
|
||||
.section-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 14px;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: $text-primary;
|
||||
|
||||
.section-icon {
|
||||
color: $tracking-primary;
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
.snapshot-loading {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 12px;
|
||||
color: $text-secondary;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.snapshot-carousel-wrapper {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.snapshot-carousel {
|
||||
height: 100%;
|
||||
|
||||
:deep(.el-carousel__container) {
|
||||
height: 100%;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
:deep(.el-carousel__arrow) {
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
width: 34px; height: 34px;
|
||||
&:hover { background: #fff; }
|
||||
}
|
||||
:deep(.el-carousel__arrow i) { color: $text-primary; }
|
||||
}
|
||||
|
||||
.snapshot-card {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.snapshot-image {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
border-radius: 10px 10px 0 0;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
.snapshot-info {
|
||||
padding: 16px 18px;
|
||||
background: linear-gradient(180deg, #fafbfc 0%, #f5f7fa 100%);
|
||||
border-radius: 0 0 10px 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.info-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 13px;
|
||||
color: $text-regular;
|
||||
|
||||
.el-icon {
|
||||
color: $tracking-primary;
|
||||
font-size: 15px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.info-label {
|
||||
color: $text-secondary;
|
||||
white-space: nowrap;
|
||||
min-width: 56px;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
font-weight: 500;
|
||||
color: $text-primary;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.snapshot-empty {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: $text-placeholder;
|
||||
gap: 12px;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue