| | |
| | | import type { FieldMapToTime, FormSchema } from './types/form'; |
| | | import type { PropType } from 'vue'; |
| | | import type { CSSProperties, PropType } from 'vue'; |
| | | import type { ColEx } from './types'; |
| | | import { TableActionType } from '../../Table/src/types/table'; |
| | | 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 = { |
| | | model: { |
| | | type: Object as PropType<any>, |
| | | type: Object as PropType<Recordable>, |
| | | default: {}, |
| | | }, |
| | | // 标签宽度 固定宽度 |
| | |
| | | type: Array as PropType<FieldMapToTime>, |
| | | default: () => [], |
| | | }, |
| | | compact: Boolean as PropType<boolean>, |
| | | compact: propTypes.bool, |
| | | // 表单配置规则 |
| | | schemas: { |
| | | type: [Array] as PropType<FormSchema[]>, |
| | | default: () => [], |
| | | required: true, |
| | | }, |
| | | mergeDynamicData: { |
| | | type: Object as PropType<any>, |
| | | type: Object as PropType<Recordable>, |
| | | default: null, |
| | | }, |
| | | baseRowStyle: { |
| | | type: Object as PropType<CSSProperties>, |
| | | }, |
| | | baseColProps: { |
| | | type: Object as PropType<any>, |
| | | type: Object as PropType<Partial<ColEx>>, |
| | | }, |
| | | autoSetPlaceHolder: { |
| | | type: Boolean, |
| | | default: true, |
| | | }, |
| | | submitOnReset: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | size: { |
| | | type: String as PropType<'default' | 'small' | 'large'>, |
| | | default: 'default', |
| | | }, |
| | | autoSetPlaceHolder: propTypes.bool.def(true), |
| | | // 在INPUT组件上单击回车时,是否自动提交 |
| | | autoSubmitOnEnter: propTypes.bool.def(false), |
| | | submitOnReset: propTypes.bool, |
| | | size: propTypes.oneOf(['default', 'small', 'large']).def('default'), |
| | | // 禁用表单 |
| | | disabled: Boolean as PropType<boolean>, |
| | | disabled: propTypes.bool, |
| | | emptySpan: { |
| | | type: [Number, Object] as PropType<number>, |
| | | default: 0, |
| | | }, |
| | | // 是否显示收起展开按钮 |
| | | showAdvancedButton: { type: Boolean as PropType<boolean>, default: false }, |
| | | showAdvancedButton: propTypes.bool, |
| | | // 转化时间 |
| | | 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: { |
| | | type: Boolean, |
| | | default: true, |
| | | }, |
| | | rulesMessageJoinLabel: propTypes.bool.def(true), |
| | | // 超过3行自动折叠 |
| | | autoAdvancedLine: { |
| | | type: Number as PropType<number>, |
| | | default: 3, |
| | | }, |
| | | autoAdvancedLine: propTypes.number.def(3), |
| | | // 不受折叠影响的行数 |
| | | alwaysShowLines: propTypes.number.def(1), |
| | | |
| | | // 是否显示操作按钮 |
| | | showActionButtonGroup: { |
| | | type: Boolean as PropType<boolean>, |
| | | default: true, |
| | | }, |
| | | showActionButtonGroup: propTypes.bool.def(true), |
| | | // 操作列Col配置 |
| | | actionColOptions: Object as PropType<ColEx>, |
| | | actionColOptions: Object as PropType<Partial<ColEx>>, |
| | | // 显示重置按钮 |
| | | showResetButton: { |
| | | type: Boolean as PropType<boolean>, |
| | | default: true, |
| | | }, |
| | | showResetButton: propTypes.bool.def(true), |
| | | // 是否聚焦第一个输入框,只在第一个表单项为input的时候作用 |
| | | autoFocusFirstItem: propTypes.bool, |
| | | // 重置按钮配置 |
| | | resetButtonOptions: Object as PropType<any>, |
| | | resetButtonOptions: Object as PropType<Partial<ButtonProps>>, |
| | | |
| | | // 显示确认按钮 |
| | | showSubmitButton: { |
| | | type: Boolean as PropType<boolean>, |
| | | default: true, |
| | | }, |
| | | showSubmitButton: propTypes.bool.def(true), |
| | | // 确认按钮配置 |
| | | submitButtonOptions: Object as PropType<any>, |
| | | submitButtonOptions: Object as PropType<Partial<ButtonProps>>, |
| | | |
| | | // 自定义重置函数 |
| | | resetFunc: Function as PropType<Fn>, |
| | | submitFunc: Function as PropType<Fn>, |
| | | resetFunc: Function as PropType<() => Promise<void>>, |
| | | submitFunc: Function as PropType<() => Promise<void>>, |
| | | |
| | | // 以下为默认props |
| | | hideRequiredMark: Boolean as PropType<boolean>, |
| | | hideRequiredMark: propTypes.bool, |
| | | |
| | | labelCol: Object as PropType<ColEx>, |
| | | labelCol: Object as PropType<Partial<ColEx>>, |
| | | |
| | | layout: { |
| | | type: String as PropType<'horizontal' | 'vertical' | 'inline'>, |
| | | default: 'horizontal', |
| | | }, |
| | | layout: propTypes.oneOf(['horizontal', 'vertical', 'inline']).def('horizontal'), |
| | | tableAction: { |
| | | type: Object as PropType<TableActionType>, |
| | | }, |
| | | |
| | | wrapperCol: Object as PropType<any>, |
| | | wrapperCol: Object as PropType<Partial<ColEx>>, |
| | | |
| | | colon: { |
| | | type: Boolean as PropType<boolean>, |
| | | default: false, |
| | | }, |
| | | colon: propTypes.bool, |
| | | |
| | | labelAlign: String as PropType<string>, |
| | | labelAlign: propTypes.string, |
| | | |
| | | rowProps: Object as PropType<RowProps>, |
| | | }; |