Merge pull request 'fix(ItemTags): wait data' (!1718) from hotFix_itemTags_id into master
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
Reviewed-on: #1718
This commit is contained in:
commit
2d21ce3681
|
@ -83,7 +83,7 @@ const isLoading = ref(false);
|
|||
const hasChanges = ref(false);
|
||||
const originalData = ref();
|
||||
const vnPaginateRef = ref();
|
||||
const formData = ref([]);
|
||||
const formData = ref();
|
||||
const saveButtonRef = ref(null);
|
||||
const watchChanges = ref();
|
||||
const formUrl = computed(() => $props.url);
|
||||
|
@ -298,6 +298,10 @@ watch(formUrl, async () => {
|
|||
});
|
||||
</script>
|
||||
<template>
|
||||
<SkeletonTable
|
||||
v-if="!formData && ($attrs['auto-load'] === '' || $attrs['auto-load'])"
|
||||
:columns="$attrs.columns?.length"
|
||||
/>
|
||||
<VnPaginate
|
||||
:url="url"
|
||||
:limit="limit"
|
||||
|
@ -316,10 +320,6 @@ watch(formUrl, async () => {
|
|||
></slot>
|
||||
</template>
|
||||
</VnPaginate>
|
||||
<SkeletonTable
|
||||
v-if="!formData && $attrs.autoLoad"
|
||||
:columns="$attrs.columns?.length"
|
||||
/>
|
||||
<Teleport to="#st-actions" v-if="stateStore?.isSubToolbarShown() && hasSubToolbar">
|
||||
<QBtnGroup push style="column-gap: 10px">
|
||||
<slot name="moreBeforeActions" />
|
||||
|
|
|
@ -183,7 +183,7 @@ const arrayData = useArrayData(arrayDataKey, {
|
|||
searchUrl: false,
|
||||
mapKey: $attrs['map-key'],
|
||||
});
|
||||
|
||||
const someIsLoading = computed(() => isLoading.value || arrayData.isLoading);
|
||||
function findKeyInOptions() {
|
||||
if (!$props.options) return;
|
||||
return filter($props.modelValue, $props.options)?.length;
|
||||
|
@ -366,7 +366,8 @@ function getCaption(opt) {
|
|||
virtual-scroll-slice-size="options.length"
|
||||
hide-bottom-space
|
||||
:input-debounce="useURL ? '300' : '0'"
|
||||
:loading="isLoading"
|
||||
:loading="someIsLoading"
|
||||
:disable="someIsLoading"
|
||||
@virtual-scroll="onScroll"
|
||||
@keydown="handleKeyDown"
|
||||
:data-cy="$attrs.dataCy ?? $attrs.label + '_select'"
|
||||
|
|
|
@ -89,7 +89,6 @@ const insertTag = (rows) => {
|
|||
:default-remove="false"
|
||||
:user-filter="{
|
||||
fields: ['id', 'itemFk', 'tagFk', 'value', 'priority'],
|
||||
where: { itemFk: route.params.id },
|
||||
include: {
|
||||
relation: 'tag',
|
||||
scope: {
|
||||
|
@ -97,6 +96,7 @@ const insertTag = (rows) => {
|
|||
},
|
||||
},
|
||||
}"
|
||||
:filter="{ where: { itemFk: route.params.id } }"
|
||||
order="priority"
|
||||
auto-load
|
||||
@on-fetch="onItemTagsFetched"
|
||||
|
|
|
@ -11,26 +11,19 @@ export function cloneItem() {
|
|||
const router = useRouter();
|
||||
const cloneItem = async (entityId) => {
|
||||
const { id } = entityId;
|
||||
try {
|
||||
const { data } = await axios.post(`Items/${id ?? entityId}/clone`);
|
||||
router.push({ name: 'ItemTags', params: { id: data.id } });
|
||||
} catch (err) {
|
||||
console.error('Error cloning item');
|
||||
}
|
||||
const { data } = await axios.post(`Items/${id ?? entityId}/clone`);
|
||||
router.push({ name: 'ItemTags', params: { id: data.id } });
|
||||
};
|
||||
|
||||
const openCloneDialog = async (entityId) => {
|
||||
quasar
|
||||
.dialog({
|
||||
component: VnConfirm,
|
||||
componentProps: {
|
||||
title: t('item.descriptor.clone.title'),
|
||||
message: t('item.descriptor.clone.subTitle'),
|
||||
},
|
||||
})
|
||||
.onOk(async () => {
|
||||
await cloneItem(entityId);
|
||||
});
|
||||
quasar.dialog({
|
||||
component: VnConfirm,
|
||||
componentProps: {
|
||||
title: t('item.descriptor.clone.title'),
|
||||
message: t('item.descriptor.clone.subTitle'),
|
||||
promise: () => cloneItem(entityId),
|
||||
},
|
||||
});
|
||||
};
|
||||
return { openCloneDialog };
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue