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
| /**
| * @description 获取图表视图配置表单
| * @param {object} card // 图表对象
| */
| export function getBaseForm (card) {
| let appType = sessionStorage.getItem('appType')
| let roleList = sessionStorage.getItem('sysRoles')
| let isprint = sessionStorage.getItem('MenuType') === 'billPrint'
| let ispop = sessionStorage.getItem('editMenuType') === 'popview'
| if (roleList) {
| try {
| roleList = JSON.parse(roleList)
| } catch (e) {
| roleList = []
| }
| } else {
| roleList = []
| }
|
| return [
| {
| type: 'text',
| field: 'title',
| label: '标题',
| initval: card.title,
| required: false
| },
| {
| type: 'text',
| field: 'name',
| label: '组件名称',
| initval: card.name,
| tooltip: '用于组件间的区分。',
| required: true
| },
| {
| type: 'radio',
| field: 'chartType',
| label: '图表类型',
| initval: card.chartType || 'antv',
| required: true,
| options: [
| { value: 'antv', label: 'antv5.0' },
| { value: 'echarts', label: 'echarts' }
| ]
| },
| {
| type: 'number',
| field: 'width',
| label: '宽度',
| initval: card.width,
| tooltip: '栅格布局,每行等分为24列。',
| min: 1,
| max: 24,
| decimal: 0,
| required: true
| },
| {
| type: 'styleInput',
| field: 'height',
| label: '图表高度',
| initval: card.height,
| tooltip: '图表绘图区域的高度,不包括标题及内外边距。',
| required: true,
| options: ['px', 'vh', 'vw']
| },
| {
| type: 'radio',
| field: 'permission',
| label: '权限验证',
| initval: card.permission || 'false',
| required: false,
| options: [
| {value: 'true', label: '启用'},
| {value: 'false', label: '禁用'},
| ],
| forbid: !appType || ispop || isprint
| },
| {
| type: 'radio',
| field: 'cacheLocal',
| label: '本地缓存',
| initval: card.cacheLocal || 'true',
| required: false,
| options: [
| {value: 'true', label: '继承菜单'},
| {value: 'false', label: '禁用'},
| ],
| forbid: ispop || isprint
| },
| {
| type: 'multiselect',
| field: 'blacklist',
| label: '黑名单',
| initval: card.blacklist || [],
| required: false,
| options: roleList,
| forbid: !!appType || isprint
| }
| ]
| }
|
|