Browse Source

fix: P1修复 — 终评状态+工作台路由+AppShell初始化

wangkangyjy 2 weeks ago
parent
commit
55a7f9b893

+ 2 - 2
backend/src/main/java/com/yimeng/okr/service/WorkspaceService.java

@@ -126,7 +126,7 @@ public class WorkspaceService {
             if (finalCount != null && finalCount > 0) {
                 Integer pendingFinal = jdbcTemplate.queryForObject(
                         "SELECT COUNT(*) FROM performance_score s JOIN sys_user u ON s.user_id = u.id " +
-                        "WHERE s.period_id = ? AND u.superior_id = ? AND s.type = 'SELF' AND s.status = 'SUBMITTED'",
+                        "WHERE s.period_id = ? AND u.superior_id = ? AND s.type = 'SELF' AND s.status = 'SELF_SUBMITTED'",
                         Integer.class, period.getId(), userId);
                 if (pendingFinal != null && pendingFinal > 0) {
                     todos.add(todo("FINAL_SCORE", "完成终评", "/scores/review", period.getId(), null, pendingFinal));
@@ -202,7 +202,7 @@ public class WorkspaceService {
 
     private List<WorkflowActionDto> buildAllowedActions(AssessmentPeriod period) {
         List<WorkflowActionDto> actions = new ArrayList<>();
-        actions.add(new WorkflowActionDto("VIEW_PERIOD", "查看周期详情", "/period", period.getId(), null));
+        actions.add(new WorkflowActionDto("VIEW_PERIOD", "查看周期详情", "/periods", period.getId(), null));
         actions.add(new WorkflowActionDto("VIEW_OKR", "查看 OKR", "/okr/my", period.getId(), null));
         actions.add(new WorkflowActionDto("VIEW_SCORES", "查看绩效", "/scores/my", period.getId(), null));
         return actions;

+ 7 - 2
frontend/src/components/shell/AppShell.vue

@@ -11,7 +11,7 @@
       <SystemStatusBar
         :period-name="periodName"
         :phase="phase"
-        :unread-count="0"
+        :unread-count="unreadCount"
       />
       <main class="app-shell__content">
         <router-view />
@@ -21,7 +21,7 @@
 </template>
 
 <script setup>
-import { ref, computed, watch } from 'vue'
+import { ref, computed, watch, onMounted } from 'vue'
 import { useRoute, useRouter } from 'vue-router'
 import { useWorkspaceStore } from '@/stores/workspace'
 import ModuleRail from './ModuleRail.vue'
@@ -38,6 +38,7 @@ const route = useRoute()
 const router = useRouter()
 const workspace = useWorkspaceStore()
 
+const unreadCount = ref(0)
 const activeModule = ref('workspace')
 const contextCollapsed = ref(false)
 
@@ -99,6 +100,10 @@ watch(() => route.path, (path) => {
     }
   }
 }, { immediate: true })
+
+onMounted(() => {
+  workspace.refreshOverview()
+})
 </script>
 
 <style scoped>