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
| // import zhCN from '@/locales/zh-CN/model.js'
| // import enUS from '@/locales/en-US/model.js'
|
| // const Formdict = localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
|
| /**
| * @description 获取按钮表单配置信息
| * @param {*} card 编辑按钮
| * @param {*} setting 组件配置
| * @param {*} permFuncField 存储过程可用的开始字段
| * @param {*} type 按钮类型,用于区分可选的打开方式
| */
| export function getCardCellForm (card) {
| let forms = [
| {
| type: 'select',
| key: 'eleType',
| label: '元素类型',
| initVal: card.eleType,
| required: true,
| options: [
| { value: 'text', text: '文本'},
| { value: 'number', text: '数值'},
| { value: 'picture', text: '图片'},
| { value: 'icon', text: '图标'},
| { value: 'link', text: '链接'},
| { value: 'slider', text: '进度条'},
| { value: 'splitline', text: '分割线'},
| ]
| },
| {
| type: 'select',
| key: 'icon',
| label: '图标',
| initVal: card.icon,
| required: true,
| options: [
| { value: 'question-circle', text: 'question-circle'},
| { value: 'alert', text: 'alert'},
| { value: 'cloud', text: 'cloud'},
| { value: 'eye', text: 'eye'},
| { value: 'eye-invisible', text: 'eye-invisible'},
| { value: 'android', text: 'android'},
| { value: 'apple', text: 'apple'},
| { value: 'windows', text: 'windows'},
| { value: 'ie', text: 'ie'},
| { value: 'chrome', text: 'chrome'},
| { value: 'github', text: 'github'},
| { value: 'aliwangwang', text: 'aliwangwang'},
| { value: 'dingding', text: 'dingding'},
| { value: 'wechat', text: 'wechat'},
| { value: 'alipay', text: 'alipay'},
| { value: 'weibo-square', text: 'weibo-square'},
| { value: 'weibo-circle', text: 'weibo-circle'},
| { value: 'taobao-circle', text: 'taobao-circle'},
| { value: 'weibo', text: 'weibo'},
| { value: 'twitter', text: 'twitter'},
| { value: 'youtube', text: 'youtube'},
| { value: 'alipay-circle', text: 'alipay-circle'},
| { value: 'taobao', text: 'taobao'},
| { value: 'skype', text: 'skype'},
| { value: 'qq', text: 'qq'},
| { value: 'gitlab', text: 'gitlab'},
| { value: 'zhihu', text: 'zhihu'},
| { value: 'slack', text: 'slack'},
| { value: 'sketch', text: 'sketch'},
| { value: 'yahoo', text: 'yahoo'},
| { value: 'reddit', text: 'reddit'},
| { value: 'dribbble', text: 'dribbble'},
| ]
| },
| {
| type: 'radio',
| key: 'datatype',
| label: '数据类型',
| initVal: card.datatype || 'static',
| required: true,
| options: [
| { value: 'dynamic', text: '动态' },
| { value: 'static', text: '静态' }
| ]
| },
| {
| type: 'select',
| key: 'field',
| label: '字段',
| initVal: card.field || '',
| required: true,
| options: []
| },
| {
| type: 'file',
| key: 'url',
| label: '图片',
| initVal: card.url || '',
| maxfile: 1,
| required: false
| },
| {
| type: 'text',
| key: 'value',
| min: 0,
| label: '内容',
| initVal: card.value || '',
| required: true
| },
| {
| type: 'select',
| key: 'labelfield',
| label: '提示字段',
| initVal: card.labelfield || '',
| required: false,
| options: []
| },
| {
| type: 'text',
| key: 'prefix',
| label: '前缀',
| initVal: card.prefix || '',
| required: false
| },
| {
| type: 'text',
| key: 'postfix',
| label: '后缀',
| initVal: card.postfix || '',
| required: false
| },
| {
| type: 'text',
| key: 'tooltip',
| label: '提示信息',
| initVal: card.tooltip || '',
| tooltip: '鼠标悬浮时显示。',
| required: false
| },
| {
| type: 'select',
| key: 'format',
| label: '格式化',
| initVal: card.format || '',
| tooltip: '注:百分数、千分位对于数值类型有效,YYYY-MM-DD对于时间类型的文本有效。',
| required: false,
| options: [
| { value: '', text: '无' },
| { value: 'percent', text: '百分数' },
| { value: 'thdSeparator', text: '千分位' },
| { value: 'YYYY-MM-DD', text: 'YYYY-MM-DD' }
| ]
| },
| {
| type: 'color',
| key: 'color',
| label: '颜色',
| initVal: card.color,
| required: true
| },
| {
| type: 'number',
| key: 'maxValue',
| min: 1,
| label: '最大值',
| initVal: card.maxValue || 100,
| tooltip: '即进度为100%时的值。',
| required: true,
| },
| {
| type: 'number',
| key: 'width',
| min: 1,
| max: 24,
| precision: 0,
| label: '宽度',
| initVal: card.width || 12,
| tooltip: '栅格布局,每行等分为24列。',
| required: true
| },
| {
| type: 'number',
| key: 'height',
| min: 1,
| max: 10,
| label: '高度(行)',
| initVal: card.height || 1,
| required: true,
| },
| {
| type: 'select',
| key: 'lenWidRadio',
| label: '长宽比',
| initVal: card.lenWidRadio || '1:1',
| required: true,
| options: [
| { value: '1:1', text: '1:1' },
| { value: '3:2', text: '3:2' },
| { value: '4:3', text: '4:3' },
| { value: '16:9', text: '16:9' }
| ]
| },
| {
| type: 'radio',
| key: 'radius',
| label: '圆角',
| initVal: card.radius || 'false',
| required: false,
| options: [
| { value: 'true', text: '有' },
| { value: 'false', text: '无' }
| ]
| },
| ]
|
| return forms
| }
|
|