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
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
| /**
| * @description 获取显示列表单配置信息
| * @param {object} card // 搜索条件对象
| */
| export function getColumnForm (card, fields = []) {
| let appType = sessionStorage.getItem('appType')
| let roleList = sessionStorage.getItem('sysRoles')
| if (roleList) {
| try {
| roleList = JSON.parse(roleList)
| } catch (e) {
| roleList = []
| }
| } else {
| roleList = []
| }
|
| let menulist = []
|
| if (appType === 'pc') {
| menulist = sessionStorage.getItem('appMenus')
| } else if (!appType) {
| menulist = sessionStorage.getItem('fstMenuList')
| }
|
| if (menulist) {
| try {
| menulist = JSON.parse(menulist)
| } catch (e) {
| menulist = []
| }
| } else {
| menulist = []
| }
|
| let options = [{
| value: 'text',
| text: '文本'
| }, {
| value: 'number',
| text: '数字'
| }, {
| value: 'custom',
| text: '自定义列'
| }, {
| value: 'formula',
| text: '公式'
| }, {
| value: 'picture',
| text: '图片'
| }, {
| value: 'video',
| text: '视频'
| }, {
| value: 'link',
| text: '链接'
| }, {
| value: 'textarea',
| text: '多行文本'
| }, {
| value: 'colspan',
| text: '合并列'
| }, {
| value: 'extend',
| text: '扩展列'
| }, {
| value: 'index',
| text: '序号'
| }]
|
| if (appType === 'mob') {
| options = options.filter(item => item.value !== 'extend')
| }
|
| if (!card.linkurl && (!card.linkmenu || card.linkmenu.length === 0)) {
| card.perspective = ''
| }
|
| return [
| {
| type: 'text',
| key: 'label',
| label: '列头文字',
| initVal: card.label,
| required: true
| },
| {
| type: 'select',
| key: 'type',
| label: '类型',
| initVal: card.type,
| required: true,
| options: options
| },
| {
| type: 'select',
| key: 'field',
| label: '字段',
| initVal: card.field,
| required: true,
| options: fields
| },
| {
| type: 'select',
| key: 'nameField',
| label: '名称字段',
| initVal: card.nameField || '',
| tooltip: '名称字段为链接在界面中显示的内容,在链接中以@***@形式拼接的字段(字段来源于字段集中,此外 id、appkey、userid、LoginUID 为系统字段),跳转时将替换为对应值,例如:http://sso.mk9h.cn/doc/index.html?appkey=@appkey@&LoginUID=@LoginUID@,其中appkey与LoginUID将被替换。',
| toolWidth: 350,
| required: false,
| options: [{uuid: 'empty', field: '', label: '空'}, ...fields]
| },
| {
| type: 'number',
| key: 'Width',
| min: 20,
| max: 1000,
| decimal: 0,
| label: '列宽',
| initVal: card.Width || 120,
| required: true
| },
| {
| type: 'radio',
| key: 'Hide',
| label: '隐藏',
| initVal: card.Hide || 'false',
| required: true,
| options: [{
| value: 'true',
| text: '是'
| }, {
| value: 'false',
| text: '否'
| }]
| },
| {
| type: 'radio',
| key: 'IsSort',
| label: '排序',
| initVal: card.IsSort || 'false',
| required: true,
| options: [{
| value: 'true',
| text: '是'
| }, {
| value: 'false',
| text: '否'
| }]
| },
| {
| type: 'select',
| key: 'sortField',
| label: '排序字段',
| initVal: card.sortField || '',
| required: true,
| options: fields
| },
| {
| type: 'radio',
| key: 'eval',
| label: '解析方式',
| initVal: card.eval || 'false',
| tooltip: '当公式内容涉及计算时请选择“计算”,当公式内容为字段拼接时请选择“字段替换”,使用函数时入参为data(数组)。',
| required: false,
| options: [{
| value: 'false',
| text: '字段替换'
| }, {
| value: 'true',
| text: '计算'
| }, {
| value: 'func',
| text: '函数'
| }]
| },
| {
| type: 'radio',
| key: 'Align',
| label: '对齐方式',
| initVal: card.Align || 'left',
| required: true,
| options: [{
| value: 'left',
| text: '左对齐'
| }, {
| value: 'center',
| text: '居中'
| }, {
| value: 'right',
| text: '右对齐'
| }]
| },
| {
| type: 'radio',
| key: 'colUnit',
| label: '单位',
| initVal: card.colUnit || 'day',
| required: true,
| options: [{
| value: 'day',
| text: '天'
| }, {
| value: 'hour',
| text: '小时'
| }]
| },
| {
| type: 'number',
| key: 'shift',
| label: '偏移量',
| initVal: card.shift || 0,
| min: -1000,
| max: 1000,
| decimal: 0,
| required: true
| },
| {
| type: 'number',
| key: 'quota',
| label: '指标数',
| initVal: card.quota || 7,
| min: 1,
| max: 1000,
| decimal: 0,
| required: true
| },
| {
| type: 'select',
| key: 'dayFormat',
| label: '格式化',
| initVal: card.dayFormat || 'M/DD',
| required: true,
| options: [{
| value: 'M/DD',
| label: 'M/DD(4/29)'
| }, {
| value: 'M-DD',
| label: 'M-DD(4-29)'
| }, {
| value: 'M月DD日',
| label: 'M月DD日(4月29日)'
| }, {
| value: 'M/DD week',
| label: 'M/DD week(4/29 星期一)'
| }, {
| value: 'M-DD week',
| label: 'M-DD week(4-29 星期一)'
| }, {
| value: 'M月DD日 week',
| label: 'M月DD日 week(4月29日 星期一)'
| }]
| },
| {
| type: 'select',
| key: 'hourFormat',
| label: '格式化',
| initVal: card.hourFormat || 'H:00',
| required: true,
| options: [{
| value: 'H:00',
| label: 'H:00(15:00)'
| }, {
| value: 'H point',
| label: 'H(15点)'
| }, {
| value: 'h:00',
| label: 'h:00(3:00 pm)'
| }]
| },
| {
| type: 'text',
| key: 'supField',
| label: '上级字段',
| initVal: card.supField || '',
| tooltip: '来源于上级组件的字段集(上级组件为空时从url参数中选取),该字段值(用逗号分隔)可控制扩展列的列名。',
| required: false,
| rules: [{
| pattern: /^[0-9a-zA-Z_]*$/ig,
| message: '字段名只允许包含数字、字母以及_'
| }]
| },
| {
| type: 'number',
| key: 'startTime',
| precision: 0,
| label: '开始时间',
| initVal: card.startTime || 0,
| tooltip: '视频开始播放的时间,用于调整视频初始化展示的界面。',
| required: false
| },
| {
| type: 'select',
| key: 'aspectRatio',
| label: '长宽比',
| initVal: card.aspectRatio || '16:9',
| required: true,
| options: [
| { value: '4:3', text: '4:3' },
| { value: '16:9', text: '16:9' }
| ]
| },
| {
| type: 'radio',
| key: 'rowspan',
| label: '行合并',
| initVal: card.rowspan || 'false',
| tooltip: '相邻行信息相同时,单元格合并。',
| required: false,
| options: [{
| value: 'true',
| text: '是'
| }, {
| value: 'false',
| text: '否'
| }]
| },
| {
| type: 'number',
| key: 'decimal',
| min: 0,
| max: 18,
| decimal: 0,
| label: '小数位',
| initVal: card.decimal,
| required: false
| },
| {
| type: 'select',
| key: 'format',
| label: '格式化',
| initVal: card.format || 'none',
| options: [{
| value: 'none',
| text: '无'
| }, {
| value: 'thdSeparator',
| text: '千分位'
| }, {
| value: 'percent',
| text: '百分比'
| }, {
| value: 'abs',
| text: '绝对值'
| }],
| required: false
| },
| {
| type: 'select',
| key: 'textFormat',
| label: '格式化',
| initVal: card.textFormat || 'none',
| options: [{
| value: 'none',
| text: '无'
| }, {
| value: 'encryption',
| text: '加密'
| }, {
| value: 'YYYY-MM-DD',
| text: 'YYYY-MM-DD'
| }, {
| value: 'YYYY-MM-DD HH:mm:ss',
| text: 'YYYY-MM-DD HH:mm:ss'
| }],
| required: false
| },
| {
| type: 'text',
| key: 'prefix',
| label: '前缀',
| initVal: card.prefix || '',
| required: false,
| readonly: false
| },
| {
| type: 'text',
| key: 'postfix',
| label: '后缀',
| initVal: card.postfix || '',
| required: false,
| readonly: false
| },
| {
| type: 'number',
| key: 'span',
| min: 1,
| max: 24,
| precision: 0,
| label: '图片宽度',
| initVal: card.span || 24,
| tooltip: '栅格布局,等分为24份。',
| required: true
| },
| {
| type: 'select',
| key: 'lenWidRadio',
| label: '长宽比',
| initVal: card.lenWidRadio || '1:1',
| required: true,
| options: [
| { value: '1:1', text: '1:1' },
| { value: '4:3', text: '4:3' },
| { value: '3:2', text: '3:2' },
| { value: '16:9', text: '16:9' },
| { value: '2:1', text: '2:1' },
| { value: '3:1', text: '3:1' },
| { value: '4:1', text: '4:1' },
| { value: '5:1', text: '5:1' },
| { value: '6:1', text: '6:1' },
| { value: '7:1', text: '7:1' },
| { value: '8:1', text: '8:1' },
| { value: '9:1', text: '9:1' },
| { value: '10:1', text: '10:1' },
| { value: '3:4', text: '3:4' },
| { value: '2:3', text: '2:3' },
| { value: '9:16', text: '9:16' },
| ]
| },
| {
| type: 'radio',
| key: 'backgroundSize',
| label: '图像大小',
| initVal: card.backgroundSize || 'cover',
| required: false,
| options: [
| { value: 'cover', text: '覆盖' },
| { value: 'contain', text: '包含' },
| { value: 'auto', text: '自适应' },
| ]
| },
| {
| type: 'radio',
| key: 'scale',
| label: '点击缩放',
| initVal: card.scale || 'true',
| required: false,
| options: [{
| value: 'true',
| text: '是'
| }, {
| value: 'false',
| text: '否'
| }]
| },
| {
| type: 'radio',
| key: 'lostTip',
| label: '图片缺失',
| initVal: card.lostTip || 'true',
| tooltip: '图片地址不存在时,是否提示图片丢失。',
| required: false,
| options: [
| { value: 'true', text: '提示' },
| { value: 'false', text: '不提示' }
| ]
| },
| {
| type: 'radio',
| key: 'perspective',
| label: '字段透视',
| initVal: card.perspective || '',
| options: [{
| value: '',
| text: '无'
| }, {
| value: 'linkmenu',
| text: '菜单'
| }, {
| value: 'linkurl',
| text: '链接'
| }],
| forbid: appType === 'mob'
| },
| {
| type: appType === 'pc' ? 'select' : 'cascader',
| key: 'linkmenu',
| label: '菜单',
| initVal: card.linkmenu || (appType === 'pc' ? '' : []),
| required: true,
| options: menulist,
| forbid: appType === 'mob'
| },
| {
| type: 'textarea',
| key: 'linkurl',
| label: '链接地址',
| initVal: card.linkurl || '',
| tooltip: '在链接中以@***@形式拼接的字段(字段来源于字段集中,此外 id、appkey、userid、LoginUID 为系统字段),跳转时将替换为对应值,例如:http://sso.mk9h.cn/doc/index.html?appkey=@appkey@&LoginUID=@LoginUID@,其中appkey与LoginUID将被替换。',
| toolWidth: 350,
| required: true,
| forbid: appType === 'mob'
| },
| {
| type: 'radio',
| key: 'open',
| label: '打开方式',
| initVal: card.open || 'blank',
| required: false,
| forbid: appType !== 'pc',
| options: [
| { value: 'blank', text: '新窗口' },
| { value: 'self', text: '当前窗口' }
| ]
| },
| {
| type: 'textarea',
| key: 'formula',
| label: '公式',
| initVal: card.formula || '',
| tooltip: '执行时会使用查询到的数据替换相应的字段,展示获得的结果,在不使用解析时换行符或空格会替换为页面元素。可使用JS的一些语法,如:三元表达式 @field1@ > @field2@ ? 0 : 1;Math对象,取绝对值 Math.abs(@field@)、四舍五入 Math.round(@field@)等',
| placeholder: '例如:@price@ * @number@',
| required: true
| },
| {
| type: 'checkbox',
| key: 'evalchars',
| label: '替换字符',
| initVal: card.evalchars || ['enter', 'space'],
| tooltip: '公式解析后,可替换回车、空格等字符,实现换行、字间距控制等页面效果。',
| required: false,
| options: [{
| value: 'enter',
| text: '回车符'
| }, {
| value: 'space',
| text: '空格'
| }]
| },
| {
| type: 'radio',
| key: 'noValue',
| label: '空值',
| initVal: card.noValue || 'show',
| tooltip: '数值为 0 或时间小于 1949-10-02 时,是否显示',
| required: false,
| options: [{
| value: 'show',
| text: '显示'
| }, {
| value: 'hide',
| text: '隐藏'
| }]
| },
| {
| type: 'multiselect',
| key: 'blacklist',
| label: '黑名单',
| initVal: card.blacklist || [],
| required: false,
| options: roleList,
| forbid: appType === 'mob'
| }
| ]
| }
|
|