forked from verdnatura/salix-front
fix: refs #6480 reactive descriptor
This commit is contained in:
parent
3fb155e697
commit
e38b53ca25
|
@ -1,6 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onBeforeMount, watch, computed, ref } from 'vue';
|
import { onBeforeMount, watch, computed, ref } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue';
|
import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
|
@ -40,7 +39,6 @@ const $props = defineProps({
|
||||||
|
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const arrayData = useArrayData($props.dataKey || $props.module, {
|
const arrayData = useArrayData($props.dataKey || $props.module, {
|
||||||
url: $props.url,
|
url: $props.url,
|
||||||
|
@ -56,14 +54,12 @@ defineExpose({
|
||||||
});
|
});
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
await getData();
|
await getData();
|
||||||
watch(
|
watch($props, async () => await getData());
|
||||||
() => route.params.id,
|
|
||||||
async () => await getData()
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
async function getData() {
|
async function getData() {
|
||||||
store.url = $props.url;
|
store.url = $props.url;
|
||||||
|
store.filter = $props.filter ?? {};
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
try {
|
try {
|
||||||
const { data } = await arrayData.fetch({ append: false, updateRouter: false });
|
const { data } = await arrayData.fetch({ append: false, updateRouter: false });
|
||||||
|
|
|
@ -31,7 +31,9 @@ const entityId = computed(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const worker = ref();
|
const worker = ref();
|
||||||
const filter = { where: { id: route.params.id}};
|
const filter = computed(() => {
|
||||||
|
return { where: { id: entityId.value } };
|
||||||
|
});
|
||||||
|
|
||||||
const sip = ref(null);
|
const sip = ref(null);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue