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
| /**
| * @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 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: '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
| }
| ]
| }
|
|