From 5e88004e790a08aa16902bef0d4d07fbcf5bf3cf Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 12 Aug 2024 08:34:16 +0200 Subject: [PATCH] fix(customerDescription): fix action buttons --- src/components/VnTable/VnTable.vue | 18 ++++++++++++---- .../Customer/Card/CustomerDescriptor.vue | 21 ++++++++++++++----- src/pages/InvoiceOut/InvoiceOutList.vue | 4 ++-- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 8cd7bb628..16d4dd160 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -108,6 +108,8 @@ const CrudModelRef = ref({}); const showForm = ref(false); const splittedColumns = ref({ columns: [] }); const columnsVisibilitySkiped = ref(); +const createForm = ref(); + const tableModes = [ { icon: 'view_column', @@ -139,6 +141,14 @@ onMounted(() => { .map((c) => c.name), ...['tableActions'], ]; + createForm.value = $props.create; + if ($props.create && route?.query?.createForm) { + showForm.value = true; + createForm.value = { + ...createForm.value, + ...{ formInitialData: JSON.parse(route?.query?.createForm) }, + }; + } }); watch( @@ -158,7 +168,7 @@ function setUserParams(watchedParams) { if (!watchedParams) return; if (typeof watchedParams == 'string') watchedParams = JSON.parse(watchedParams); - const filter = JSON.parse(watchedParams?.filter); + const filter = JSON.parse(watchedParams?.filter ?? '{}'); const where = filter?.where; const order = filter?.order; @@ -598,14 +608,14 @@ defineExpose({ - {{ create.title }} + {{ createForm.title }}