refactor(projects): 1 工作台缓存优化;2 工作日志总工时下进度显示

This commit is contained in:
2026-06-22 19:28:39 +08:00
parent 61fe9ef143
commit 4a7f54b0ed
8 changed files with 242 additions and 86 deletions

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { type Component, computed, markRaw, onMounted, ref, watch } from 'vue';
import { type Component, computed, markRaw, onActivated, ref, watch } from 'vue';
import { useRouter } from 'vue-router';
import type { RouteKey } from '@elegant-router/types';
import { OBJECT_CONTEXT_QUERY_KEY } from '@/constants/object-context';
@@ -865,14 +865,8 @@ function getDeadlineToneClass(item: WorkbenchTodoItem) {
return 'workbench-todo__deadline--slate';
}
onMounted(async () => {
await Promise.all([
loadMyTaskItems(),
loadPersonalTodoItems(),
loadOvertimeApprovalItems(),
loadWorkReportApprovalItems()
]);
});
// 工作台路由 keepAlive切回不重挂用 onActivated 替代 onMounted每次激活经 refresh 重拉(首挂也会触发,不漏首屏)
onActivated(refresh);
</script>
<template>