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
| /**
| * @description 获取图表视图外部配置表单
| * @param {object} card // 搜索条件对象
| * @param {Array} columns // 显示列
| * @param {Array} actions // 按钮组excel
| * @param {Array} extraActions // 常规按钮
| */
| export function getChartViewForm (card, _columns, actions, extraActions) {
| let roleList = sessionStorage.getItem('sysRoles')
| if (roleList) {
| try {
| roleList = JSON.parse(roleList)
| } catch (e) {
| roleList = []
| }
| } else {
| roleList = []
| }
|
| let _charts = [{
| value: 'line',
| text: '折线图'
| }, {
| value: 'bar',
| text: '柱状图'
| }, {
| value: 'pie',
| text: '饼图'
| }, {
| value: 'card',
| text: '卡片'
| }]
|
| if (card.chartType === 'table') {
| _charts = [{
| value: 'table',
| text: '表格'
| }]
| }
|
| return [
| {
| type: 'text',
| key: 'title',
| label: '标题',
| initVal: card.title,
| required: false
| },
| {
| type: 'select',
| key: 'chartType',
| label: '图表类型',
| initVal: card.chartType,
| required: true,
| readonly: card.chartType === 'table',
| options: _charts
| },
| {
| type: 'number',
| key: 'height',
| min: 100,
| max: 1000,
| decimal: 0,
| label: '高度',
| initVal: card.height || 400,
| required: true
| },
| {
| type: 'radio',
| key: 'Hide',
| label: '隐藏',
| initVal: card.Hide,
| required: true,
| options: [{
| value: 'true',
| text: '是'
| }, {
| value: 'false',
| text: '否'
| }]
| },
| {
| type: 'number',
| key: 'width',
| min: 1,
| max: 24,
| decimal: 0,
| label: '图表宽度',
| tooltip: '栅格布局,每行等分为24列。',
| initVal: card.width || 24,
| required: true
| },
| {
| type: 'number',
| key: 'cardWidth',
| min: 1,
| max: 24,
| decimal: 0,
| label: '卡片宽度',
| tooltip: '栅格布局,每行等分为24列。',
| initVal: card.cardWidth || 6,
| hidden: true,
| required: true
| },
| {
| type: 'select',
| key: 'bgfield',
| label: '背景控制',
| initVal: card.bgfield || '',
| required: false,
| readonly: false,
| hidden: true,
| options: _columns
| },
| {
| type: 'radio',
| key: 'border',
| label: '边框',
| initVal: card.border || 'show',
| required: false,
| hidden: true,
| options: [{
| value: 'show',
| text: '显示'
| }, {
| value: 'hidden',
| text: '隐藏'
| }]
| },
| {
| type: 'radio',
| key: 'switch',
| label: '数据切换',
| initVal: card.switch || 'true',
| required: false,
| hidden: true,
| options: [{
| value: 'true',
| text: '是'
| }, {
| value: 'false',
| text: '否'
| }]
| },
| {
| type: 'select',
| key: 'extraAction',
| label: '扩展卡片',
| initVal: card.extraAction || '',
| tooltip: '绑定不选行的按钮,卡片尾部会增加功能卡片',
| required: false,
| options: extraActions
| },
| {
| type: 'multiselect',
| key: 'blacklist',
| label: '黑名单',
| initVal: card.blacklist || [],
| required: false,
| options: roleList
| },
| {
| type: 'multiselect',
| key: 'actions',
| label: '扩展按钮',
| initVal: card.actions || [],
| tooltip: '可绑定已有的excel导入、导出按钮',
| required: false,
| options: actions
| }
| ]
| }
|
|