|
|
@ -3,8 +3,6 @@ import type { UITypes } from 'nocodb-sdk' |
|
|
|
import { AllowedColumnTypesForQrAndBarcodes } from 'nocodb-sdk' |
|
|
|
import { AllowedColumnTypesForQrAndBarcodes } from 'nocodb-sdk' |
|
|
|
import type { SelectProps } from 'ant-design-vue' |
|
|
|
import type { SelectProps } from 'ant-design-vue' |
|
|
|
import { useVModel } from '#imports' |
|
|
|
import { useVModel } from '#imports' |
|
|
|
import * as Ewa from '@chenfengyuan/vue-barcode' |
|
|
|
|
|
|
|
import * as Daniel from 'JsBarcode' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps<{ |
|
|
|
const props = defineProps<{ |
|
|
|
modelValue: any |
|
|
|
modelValue: any |
|
|
@ -57,13 +55,19 @@ const supportedBarcodeFormats = [ |
|
|
|
onMounted(() => { |
|
|
|
onMounted(() => { |
|
|
|
// set default value |
|
|
|
// set default value |
|
|
|
vModel.value.fk_barcode_value_column_id = (column?.value?.colOptions as Record<string, any>)?.fk_barcode_value_column_id || '' |
|
|
|
vModel.value.fk_barcode_value_column_id = (column?.value?.colOptions as Record<string, any>)?.fk_barcode_value_column_id || '' |
|
|
|
vModel.value.barcode_format = (column?.value?.colOptions as Record<string, any>)?.barcode_format || '' |
|
|
|
// vModel.value.meta.barcode_format = (column?.value?.colOptions as Record<string, any>)?.barcode_format || '' |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
setAdditionalValidations({ |
|
|
|
setAdditionalValidations({ |
|
|
|
fk_barcode_value_column_id: [{ required: true, message: 'Required' }], |
|
|
|
fk_barcode_value_column_id: [{ required: true, message: 'Required' }], |
|
|
|
// barcode_format: [{ required: true, message: 'Required' }], |
|
|
|
barcode_format: [{ required: true, message: 'Required' }], |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// set default meta value |
|
|
|
|
|
|
|
vModel.value.meta = { |
|
|
|
|
|
|
|
barcodeFormat: supportedBarcodeFormats[0].value, |
|
|
|
|
|
|
|
...vModel.value.meta, |
|
|
|
|
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
@ -81,18 +85,18 @@ setAdditionalValidations({ |
|
|
|
@click.stop |
|
|
|
@click.stop |
|
|
|
/> |
|
|
|
/> |
|
|
|
</a-form-item> |
|
|
|
</a-form-item> |
|
|
|
<!-- <a-form-item |
|
|
|
<a-form-item |
|
|
|
class="flex w-1/2 pb-2 nc-qr-code-value-column-select" |
|
|
|
class="flex w-1/2 pb-2 nc-qr-code-value-column-select" |
|
|
|
:label="$t('labels.barcodeFormat')" |
|
|
|
:label="$t('labels.barcodeFormat')" |
|
|
|
v-bind="validateInfos.barcode_format" |
|
|
|
v-bind="validateInfos.barcode_format" |
|
|
|
> |
|
|
|
> |
|
|
|
<a-select |
|
|
|
<a-select |
|
|
|
v-model:value="vModel.barcode_format" |
|
|
|
v-model:value="vModel.meta.barcodeFormat" |
|
|
|
:options="supportedBarcodeFormats" |
|
|
|
:options="supportedBarcodeFormats" |
|
|
|
placeholder="Select a Barcode format" |
|
|
|
placeholder="Select a Barcode format" |
|
|
|
@click.stop |
|
|
|
@click.stop |
|
|
|
/> |
|
|
|
/> |
|
|
|
</a-form-item> --> |
|
|
|
</a-form-item> |
|
|
|
</a-col> |
|
|
|
</a-col> |
|
|
|
</a-row> |
|
|
|
</a-row> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|