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
| /**
| * @description Wrap表单配置信息
| */
| export default function (wrap, subtype) {
| let appType = sessionStorage.getItem('appType')
| let roleList = sessionStorage.getItem('sysRoles')
|
| if (roleList) {
| try {
| roleList = JSON.parse(roleList)
| } catch (e) {
| roleList = []
| }
| } else {
| roleList = []
| }
|
| const cardWrapForm = [
| {
| 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: 'radio',
| field: 'datatype',
| label: '数据来源',
| initval: wrap.datatype || 'dynamic',
| tooltip: '选择静态值,无需配置数据源。',
| required: false,
| options: [
| {value: 'dynamic', label: '动态'},
| {value: 'static', label: '静态'},
| ],
| forbid: subtype !== 'propcard'
| },
| {
| type: 'radio',
| field: 'autoplay',
| label: '自动切换',
| initval: wrap.autoplay || 'false',
| required: false,
| options: [
| {value: 'false', label: '否'},
| {value: 'true', label: '是'},
| ]
| },
| {
| type: 'number',
| field: 'speed',
| label: '时间间隔',
| initval: wrap.speed || 3,
| tooltip: '使用自动切换时有效,默认为3秒',
| min: 1,
| max: 100,
| precision: 0,
| required: false
| },
| {
| type: 'radio',
| field: 'dots',
| label: '指示点',
| initval: wrap.dots || 'true',
| required: false,
| options: [
| {value: 'true', label: '显示'},
| {value: 'false', label: '隐藏'},
| ]
| },
| {
| type: 'radio',
| field: 'vertical',
| label: '垂直显示',
| initval: wrap.vertical || 'false',
| required: false,
| options: [
| {value: 'true', label: '是'},
| {value: 'false', label: '否'},
| ],
| forbid: appType !== 'mob'
| },
| {
| type: 'radio',
| field: 'dotPosition',
| label: '指示点位置',
| initval: wrap.dotPosition || 'bottom',
| required: false,
| options: [
| {value: 'top', label: '上'},
| {value: 'bottom', label: '下'},
| {value: 'left', label: '左'},
| {value: 'right', label: '右'},
| ],
| forbid: appType === 'mob'
| },
| {
| type: 'radio',
| field: 'effect',
| label: '动画效果',
| initval: wrap.effect || 'scrollx',
| required: false,
| options: [
| {value: 'scrollx', label: '切换'},
| {value: 'fade', label: '渐显'},
| ],
| forbid: appType === 'mob'
| },
| {
| type: 'multiselect',
| field: 'blacklist',
| label: '黑名单',
| initval: wrap.blacklist || [],
| required: false,
| options: roleList,
| forbid: !!appType
| },
| ]
|
| return cardWrapForm
| }
|
|