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

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

@ -6,6 +6,7 @@ import { useVModel } from '#imports'
const props = defineProps<{ const props = defineProps<{
modelValue: any modelValue: any
}>() }>()
const emit = defineEmits(['update:modelValue']) const emit = defineEmits(['update:modelValue'])
const meta = inject(MetaInj, ref()) const meta = inject(MetaInj, ref())
@ -53,22 +54,14 @@ setAdditionalValidations({
<template> <template>
<a-row> <a-row>
<a-col :span="24"> <a-col :span="24">
<div class="nc-fields-list py-1"> <a-form-item class="flex w-1/2 pb-2" :label="$t('labels.qrCodeValueColumn')" v-bind="validateInfos.fk_qr_value_column_id">
<div class="grouping-field"> <a-select
<a-form-item v-model:value="vModel.fk_qr_value_column_id"
class="flex w-1/2 pb-2" :options="columnsAllowedAsQrValue"
:label="$t('labels.qrCodeValueColumn')" placeholder="Select a column for the QR code value"
v-bind="validateInfos.fk_qr_value_column_id" @click.stop
> />
<a-select </a-form-item>
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-col> </a-col>
</a-row> </a-row>
</template> </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 cellValue = inject(CellValueInj)
const qrValue = computed(() => String(cellValue?.value)) const qrValue = computed(() => String(cellValue?.value))
const qrCode = useQRCode(qrValue, { const qrCode = useQRCode(qrValue, {
width: 150, width: 150,
}) })
const qrCodeLarge = useQRCode(qrValue, { const qrCodeLarge = useQRCode(qrValue, {
width: 600, width: 600,
}) })
const modalVisible = ref(false) const modalVisible = ref(false)
const showQrModal = (ev: MouseEvent) => { const showQrModal = (ev: MouseEvent) => {
ev.stopPropagation() ev.stopPropagation()
modalVisible.value = true modalVisible.value = true

Loading…
Cancel
Save