Browse Source

qr scanner - WIP

pull/4898/head
Daniel Spaude 2 years ago
parent
commit
b87f8d0313
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 1
      packages/nc-gui/components.d.ts
  2. 23
      packages/nc-gui/components/smartsheet/qr-scanner-button/QrScannerButton.vue

1
packages/nc-gui/components.d.ts vendored

@ -90,6 +90,7 @@ declare module '@vue/runtime-core' {
LogosMysqlIcon: typeof import('~icons/logos/mysql-icon')['default']
LogosPostgresql: typeof import('~icons/logos/postgresql')['default']
LogosRedditIcon: typeof import('~icons/logos/reddit-icon')['default']
LogosSnowflakeIcon: typeof import('~icons/logos/snowflake-icon')['default']
LogosSwagger: typeof import('~icons/logos/swagger')['default']
MaterialSymbolsAccountTreeRounded: typeof import('~icons/material-symbols/account-tree-rounded')['default']
MaterialSymbolsArrowCircleLeftRounded: typeof import('~icons/material-symbols/arrow-circle-left-rounded')['default']

23
packages/nc-gui/components/smartsheet/qr-scanner-button/QrScannerButton.vue

@ -25,14 +25,12 @@ interface Entry {
onBeforeMount(init)
async function init() {
qrCodeFieldOptions.value = meta?.value
?.columns!.filter((el) => el.uidt === UITypes.QrCode)
.map((field) => {
return {
value: field.id,
label: field.title,
}
})
qrCodeFieldOptions.value = meta?.value?.columns!.map((field) => {
return {
value: field.id,
label: field.title,
}
})
}
const showQrCodeScanner = ref(false)
@ -41,7 +39,7 @@ const entry = ref<Entry | null>(null)
const selectedCodeColumnIdToScanFor = ref('')
const onDecode = async (qrCodeValue: string) => {
// alert(qrCodeValue)
alert(qrCodeValue)
try {
showQrCodeScanner.value = false
@ -74,6 +72,12 @@ const onLoaded = async () => {
// alert('FOO')
scannerIsReady.value = true
}
const FOO = async () => {
alert('FOO')
}
// TODO: ensure that when modal is closed, scannerIsReady gets set back to false
</script>
<template>
@ -94,7 +98,6 @@ const onLoaded = async () => {
:footer="null"
wrap-class-name="nc-modal-generate-token"
destroy-on-close
:after-close="(scannerIsReady = false)"
>
<div class="relative flex flex-col h-full">
<a-form-item :label="$t('labels.qrCodeColumn')">

Loading…
Cancel
Save