|
|
@ -54,7 +54,7 @@ const localState = computed({ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (val?.isValid()) { |
|
|
|
if (val?.isValid()) { |
|
|
|
emit('update:modelValue', Number(val.format('YYYY'))) |
|
|
|
emit('update:modelValue', val.format('YYYY')) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
@ -76,7 +76,7 @@ watch( |
|
|
|
|
|
|
|
|
|
|
|
const placeholder = computed(() => { |
|
|
|
const placeholder = computed(() => { |
|
|
|
if (isEditColumn.value && modelValue === null) { |
|
|
|
if (isEditColumn.value && modelValue === null) { |
|
|
|
return '(Optional)' |
|
|
|
return 'Select default year (Optional)' |
|
|
|
} else if (modelValue === null && showNull.value) { |
|
|
|
} else if (modelValue === null && showNull.value) { |
|
|
|
return 'NULL' |
|
|
|
return 'NULL' |
|
|
|
} else if (isYearInvalid.value) { |
|
|
|
} else if (isYearInvalid.value) { |
|
|
@ -110,12 +110,13 @@ useSelectedCellKeyupListener(active, (e: KeyboardEvent) => { |
|
|
|
class="!w-full !px-1 !border-none" |
|
|
|
class="!w-full !px-1 !border-none" |
|
|
|
:class="{ 'nc-null': modelValue === null && showNull }" |
|
|
|
:class="{ 'nc-null': modelValue === null && showNull }" |
|
|
|
:placeholder="placeholder" |
|
|
|
:placeholder="placeholder" |
|
|
|
:allow-clear="!readOnly && !localState && !isPk" |
|
|
|
:allow-clear="(!readOnly && !localState && !isPk) || isEditColumn" |
|
|
|
:input-read-only="true" |
|
|
|
:input-read-only="true" |
|
|
|
:open="(readOnly || (localState && isPk)) && !active && !editable ? false : open" |
|
|
|
:open="(readOnly || (localState && isPk)) && !active && !editable ? false : open" |
|
|
|
:dropdown-class-name="`${randomClass} nc-picker-year ${open ? 'active' : ''}`" |
|
|
|
:dropdown-class-name="`${randomClass} nc-picker-year ${open ? 'active' : ''}`" |
|
|
|
@click="open = (active || editable) && !open" |
|
|
|
@click="open = (active || editable) && !open" |
|
|
|
@change="open = (active || editable) && !open" |
|
|
|
@change="open = (active || editable) && !open" |
|
|
|
|
|
|
|
@ok="open = !open" |
|
|
|
> |
|
|
|
> |
|
|
|
<template #suffixIcon></template> |
|
|
|
<template #suffixIcon></template> |
|
|
|
</a-date-picker> |
|
|
|
</a-date-picker> |
|
|
|