fix: refs #6943 formModel workerDepartment
This commit is contained in:
parent
cb034dc406
commit
6baf850470
|
@ -12,6 +12,7 @@ import SkeletonForm from 'components/ui/SkeletonForm.vue';
|
||||||
import VnConfirm from './ui/VnConfirm.vue';
|
import VnConfirm from './ui/VnConfirm.vue';
|
||||||
import { tMobile } from 'src/composables/tMobile';
|
import { tMobile } from 'src/composables/tMobile';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
import { getDifferences, getUpdatedValues } from 'src/filters';
|
||||||
|
|
||||||
const { push } = useRouter();
|
const { push } = useRouter();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
|
@ -284,7 +285,12 @@ function trimData(data) {
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
function onBeforeSave(formData, originalData) {
|
||||||
|
return getUpdatedValues(
|
||||||
|
Object.keys(getDifferences(formData, originalData)),
|
||||||
|
formData,
|
||||||
|
);
|
||||||
|
}
|
||||||
async function onKeyup(evt) {
|
async function onKeyup(evt) {
|
||||||
if (evt.key === 'Enter' && !('prevent-submit' in attrs)) {
|
if (evt.key === 'Enter' && !('prevent-submit' in attrs)) {
|
||||||
const input = evt.target;
|
const input = evt.target;
|
||||||
|
@ -321,6 +327,7 @@ defineExpose({
|
||||||
class="q-pa-md"
|
class="q-pa-md"
|
||||||
:style="maxWidth ? 'max-width: ' + maxWidth : ''"
|
:style="maxWidth ? 'max-width: ' + maxWidth : ''"
|
||||||
id="formModel"
|
id="formModel"
|
||||||
|
:mapper="onBeforeSave"
|
||||||
>
|
>
|
||||||
<QCard>
|
<QCard>
|
||||||
<slot
|
<slot
|
||||||
|
|
|
@ -1,16 +1,9 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import VnSection from 'src/components/common/VnSection.vue';
|
|
||||||
import WorkerDepartmentTree from './WorkerDepartmentTree.vue';
|
import WorkerDepartmentTree from './WorkerDepartmentTree.vue';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnSection data-key="WorkerDepartment" :search-bar="false">
|
<QPage class="q-pa-md flex justify-center"> <WorkerDepartmentTree /> </QPage>
|
||||||
<template #body>
|
|
||||||
<div class="flex flex-center q-pa-md">
|
|
||||||
<WorkerDepartmentTree />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</VnSection>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
Loading…
Reference in New Issue