diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index 1234ce123..b1c7606e6 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -176,14 +176,13 @@ async function saveChanges(data) { const changes = data || getChanges(); try { await axios.post($props.saveUrl || $props.url + '/crud', changes); - } catch (e) { - return (isLoading.value = false); + } finally { + isLoading.value = false; } originalData.value = JSON.parse(JSON.stringify(formData.value)); if (changes.creates?.length) await vnPaginateRef.value.fetch(); hasChanges.value = false; - isLoading.value = false; emit('saveChanges', data); quasar.notify({ type: 'positive', diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index db47231f4..78e72127e 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -8,7 +8,14 @@ import dataByOrder from 'src/utils/dataByOrder'; const emit = defineEmits(['update:modelValue', 'update:options', 'remove']); const $attrs = useAttrs(); const { t } = useI18n(); -const { isRequired, requiredFieldRule } = useRequired($attrs); + +const isRequired = computed(() => { + return useRequired($attrs).isRequired; +}); +const requiredFieldRule = computed(() => { + return useRequired($attrs).requiredFieldRule; +}); + const $props = defineProps({ modelValue: { type: [String, Number, Object], @@ -284,9 +291,9 @@ async function onScroll({ to, direction, from, index }) { :loading="isLoading" @virtual-scroll="onScroll" > - diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index 716d8331f..7319dc866 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -79,7 +79,7 @@ const userParams = ref({}); defineExpose({ search, sanitizer, params: userParams }); onMounted(() => { - userParams.value = $props.modelValue ?? {}; + if (!userParams.value) userParams.value = $props.modelValue ?? {}; emit('init', { params: userParams.value }); }); @@ -105,7 +105,8 @@ watch( watch( () => arrayData.store.userParams, - (val, oldValue) => (val || oldValue) && setUserParams(val) + (val, oldValue) => (val || oldValue) && setUserParams(val), + { immediate: true } ); watch( diff --git a/src/components/ui/VnLinkPhone.vue b/src/components/ui/VnLinkPhone.vue index 4068498cd..c5d5df394 100644 --- a/src/components/ui/VnLinkPhone.vue +++ b/src/components/ui/VnLinkPhone.vue @@ -1,23 +1,28 @@ diff --git a/src/pages/Customer/Card/CustomerWebAccess.vue b/src/pages/Customer/Card/CustomerWebAccess.vue index eec127fde..ea901c65a 100644 --- a/src/pages/Customer/Card/CustomerWebAccess.vue +++ b/src/pages/Customer/Card/CustomerWebAccess.vue @@ -42,13 +42,13 @@ async function hasCustomerRole() { >