From ad4e85b080e43e19d7aeddef6e67d0d1cb83001e Mon Sep 17 00:00:00 2001 From: joan Date: Fri, 10 Mar 2023 12:49:08 +0100 Subject: [PATCH] Polishing --- src/components/common/SendEmailDialog.vue | 33 ++-- src/components/common/VnSmsDialog.vue | 23 +-- src/components/ui/VnConfirm.vue | 53 +++++-- src/pages/Claim/Card/ClaimDescriptorMenu.vue | 44 +++--- src/pages/Claim/Card/ClaimPhoto.vue | 12 +- src/pages/Claim/Card/ClaimRma.vue | 11 +- src/pages/Claim/ClaimRmaList.vue | 146 ++++++++++-------- src/pages/Ticket/Card/TicketDescriptor.vue | 4 +- .../Ticket/Card/TicketDescriptorMenu.vue | 50 ++++-- 9 files changed, 219 insertions(+), 157 deletions(-) diff --git a/src/components/common/SendEmailDialog.vue b/src/components/common/SendEmailDialog.vue index 0db0af056..e22b60329 100644 --- a/src/components/common/SendEmailDialog.vue +++ b/src/components/common/SendEmailDialog.vue @@ -3,12 +3,13 @@ import { ref } from 'vue'; import { useDialogPluginComponent } from 'quasar'; import { useI18n } from 'vue-i18n'; -const $props = defineProps({ - address: { - type: String, - default: '', +const props = defineProps({ + data: { + type: Object, + requied: true, + default: null, }, - send: { + promise: { type: Function, required: true, }, @@ -19,24 +20,27 @@ defineEmits(['confirm', ...useDialogPluginComponent.emits]); const { dialogRef, onDialogOK } = useDialogPluginComponent(); const { t } = useI18n(); -const address = ref($props.address); +const address = ref(props.data.address); const isLoading = ref(false); async function confirm() { - isLoading.value = true; - await $props.send(address.value); - isLoading.value = false; + const response = { address }; - onDialogOK(); + if (props.promise) { + isLoading.value = true; + Object.assign(response, props.data); + await props.send(response); + isLoading.value = false; + } + + onDialogOK(response); }