|
|
@ -29,6 +29,14 @@ export function useForm( |
|
|
|
const { t } = useI18n() |
|
|
|
const { t } = useI18n() |
|
|
|
const userStore = useUserStore() |
|
|
|
const userStore = useUserStore() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const resetForm = () => { |
|
|
|
|
|
|
|
variables.model = { |
|
|
|
|
|
|
|
projectName: '', |
|
|
|
|
|
|
|
description: '', |
|
|
|
|
|
|
|
userName: (userStore.getUserInfo as UserInfoRes).userName |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const variables = reactive({ |
|
|
|
const variables = reactive({ |
|
|
|
projectFormRef: ref(), |
|
|
|
projectFormRef: ref(), |
|
|
|
model: { |
|
|
|
model: { |
|
|
@ -75,6 +83,7 @@ export function useForm( |
|
|
|
try { |
|
|
|
try { |
|
|
|
await createProject(variables.model) |
|
|
|
await createProject(variables.model) |
|
|
|
variables.saving = false |
|
|
|
variables.saving = false |
|
|
|
|
|
|
|
resetForm() |
|
|
|
ctx.emit('confirmModal', props.showModalRef) |
|
|
|
ctx.emit('confirmModal', props.showModalRef) |
|
|
|
} catch (err) { |
|
|
|
} catch (err) { |
|
|
|
variables.saving = false |
|
|
|
variables.saving = false |
|
|
@ -87,6 +96,7 @@ export function useForm( |
|
|
|
try { |
|
|
|
try { |
|
|
|
await updateProject(variables.model, props.row.code) |
|
|
|
await updateProject(variables.model, props.row.code) |
|
|
|
variables.saving = false |
|
|
|
variables.saving = false |
|
|
|
|
|
|
|
resetForm() |
|
|
|
ctx.emit('confirmModal', props.showModalRef) |
|
|
|
ctx.emit('confirmModal', props.showModalRef) |
|
|
|
} catch (err) { |
|
|
|
} catch (err) { |
|
|
|
variables.saving = false |
|
|
|
variables.saving = false |
|
|
|