|
@@ -74,7 +74,7 @@ import {repositoryHelper} from '~/services/store/repository'
|
|
|
import {queryHelper} from '~/services/store/query'
|
|
import {queryHelper} from '~/services/store/query'
|
|
|
import {FORM_STATUS, QUERY_TYPE, SUBMIT_TYPE, TYPE_ALERT} from '~/types/enums'
|
|
import {FORM_STATUS, QUERY_TYPE, SUBMIT_TYPE, TYPE_ALERT} from '~/types/enums'
|
|
|
import {AnyJson} from '~/types/interfaces'
|
|
import {AnyJson} from '~/types/interfaces'
|
|
|
-import {$useForm} from '~/composables/form/useForm'
|
|
|
|
|
|
|
+import {useForm} from "~/composables/form/useForm";
|
|
|
import * as _ from 'lodash'
|
|
import * as _ from 'lodash'
|
|
|
import Form from "~/services/store/form";
|
|
import Form from "~/services/store/form";
|
|
|
import Page from "~/services/store/page";
|
|
import Page from "~/services/store/page";
|
|
@@ -106,7 +106,7 @@ export default defineComponent({
|
|
|
},
|
|
},
|
|
|
setup(props) {
|
|
setup(props) {
|
|
|
const {$dataPersister, store, app: {router, i18n}} = useContext()
|
|
const {$dataPersister, store, app: {router, i18n}} = useContext()
|
|
|
- const {markFormAsDirty, markFormAsNotDirty, readonly} = $useForm()
|
|
|
|
|
|
|
+ const {markAsDirty, markAsNotDirty, readonly} = useForm(store)
|
|
|
const nextStepFactory = new UseNextStepFactory()
|
|
const nextStepFactory = new UseNextStepFactory()
|
|
|
const {id, query}: ToRefs = toRefs(props)
|
|
const {id, query}: ToRefs = toRefs(props)
|
|
|
const page = new Page(store)
|
|
const page = new Page(store)
|
|
@@ -117,13 +117,13 @@ export default defineComponent({
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const updateRepository = (newValue: string, field: string) => {
|
|
const updateRepository = (newValue: string, field: string) => {
|
|
|
- markFormAsDirty()
|
|
|
|
|
|
|
+ markAsDirty()
|
|
|
repositoryHelper.updateStoreFromField(props.model, entry.value, newValue, field)
|
|
repositoryHelper.updateStoreFromField(props.model, entry.value, newValue, field)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const submit = async (next: string|null = null) => {
|
|
const submit = async (next: string|null = null) => {
|
|
|
if(form.value.validate()){
|
|
if(form.value.validate()){
|
|
|
- markFormAsNotDirty()
|
|
|
|
|
|
|
+ markAsNotDirty()
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
const response = await $dataPersister.invoke({
|
|
const response = await $dataPersister.invoke({
|
|
@@ -175,7 +175,7 @@ export default defineComponent({
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const quitForm = () => {
|
|
const quitForm = () => {
|
|
|
- markFormAsNotDirty()
|
|
|
|
|
|
|
+ markAsNotDirty()
|
|
|
store.commit('form/setShowConfirmToLeave', false)
|
|
store.commit('form/setShowConfirmToLeave', false)
|
|
|
|
|
|
|
|
const entryCopy = query.value.first()
|
|
const entryCopy = query.value.first()
|