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
| /**
| * @description Setting表单配置信息
| */
| export default function (setting, columns) {
| let menulist = sessionStorage.getItem('appMenus')
|
| if (menulist) {
| try {
| menulist = JSON.parse(menulist)
| } catch (e) {
| menulist = []
| }
| } else {
| menulist = []
| }
|
| let ops = []
| let adapters = sessionStorage.getItem('adapter') || ''
| if (adapters.indexOf('wxmini') > -1) {
| ops.push({value: 'miniprogram', label: '小程序'})
| } else if (setting.type === 'miniprogram') {
| setting.type = ''
| }
|
| const menuWrapForm = [
| {
| type: 'text',
| field: 'name',
| label: '菜单名称',
| initval: setting.name || '',
| required: true
| },
| // {
| // type: 'text',
| // field: 'MenuNo',
| // label: '菜单参数',
| // initval: setting.MenuNo || '',
| // required: true
| // },
| {
| type: 'radio',
| field: 'type',
| label: '菜单属性',
| initval: setting.type || 'menu',
| required: true,
| options: [
| {value: 'menu', label: '菜单'},
| {value: 'linkmenu', label: '关联菜单'},
| {value: 'link', label: '链接'},
| ...ops
| ],
| controlFields: [
| {field: 'copyMenuId', values: ['menu']},
| {field: 'linkMenuId', values: ['linkmenu']},
| {field: 'linkurl', values: ['link']},
| {field: 'primaryId', values: ['menu', 'linkmenu']},
| {field: 'miniAppId', values: ['miniprogram']},
| {field: 'miniPath', values: ['miniprogram']},
| ]
| },
| {
| type: 'text',
| field: 'miniAppId',
| label: '小程序AppID',
| initval: setting.miniAppId || '',
| required: true
| },
| {
| type: 'text',
| field: 'miniPath',
| label: '页面路径',
| initval: setting.miniPath || '',
| tooltip: '可指定跳转小程序页面路径。',
| required: false
| },
| {
| type: 'select',
| field: 'copyMenuId',
| label: '复制菜单',
| initval: setting.copyMenuId || '',
| tooltip: '复制菜单仅在当前菜单创建时有效。',
| required: false,
| options: menulist,
| extendName: 'MenuNo',
| dropdown: 'false',
| controlFields: [
| {field: 'clearMenu', notNull: true},
| ],
| },
| {
| type: 'radio',
| field: 'clearMenu',
| label: '清空关联菜单',
| initval: setting.clearMenu || 'true',
| tooltip: '复制菜单时,是否清空原页面中的关联菜单。',
| required: false,
| options: [
| {value: 'true', label: '是'},
| {value: 'false', label: '否'}
| ]
| },
| {
| type: 'select',
| field: 'linkMenuId',
| label: '关联菜单',
| initval: setting.linkMenuId || '',
| required: true,
| extendName: 'MenuNo',
| options: [
| ...menulist,
| // {value: 'IM', label: '即时通信(系统页)'},
| {value: 'AIService', label: '智能客服(系统页)'}
| ]
| },
| {
| type: 'textarea',
| field: 'linkurl',
| label: '链接',
| initval: setting.linkurl || '',
| required: true,
| span: 24
| },
| {
| type: 'radio',
| field: 'sign',
| label: '标志',
| initval: setting.sign || 'icon',
| required: true,
| options: [
| {value: 'icon', label: '图标'},
| {value: 'image', label: '图片'},
| ],
| controlFields: [
| {field: 'icon', values: ['icon']},
| {field: 'iconFont', values: ['icon']},
| {field: 'padding', values: ['icon']},
| {field: 'color', values: ['icon']},
| {field: 'background', values: ['icon']},
| {field: 'url', values: ['image']},
| {field: 'imgWidth', values: ['image']},
| ]
| },
| {
| type: 'mkicon',
| field: 'icon',
| label: '图标',
| initval: setting.icon || '',
| required: true
| },
| {
| type: 'number',
| field: 'width',
| label: '宽度',
| initval: setting.width || 24,
| tooltip: '栅格布局,每行等分为24列。',
| min: 1,
| max: 24,
| precision: 0,
| required: true
| },
| {
| type: 'number',
| field: 'iconFont',
| label: '字体大小',
| initval: setting.iconFont || 20,
| min: 12,
| max: 300,
| precision: 0,
| required: true
| },
| {
| type: 'number',
| field: 'padding',
| label: '内边距',
| initval: setting.padding || 12,
| min: 0,
| max: 200,
| precision: 0,
| required: true
| },
| {
| type: 'styleInput',
| field: 'borderRadius',
| label: '圆角',
| initval: setting.borderRadius || '15%',
| required: false
| },
| {
| type: 'color',
| field: 'color',
| label: '字体颜色',
| initval: setting.color || '#ffffff',
| required: false
| },
| {
| type: 'color',
| field: 'background',
| label: '背景色',
| initval: setting.background || '#1890ff',
| required: false
| },
| {
| type: 'source',
| field: 'url',
| label: '图片地址',
| initval: setting.url || '',
| required: true
| },
| {
| type: 'number',
| field: 'imgWidth',
| label: '图片宽度',
| initval: setting.imgWidth || 36,
| tooltip: '图片宽度与高度相当,使用的图片比例应为1:1。',
| min: 10,
| max: 500,
| precision: 0,
| required: false
| },
| {
| type: 'select',
| field: 'tip',
| label: '提示',
| initval: setting.tip || '',
| tooltip: '绑定提示字段后,会在菜单右上角显示红色标记。',
| required: false,
| options: columns
| },
| {
| type: 'text',
| field: 'primaryId',
| label: '静态主键值',
| initval: setting.primaryId || '',
| tooltip: '可作为BID传到下一页面。注:@userid@会替换为用户ID。',
| required: false
| }
| ]
|
| return menuWrapForm
| }
|
|