File size: 2,520 Bytes
52e990b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<script setup lang="ts">
import { computed } from 'vue';
import type { MergedResults } from '@/types';
import { Icons } from '@/components/ui';

const props = defineProps<{
  total: number;
  mergedResults: MergedResults;
  loading: boolean;
  searchTime?: number;
  isUpdating: boolean;
  updateCount: number;
}>();

// 计算网盘类型数量
const diskTypeCount = computed(() => {
  return Object.keys(props.mergedResults || {}).length;
});
</script>

<template>
  <div class="card">
    <div class="flex items-center justify-between p-4">
      <div class="flex items-center gap-6">
        <!-- 搜索结果总数 -->
        <div class="flex items-center gap-2">
          <component :is="Icons.Grid()" class="w-4 h-4 text-muted-foreground" />
          <span class="text-sm text-muted-foreground">搜索结果</span>
          <span class="font-semibold text-foreground">{{ total.toLocaleString() }}</span>
        </div>
        
        <!-- 网盘类型数量 -->
        <div class="flex items-center gap-2">
          <component :is="Icons.Folder()" class="w-4 h-4 text-muted-foreground" />
          <span class="text-sm text-muted-foreground">网盘类型</span>
          <span class="font-semibold text-foreground">{{ diskTypeCount }}</span>
        </div>
        
        <!-- 搜索耗时 -->
        <div v-if="searchTime" class="flex items-center gap-2">
          <component :is="Icons.Clock()" class="w-4 h-4 text-muted-foreground" />
          <span class="text-sm text-muted-foreground">用时</span>
          <span class="font-semibold text-foreground">{{ searchTime }}ms</span>
        </div>
      </div>
    </div>
  </div>
</template>

<style scoped>
.stats-container {
  margin-bottom: 1.5rem;
  background-color: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.stats-content {
  display: flex;
  align-items: center;
  padding: 1rem;
}

.stats-item {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 1rem;
}

.stats-divider {
  width: 1px;
  height: 2rem;
  background-color: #e5e7eb;
  margin: 0 0.5rem;
}

.stats-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.stats-value {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
}

@media (max-width: 768px) {
  .stats-content {
    padding: 0.75rem;
    flex-wrap: wrap;
    justify-content: space-around;
  }
  
  .stats-divider {
    display: none;
  }
  
  .stats-item {
    padding: 0.5rem;
    align-items: center;
  }
}
</style>