Browse Source

qr code: code cleanups

pull/4142/head
Daniel Spaude 2 years ago
parent
commit
edb24b4562
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 2
      packages/nc-gui/components/smartsheet/Form.vue
  2. 25
      packages/nc-gui/components/smartsheet/column/QrCodeOptions.vue
  3. 3
      packages/nc-gui/components/virtual-cell/QrCode.vue

2
packages/nc-gui/components/smartsheet/Form.vue

@ -75,7 +75,6 @@ const { syncLTARRefs, row } = useProvideSmartsheetRowStore(
}),
)
// const columns = computed(() => meta?.value?.columns?.filter((col) => col.uidt !== UITypes.QrCode) || [])
const columns = computed(() => meta?.value?.columns || [])
const localColumns = ref<Record<string, any>[]>([])
@ -259,7 +258,6 @@ async function checkSMTPStatus() {
}
function setFormData() {
// const col = formColumnData?.value?.filter((c) => c.uidt !== UITypes.QrCode) || []
const col = formColumnData?.value || []
formViewData.value = {

25
packages/nc-gui/components/smartsheet/column/QrCodeOptions.vue

@ -6,6 +6,7 @@ import { useVModel } from '#imports'
const props = defineProps<{
modelValue: any
}>()
const emit = defineEmits(['update:modelValue'])
const meta = inject(MetaInj, ref())
@ -53,22 +54,14 @@ setAdditionalValidations({
<template>
<a-row>
<a-col :span="24">
<div class="nc-fields-list py-1">
<div class="grouping-field">
<a-form-item
class="flex w-1/2 pb-2"
:label="$t('labels.qrCodeValueColumn')"
v-bind="validateInfos.fk_qr_value_column_id"
>
<a-select
v-model:value="vModel.fk_qr_value_column_id"
:options="columnsAllowedAsQrValue"
placeholder="Select a column for the QR code value"
@click.stop
/>
</a-form-item>
</div>
</div>
<a-form-item class="flex w-1/2 pb-2" :label="$t('labels.qrCodeValueColumn')" v-bind="validateInfos.fk_qr_value_column_id">
<a-select
v-model:value="vModel.fk_qr_value_column_id"
:options="columnsAllowedAsQrValue"
placeholder="Select a column for the QR code value"
@click.stop
/>
</a-form-item>
</a-col>
</a-row>
</template>

3
packages/nc-gui/components/virtual-cell/QrCode.vue

@ -4,14 +4,17 @@ import { useQRCode } from '@vueuse/integrations/useQRCode'
const cellValue = inject(CellValueInj)
const qrValue = computed(() => String(cellValue?.value))
const qrCode = useQRCode(qrValue, {
width: 150,
})
const qrCodeLarge = useQRCode(qrValue, {
width: 600,
})
const modalVisible = ref(false)
const showQrModal = (ev: MouseEvent) => {
ev.stopPropagation()
modalVisible.value = true

Loading…
Cancel
Save