refactor(projects): 1 工作台缓存优化;2 工作日志总工时下进度显示
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user