Blame view

src/views/demo/page/form/basic/data.ts 2.62 KB
1
import { FormSchema } from '/@/components/Form';
2
3
4
5
const colProps = {
  span: 8,
};
6
7
8
9
10
11

export const schemas: FormSchema[] = [
  {
    field: 'title',
    component: 'Input',
    label: '标题',
12
    colProps,
13
14
15
16
17
18
19
20
21
    componentProps: {
      placeholder: '给目标起个名字',
    },
    required: true,
  },
  {
    field: 'time',
    component: 'RangePicker',
    label: '起止日期',
22
    colProps,
23
24
25
    required: true,
  },
  {
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
    field: 'client',
    component: 'Input',
    colProps,
    label: '客户',
    helpMessage: '目标的服务对象',
    subLabel: '( 选填 )',
    componentProps: {
      placeholder: '请描述你服务的客户,内部客户直接 @姓名/工号',
    },
  },
  {
    field: 'weights',
    component: 'InputNumber',
    label: '权重',
    colProps,
    subLabel: '( 选填 )',
    componentProps: {
      formatter: (value: string) => (value ? `${value}%` : ''),
      parser: (value: string) => value.replace('%', ''),
      placeholder: '请输入',
    },
  },
  {
49
50
51
    field: 'target',
    component: 'InputTextArea',
    label: '目标描述',
52
    colProps,
53
54
55
56
57
58
59
60
61
62
    componentProps: {
      placeholder: '请输入你的阶段性工作目标',
      rows: 4,
    },
    required: true,
  },
  {
    field: 'metrics',
    component: 'InputTextArea',
    label: '衡量标准',
63
    colProps,
64
65
66
67
68
69
    componentProps: {
      placeholder: '请输入衡量标准',
      rows: 4,
    },
    required: true,
  },
70
71
72
73
74
  {
    field: 'inviteer',
    component: 'Input',
    label: '邀评人',
75
76
    colProps: {
      span: 8,
77
78
79
    },
    subLabel: '( 选填 )',
    componentProps: {
80
      placeholder: '请直接 @姓名/工号,最多可邀请 5 人',
81
82
83
84
85
86
    },
  },
  {
    field: 'disclosure',
    component: 'RadioGroup',
    label: '目标公开',
87
88
89
    colProps: {
      span: 16,
    },
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
    itemProps: {
      extra: '客户、邀评人默认被分享',
    },
    componentProps: {
      options: [
        {
          label: '公开',
          value: '1',
        },
        {
          label: '部分公开',
          value: '2',
        },
        {
          label: '不公开',
          value: '3',
        },
      ],
    },
  },
  {
111
    field: 'disclosure',
112
113
    component: 'Select',
    label: ' ',
114
115
116
    colProps: {
      span: 8,
    },
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
    show: ({ model }) => {
      return model.disclosure === '2';
    },
    componentProps: {
      placeholder: '公开给',
      mode: 'multiple',
      options: [
        {
          label: '同事1',
          value: '1',
        },
        {
          label: '同事2',
          value: '2',
        },
        {
          label: '同事3',
          value: '3',
        },
      ],
    },
  },
];