king
2021-09-08 6d71b3fac75a35e8ebf08e71ba40c5be8a586024
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/**
 * @description Wrap表单配置信息
 */
export default function (wrap, action = []) {
  let roleList = sessionStorage.getItem('sysRoles')
  let appType = sessionStorage.getItem('appType')
 
  if (roleList) {
    try {
      roleList = JSON.parse(roleList)
    } catch (e) {
      roleList = []
    }
  } else {
    roleList = []
  }
 
  const wrapForm = [
    {
      type: 'text',
      field: 'title',
      label: '标题',
      initval: wrap.title || '',
      required: false
    },
    {
      type: 'text',
      field: 'name',
      label: '组件名称',
      initval: wrap.name || '',
      tooltip: '用于组件间的区分。',
      required: true
    },
    {
      type: 'radio',
      field: 'tableType',
      label: '表格属性',
      initval: wrap.tableType,
      required: false,
      options: [
        {value: '', label: '不可选'},
        {value: 'radio', label: '单选'},
        {value: 'checkbox', label: '多选'},
      ]
    },
    {
      type: 'radio',
      field: 'bordered',
      label: '边框',
      initval: wrap.bordered || 'true',
      required: false,
      options: [
        {value: 'true', label: '有'},
        {value: 'false', label: '无'},
      ]
    },
    {
      type: 'radio',
      field: 'tableHeader',
      label: '表头',
      initval: wrap.tableHeader || 'show',
      required: false,
      options: [
        {value: 'show', label: '显示'},
        {value: 'hidden', label: '隐藏'},
      ]
    },
    {
      type: 'radio',
      field: 'collapse',
      label: '可收起',
      initval: wrap.collapse || 'false',
      required: false,
      options: [
        {value: 'true', label: '是'},
        {value: 'false', label: '否'},
      ],
      forbid: appType === 'mob'
    },
    {
      type: 'radio',
      field: 'size',
      label: '表格大小',
      initval: wrap.size || 'middle',
      required: false,
      options: [
        {value: 'default', label: '大'},
        {value: 'middle', label: '中'},
        {value: 'small', label: '小'},
      ]
    },
    {
      type: 'radio',
      field: 'mode',
      label: '模式',
      initval: wrap.mode || 'default',
      required: false,
      options: [
        {value: 'default', label: '常规'},
        {value: 'ghost', label: '透明'},
      ]
    },
    {
      type: 'color',
      field: 'borderColor',
      label: '边框颜色',
      initval: wrap.borderColor || '#e8e8e8',
      tooltip: '默认值 #e8e8e8。',
      required: false
    },
    {
      type: 'color',
      field: 'color',
      label: '字体颜色',
      initval: wrap.color || 'rgba(0, 0, 0, 0.65)',
      tooltip: '默认值 rgba(0, 0, 0, 0.65)。',
      required: false
    },
    {
      type: 'number',
      field: 'fontSize',
      label: '字体大小',
      initval: wrap.fontSize || 24,
      min: 12,
      max: 30,
      precision: 0,
      required: false
    },
    {
      type: 'number',
      field: 'width',
      label: '宽度',
      initval: wrap.width || 24,
      tooltip: '栅格布局,每行等分为24列。',
      min: 1,
      max: 24,
      precision: 0,
      required: true
    },
    {
      type: 'number',
      field: 'advanceWidth',
      label: '高级搜索',
      initval: wrap.advanceWidth || 1000,
      tooltip: '高级搜索弹窗的宽度,注:当宽度值小于100时表示占窗口的百分比,大于100时表示宽度的绝对值。',
      min: 10,
      max: 3000,
      precision: 0,
      required: false,
      forbid: appType === 'mob'
    },
    {
      type: 'select',
      field: 'doubleClick',
      label: '双击事件',
      initval: wrap.doubleClick || '',
      tooltip: '双击表格中行,触发的按钮。',
      required: false,
      allowClear: true,
      options: action.map(item => ({value: item.uuid, label: item.label})),
      forbid: appType === 'mob'
    },
    {
      type: 'multiselect',
      field: 'blacklist',
      label: '黑名单',
      initval: wrap.blacklist || [],
      required: false,
      options: roleList,
      forbid: !!appType
    },
  ]
 
  return wrapForm