|
|
|
@ -1,4 +1,4 @@ |
|
|
|
import type { ValidationRule } from 'ant-design-vue/lib/form/Form'; |
|
|
|
import type { Rule as ValidationRule } from 'ant-design-vue/lib/form/interface'; |
|
|
|
import type { ComponentType } from './types/index'; |
|
|
|
import { useI18n } from '/@/hooks/web/useI18n'; |
|
|
|
import { dateUtil } from '/@/utils/dateUtil'; |
|
|
|
@ -55,7 +55,7 @@ export function setComponentRuleType( |
|
|
|
export function processDateValue(attr: Recordable, component: string) { |
|
|
|
const { valueFormat, value } = attr; |
|
|
|
if (valueFormat) { |
|
|
|
attr.value = isObject(value) ? dateUtil(value).format(valueFormat) : value; |
|
|
|
attr.value = isObject(value) ? dateUtil(value as unknown as Date).format(valueFormat) : value; |
|
|
|
} else if (DATE_TYPE.includes(component) && value) { |
|
|
|
attr.value = dateUtil(attr.value); |
|
|
|
} |
|
|
|
|