-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.js
101 lines (99 loc) · 2.18 KB
/
data.js
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
export function getMeta() {
return {
name: 'root',
component: 'Layout',
className: 'mk-app-hot-modify-app',
children: [{
name: 'left',
component: 'Layout',
className: 'mk-app-hot-modify-app-left',
children: [{
name: 'search',
component: 'Input.Search',
placeholder: "请输入app name过滤",
value: '{{data.search}}',
onChange: '{{$searchChange}}'
}, {
name: 'apps',
component: 'Tree',
onSelect: '{{$appSelected}}',
selectedKeys: '{{[data.selectApp.name]}}',
_visible: '{{data.apps && data.apps.length > 0}}',
children: [{
name: 'app',
component: 'Tree.TreeNode',
key: '{{data.apps[_rowIndex].name}}',
title: '{{data.apps[_rowIndex].name}}',
_power: 'for in data.apps'
}]
}]
}, {
name: 'content',
component: 'Layout',
className: 'mk-app-hot-modify-app-content',
children: [{
name: 'card',
component: 'Card',
className: 'mk-app-hot-modify-app-content-main',
title: {
name: 'type',
component: 'Radio.Group',
value: '{{data.selectType}}',
onChange: '{{$typeChange}}',
children: [{
name: 'meta',
component: 'Radio.Button',
value: 'meta',
children: '元数据(meta)'
}, {
name: 'state',
component: 'Radio.Button',
value: 'state',
children: '当前状态(state)'
}]
},
extra: {
name: 'extra',
component: '::div',
children: [{
name: 'format',
component: 'Button',
style: { marginRight: 6 },
type: 'softly',
children: '格式化',
onClick: '{{$formatJson}}'
}, {
name: 'reset',
component: 'Button',
_visible: "{{data.selectType == 'meta'}}",
type: 'softly',
children: '重置',
onClick: '{{$reset}}'
}]
},
children: [{
name: 'json',
component: 'CodeMirror',
value: '{{data.currentJson}}',
onChange: '{{$jsonChange}}',
options: {
mode: 'javascript',
theme: 'material',
lineNumbers: true,
inputStyle: 'textarea'
}
}]
}]
}]
}
}
export function getInitState() {
return {
data: {
apps: [],
selectApp: {},
search: '',
other: {}
}
}
}