<template>
  <el-container class="customer-dashboard">
    <el-header>
      <h1>中医药与心理健康</h1>
      <el-menu>
        <el-menu-item index="1" @click="$router.push('/customer/home')">首页</el-menu-item>
        <el-dropdown placement="bottom-start">
          <el-menu-item index="2"> 教育与预防 </el-menu-item>
          <template #dropdown>
          <el-dropdown-menu>
            <el-dropdown-item @click="$router.push('/customer/knowledge-base')">知识库</el-dropdown-item>
            <el-dropdown-item @click="$router.push('/customer/wellness-guide')">养生指南</el-dropdown-item>
          </el-dropdown-menu>
          </template>
        </el-dropdown>
        <el-dropdown placement="bottom-start">
          <el-menu-item index="3"> 心理健康评估 </el-menu-item>
          <template #dropdown>
            <el-dropdown-menu>
              <el-dropdown-item @click="$router.push('/customer/psychological-test')">心理测试</el-dropdown-item>
              <el-dropdown-item @click="$router.push('/customer/questionnaire')">问卷调查</el-dropdown-item>
            </el-dropdown-menu>
          </template>
        </el-dropdown>
        <el-menu-item index="4" @click="$router.push('/customer/social-circle')">匿名分享圈</el-menu-item>
      </el-menu>
      <el-button @click="logout" type="danger">退出登录</el-button>
    </el-header>
    <el-main>
      <router-view></router-view>
    </el-main>
  </el-container>
</template>

<script>

export default {
  name: 'CustomerDashboard',
  methods: {
    data () {
      return {

      }
    },
    logout () {
      this.$router.push('/login')
    }
  }
}
</script>

<style scoped>
.customer-dashboard {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.el-header {
  background: #4CAF50;
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.el-menu {
  display: flex;
  gap: 20px;
  background-color: transparent;
  border: none;
}

/*.el-menu-item {
  color: greet;
}*/

.el-menu-item:hover {
  background: rgba(255, 255, 255, 0.2);
}

</style>
