diff --git a/components/index/ContentDashboard.vue b/components/index/ContentDashboard.vue index 8b424d4..81cd8ff 100644 --- a/components/index/ContentDashboard.vue +++ b/components/index/ContentDashboard.vue @@ -322,7 +322,19 @@ const calculateOverdueDays = (expireTime) => { // 加载逾期任务列表 const loadOverdueTasks = async () => { try { - const res = await getTaskList({ overdue: true,pageNum:1,pageSize:100, statusList: [1, 2] }); + // 根据私有视角设置 ownerId 参数 + const ownerId = currentUserId.value && privateView.value ? currentUserId.value : ''; + const params = { + overdue: true, + pageNum: 1, + pageSize: 100, + statusList: [2] + }; + if (ownerId) { + params.ownerId = ownerId; + } + + const res = await getTaskList(params); console.log('逾期任务列表加载成功:', res); // 根据实际返回的数据结构:{ total: 27, rows: [...], code: 200, msg: "查询成功" } @@ -507,6 +519,11 @@ watch(filterSelf, () => { loadDashboardData(); }); +// 监听私有视角变化,自动刷新数据 +watch(() => userStore.privateView, () => { + loadDashboardData(); +}); + // 跳转到任务列表页 const goToTaskList = (label) => { // 将中文标签映射为状态参数