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
| /**
| * @description 获取显示列表单配置信息
| * @param {object} card // 搜索条件对象
| */
| export function getColumnForm (card, fields = [], columns = []) {
| let roleList = sessionStorage.getItem('sysRoles')
| if (roleList) {
| try {
| roleList = JSON.parse(roleList)
| } catch (e) {
| roleList = []
| }
| } else {
| roleList = []
| }
|
| // if (['picture', 'link', 'colspan'].includes(card.type)) {
| if (['picture', 'link'].includes(card.type)) {
| card.type = 'text'
| }
|
| let options = [{
| value: 'text',
| text: '文本'
| }, {
| value: 'number',
| text: '数字'
| }, {
| value: 'textarea',
| text: '多行文本'
| }, {
| value: 'custom',
| text: '自定义列'
| }, {
| value: 'colspan',
| text: '合并列'
| // }, {
| // value: 'action',
| // text: '操作'
| }, {
| value: 'formula',
| text: '公式'
| }, {
| value: 'index',
| text: '序号'
| }]
|
| if (!card.isSub) {
| options.push({
| value: 'action',
| text: '操作'
| })
| }
|
| let editCols = [
| {
| field: '$sub',
| label: '提交'
| },
| {
| field: '$next',
| label: '下一行'
| },
| {
| field: '$noAct',
| label: '无动作'
| }
| ]
| columns.forEach(col => {
| if (col.editable === 'true' && col.uuid !== card.uuid) {
| editCols.push({
| field: col.uuid,
| label: col.label
| })
| } else if (col.type === 'colspan') {
| col.subcols.forEach(subcol => {
| if (subcol.editable === 'true' && subcol.uuid !== card.uuid) {
| editCols.push({
| field: subcol.uuid,
| label: col.label + '-' + subcol.label
| })
| }
| })
| }
| })
|
| 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: 'number',
| key: 'Width',
| min: 20,
| max: 1000,
| precision: 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 || (card.isSub ? 'false' : 'true'),
| required: true,
| options: [{
| value: 'true',
| text: '是'
| }, {
| value: 'false',
| 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: 'sum',
| // label: '显示合计',
| // initVal: card.sum || 'false',
| // tooltip: '合计信息只在使用系统数据源时有效。',
| // required: false,
| // options: [{
| // value: 'true',
| // text: '是'
| // }, {
| // value: 'false',
| // text: '否'
| // }]
| // },
| {
| type: 'radio',
| key: 'editable',
| label: '可编辑',
| initVal: card.editable || 'false',
| required: true,
| options: [{
| value: 'false',
| text: '否'
| }, {
| value: 'true',
| text: '是'
| }]
| },
| {
| type: 'radio',
| key: 'editType',
| label: '编辑类型',
| initVal: card.editType || 'text',
| required: true,
| options: [{
| value: 'text',
| text: '文本'
| }, {
| value: 'select',
| text: '下拉'
| }, {
| value: 'switch',
| text: '开关'
| }]
| },
| {
| type: 'text',
| key: 'initval',
| label: '默认值',
| initVal: card.initval,
| tooltip: '使用$copy时,表示新增时复制上一行信息。',
| required: false
| },
| {
| type: 'text',
| key: 'openVal',
| label: '开启值',
| initVal: card.openVal || '',
| required: false
| },
| {
| type: 'text',
| key: 'closeVal',
| label: '关闭值',
| initVal: card.closeVal || '',
| required: false
| },
| {
| type: 'text',
| key: 'openText',
| label: '开启提示',
| initVal: card.openText || '',
| required: false
| },
| {
| type: 'text',
| key: 'closeText',
| label: '关闭提示',
| initVal: card.closeText || '',
| required: false
| },
| {
| type: 'radio',
| key: 'resourceType',
| label: '选项来源',
| initVal: card.resourceType || '0',
| required: true,
| options: [{
| value: '0',
| text: '自定义'
| }, {
| value: '1',
| text: '数据源'
| }]
| },
| {
| type: 'select',
| key: 'editField',
| label: '编辑字段',
| initVal: card.editField || '',
| tooltip: '当值与提示文字不同时,可额外添加编辑字段,作为实际值的录入字段。',
| allowClear: true,
| required: false,
| options: fields
| },
| {
| type: 'options',
| key: 'options',
| label: '选项',
| initVal: card.options || [],
| required: true,
| },
| {
| type: 'codemirror',
| key: 'dataSource',
| label: '数据源',
| initVal: card.dataSource || '',
| required: true,
| },
| {
| type: 'text',
| key: 'valueField',
| label: '值·字段',
| initVal: card.valueField || '',
| required: true,
| },
| {
| type: 'text',
| key: 'valueText',
| label: '文本·字段',
| initVal: card.valueText || '',
| required: true,
| },
| {
| type: 'text',
| key: 'orderBy',
| label: '排序·字段',
| initVal: card.orderBy || '',
| required: false,
| },
| {
| type: 'select',
| key: 'orderType',
| label: '排序方式',
| initVal: card.orderType || 'asc',
| options: [{
| value: 'asc',
| text: '正序'
| }, {
| value: 'desc',
| text: '倒序'
| }]
| },
| {
| type: 'text',
| key: 'disableField',
| label: '禁用·字段',
| initVal: card.disableField || '',
| tooltip: '设置禁用字段,且字段值为true时,选项不可选。',
| required: false,
| },
| {
| type: 'radio',
| key: 'dropdown',
| label: '下拉宽度',
| initVal: card.dropdown || 'flex',
| required: false,
| options: [{
| value: 'flex',
| text: '自适应'
| }, {
| value: 'fixed',
| text: '定宽'
| }]
| },
| {
| type: 'radio',
| key: 'required',
| label: '必填',
| initVal: card.required || 'false',
| required: false,
| options: [{
| value: 'false',
| text: '否'
| }, {
| value: 'true',
| text: '是'
| }]
| },
| {
| type: 'radio',
| key: 'database',
| label: '数据库',
| initVal: card.database || 'local',
| options: [{
| value: 'local',
| text: '本地'
| }, {
| value: 'sso',
| text: '系统'
| }]
| },
| {
| type: 'select',
| key: 'enter',
| label: '回车切换',
| initVal: card.enter || '$next',
| tooltip: '包括文本或数值回车事件、下拉菜单选中事件、开关切换事件。',
| options: editCols
| },
| {
| type: 'select',
| key: 'ctrlField',
| label: '禁用字段',
| initVal: card.ctrlField || '',
| tooltip: '控制单元格是否可以编辑。',
| allowClear: true,
| required: false,
| options: fields
| },
| {
| type: 'text',
| key: 'ctrlValue',
| label: '禁用值',
| initVal: card.ctrlValue || '',
| tooltip: '多个值用逗号分隔。',
| required: false
| },
| // {
| // type: 'radio',
| // key: 'footEnter',
| // label: '末行回车',
| // initVal: card.footEnter || 'false',
| // tooltip: '新增功能仅在表格可新增时有效。',
| // options: [{
| // value: 'sub',
| // text: '提交'
| // }, {
| // value: 'add',
| // text: '新增'
| // }, {
| // value: 'false',
| // text: '无动作'
| // }]
| // },
| {
| type: 'number',
| key: 'decimal',
| min: 0,
| max: 18,
| precision: 0,
| label: '小数位',
| initVal: card.decimal || 0,
| required: false
| },
| {
| type: 'number',
| key: 'min',
| label: '最小值',
| initVal: card.min,
| unlimit: true,
| required: false
| },
| {
| type: 'number',
| key: 'max',
| label: '最大值',
| initVal: card.max,
| unlimit: true,
| 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,
| },
| {
| type: 'text',
| key: 'postfix',
| label: '后缀',
| initVal: card.postfix || '',
| required: false,
| },
| {
| type: 'radio',
| key: 'eval',
| label: '解析',
| initVal: card.eval || 'false',
| tooltip: '当公式内容涉及计算时请选择“是”,当公式内容为字段拼接时请选择“否”。',
| required: false,
| options: [
| { value: 'true', text: '是' },
| { value: 'false', 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: 'multiselect',
| key: 'linkSubField',
| label: '填充表单',
| tooltip: '在切换选项时会把信息自动填入关联的字段中。',
| initVal: card.linkSubField || [],
| options: fields
| },
| {
| type: 'radio',
| key: 'noValue',
| label: '空值',
| initVal: card.noValue || 'show',
| tooltip: '当值为0时是否显示',
| required: false,
| options: [{
| value: 'show',
| text: '显示'
| }, {
| value: 'hide',
| text: '隐藏'
| }]
| },
| {
| type: 'multiselect',
| key: 'blacklist',
| label: '黑名单',
| initVal: card.blacklist || [],
| required: false,
| options: roleList
| }
| ]
| }
|
|