<template>
  <div class="workspace-view">
    <div class="data-toolbar">
      <span class="data-toolbar__title">工作台</span>
      <span class="data-toolbar__sep">|</span>
      <span class="data-toolbar__meta" v-if="workspace.currentPeriod">
        {{ workspace.currentPeriod.name }} · {{ phaseLabel }}
      </span>
    </div>
    <div class="workspace-grid">
      <p>工作台页面（将在任务9完善）</p>
    </div>
  </div>
</template>

<script setup>
import { computed, onMounted } from 'vue'
import { useWorkspaceStore } from '@/stores/workspace'

const workspace = useWorkspaceStore()

const phaseLabel = computed(() => {
  const map = { DRAFT: '草稿', OKR_ALIGN: 'OKR 对齐', EXECUTING: '执行中', ASSESSING: '考评中', ARCHIVED: '已归档' }
  return map[workspace.currentPhase] || workspace.currentPhase || ''
})

onMounted(() => {
  workspace.refreshOverview()
})
</script>
