refactor(projects): 1 工作台缓存优化;2 工作日志总工时下进度显示
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref, watch } from 'vue';
|
||||
import { computed, onActivated, ref, watch } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { RDMS_REQ_PRIORITY_DICT_CODE } from '@/constants/dict';
|
||||
import { OBJECT_CONTEXT_QUERY_KEY } from '@/constants/object-context';
|
||||
@@ -31,7 +31,8 @@ const { loading, refresh } = useWorkbenchRefresh(async () => {
|
||||
items.value = buildWorkbenchMyExecutionItems(data?.list ?? []);
|
||||
});
|
||||
|
||||
onMounted(refresh);
|
||||
// 工作台路由 keepAlive:切回不重挂,用 onActivated 替代 onMounted,每次激活重拉(首挂也会触发,不漏首屏)
|
||||
onActivated(refresh);
|
||||
|
||||
// 按项目归类:未完成执行数多的项目在前;项目内按计划结束日升序(更紧的在前)
|
||||
const groups = computed<Array<{ projectId: string; projectName: string; items: MyExecutionItem[] }>>(() => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref, watch } from 'vue';
|
||||
import { computed, onActivated, ref, watch } from 'vue';
|
||||
import { fetchGetMyOwnedProjectPage, fetchGetMyParticipatedProjectPage } from '@/service/api';
|
||||
import { useRouterPush } from '@/hooks/common/router';
|
||||
import {
|
||||
@@ -46,7 +46,8 @@ const { loading, refresh } = useWorkbenchRefresh(async () => {
|
||||
}
|
||||
});
|
||||
|
||||
onMounted(refresh);
|
||||
// 工作台路由 keepAlive:切回不重挂,用 onActivated 替代 onMounted,每次激活重拉(首挂也会触发,不漏首屏)
|
||||
onActivated(refresh);
|
||||
|
||||
const currentOwnedId = ref<string>('');
|
||||
watch(ownedItems, list => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { computed, onActivated, ref } from 'vue';
|
||||
import { fetchGetMyTeamLoad } from '@/service/api';
|
||||
import { getWorkbenchItemColor } from '../composables/use-workbench-colors';
|
||||
import {
|
||||
@@ -45,7 +45,8 @@ function toTeamLoadSource(member: Api.Project.TeamLoadMember, index: number): Wo
|
||||
|
||||
const view = computed(() => buildWorkbenchTeamLoadView({ members: teamLoadMembers.value.map(toTeamLoadSource) }));
|
||||
|
||||
onMounted(loadTeamLoad);
|
||||
// 工作台路由 keepAlive:切回不重挂,用 onActivated 替代 onMounted,每次激活经 refresh 重拉(首挂也会触发,不漏首屏)
|
||||
onActivated(refresh);
|
||||
|
||||
const LEVEL_LABEL: Record<WorkbenchTeamLoadLevel, string> = {
|
||||
high: '高负载',
|
||||
|
||||
@@ -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