vben
2020-11-10 4ff6b73c2bb57764db2bcd8212d82f028e25e36d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
import type { FieldMapToTime, FormSchema } from './types/form';
import type { PropType } from 'vue';
import type { ColEx } from './types';
import { TableActionType } from '../../Table/src/types/table';
 
export const basicProps = {
  model: {
    type: Object as PropType<any>,
    default: {},
  },
  // 标签宽度  固定宽度
  labelWidth: {
    type: [Number, String] as PropType<number | string>,
    default: 0,
  },
  fieldMapToTime: {
    type: Array as PropType<FieldMapToTime>,
    default: () => [],
  },
  compact: Boolean as PropType<boolean>,
  // 表单配置规则
  schemas: {
    type: [Array] as PropType<FormSchema[]>,
    default: () => [],
    required: true,
  },
  mergeDynamicData: {
    type: Object as PropType<any>,
    default: null,
  },
  baseColProps: {
    type: Object as PropType<any>,
  },
  autoSetPlaceHolder: {
    type: Boolean,
    default: true,
  },
  submitOnReset: {
    type: Boolean,
    default: false,
  },
  size: {
    type: String as PropType<'default' | 'small' | 'large'>,
    default: 'default',
  },
  // 禁用表单
  disabled: Boolean as PropType<boolean>,
  emptySpan: {
    type: [Number, Object] as PropType<number>,
    default: 0,
  },
  // 是否显示收起展开按钮
  showAdvancedButton: { type: Boolean as PropType<boolean>, default: false },
  // 转化时间
  transformDateFunc: {
    type: Function as PropType<Fn>,
    default: (date: any) => {
      return date._isAMomentObject ? date.format('YYYY-MM-DD HH:mm:ss') : date;
    },
  },
  rulesMessageJoinLabel: {
    type: Boolean,
    default: true,
  },
  // 超过3行自动折叠
  autoAdvancedLine: {
    type: Number as PropType<number>,
    default: 3,
  },
 
  // 是否显示操作按钮
  showActionButtonGroup: {
    type: Boolean as PropType<boolean>,
    default: true,
  },
  // 操作列Col配置
  actionColOptions: Object as PropType<ColEx>,
  // 显示重置按钮
  showResetButton: {
    type: Boolean as PropType<boolean>,
    default: true,
  },
  // 重置按钮配置
  resetButtonOptions: Object as PropType<any>,
 
  // 显示确认按钮
  showSubmitButton: {
    type: Boolean as PropType<boolean>,
    default: true,
  },
  // 确认按钮配置
  submitButtonOptions: Object as PropType<any>,
 
  // 自定义重置函数
  resetFunc: Function as PropType<Fn>,
  submitFunc: Function as PropType<Fn>,
 
  // 以下为默认props
  hideRequiredMark: Boolean as PropType<boolean>,
 
  labelCol: Object as PropType<ColEx>,
 
  layout: {
    type: String as PropType<'horizontal' | 'vertical' | 'inline'>,
    default: 'horizontal',
  },
  tableAction: {
    type: Object as PropType<TableActionType>,
  },
 
  wrapperCol: Object as PropType<any>,
 
  colon: {
    type: Boolean as PropType<boolean>,
    default: false,
  },
 
  labelAlign: String as PropType<string>,
};