AppHeader.vue 4.23 KB
<script setup lang="ts">
import type { SystemStatus } from '@/types'

defineProps<{
  systemStatus: SystemStatus
  busy: boolean
}>()

defineEmits<{
  startSystem: []
  refreshAll: []
  openSettings: []
  shutdownSystem: []
}>()
</script>

<template>
  <header class="hero">
    <div class="hero-copy">
      <p class="hero-kicker">Venue Operations Research Platform</p>
      <h1 class="hero-title">场馆运营反馈调研平台</h1>
      <p class="hero-description">
        把场馆研究任务、平台采集、三引擎分析和管理层报告放进同一张工作台。
        界面保持克制,但每一步都更直接、更可追踪。
      </p>
      <div class="hero-status-row">
        <span class="hero-pill" :data-tone="systemStatus.started ? 'success' : 'neutral'">
          {{ systemStatus.started ? '系统已启动' : '等待启动' }}
        </span>
        <span class="hero-pill" :data-tone="systemStatus.starting ? 'running' : 'neutral'">
          {{ systemStatus.starting ? '组件拉起中' : '组件稳定' }}
        </span>
      </div>
    </div>

    <div class="hero-actions">
      <button class="action-button subtle" type="button" @click="$emit('openSettings')">配置中心</button>
      <button class="action-button subtle" type="button" @click="$emit('refreshAll')">刷新状态</button>
      <button
        class="action-button primary"
        type="button"
        :disabled="busy || systemStatus.starting"
        @click="$emit('startSystem')"
      >
        {{ systemStatus.started ? '重新校验系统' : '启动系统' }}
      </button>
      <button class="action-button danger" type="button" :disabled="busy" @click="$emit('shutdownSystem')">
        关闭系统
      </button>
    </div>
  </header>
</template>

<style scoped>
.hero {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  padding: 28px 32px;
  border: 1px solid var(--border-strong);
  border-radius: 32px;
  background:
    radial-gradient(circle at top left, rgba(46, 92, 76, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(250, 245, 237, 0.94));
  box-shadow: var(--panel-shadow);
}

.hero-copy {
  max-width: 760px;
}

.hero-kicker {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 58px);
  line-height: 1.02;
  letter-spacing: 0.02em;
  color: var(--text-strong);
}

.hero-description {
  margin: 18px 0 0;
  max-width: 680px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-muted);
}

.hero-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.hero-pill {
  padding: 9px 14px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  background: rgba(23, 27, 24, 0.06);
  color: var(--text-muted);
}

.hero-pill[data-tone='success'] {
  background: rgba(31, 92, 76, 0.14);
  color: var(--accent-strong);
}

.hero-pill[data-tone='running'] {
  background: rgba(157, 116, 69, 0.16);
  color: var(--accent-warm);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-end;
  gap: 12px;
  min-width: 280px;
}

.action-button {
  min-width: 126px;
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-strong);
  font: inherit;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.action-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(23, 27, 24, 0.48);
}

.action-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.action-button.primary {
  background: var(--accent-strong);
  color: white;
  border-color: var(--accent-strong);
}

.action-button.subtle {
  background: rgba(255, 252, 246, 0.9);
}

.action-button.danger {
  color: #7a2821;
  border-color: rgba(122, 40, 33, 0.25);
  background: rgba(122, 40, 33, 0.06);
}

@media (max-width: 1080px) {
  .hero {
    flex-direction: column;
  }

  .hero-actions {
    min-width: 0;
    justify-content: flex-start;
  }
}
</style>