From 34134da10ac651cbe6a872f013ae1b3a8c300de6 Mon Sep 17 00:00:00 2001 From: Daniel Spaude Date: Mon, 20 Feb 2023 18:18:15 -0500 Subject: [PATCH] code scanner for forms - WIP --- .../pages/[projectType]/form/[viewId]/index/index.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/nc-gui/pages/[projectType]/form/[viewId]/index/index.vue b/packages/nc-gui/pages/[projectType]/form/[viewId]/index/index.vue index a78c81a89f..29c7446dad 100644 --- a/packages/nc-gui/pages/[projectType]/form/[viewId]/index/index.vue +++ b/packages/nc-gui/pages/[projectType]/form/[viewId]/index/index.vue @@ -20,12 +20,12 @@ function isRequired(_columnObj: Record, required = false) { return !!(required || (columnObj && columnObj.rqd && !columnObj.cdf)) } -const showCodeScannerOverlay = ref(false) - const fieldTitleForCurrentScan = ref('') const scannerIsReady = ref(false) +const showCodeScannerOverlay = ref(false) + const onLoaded = async () => { scannerIsReady.value = true } @@ -39,10 +39,11 @@ const onDecode = async (codeValue: string) => { if (!showCodeScannerOverlay.value) { return } + // TODO: remove try catch try { - showCodeScannerOverlay.value = false - // formColumns.value[1]. formState.value[fieldTitleForCurrentScan.value] = codeValue + fieldTitleForCurrentScan.value = '' + showCodeScannerOverlay.value = false } catch (error) { console.error(error) }