diff --git a/frontend/src/components/business/ms-project-select/index.vue b/frontend/src/components/business/ms-project-select/index.vue index b46cfebca7..088178cb05 100644 --- a/frontend/src/components/business/ms-project-select/index.vue +++ b/frontend/src/components/business/ms-project-select/index.vue @@ -25,7 +25,7 @@ useDefaultArrowIcon?: boolean; }>(); const emit = defineEmits<{ - (e: 'change', val: string): void; + (e: 'change', val: string, project?: ProjectListItem): void; }>(); const appStore = useAppStore(); @@ -34,6 +34,14 @@ default: () => '', }); + function selectProject( + value: string | number | boolean | Record | (string | number | boolean | Record)[] + ) { + project.value = value as string; + const _project = projectList.value.find((item) => item.id === value); + emit('change', value as string, _project); + } + onBeforeMount(async () => { if (!project.value) { project.value = appStore.currentProjectId; @@ -42,6 +50,7 @@ if (appStore.currentOrgId) { const res = await getProjectList(appStore.getCurrentOrgId); projectList.value = res; + selectProject(project.value); } else { projectList.value = []; } @@ -50,12 +59,6 @@ console.log(error); } }); - - function selectProject( - value: string | number | boolean | Record | (string | number | boolean | Record)[] - ) { - emit('change', value as string); - } diff --git a/frontend/src/components/pure/ms-color-line/index.vue b/frontend/src/components/pure/ms-color-line/index.vue index b7413e7ca3..1427ecebf3 100644 --- a/frontend/src/components/pure/ms-color-line/index.vue +++ b/frontend/src/components/pure/ms-color-line/index.vue @@ -1,5 +1,5 @@ diff --git a/frontend/src/views/workbench/myToDo/index.vue b/frontend/src/views/workbench/myToDo/index.vue index fc1a0c7fab..e7c4000ba9 100644 --- a/frontend/src/views/workbench/myToDo/index.vue +++ b/frontend/src/views/workbench/myToDo/index.vue @@ -2,7 +2,12 @@