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
| import React from 'react'
| import MenuUtils, { getLinkModules, getInterfaces } from '@/utils/utils-custom.js'
|
| /**
| * @description Wrap表单配置信息
| */
| export default function (wrap, buttons, columns) {
| let menu = window.GLOB.customMenu
| let isprint = sessionStorage.getItem('MenuType') === 'billPrint'
| let ispop = sessionStorage.getItem('editMenuType') === 'popview'
|
| let modules = getLinkModules(menu.components) || []
| let supmodules = MenuUtils.getSupModules(menu.components, '', menu.interfaces)
| let roleList = sessionStorage.getItem('sysRoles')
| let appType = sessionStorage.getItem('appType')
|
| let interfaces = getInterfaces()
|
| if (roleList) {
| try {
| roleList = JSON.parse(roleList)
| } catch (e) {
| roleList = []
| }
| } else {
| roleList = []
| }
|
| const balconyWrapForm = [
| {
| 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 || 'static',
| tooltip: '选择静态时,无需配置数据源,可展示上级组件或url参数字段。',
| required: false,
| options: [
| {value: 'dynamic', label: '动态'},
| {value: 'static', label: '静态'},
| {value: 'public', label: '公共数据源'},
| ],
| controlFields: [
| {field: 'empty', values: ['dynamic']},
| {field: 'publicId', values: ['public']},
| {field: 'bgField', values: ['dynamic', 'public']},
| ]
| },
| {
| type: 'select',
| field: 'publicId',
| label: '数据源',
| initval: wrap.publicId || '',
| required: true,
| options: interfaces,
| reset_source: true,
| callback: (record) => {
| if (!record.publicId) return
|
| let d = interfaces.filter(m => m.value === record.publicId)[0]
|
| if (!d || !d.columns) return
|
| return {
| bgField: d.columns
| }
| }
| },
| {
| type: 'radio',
| field: 'linkType',
| label: '受控类型',
| initval: wrap.linkType || 'static',
| tooltip: <div>
| <div>同步类型:此类型时公式、按钮以及全选元素比较特殊,操作数据为其同步组件选中的数据。</div>
| <div>上级类型:可设置当前组件的显示条件(始终显示或上级选行时显示),与静态数据源配合也可用于展示上级组件选中的信息。</div>
| </div>,
| toolWidth: 400,
| required: false,
| options: [
| {value: 'static', label: '无'},
| {value: 'sync', label: '同步'},
| {value: 'sup', label: '上级'},
| ],
| controlFields: [
| {field: 'supModule', values: ['sup']},
| {field: 'supControl', values: ['sup']},
| {field: 'syncModule', values: ['sync']},
| {field: 'checkAll', values: ['sync']},
| ],
| forbid: isprint
| },
| {
| type: 'cascader',
| field: 'supModule',
| label: '上级组件',
| initval: wrap.supModule || [],
| required: true,
| options: supmodules,
| forbid: isprint
| },
| {
| type: 'radio',
| field: 'supControl',
| label: '显示控制',
| initval: wrap.supControl || 'show',
| tooltip: '当前组件在主表选中行时显示,还是始终显示。',
| required: false,
| options: [
| {value: 'hidden', label: '选行'},
| {value: 'show', label: '始终'},
| ],
| forbid: isprint
| },
| {
| type: 'cascader',
| field: 'syncModule',
| label: '同步组件',
| initval: wrap.syncModule || '',
| tooltip: '当同步组件不存在或没有权限时,当前组件不显示。',
| required: true,
| options: modules,
| forbid: isprint
| },
| {
| type: 'cascader',
| field: 'syncModule',
| label: '同步组件',
| initval: wrap.syncModule || '',
| tooltip: '当同步组件不存在或没有权限时,当前组件不显示。',
| required: true,
| options: modules,
| forbid: isprint
| },
| {
| type: 'radio',
| field: 'checkAll',
| label: '全选',
| initval: wrap.checkAll || 'hidden',
| tooltip: '当同步组件可多选时,设置全选有效。',
| required: false,
| options: [
| {value: 'hidden', label: '隐藏'},
| {value: 'show', label: '显示'},
| ],
| forbid: isprint
| },
| {
| type: 'radio',
| field: 'empty',
| label: '空值隐藏',
| initval: wrap.empty || 'show',
| tooltip: '当查询数据为空时,隐藏该组件。',
| required: false,
| skip: true,
| options: [
| {value: 'show', label: '否'},
| {value: 'hidden', label: '是'},
| ],
| },
| {
| type: 'select',
| field: 'bgField',
| label: '背景图',
| initval: wrap.bgField || '',
| tooltip: '动态背景,背景图片由字段值控制。请注意调整背景样式。',
| timestamp: new Date().getTime(),
| required: false,
| options: columns
| },
| {
| type: 'radio',
| field: 'printType',
| label: '组件类型',
| initval: wrap.printType || 'content',
| tooltip: '选择类型为《页眉/页脚》时,打印的每页里都会带有该组件。注:页眉页脚中文本元素将替换 @pageIndex@(页码)、@total@(总数)、@date@(当前日期)、@datetime@(当前时间),使用分页参数时注意打印模板的页面布局使用分页。',
| required: false,
| options: [
| {value: 'content', label: '浮动卡'},
| {value: 'headerOrfooter', label: '页眉/页脚'},
| ],
| forbid: !isprint
| },
| {
| type: 'radio',
| field: 'permission',
| label: '权限验证',
| initval: wrap.permission || (!appType ? 'true' : 'false'),
| required: false,
| options: [
| {value: 'true', label: !appType ? '继承菜单' : '启用'},
| {value: 'false', label: '禁用'},
| ],
| forbid: ispop || isprint
| },
| {
| type: 'radio',
| field: 'cacheLocal',
| label: '本地缓存',
| initval: wrap.cacheLocal || 'true',
| required: false,
| options: [
| {value: 'true', label: '继承菜单'},
| {value: 'false', label: '禁用'},
| ],
| forbid: ispop || isprint
| },
| {
| type: 'select',
| field: 'linkbtn',
| label: '关联按钮',
| initval: wrap.linkbtn || '',
| required: false,
| options: buttons,
| forbid: isprint
| },
| {
| type: 'multiselect',
| field: 'blacklist',
| label: '黑名单',
| initval: wrap.blacklist || [],
| required: false,
| options: roleList,
| forbid: !!appType || isprint
| },
| ]
|
| return balconyWrapForm
| }
|
|