From 9c6b2710974c3f35904892cd2558373f543f9f50 Mon Sep 17 00:00:00 2001 From: invalid w Date: Sun, 8 Oct 2023 18:30:50 +0800 Subject: [PATCH] =?UTF-8?q?chore(Form):=20=E6=B6=88=E9=99=A4antd=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E5=AF=BC=E8=87=B4=E7=B1=BB=E5=9E=8B=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=BC=95=E7=94=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Form/src/components/FormItem.vue | 2 +- src/components/Form/src/helper.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Form/src/components/FormItem.vue b/src/components/Form/src/components/FormItem.vue index 28ad32bd4..9e057527b 100644 --- a/src/components/Form/src/components/FormItem.vue +++ b/src/components/Form/src/components/FormItem.vue @@ -3,7 +3,7 @@ import type { PropType, Ref } from 'vue'; import { computed, defineComponent, toRefs, unref } from 'vue'; import type { FormActionType, FormProps, FormSchema } from '../types/form'; - import type { ValidationRule } from 'ant-design-vue/lib/form/Form'; + import type { Rule as ValidationRule } from 'ant-design-vue/lib/form/interface'; import type { TableActionType } from '/@/components/Table'; import { Col, Divider, Form } from 'ant-design-vue'; import { componentMap } from '../componentMap'; diff --git a/src/components/Form/src/helper.ts b/src/components/Form/src/helper.ts index e37f5e9ef..9118f3557 100644 --- a/src/components/Form/src/helper.ts +++ b/src/components/Form/src/helper.ts @@ -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); }