vben
2021-11-10 3fcfac1f37c2aeabbb2af4897ada6ba8c225c667
src/components/Form/src/props.ts
@@ -3,7 +3,7 @@
import type { ColEx } from './types';
import type { TableActionType } from '/@/components/Table';
import type { ButtonProps } from 'ant-design-vue/es/button/buttonTypes';
import type { RowProps } from 'ant-design-vue/lib/grid/Row';
import { propTypes } from '/@/utils/propTypes';
export const basicProps = {
@@ -25,7 +25,6 @@
  schemas: {
    type: [Array] as PropType<FormSchema[]>,
    default: () => [],
    required: true,
  },
  mergeDynamicData: {
    type: Object as PropType<Recordable>,
@@ -38,6 +37,8 @@
    type: Object as PropType<Partial<ColEx>>,
  },
  autoSetPlaceHolder: propTypes.bool.def(true),
  // 在INPUT组件上单击回车时,是否自动提交
  autoSubmitOnEnter: propTypes.bool.def(false),
  submitOnReset: propTypes.bool,
  size: propTypes.oneOf(['default', 'small', 'large']).def('default'),
  // 禁用表单
@@ -52,12 +53,14 @@
  transformDateFunc: {
    type: Function as PropType<Fn>,
    default: (date: any) => {
      return date._isAMomentObject ? date?.format('YYYY-MM-DD HH:mm:ss') : date;
      return date?.format?.('YYYY-MM-DD HH:mm:ss') ?? date;
    },
  },
  rulesMessageJoinLabel: propTypes.bool.def(true),
  // 超过3行自动折叠
  autoAdvancedLine: propTypes.number.def(3),
  // 不受折叠影响的行数
  alwaysShowLines: propTypes.number.def(1),
  // 是否显示操作按钮
  showActionButtonGroup: propTypes.bool.def(true),
@@ -65,6 +68,8 @@
  actionColOptions: Object as PropType<Partial<ColEx>>,
  // 显示重置按钮
  showResetButton: propTypes.bool.def(true),
  // 是否聚焦第一个输入框,只在第一个表单项为input的时候作用
  autoFocusFirstItem: propTypes.bool,
  // 重置按钮配置
  resetButtonOptions: Object as PropType<Partial<ButtonProps>>,
@@ -92,4 +97,6 @@
  colon: propTypes.bool,
  labelAlign: propTypes.string,
  rowProps: Object as PropType<RowProps>,
};