MissionPanel.vue
8.89 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
<script setup lang="ts">
import { ref } from 'vue'
import IconSet from '@/components/common/IconSet.vue'
// 模拟数据
const currentVenue = ref('北京国家体育场')
const missionSummary = ref('分析场馆运营效率与观众体验反馈,重点关注服务设施配套情况')
const missionProgress = ref(68)
const missionStatusLabel = ref('分析中')
const missionTone = ref<'success' | 'running' | 'warning'>('running')
const hasActiveMission = ref(true)
const engines = ref([
{ name: 'Query', status: 'running', label: 'Query 检索' },
{ name: 'Media', status: 'success', label: 'Media 多模态' },
{ name: 'Insight', status: 'success', label: 'Insight 洞察' },
{ name: 'Forum', status: 'warning', label: 'Forum 协作' },
])
const recentMissions = ref([
{ id: '1', name: '上海迪士尼乐园', time: '2小时前' },
{ id: '2', name: '广州长隆野生动物园', time: '昨天' },
{ id: '3', name: '成都大熊猫基地', time: '3天前' },
])
function getEngineTone(status: string): string {
if (status === 'success') return 'success'
if (status === 'running') return 'running'
if (status === 'warning') return 'warning'
return 'idle'
}
function getMissionTone(): string {
if (missionProgress.value >= 100) return 'success'
if (missionProgress.value > 0) return 'running'
return 'idle'
}
const emit = defineEmits<{
createMission: []
continueMission: []
switchMission: [id: string]
}>()
</script>
<template>
<aside class="mission-panel">
<!-- 当前任务卡片 -->
<div class="mission-card" :class="{ 'mission-card--active': hasActiveMission }">
<div class="mission-card__header">
<span class="kicker">当前任务 Current Mission</span>
<span class="mission-status" :class="`mission-status--${getMissionTone()}`">
{{ missionStatusLabel }}
</span>
</div>
<h3 class="mission-venue">{{ currentVenue || '等待创建任务' }}</h3>
<p class="mission-summary">{{ missionSummary || '创建任务后开始分析' }}</p>
<!-- 进度指示 -->
<div class="mission-progress">
<div class="progress-track">
<div class="progress-fill" :style="{ width: `${missionProgress}%` }" />
</div>
<span class="progress-label">{{ missionProgress }}%</span>
</div>
<!-- 快捷操作 -->
<div class="mission-actions">
<button
v-if="!hasActiveMission"
class="action-btn action-btn--primary"
type="button"
@click="emit('createMission')"
>
<IconSet type="plus" />
创建任务
</button>
<button
v-else
class="action-btn"
type="button"
@click="emit('continueMission')"
>
继续推进
<IconSet type="arrow-right" />
</button>
</div>
</div>
<!-- 引擎状态矩阵 -->
<div class="engine-matrix">
<div class="matrix-header">
<span class="kicker">引擎状态 Engine Status</span>
</div>
<div
v-for="engine in engines"
:key="engine.name"
class="engine-row"
>
<span class="engine-indicator" :class="`engine-indicator--${getEngineTone(engine.status)}`" />
<span class="engine-name">{{ engine.label }}</span>
<span class="engine-status">{{ engine.status === 'success' ? '就绪' : engine.status === 'running' ? '运行中' : '等待' }}</span>
</div>
</div>
<!-- 最近任务列表 -->
<div class="recent-missions">
<span class="kicker">历史任务 Recent Missions</span>
<div
v-for="mission in recentMissions"
:key="mission.id"
class="mission-item"
@click="emit('switchMission', mission.id)"
>
<span class="mission-item__name">{{ mission.name }}</span>
<span class="mission-item__time">{{ mission.time }}</span>
</div>
</div>
</aside>
</template>
<style scoped>
.mission-panel {
position: fixed;
top: var(--cmd-bar-height, 64px);
left: 0;
bottom: 0;
width: var(--sidebar-width, 280px);
padding: 20px 16px;
background: var(--bg-base);
border-right: 1px solid var(--border-subtle);
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 20px;
}
.mission-card {
padding: 20px;
background: var(--bg-elevated);
border: 1px solid var(--border-subtle);
border-radius: var(--radius-xl);
transition: all 0.3s ease;
}
.mission-card--active {
border-color: var(--accent);
box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
}
.mission-card__header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
}
.kicker {
font-family: var(--font-mono);
font-size: 10px;
letter-spacing: 0.16em;
text-transform: uppercase;
color: var(--text-muted);
}
.mission-status {
padding: 4px 10px;
border-radius: var(--radius-full);
font-family: var(--font-mono);
font-size: 10px;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.mission-status--success {
background: rgba(61, 139, 110, 0.15);
color: var(--success);
}
.mission-status--running {
background: rgba(184, 134, 59, 0.15);
color: var(--warning);
}
.mission-status--idle {
background: var(--bg-base);
color: var(--text-muted);
}
.mission-venue {
margin: 0 0 8px;
font-family: var(--font-display);
font-size: 20px;
font-weight: 600;
color: var(--text-primary);
line-height: 1.3;
}
.mission-summary {
margin: 0 0 16px;
font-size: 13px;
color: var(--text-secondary);
line-height: 1.6;
}
.mission-progress {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 16px;
}
.progress-track {
flex: 1;
height: 6px;
background: var(--border-medium);
border-radius: var(--radius-full);
overflow: hidden;
}
.progress-fill {
height: 100%;
background: linear-gradient(90deg, var(--accent), var(--primary));
border-radius: inherit;
transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.progress-label {
font-family: var(--font-mono);
font-size: 12px;
font-weight: 500;
color: var(--accent);
}
.mission-actions {
display: flex;
gap: 10px;
}
.action-btn {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
height: 40px;
padding: 0 16px;
border: 1px solid var(--border-medium);
border-radius: var(--radius-full);
background: var(--bg-elevated);
font-family: var(--font-mono);
font-size: 12px;
font-weight: 500;
color: var(--text-primary);
cursor: pointer;
transition: all 0.2s ease;
}
.action-btn:hover {
background: var(--primary);
border-color: var(--primary);
color: var(--text-inverse);
transform: translateY(-1px);
}
.action-btn :deep(.icon) {
width: 16px;
height: 16px;
}
.action-btn--primary {
background: var(--primary);
border-color: var(--primary);
color: var(--text-inverse);
}
.action-btn--primary:hover {
background: var(--primary-light);
border-color: var(--primary-light);
}
/* 引擎状态矩阵 */
.engine-matrix {
padding: 16px;
background: var(--bg-elevated);
border: 1px solid var(--border-subtle);
border-radius: var(--radius-xl);
}
.matrix-header {
margin-bottom: 14px;
}
.engine-row {
display: flex;
align-items: center;
gap: 12px;
padding: 10px 0;
border-bottom: 1px solid var(--border-subtle);
}
.engine-row:last-child {
border-bottom: none;
}
.engine-indicator {
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--text-muted);
}
.engine-indicator--success {
background: var(--success);
box-shadow: 0 0 8px rgba(61, 139, 110, 0.5);
}
.engine-indicator--running {
background: var(--warning);
animation: pulse-breathe 2s ease-in-out infinite;
}
.engine-indicator--warning {
background: var(--warning);
}
.engine-indicator--idle {
background: var(--text-muted);
}
@keyframes pulse-breathe {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
.engine-name {
flex: 1;
font-size: 14px;
font-weight: 500;
color: var(--text-primary);
}
.engine-status {
font-family: var(--font-mono);
font-size: 11px;
color: var(--text-muted);
text-transform: uppercase;
}
/* 最近任务 */
.recent-missions {
padding: 16px;
background: var(--bg-elevated);
border: 1px solid var(--border-subtle);
border-radius: var(--radius-xl);
display: flex;
flex-direction: column;
gap: 12px;
}
.mission-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 12px;
background: var(--bg-base);
border-radius: var(--radius-md);
cursor: pointer;
transition: all 0.2s ease;
}
.mission-item:hover {
background: var(--primary);
color: var(--text-inverse);
}
.mission-item__name {
font-size: 13px;
font-weight: 500;
}
.mission-item__time {
font-family: var(--font-mono);
font-size: 10px;
color: var(--text-muted);
text-transform: uppercase;
}
.mission-item:hover .mission-item__time {
color: rgba(245, 240, 232, 0.6);
}
@media (max-width: 1024px) {
.mission-panel {
display: none;
}
}
</style>