<template>
  <el-container class="app-container">
    <el-header class="app-header">
      <div class="logo">员工缺勤分析与预测系统</div>
      <el-menu
        :default-active="activeMenu"
        mode="horizontal"
        router
        class="nav-menu"
      >
        <el-menu-item index="/dashboard">数据概览</el-menu-item>
        <el-menu-item index="/analysis">影响因素</el-menu-item>
        <el-menu-item index="/prediction">缺勤预测</el-menu-item>
        <el-menu-item index="/clustering">员工画像</el-menu-item>
      </el-menu>
    </el-header>
    <el-main class="app-main">
      <router-view />
    </el-main>
  </el-container>
</template>

<script setup>
import { computed } from 'vue'
import { useRoute } from 'vue-router'

const route = useRoute()
const activeMenu = computed(() => route.path)
</script>

<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
  background-color: #f5f7fa;
}

.app-container {
  min-height: 100vh;
}

.app-header {
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 60px !important;
}

.logo {
  font-size: 18px;
  font-weight: bold;
  color: #409EFF;
  margin-right: 40px;
  white-space: nowrap;
}

.nav-menu {
  border-bottom: none;
  flex: 1;
}

.app-main {
  padding: 20px;
  background-color: #f5f7fa;
  min-height: calc(100vh - 60px);
}
</style>
