Skip to content

Commit

Permalink
chore(Form): 消除antd升级导致类型文件引用错误
Browse files Browse the repository at this point in the history
  • Loading branch information
wangjue666 committed Oct 8, 2023
1 parent ec33820 commit 9c6b271
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/Form/src/components/FormItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions src/components/Form/src/helper.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 9c6b271

Please sign in to comment.