diff --git a/dolphinscheduler-ui-next/src/views/projects/list/components/project-modal.tsx b/dolphinscheduler-ui-next/src/views/projects/list/components/project-modal.tsx index 3c66aa16f8..5cf725816b 100644 --- a/dolphinscheduler-ui-next/src/views/projects/list/components/project-modal.tsx +++ b/dolphinscheduler-ui-next/src/views/projects/list/components/project-modal.tsx @@ -52,6 +52,8 @@ const ProjectModal = defineComponent({ variables.model.description = '' } else { variables.model.userName = props.row.userName + variables.model.projectName = props.row.name + variables.model.description = props.row.description } ctx.emit('cancelModal', props.showModalRef) } diff --git a/dolphinscheduler-ui-next/src/views/projects/list/components/use-form.ts b/dolphinscheduler-ui-next/src/views/projects/list/components/use-form.ts index fc0e7eba77..a3c96c43d9 100644 --- a/dolphinscheduler-ui-next/src/views/projects/list/components/use-form.ts +++ b/dolphinscheduler-ui-next/src/views/projects/list/components/use-form.ts @@ -29,6 +29,14 @@ export function useForm( const { t } = useI18n() const userStore = useUserStore() + const resetForm = () => { + variables.model = { + projectName: '', + description: '', + userName: (userStore.getUserInfo as UserInfoRes).userName + } + } + const variables = reactive({ projectFormRef: ref(), model: { @@ -75,6 +83,7 @@ export function useForm( try { await createProject(variables.model) variables.saving = false + resetForm() ctx.emit('confirmModal', props.showModalRef) } catch (err) { variables.saving = false @@ -87,6 +96,7 @@ export function useForm( try { await updateProject(variables.model, props.row.code) variables.saving = false + resetForm() ctx.emit('confirmModal', props.showModalRef) } catch (err) { variables.saving = false