Browse Source

barcode: fix barcode value in cleaner way

pull/4641/head
flisowna 2 years ago
parent
commit
94bbacf975
  1. 2
      packages/nc-gui/components/virtual-cell/QrCode.vue
  2. 3
      packages/nc-gui/components/virtual-cell/barcode/Barcode.vue

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

@ -6,7 +6,9 @@ const maxNumberOfAllowedCharsForQrValue = 2000
const cellValue = inject(CellValueInj) const cellValue = inject(CellValueInj)
const qrValue = computed(() => String(cellValue?.value)) const qrValue = computed(() => String(cellValue?.value))
const tooManyCharsForQrCode = computed(() => qrValue?.value.length > maxNumberOfAllowedCharsForQrValue) const tooManyCharsForQrCode = computed(() => qrValue?.value.length > maxNumberOfAllowedCharsForQrValue)
const showQrCode = computed(() => qrValue?.value?.length > 0 && !tooManyCharsForQrCode.value) const showQrCode = computed(() => qrValue?.value?.length > 0 && !tooManyCharsForQrCode.value)
const qrCode = useQRCode(qrValue, { const qrCode = useQRCode(qrValue, {

3
packages/nc-gui/components/virtual-cell/barcode/Barcode.vue

@ -40,8 +40,7 @@ const { showEditNonEditableFieldWarning, showClearNonEditableFieldWarning } = us
:footer="null" :footer="null"
@ok="handleModalOkClick" @ok="handleModalOkClick"
> >
<JsBarcodeWrapper v-if="showBarcode" :barcode-value="barcodeValue" :barcode-format="barcodeMeta.barcodeFormat"> <JsBarcodeWrapper v-if="showBarcode" :barcode-value="barcodeValue" :barcode-format="barcodeMeta.barcodeFormat" />
</JsBarcodeWrapper>
</a-modal> </a-modal>
<JsBarcodeWrapper <JsBarcodeWrapper
v-if="showBarcode" v-if="showBarcode"

Loading…
Cancel
Save