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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
| /**
| * @description Setting表单配置信息
| */
| export default function (setting, subtype, buttons = [], cardType, columns, menus = []) {
| let appType = sessionStorage.getItem('appType')
| let hasMenus = subtype === 'datacard' && cardType !== 'extendCard'
|
| let menulist = []
|
| if (appType) {
| menulist = sessionStorage.getItem('appMenus')
| if (menulist) {
| try {
| menulist = JSON.parse(menulist)
| } catch (e) {
| menulist = []
| }
| } else {
| menulist = []
| }
| if (appType === 'mob' && (subtype === 'datacard' || subtype === 'propcard') && cardType !== 'extendCard') { // 数据卡可打开即时通信
| menulist.push({
| value: 'IM', label: '即时通信(系统页)'
| })
| }
| } else {
| menulist = sessionStorage.getItem('fstMenuList')
| if (menulist) {
| try {
| menulist = JSON.parse(menulist)
| } catch (e) {
| menulist = []
| }
| } else {
| menulist = []
| }
| }
|
| let ops = []
| if (hasMenus) {
| ops = [{value: 'menus', label: '菜单组'}]
| }
| let adapters = sessionStorage.getItem('adapter') || ''
| if (adapters.indexOf('wxmini') > -1) {
| ops.push({value: 'miniprogram', label: '小程序'})
| } else if (setting.click === 'miniprogram') {
| setting.click = ''
| }
|
| const cardSettingForm = [
| {
| type: 'number',
| field: 'width',
| label: '卡片宽度',
| initval: setting.width || 24,
| tooltip: '栅格布局,每行等分为24列。',
| min: 1,
| max: 24,
| precision: 0,
| required: true
| },
| {
| type: 'radio',
| field: 'cardRole',
| label: '卡片角色',
| initval: setting.cardRole || 'card',
| required: false,
| options: [
| {value: 'card', label: '属性卡'},
| {value: 'header', label: '表格头'},
| ],
| controlFields: [
| {field: 'type', values: ['card']},
| {field: 'click', values: ['card']},
| {field: 'btnControl', values: ['card']},
| ],
| del: true,
| forbid: cardType !== 'extendCard'
| },
| {
| type: 'radio',
| field: 'type',
| label: '卡片类型',
| initval: setting.type || 'simple',
| tooltip: '选择复式卡时,可配置鼠标悬浮时的显示信息。',
| required: false,
| options: [
| {value: 'simple', label: '单卡'},
| {value: 'multi', label: '复式卡'},
| ],
| controlFields: [
| {field: 'transform', values: ['multi']},
| ],
| forbid: appType === 'mob' || subtype === 'dualdatacard'
| },
| {
| type: 'select',
| field: 'transform',
| label: '过渡效果',
| initval: setting.transform || 'up',
| tooltip: '复式卡片鼠标悬浮信息的动画效果。',
| required: false,
| options: [
| {value: 'up', label: '向上滑动'},
| {value: 'down', label: '向下滑动'},
| {value: 'left', label: '向左滑动'},
| {value: 'right', label: '向右滑动'},
| {value: 'scale', label: '缩放'},
| {value: 'opacity', label: '透明度'},
| {value: 'rotateX', label: '纵向展开'},
| {value: 'rotateY', label: '横向展开'},
| ],
| forbid: appType === 'mob' || subtype === 'dualdatacard'
| },
| {
| type: 'text',
| field: 'primaryId',
| label: '静态主键值',
| initval: setting.primaryId || '',
| tooltip: '设置一个属性卡静态ID,向其他组件传递的指定静态ID值,主键为动态值时无效。',
| required: false,
| forbid: subtype !== 'propcard'
| },
| {
| type: 'select',
| field: 'bgField',
| label: '背景图',
| initval: setting.bgField || '',
| tooltip: '动态背景,背景图片由字段值控制。请注意调整背景样式。',
| required: false,
| options: columns,
| forbid: cardType === 'extendCard'
| },
| {
| type: ops.length === 0 ? 'radio' : 'select',
| field: 'click',
| label: '点击事件',
| initval: setting.click || '',
| // tooltip: '当绑定点击事件时,卡片的切换功能将失效。',
| required: false,
| options: [
| {value: '', label: '无'},
| {value: 'menu', label: '菜单'},
| {value: 'link', label: '链接'},
| {value: 'button', label: '按钮'},
| ...ops
| ],
| controlFields: [
| {field: 'menu', values: ['menu']},
| {field: 'linkurl', values: ['link']},
| {field: 'open', values: ['menu', 'link', 'menus']},
| {field: 'joint', values: ['menu', 'link', 'menus', 'miniprogram']},
| {field: 'linkbtn', values: ['button']},
| {field: 'clickType', values: ['button']},
| {field: 'menuType', values: ['menus']},
| {field: 'menus', values: ['menus']},
| {field: 'miniAppId', values: ['miniprogram']},
| {field: 'miniPath', values: ['miniprogram']},
| ]
| },
| {
| type: 'select',
| field: 'menuType',
| label: '菜单类型',
| initval: setting.menuType || '',
| required: true,
| options: columns,
| },
| {
| type: appType ? 'select' : 'cascader',
| field: 'menu',
| label: '关联菜单',
| initval: setting.menu || (appType ? '' : []),
| required: true,
| extendName: 'MenuNo',
| options: menulist,
| },
| {
| type: 'textarea',
| field: 'linkurl',
| label: '链接',
| initval: setting.linkurl || '',
| required: true,
| options: [],
| span: 24
| },
| {
| type: 'text',
| field: 'miniAppId',
| label: '小程序AppID',
| initval: setting.miniAppId || '',
| required: true
| },
| {
| type: 'text',
| field: 'miniPath',
| label: '页面路径',
| initval: setting.miniPath || '',
| tooltip: '可指定跳转小程序页面,为空时打开首页,注:参数拼接在指定页面时有效。',
| required: false
| },
| {
| type: 'radio',
| field: 'open',
| label: '打开方式',
| initval: setting.open || 'blank',
| required: false,
| options: [
| {value: 'blank', label: appType !== 'mob' ? '新窗口' : '新页面'},
| {value: 'self', label: appType !== 'mob' ? '当前窗口' : '当前页面'},
| ],
| forbid: appType !== 'pc' && appType !== 'mob'
| },
| {
| type: 'radio',
| field: 'joint',
| label: '参数拼接',
| initval: setting.joint || 'true',
| required: false,
| options: [
| {value: 'true', label: '是'},
| {value: 'false', label: '否'},
| ],
| },
| {
| type: 'select',
| field: 'linkbtn',
| label: '关联按钮',
| initval: setting.linkbtn || '',
| required: true,
| options: buttons
| },
| {
| type: 'radio',
| field: 'layout',
| label: '元素布局',
| initval: setting.layout || 'grid',
| required: false,
| options: [
| {value: 'grid', label: '栅格布局'},
| {value: 'flex', label: '弹性布局'},
| ]
| },
| {
| type: 'radio',
| field: 'clickType',
| label: '触发方式',
| initval: setting.clickType || 'normal',
| required: false,
| options: [
| {value: 'normal', label: '单击'},
| {value: 'multi', label: '双击'},
| ],
| forbid: appType === 'mob'
| },
| {
| type: 'radio',
| field: 'btnControl',
| label: '按钮控制',
| initval: setting.btnControl || 'show',
| tooltip: '可设置按钮显示规则,始终显示或鼠标悬浮时显示。',
| required: false,
| options: [
| {value: 'show', label: '正常显示'},
| {value: 'hover', label: '悬浮显示'},
| ],
| forbid: appType === 'mob'
| },
| {
| type: 'radio',
| field: 'checkAll',
| label: '全选',
| initval: setting.checkAll || 'hidden',
| tooltip: '全选仅在数据卡可多选,且选中风格为勾选框时有效。',
| required: false,
| options: [
| {value: 'hidden', label: '隐藏'},
| {value: 'show', label: '显示'},
| ],
| forbid: cardType !== 'extendCard'
| },
| {
| type: 'table',
| field: 'menus',
| label: '菜单组',
| initval: 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: !appType ? 'cascader' : 'select',
| editable: true,
| required: true,
| extends: !appType ? 'Menu' : [{key: 'label', value: 'label'}],
| width: '40%',
| render: (text, record) => record.label,
| options: menulist
| }
| ]
| }
| ]
|
| return cardSettingForm
| }
|
|