Browse Source

[Fix][UI Next][V1.0.0-Alpha] When creating a new project, the last created project information is not cleared (#9037)

3.0.0/version-upgrade
zhangxinruu 3 years ago committed by GitHub
parent
commit
16bc226bad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      dolphinscheduler-ui-next/src/views/projects/list/components/project-modal.tsx
  2. 10
      dolphinscheduler-ui-next/src/views/projects/list/components/use-form.ts

2
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)
}

10
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

Loading…
Cancel
Save