<script setup lang="ts">
/**
 * Dashboard 占位页
 * 后续替换为经营看板的图表和数据。
 */
import { useUserStore } from '@/store/user'
import { useRouter } from 'vue-router'

const userStore = useUserStore()
const router = useRouter()

function handleLogout() {
  userStore.logout()
  router.push('/login')
}
</script>

<template>
  <el-container style="min-height: 100vh">
    <el-header style="display: flex; align-items: center; justify-content: space-between; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.08)">
      <h3>SHBL-CRM 控制台</h3>
      <div>
        <span style="margin-right: 16px; color: #606266">
          {{ userStore.realName }} ({{ userStore.userInfo?.role_name || '未分配角色' }})
        </span>
        <el-button size="small" @click="handleLogout">退出登录</el-button>
      </div>
    </el-header>
    <el-main>
      <el-result icon="success" title="登录成功" sub-title="系统骨架已就绪，后续业务模块开发中。" />
    </el-main>
  </el-container>
</template>
