ModeTabs.vue
3.68 KB
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<script setup lang="ts">
import { ref, computed } from 'vue'
import IconSet from '@/components/common/IconSet.vue'
const props = defineProps<{
activeMode: 'observe' | 'analyze' | 'deliver' | 'tasks' | 'settings'
}>()
const emit = defineEmits<{
'update:activeMode': [value: 'observe' | 'analyze' | 'deliver' | 'tasks' | 'settings']
}>()
const modes = [
{ id: 'tasks' as const, label: '任务', icon: 'list', description: '历史任务与报告' },
{ id: 'observe' as const, label: '观察', icon: 'globe', description: '采集编排与浏览' },
{ id: 'analyze' as const, label: '分析', icon: 'analysis', description: '引擎协作研判' },
{ id: 'deliver' as const, label: '交付', icon: 'document', description: '报告生成导出' },
{ id: 'settings' as const, label: '配置', icon: 'settings', description: '系统设置' },
]
const hoveredMode = ref<string | null>(null)
function selectMode(mode: 'observe' | 'analyze' | 'deliver' | 'tasks' | 'settings') {
emit('update:activeMode', mode)
}
</script>
<template>
<nav class="mode-tabs">
<button
v-for="mode in modes"
:key="mode.id"
class="mode-tab"
:class="{ 'mode-tab--active': activeMode === mode.id }"
type="button"
@click="selectMode(mode.id)"
@mouseenter="hoveredMode = mode.id"
@mouseleave="hoveredMode = null"
>
<IconSet :type="mode.icon" class="mode-icon" />
<span class="mode-label">{{ mode.label }}</span>
<span class="mode-desc">{{ mode.description }}</span>
<span class="mode-indicator" />
</button>
</nav>
</template>
<style scoped>
.mode-tabs {
display: flex;
gap: 12px;
padding: 0 24px;
margin-bottom: 24px;
}
.mode-tab {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
padding: 16px 32px;
border: 1px solid var(--border-subtle);
border-radius: var(--radius-xl);
background: var(--bg-elevated);
cursor: pointer;
transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
overflow: hidden;
}
.mode-tab::before {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(135deg, var(--primary), var(--primary-light));
opacity: 0;
transition: opacity 0.3s ease;
}
.mode-tab:hover::before {
opacity: 0.08;
}
.mode-tab--active {
border-color: var(--accent);
background: var(--bg-elevated);
box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm);
}
.mode-tab--active::before {
opacity: 0;
}
.mode-tab:hover {
transform: translateY(-2px);
border-color: var(--border-medium);
box-shadow: var(--shadow-sm);
}
.mode-icon {
width: 22px;
height: 22px;
color: var(--text-muted);
transition: color 0.3s ease, transform 0.3s ease;
position: relative;
z-index: 1;
}
.mode-tab:hover .mode-icon {
transform: translateY(-1px);
}
.mode-tab--active .mode-icon {
color: var(--accent);
}
.mode-label {
font-family: var(--font-display);
font-size: 16px;
font-weight: 600;
color: var(--text-primary);
position: relative;
z-index: 1;
transition: color 0.3s ease;
}
.mode-tab--active .mode-label {
color: var(--accent);
}
.mode-desc {
font-size: 11px;
color: var(--text-muted);
position: relative;
z-index: 1;
transition: color 0.3s ease;
}
.mode-indicator {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 40px;
height: 3px;
background: var(--accent);
border-radius: var(--radius-full) var(--radius-full) 0 0;
opacity: 0;
transition: all 0.3s ease;
}
.mode-tab--active .mode-indicator {
opacity: 1;
width: 60px;
}
@media (max-width: 768px) {
.mode-tabs {
padding: 0 16px;
gap: 8px;
}
.mode-tab {
padding: 12px 20px;
}
.mode-desc {
display: none;
}
}
</style>