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
| /**
| * @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: '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: 'text',
| field: 'field',
| label: '搜索字段',
| initval: wrap.field || '',
| tooltip: '多个字段可用逗号拼接。',
| required: true
| },
| {
| type: 'text',
| field: 'label',
| label: '提示文字',
| initval: wrap.label || '',
| required: false
| },
| {
| type: 'radio',
| field: 'show',
| label: '搜索样式',
| initval: wrap.show || 'button',
| required: false,
| options: [
| {value: 'button', label: '搜索按钮'},
| {value: 'icon', label: '搜索图标'},
| {value: 'input', label: '输入框'},
| ]
| },
| {
| type: 'radio',
| field: 'show',
| label: '搜索按钮',
| initval: wrap.show || 'true',
| required: false,
| options: [
| {value: 'true', label: '显示'},
| {value: 'false', label: '隐藏'},
| ]
| },
| {
| type: 'multiselect',
| field: 'blacklist',
| label: '黑名单',
| initval: wrap.blacklist || [],
| required: false,
| options: roleList,
| forbid: !!appType
| },
| ]
|
| return wrapForm
| }
|
|