|
|
@ -15,6 +15,7 @@ import { |
|
|
|
useSelectedCellKeyupListener, |
|
|
|
useSelectedCellKeyupListener, |
|
|
|
watch, |
|
|
|
watch, |
|
|
|
} from '#imports' |
|
|
|
} from '#imports' |
|
|
|
|
|
|
|
import { isDateMonthFormat } from '~/utils' |
|
|
|
|
|
|
|
|
|
|
|
interface Props { |
|
|
|
interface Props { |
|
|
|
modelValue?: string | null |
|
|
|
modelValue?: string | null |
|
|
@ -45,6 +46,8 @@ const isDateInvalid = ref(false) |
|
|
|
|
|
|
|
|
|
|
|
const dateFormat = computed(() => parseProp(columnMeta?.value?.meta)?.date_format ?? 'YYYY-MM-DD') |
|
|
|
const dateFormat = computed(() => parseProp(columnMeta?.value?.meta)?.date_format ?? 'YYYY-MM-DD') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const picker = computed(() => (isDateMonthFormat(dateFormat.value) ? 'month' : '')) |
|
|
|
|
|
|
|
|
|
|
|
const localState = computed({ |
|
|
|
const localState = computed({ |
|
|
|
get() { |
|
|
|
get() { |
|
|
|
if (!modelValue) { |
|
|
|
if (!modelValue) { |
|
|
@ -215,6 +218,7 @@ const clickHandler = () => { |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<a-date-picker |
|
|
|
<a-date-picker |
|
|
|
v-model:value="localState" |
|
|
|
v-model:value="localState" |
|
|
|
|
|
|
|
:picker="picker" |
|
|
|
:bordered="false" |
|
|
|
:bordered="false" |
|
|
|
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 }" |
|
|
|