king
2021-12-22 5223edbcccfed84a33a706e5637ee65a61f377aa
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
/**
 * @description Wrap表单配置信息
 */
export default function (wrap) {
  const wrapForm = [
    {
      type: 'text',
      field: 'name',
      label: '组件名称',
      initval: wrap.name || '',
      tooltip: '用于组件间的区分。',
      required: true
    },
    {
      type: 'number',
      field: 'width',
      label: '宽度',
      initval: wrap.width || 24,
      tooltip: '栅格布局,每行等分为24列。',
      min: 1,
      max: 24,
      precision: 0,
      required: true
    },
    {
      type: 'text',
      field: 'field',
      label: '搜索字段',
      initval: wrap.field || '',
      tooltip: '多个字段可用逗号拼接。',
      required: true
    },
    {
      type: 'text',
      field: 'label',
      label: '提示文字',
      initval: wrap.label || '',
      required: false
    },
    {
      type: 'text',
      field: 'initval',
      label: '初始值',
      initval: wrap.initval || '',
      required: false
    },
    {
      type: 'radio',
      field: 'required',
      label: '必填',
      initval: wrap.required || 'false',
      required: false,
      options: [
        {value: 'true', label: '是'},
        {value: 'false', label: '否'},
      ]
    },
    {
      type: 'radio',
      field: 'match',
      label: '匹配方式',
      initval: wrap.match || 'like',
      required: true,
      options: [
        {value: 'like', label: 'like'},
        {value: 'not like', label: 'not like'},
        {value: '=', label: '='},
      ]
    },
    {
      type: 'radio',
      field: 'show',
      label: '搜索样式',
      initval: wrap.show || 'text',
      required: false,
      options: [
        {value: 'text', label: '文字'},
        {value: 'icon', label: '图标'},
      ]
    },
    {
      type: 'radio',
      field: 'scan',
      label: '扫码',
      initval: wrap.scan || 'hidden',
      required: false,
      options: [
        {value: 'hidden', label: '隐藏'},
        {value: 'show', label: '显示'},
      ]
    },
    {
      type: 'number',
      field: 'borderRadius',
      label: '圆角',
      min: 0,
      max: 500,
      precision: 0,
      initval: wrap.borderRadius || 0,
      required: false
    },
    {
      type: 'number',
      field: 'height',
      label: '高度',
      min: 28,
      max: 150,
      precision: 0,
      initval: wrap.height || 32,
      required: false
    }
  ]
 
  return wrapForm