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
| /**
| * @description 获取图表视图配置表单
| * @param {object} card // 图表对象
| */
| export function getBaseForm (card) {
| let roleList = sessionStorage.getItem('sysRoles')
| if (roleList) {
| try {
| roleList = JSON.parse(roleList)
| } catch {
| roleList = []
| }
| } else {
| roleList = []
| }
|
| return [
| {
| type: 'text',
| key: 'title',
| label: '标题',
| initVal: card.title,
| required: false
| },
| {
| type: 'text',
| key: 'name',
| label: '组件名称',
| initVal: card.name,
| tooltip: '用于组件间的区分。',
| required: true
| },
| {
| type: 'number',
| key: 'width',
| label: '宽度',
| initVal: card.width,
| tooltip: '栅格布局,每行等分为24列。',
| min: 1,
| max: 24,
| decimal: 0,
| required: true
| },
| {
| type: 'number',
| key: 'height',
| label: '高度',
| initVal: card.height,
| min: 100,
| max: 1000,
| decimal: 0,
| required: true
| },
| {
| type: 'select',
| key: 'blacklist',
| label: '黑名单',
| initVal: card.blacklist || [],
| multi: true,
| required: false,
| options: roleList
| }
| ]
| }
|
| /**
| * @description 获取图表视图配置表单
| * @param {object} card // 图表对象
| * @param {Array} columns // 显示列
| */
| export function getOptionForm (card, columns) {
| let appType = sessionStorage.getItem('appType')
| let xfields = columns.filter(item => /^Nvarchar/ig.test(item.datatype))
| let yfields = columns.filter(item => /^(Int|Decimal)/ig.test(item.datatype))
|
| return [
| {
| type: 'select',
| key: 'gender',
| label: '类型',
| initVal: card.gender || '',
| required: true,
| options: xfields
| },
| {
| type: 'select',
| key: 'Xaxis',
| label: 'X-轴',
| initVal: card.Xaxis || '',
| required: true,
| options: columns
| },
| {
| type: 'select',
| key: 'Yaxis',
| label: 'Y-轴',
| initVal: card.Yaxis || '',
| required: true,
| options: yfields
| },
| {
| type: 'radio',
| key: 'shape',
| label: '形状',
| initVal: card.shape || 'circle',
| required: false,
| options: [{
| value: 'circle',
| text: 'circle'
| }, {
| value: 'square',
| text: 'square'
| }]
| },
| {
| type: 'radio',
| key: 'tooltip',
| label: '悬浮提示',
| initVal: card.tooltip || 'true',
| required: false,
| options: [{
| value: 'true',
| text: '显示'
| }, {
| value: 'false',
| text: '隐藏'
| }]
| },
| {
| type: 'text',
| key: 'Xunit',
| label: 'X轴单位',
| initVal: card.Xunit || '',
| required: false
| },
| {
| type: 'text',
| key: 'Yunit',
| label: 'Y轴单位',
| initVal: card.Yunit || '',
| required: false
| },
| {
| type: 'color',
| key: 'color',
| label: '色系',
| initVal: card.color || 'rgba(0, 0, 0, 0.65)',
| tooltip: '坐标轴提示文字及示例的颜色。',
| required: false
| }, {
| type: 'select',
| key: 'interaction',
| label: '交互效果',
| initVal: card.interaction || [],
| multi: true,
| required: false,
| forbid: appType === 'mob',
| options: [
| { value: 'element-active', label: '元素聚焦' },
| { value: 'element-selected', label: '元素选中(多选)' },
| { value: 'element-single-selected', label: '元素选中(单选)' },
| // { value: 'active-region', label: '背景框' },
| { value: 'view-zoom', label: '视图缩放' },
| { value: 'element-highlight', label: '元素高亮' },
| { value: 'element-highlight-by-color', label: '同色元素高亮' },
| { value: 'element-highlight-by-x', label: '同X轴元素高亮' },
| { value: 'legend-filter', label: '图例过滤' },
| { value: 'legend-active', label: '图例聚焦' },
| { value: 'legend-highlight', label: '图例高亮' },
| { value: 'brush', label: '选框过滤' },
| ]
| }
| ]
| }
|
|