Bladeren bron

feat(frontend): AppShell 真实通知数 + API 层 getHistory/getReviewQueue/getWorkbench

wangkangyjy 1 week geleden
bovenliggende
commit
5c635df5c9
2 gewijzigde bestanden met toevoegingen van 10 en 2 verwijderingen
  1. 4 1
      frontend/src/api/index.js
  2. 6 1
      frontend/src/components/shell/AppShell.vue

+ 4 - 1
frontend/src/api/index.js

@@ -93,6 +93,7 @@ export const okrApi = {
   getSubordinates: periodId => api.get(`/okr/period/${periodId}/subordinates`).then(r => r.data),
   getPendingReviews: periodId => api.get(`/okr/period/${periodId}/pending-reviews`).then(r => r.data),
   getAllOkrs: periodId => api.get(`/okr/period/${periodId}/all`).then(r => r.data),
+  getWorkbench: periodId => api.get('/okr/workbench', { params: { periodId } }).then(r => r.data),
   getDetail: id => api.get(`/okr/${id}`).then(r => r.data),
   getTree: periodId => api.get(`/okr/period/${periodId}/tree`).then(r => r.data),
   getOrphans: periodId => api.get(`/okr/period/${periodId}/orphans`).then(r => r.data),
@@ -121,7 +122,9 @@ export const scoreApi = {
   confirm: data => api.post('/scores/confirm', data),
   getPage: (periodId, userId) => api.get('/scores/page', { params: { periodId, userId } }).then(r => r.data),
   getMyResult: periodId => api.get('/scores/my', { params: { periodId } }).then(r => r.data),
-  getSubordinates: periodId => api.get('/scores/subordinates', { params: { periodId } }).then(r => r.data)
+  getSubordinates: periodId => api.get('/scores/subordinates', { params: { periodId } }).then(r => r.data),
+  getReviewQueue: periodId => api.get('/scores/review-queue', { params: { periodId } }).then(r => r.data),
+  getHistory: () => api.get('/scores/history').then(r => r.data)
 }
 
 export const scoreAppealApi = {

+ 6 - 1
frontend/src/components/shell/AppShell.vue

@@ -24,6 +24,7 @@
 import { ref, computed, watch, onMounted } from 'vue'
 import { useRoute, useRouter } from 'vue-router'
 import { useWorkspaceStore } from '@/stores/workspace'
+import api from '@/api'
 import ModuleRail from './ModuleRail.vue'
 import ContextNav from './ContextNav.vue'
 import SystemStatusBar from './SystemStatusBar.vue'
@@ -101,8 +102,12 @@ watch(() => route.path, (path) => {
   }
 }, { immediate: true })
 
-onMounted(() => {
+onMounted(async () => {
   workspace.refreshOverview()
+  try {
+    const res = await api.get('/notifications/unread-count')
+    unreadCount.value = res?.data?.count || res?.count || 0
+  } catch { /* ignore */ }
 })
 </script>