config.ts 1.57 KB
Newer Older
hucy's avatar
hucy committed
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
import { isEmpty } from 'src/common/utils';

export const defaultColDef = {
  flex: 1,
  minWidth: 100,
  suppressMenu: true, // 是否禁用标题行菜单
};

export const testData = [
  { name: '张三', age: 22 },
  { name: '孙火旺', age: 18 },
];

export const form_config = [
  {
    fild: 'username',
    label: '用户名',
    col: 'col-4',
    type: 'text',
    required: true,
    bind: {
      filled: true,
      lazyRules: true,
      rules: [(val: any) => !isEmpty(val) || '必填'],
    },
  },
  {
    fild: 'account',
    label: '账号',
    col: 'col-4',
    type: 'text',
    required: true,
    bind: {
      filled: true,
      lazyRules: true,
      rules: [(val: any) => !isEmpty(val) || '必填'],
    },
  },
  {
    fild: 'age',
    label: '年龄',
    col: 'col-4',
    type: 'number',
    required: true,
    bind: {
      filled: true,
      lazyRules: true,
      rules: [
        (val: any) => !isEmpty(val) || '必填',
        (val: any) => (val > 0 && val < 100) || '请输入真实年龄',
      ],
    },
  },
  {
hucy's avatar
hucy committed
55
    solt: 'sex',
hucy's avatar
hucy committed
56 57 58 59 60 61 62
    col: 'col-4',
  },
  {
    fild: 'dateRange',
    label: '开始日期~结束日期',
    col: 'col-4',
    type: 'dateRange',
63
    required: true,
hucy's avatar
hucy committed
64 65 66 67
    bind: {
      filled: true,
      clearable: true,
      dateMask: 'YYYY-MM-DD',
68
      rules: [(val: any) => !isEmpty(val) || '必填'],
hucy's avatar
hucy committed
69 70 71
    },
  },
  {
72
    solt: 'days',
hucy's avatar
hucy committed
73
    col: 'col-4',
74 75 76 77
  },
  {
    solt: 'social',
    col: 'col-12',
hucy's avatar
hucy committed
78 79 80 81 82 83 84 85 86 87 88
  },
  {
    fild: 'remark',
    label: '备注',
    col: 'col-12',
    type: 'textarea',
    bind: {
      filled: true,
    },
  },
];