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
| import { fromJS } from 'immutable'
| import MenuUtils from '@/utils/utils-custom.js'
|
| /**
| * @description Wrap表单配置信息
| */
| export default function (wrap, subtype, columns, id) {
| let appType = sessionStorage.getItem('appType')
| let MenuType = ''
| let menu = fromJS(window.GLOB.customMenu).toJS()
|
| if (menu.parentId === 'BillPrintTemp') {
| MenuType = 'billPrint'
| }
| let modules = []
| if (subtype === 'propcard') {
| modules = MenuUtils.getSupModules(menu.components, id) || []
| }
|
| let roleList = sessionStorage.getItem('sysRoles')
|
| if (roleList) {
| try {
| roleList = JSON.parse(roleList)
| } catch (e) {
| roleList = []
| }
| } else {
| roleList = []
| }
|
| const cardWrapForm = [
| {
| type: 'text',
| field: 'title',
| label: '标题',
| initval: wrap.title || '',
| required: false
| },
| {
| 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: '静态'},
| ],
| controlFields: [
| {field: 'goback', values: ['dynamic']},
| {field: 'supModule', values: ['static']},
| ],
| forbid: subtype !== 'propcard'
| },
| {
| type: 'radio',
| field: 'pagestyle',
| label: '分页风格',
| initval: wrap.pagestyle || 'page',
| tooltip: '数据源选择分页时有效。',
| required: false,
| options: [
| {value: 'page', label: '页码'},
| {value: 'switch', label: '左右切换', forbid: appType === 'mob'},
| {value: 'slide', label: '滑动加载', forbid: appType !== 'mob'},
| ],
| forbid: !(subtype === 'datacard' || (subtype === 'tablecard' && appType === 'mob'))
| },
| {
| type: 'radio',
| field: 'cardType',
| label: '数据选择',
| initval: wrap.cardType || '',
| required: false,
| options: [
| {value: '', label: '不可选'},
| {value: 'radio', label: '单选'},
| {value: 'checkbox', label: '多选', disabled: subtype === 'propcard'},
| ],
| controlFields: [
| {field: 'checkAll', values: ['checkbox']},
| {field: 'selected', values: ['radio', 'checkbox']},
| ],
| forbid: subtype === 'tablecard'
| },
| {
| type: 'radio',
| field: 'selected',
| label: '首行选中',
| initval: wrap.selected || 'false',
| required: false,
| options: [
| {value: 'false', label: '无'},
| {value: 'init', label: '初始化'},
| {value: 'always', label: '数据加载', disabled: subtype === 'propcard'},
| ]
| },
| {
| type: 'radio',
| field: 'checkAll',
| label: '全选',
| initval: wrap.checkAll || 'hidden',
| required: false,
| options: [
| {value: 'hidden', label: '隐藏'},
| {value: 'show', label: '显示'},
| ],
| forbid: subtype !== 'datacard' || appType !== 'mob'
| },
| {
| type: 'radio',
| field: 'cardFloat',
| label: '对齐方式',
| initval: wrap.cardFloat || 'left',
| tooltip: '设置为居中对齐或右对齐,只在卡片为1行时有效。',
| required: false,
| options: [
| {value: 'left', label: '左对齐'},
| {value: 'center', label: '居中'},
| {value: 'right', label: '右对齐'},
| ],
| forbid: subtype === 'tablecard'
| },
| {
| type: 'radio',
| field: 'scale',
| label: '放大效果',
| initval: wrap.scale || 'false',
| tooltip: '鼠标悬浮于卡片上方时,卡片放大1.05倍。',
| required: false,
| options: [
| {value: 'false', label: '无'},
| {value: 'true', label: '有'},
| ],
| forbid: subtype === 'tablecard' || appType === 'mob'
| },
| {
| type: 'radio',
| field: 'printType',
| label: '组件类型',
| initval: wrap.printType || 'content',
| tooltip: '选择类型为《页眉/页脚》时,打印的每页里都会带有该组件。',
| required: false,
| options: [
| {value: 'content', label: '内容'},
| {value: 'headerOrfooter', label: '页眉/页脚'},
| ],
| forbid: subtype !== 'propcard' || MenuType !== 'billPrint'
| },
| {
| type: 'select',
| field: 'broadcast',
| label: '语音播报',
| initval: wrap.broadcast || '',
| tooltip: '语音播报在移动端app中有效。注:使用语音播报时,数据源不要使用同步查询,添加定时器时,可循环播报',
| required: false,
| options: columns,
| forbid: !columns || appType !== 'mob'
| },
| {
| type: 'radio',
| field: 'goback',
| label: '空值返回',
| initval: wrap.goback || 'false',
| tooltip: '当查询数据为空时,返回上一界面。',
| required: false,
| options: [
| {value: 'true', label: '动态'},
| {value: 'false', label: '静态'},
| ],
| forbid: subtype !== 'propcard' || appType !== 'mob'
| },
| {
| type: 'cascader',
| field: 'supModule',
| label: '上级组件',
| initval: wrap.supModule || [],
| required: false,
| options: modules,
| allowClear: true,
| forbid: subtype !== 'propcard'
| },
| {
| type: 'multiselect',
| field: 'blacklist',
| label: '黑名单',
| initval: wrap.blacklist || [],
| required: false,
| options: roleList,
| forbid: !!appType
| },
| ]
|
| return cardWrapForm.map(item => {
| if (['pagestyle'].includes(item.field)) {
| item.options = item.options.filter(option => !option.forbid)
| }
|
| return item
| })
| }
|
|