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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
| import React from 'react'
| /**
| * @description Wrap表单配置信息
| */
| export default function (wrap, columns) {
| let roleList = sessionStorage.getItem('sysRoles')
| let appType = sessionStorage.getItem('appType')
|
| if (roleList) {
| try {
| roleList = JSON.parse(roleList)
| } catch (e) {
| roleList = []
| }
| } else {
| roleList = []
| }
|
| let menulist = sessionStorage.getItem('fstMenuList')
| if (menulist) {
| try {
| menulist = JSON.parse(menulist)
| } catch (e) {
| menulist = []
| }
| } else {
| menulist = []
| }
|
| const calendarWrapForm = [
| {
| type: 'text',
| field: 'title',
| label: '标题',
| initval: wrap.title || '',
| required: false
| },
| {
| 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: 'checkbox',
| field: 'levels',
| label: '日历等级',
| initval: wrap.levels || [],
| required: true,
| options: [
| {value: 'day', label: '日'},
| {value: 'month', label: '月'},
| {value: 'year', label: '年'},
| ]
| },
| {
| type: 'select',
| field: 'timeField',
| label: '时间字段',
| initval: wrap.timeField || '',
| tooltip: '数据中的时间字段,用于在日历中标记事件位置。',
| required: true,
| options: columns
| },
| {
| type: 'select',
| field: 'endField',
| label: '结束时间',
| initval: wrap.endField || '',
| tooltip: '数据中事件的结束时间,用于在日历中标记事件位置。',
| required: false,
| options: columns
| },
| {
| type: 'select',
| field: 'remarkField',
| label: '信息字段',
| initval: wrap.remarkField || '',
| required: true,
| options: columns
| },
| {
| type: 'select',
| field: 'colorField',
| label: '颜色字段',
| initval: wrap.colorField || '',
| required: false,
| options: columns,
| controlFields: [
| {field: 'signs', notNull: true},
| ]
| },
| {
| type: 'radio',
| field: 'permission',
| label: '权限验证',
| initval: wrap.permission || (!appType ? 'true' : 'false'),
| required: false,
| options: [
| {value: 'true', label: !appType ? '继承菜单' : '启用'},
| {value: 'false', label: '禁用'},
| ],
| forbid: sessionStorage.getItem('editMenuType') === 'popview'
| },
| {
| type: 'radio',
| field: 'cacheLocal',
| label: '本地缓存',
| initval: wrap.cacheLocal || 'true',
| required: false,
| options: [
| {value: 'true', label: '继承菜单'},
| {value: 'false', label: '禁用'},
| ],
| forbid: sessionStorage.getItem('editMenuType') === 'popview'
| },
| {
| type: 'radio',
| field: 'click',
| label: '点击事件',
| initval: wrap.click || '',
| tooltip: '可通过点击事件跳转至指定页面。',
| required: false,
| options: [
| {value: '', label: '无'},
| {value: 'menu', label: '菜单'},
| {value: 'menus', label: '菜单组'}
| ],
| controlFields: [
| {field: 'menu', values: ['menu']},
| {field: 'menuType', values: ['menus']},
| {field: 'menus', values: ['menus']},
| ]
| },
| {
| type: 'select',
| field: 'menuType',
| label: '菜单类型',
| initval: wrap.menuType || '',
| required: true,
| options: columns,
| },
| {
| type: 'cascader',
| field: 'menu',
| label: '关联菜单',
| initval: wrap.menu || [],
| required: true,
| extendName: 'MenuNo',
| options: menulist,
| },
| {
| type: 'multiselect',
| field: 'blacklist',
| label: '黑名单',
| initval: wrap.blacklist || [],
| required: false,
| options: roleList,
| forbid: !!appType
| },
| {
| type: 'table',
| field: 'signs',
| label: '颜色标识',
| initval: wrap.signs || [],
| required: false,
| span: 24,
| columns: [
| {
| title: '标识',
| dataIndex: 'sign',
| inputType: 'input',
| editable: true,
| unique: true,
| required: false,
| width: '30%'
| },
| {
| title: '颜色',
| dataIndex: 'background',
| inputType: 'color',
| editable: true,
| required: true,
| render: (text, record) => (<div style={{background: text, width: '100px', height: '25px'}}></div>),
| width: '40%'
| }
| ]
| },
| {
| type: 'table',
| field: 'menus',
| label: '菜单组',
| initval: wrap.menus || [],
| required: true,
| span: 24,
| actions: ['view'],
| columns: [
| {
| title: '标识',
| dataIndex: 'sign',
| inputType: 'input',
| editable: true,
| unique: true,
| required: false,
| width: '30%'
| },
| {
| title: '菜单',
| dataIndex: 'menu',
| inputType: 'cascader',
| editable: true,
| required: true,
| extends: 'Menu',
| width: '40%',
| render: (text, record) => record.label,
| options: menulist
| }
| ]
| },
| ]
|
| return calendarWrapForm
| }
|
|