amis-editor 4.2.0-beta.2 → 5.1.9
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/6dbcbb49b6fd405190a9.png +0 -0
- package/dist/component/Control/APIControl.d.ts +1101 -447
- package/dist/component/Control/ActionAPIControl.d.ts +1158 -0
- package/dist/component/Control/BadgeControl.d.ts +133 -0
- package/dist/component/Control/BaseControl.d.ts +248 -0
- package/dist/component/Control/DataBindingControl.d.ts +14 -0
- package/dist/component/Control/DataPickerControl.d.ts +13 -0
- package/dist/component/Control/DateShortCutControl.d.ts +83 -0
- package/dist/component/Control/FormulaControl.d.ts +51 -0
- package/dist/component/Control/OptionControl.d.ts +23 -34
- package/dist/component/Control/StatusControl.d.ts +39 -0
- package/dist/component/Control/SwitchMoreControl.d.ts +224 -0
- package/dist/component/Control/ValidationControl.d.ts +50 -15
- package/dist/component/Control/ValidationItem.d.ts +46 -0
- package/dist/component/Control/style-control/Background.d.ts +17 -0
- package/dist/component/Control/style-control/Border.d.ts +18 -0
- package/dist/component/Control/style-control/BoxModel.d.ts +17 -0
- package/dist/component/Control/style-control/BoxShadow.d.ts +18 -0
- package/dist/component/Control/style-control/Display.d.ts +14 -0
- package/dist/component/Control/style-control/Font.d.ts +16 -0
- package/dist/component/Control/style-control/font-family.d.ts +11 -0
- package/dist/component/Control/style-control/transformation.d.ts +29 -0
- package/dist/component/Control/style-control/types.d.ts +8 -0
- package/dist/component/Editor.d.ts +16 -0
- package/dist/component/RegionWrapper.d.ts +10 -0
- package/dist/component/VRenderer.d.ts +10 -0
- package/dist/component/schemaTpl.d.ts +8 -0
- package/dist/component/validator.d.ts +62 -0
- package/dist/dnd/index.d.ts +1 -1
- package/dist/event-action/action-config-panel.d.ts +8 -0
- package/dist/event-action/actions.d.ts +3 -0
- package/dist/event-action/comp-action-select.d.ts +11 -0
- package/dist/event-action/config.d.ts +13 -0
- package/dist/event-action/index.d.ts +459 -0
- package/dist/event-action/schema.d.ts +32 -0
- package/dist/exports.min.js +1 -1
- package/dist/index.d.ts +23 -5
- package/dist/index.min.js +1 -1
- package/dist/manager.d.ts +46 -1
- package/dist/plugin/Alert.d.ts +4 -2
- package/dist/plugin/Button.d.ts +5 -1
- package/dist/plugin/ButtonGroup.d.ts +13 -34
- package/dist/plugin/ButtonToolbar.d.ts +4 -10
- package/dist/plugin/CRUD.d.ts +2 -0
- package/dist/plugin/Chart.d.ts +2 -0
- package/dist/plugin/Collapse.d.ts +1 -0
- package/dist/plugin/CollapseGroup.d.ts +28 -4
- package/dist/plugin/Container.d.ts +2 -1
- package/dist/plugin/Dialog.d.ts +12 -2
- package/dist/plugin/Drawer.d.ts +12 -2
- package/dist/plugin/DropDownButton.d.ts +11 -11
- package/dist/plugin/Form/ButtonGroupSelect.d.ts +7 -2
- package/dist/plugin/Form/ButtonToolbar.d.ts +8 -7
- package/dist/plugin/Form/ChainedSelect.d.ts +3 -0
- package/dist/plugin/Form/Checkbox.d.ts +7 -2
- package/dist/plugin/Form/Checkboxes.d.ts +8 -2
- package/dist/plugin/Form/CodeEditor.d.ts +7 -22
- package/dist/plugin/Form/Combo.d.ts +3 -0
- package/dist/plugin/Form/Control.d.ts +6 -2
- package/dist/plugin/Form/DiffEditor.d.ts +7 -1
- package/dist/plugin/Form/Form.d.ts +6 -0
- package/dist/plugin/Form/Formula.d.ts +1 -25
- package/dist/plugin/Form/InputDate.d.ts +8 -2
- package/dist/plugin/Form/InputDateRange.d.ts +8 -2
- package/dist/plugin/Form/InputDateTime.d.ts +4 -4
- package/dist/plugin/Form/InputDateTimeRange.d.ts +4 -4
- package/dist/plugin/Form/InputEmail.d.ts +1 -0
- package/dist/plugin/Form/InputExcel.d.ts +6 -41
- package/dist/plugin/Form/InputFile.d.ts +7 -3
- package/dist/plugin/Form/InputKV.d.ts +6 -0
- package/dist/plugin/Form/InputMonth.d.ts +1 -0
- package/dist/plugin/Form/InputMonthRange.d.ts +4 -4
- package/dist/plugin/Form/InputPassword.d.ts +1 -0
- package/dist/plugin/Form/InputQuarter.d.ts +1 -0
- package/dist/plugin/Form/InputQuarterRange.d.ts +4 -4
- package/dist/plugin/Form/InputRange.d.ts +3 -0
- package/dist/plugin/Form/InputRating.d.ts +9 -3
- package/dist/plugin/Form/InputText.d.ts +24 -2
- package/dist/plugin/Form/InputTime.d.ts +3 -3
- package/dist/plugin/Form/InputTimeRange.d.ts +20 -0
- package/dist/plugin/Form/InputTree.d.ts +6 -2
- package/dist/plugin/Form/InputURL.d.ts +1 -0
- package/dist/plugin/Form/InputYear.d.ts +1 -0
- package/dist/plugin/Form/InputYearRange.d.ts +20 -0
- package/dist/plugin/Form/ListSelect.d.ts +6 -2
- package/dist/plugin/Form/LocationPicker.d.ts +1 -31
- package/dist/plugin/Form/NestedSelect.d.ts +5 -2
- package/dist/plugin/Form/Radios.d.ts +7 -2
- package/dist/plugin/Form/Select.d.ts +7 -2
- package/dist/plugin/Form/Switch.d.ts +7 -2
- package/dist/plugin/Form/TabsTransfer.d.ts +5 -2
- package/dist/plugin/Form/Textarea.d.ts +7 -1
- package/dist/plugin/Form/Transfer.d.ts +5 -2
- package/dist/plugin/Form/TreeSelect.d.ts +6 -2
- package/dist/plugin/IFrame.d.ts +2 -2
- package/dist/plugin/Nav.d.ts +1 -116
- package/dist/plugin/Others/Action.d.ts +5 -1
- package/dist/plugin/Page.d.ts +5 -2
- package/dist/plugin/Progress.d.ts +5 -1
- package/dist/plugin/Table.d.ts +2 -0
- package/dist/plugin/Tabs.d.ts +33 -2
- package/dist/plugin/TooltipWrapper.d.ts +10 -0
- package/dist/plugin/Tpl.d.ts +2 -1
- package/dist/plugin/Wizard.d.ts +4 -1
- package/dist/plugin.d.ts +37 -1
- package/dist/store/editor.d.ts +65 -38
- package/dist/store/node.d.ts +16 -0
- package/dist/style.css +1 -1
- package/dist/util.d.ts +36 -3
- package/package.json +14 -8
- package/src/component/schemaTpl.tsx +1198 -474
- package/src/plugin/.DS_Store +0 -0
- package/src/plugin/Alert.tsx +69 -48
- package/src/plugin/AnchorNav.tsx +1 -0
- package/src/plugin/Audio.tsx +9 -15
- package/src/plugin/Avatar.tsx +2 -1
- package/src/plugin/Breadcrumb.tsx +2 -1
- package/src/plugin/Button.tsx +257 -188
- package/src/plugin/ButtonGroup.tsx +99 -38
- package/src/plugin/ButtonToolbar.tsx +7 -13
- package/src/plugin/CRUD.tsx +77 -135
- package/src/plugin/Card.tsx +1 -0
- package/src/plugin/Cards.tsx +8 -14
- package/src/plugin/Carousel.tsx +1 -1
- package/src/plugin/Chart.tsx +26 -14
- package/src/plugin/Collapse.tsx +78 -78
- package/src/plugin/CollapseGroup.tsx +165 -83
- package/src/plugin/Container.tsx +59 -6
- package/src/plugin/Custom.tsx +2 -8
- package/src/plugin/CustomRegion.tsx +4 -3
- package/src/plugin/Dialog.tsx +55 -24
- package/src/plugin/Drawer.tsx +65 -35
- package/src/plugin/DropDownButton.tsx +95 -79
- package/src/plugin/Flex.tsx +123 -65
- package/src/plugin/Form/ButtonGroupSelect.tsx +114 -26
- package/src/plugin/Form/ButtonToolbar.tsx +62 -55
- package/src/plugin/Form/ChainedSelect.tsx +45 -0
- package/src/plugin/Form/Checkbox.tsx +122 -33
- package/src/plugin/Form/Checkboxes.tsx +154 -87
- package/src/plugin/Form/CodeEditor.tsx +163 -34
- package/src/plugin/Form/Combo.tsx +104 -65
- package/src/plugin/Form/Control.tsx +16 -70
- package/src/plugin/Form/DiffEditor.tsx +158 -54
- package/src/plugin/Form/FieldSet.tsx +6 -11
- package/src/plugin/Form/Form.tsx +277 -70
- package/src/plugin/Form/Formula.tsx +8 -14
- package/src/plugin/Form/InputArray.tsx +7 -16
- package/src/plugin/Form/InputCity.tsx +1 -1
- package/src/plugin/Form/InputDate.tsx +344 -121
- package/src/plugin/Form/InputDateRange.tsx +303 -161
- package/src/plugin/Form/InputDateTime.tsx +6 -150
- package/src/plugin/Form/InputDateTimeRange.tsx +7 -187
- package/src/plugin/Form/InputEmail.tsx +1 -0
- package/src/plugin/Form/InputExcel.tsx +70 -27
- package/src/plugin/Form/InputFile.tsx +326 -152
- package/src/plugin/Form/InputImage.tsx +1 -1
- package/src/plugin/Form/InputKV.tsx +61 -0
- package/src/plugin/Form/InputMonth.tsx +3 -1
- package/src/plugin/Form/InputMonthRange.tsx +6 -160
- package/src/plugin/Form/InputNumber.tsx +1 -1
- package/src/plugin/Form/InputPassword.tsx +2 -0
- package/src/plugin/Form/InputQuarter.tsx +3 -1
- package/src/plugin/Form/InputQuarterRange.tsx +6 -160
- package/src/plugin/Form/InputRange.tsx +74 -4
- package/src/plugin/Form/InputRating.tsx +347 -35
- package/src/plugin/Form/InputRichText.tsx +2 -3
- package/src/plugin/Form/InputTable.tsx +33 -49
- package/src/plugin/Form/InputTag.tsx +1 -1
- package/src/plugin/Form/InputText.tsx +310 -132
- package/src/plugin/Form/InputTime.tsx +4 -53
- package/src/plugin/Form/InputTimeRange.tsx +41 -0
- package/src/plugin/Form/InputTree.tsx +196 -46
- package/src/plugin/Form/InputURL.tsx +2 -0
- package/src/plugin/Form/InputYear.tsx +2 -0
- package/src/plugin/Form/InputYearRange.tsx +41 -0
- package/src/plugin/Form/Item.tsx +17 -18
- package/src/plugin/Form/ListSelect.tsx +75 -20
- package/src/plugin/Form/LocationPicker.tsx +2 -7
- package/src/plugin/Form/MatrixCheckboxes.tsx +1 -1
- package/src/plugin/Form/NestedSelect.tsx +110 -43
- package/src/plugin/Form/Picker.tsx +2 -5
- package/src/plugin/Form/Radios.tsx +122 -52
- package/src/plugin/Form/Select.tsx +239 -168
- package/src/plugin/Form/Static.tsx +1 -1
- package/src/plugin/Form/Switch.tsx +170 -58
- package/src/plugin/Form/TabsTransfer.tsx +175 -79
- package/src/plugin/Form/Textarea.tsx +146 -36
- package/src/plugin/Form/Transfer.tsx +295 -233
- package/src/plugin/Form/TreeSelect.tsx +287 -146
- package/src/plugin/Grid.tsx +340 -312
- package/src/plugin/HBox.tsx +1 -0
- package/src/plugin/IFrame.tsx +21 -12
- package/src/plugin/Image.tsx +7 -12
- package/src/plugin/Images.tsx +7 -12
- package/src/plugin/Link.tsx +6 -12
- package/src/plugin/List.tsx +6 -10
- package/src/plugin/ListItem.tsx +1 -0
- package/src/plugin/Nav.tsx +7 -9
- package/src/plugin/Others/Action.tsx +16 -10
- package/src/plugin/Others/BasicToolbar.tsx +4 -1
- package/src/plugin/Others/TableCell.tsx +19 -39
- package/src/plugin/Page.tsx +315 -229
- package/src/plugin/Panel.tsx +6 -7
- package/src/plugin/Plain.tsx +3 -6
- package/src/plugin/Progress.tsx +234 -94
- package/src/plugin/Service.tsx +10 -6
- package/src/plugin/Table.tsx +49 -20
- package/src/plugin/TableView.tsx +212 -106
- package/src/plugin/Tabs.tsx +306 -146
- package/src/plugin/TooltipWrapper.tsx +231 -135
- package/src/plugin/Tpl.tsx +68 -52
- package/src/plugin/Video.tsx +9 -20
- package/src/plugin/Wizard.tsx +537 -336
- package/src/plugin/Wrapper.tsx +82 -61
- package/src/plugin.ts +66 -4
- package/static/empty.png +0 -0
package/src/plugin/Page.tsx
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
import {ContainerWrapper} from '../component/ContainerWrapper';
|
2
2
|
import {registerEditorPlugin} from '../manager';
|
3
|
-
import {BasePlugin} from '../plugin';
|
3
|
+
import {BaseEventContext, BasePlugin} from '../plugin';
|
4
4
|
import {getSchemaTpl} from '../component/schemaTpl';
|
5
|
+
import {getEventControlConfig} from '../util';
|
6
|
+
import {RendererAction, RendererEvent} from '../event-action';
|
5
7
|
import type {SchemaObject} from 'amis/lib/Schema';
|
6
8
|
|
7
9
|
export class PagePlugin extends BasePlugin {
|
@@ -37,6 +39,44 @@ export class PagePlugin extends BasePlugin {
|
|
37
39
|
body: '内容'
|
38
40
|
};
|
39
41
|
|
42
|
+
events: RendererEvent[] = [
|
43
|
+
{
|
44
|
+
eventName: 'inited',
|
45
|
+
eventLabel: '初始化完成',
|
46
|
+
description: '远程初始化接口请求成功时触发',
|
47
|
+
dataSchema: [
|
48
|
+
{
|
49
|
+
type: 'object',
|
50
|
+
properties: {
|
51
|
+
'event.data': {
|
52
|
+
type: 'object',
|
53
|
+
title: '远程请求返回的初始化数据'
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
57
|
+
]
|
58
|
+
},
|
59
|
+
{
|
60
|
+
eventName: 'pullRefresh',
|
61
|
+
eventLabel: '下拉刷新',
|
62
|
+
description: '开启下拉刷新后,下拉释放后触发(仅用于移动端)'
|
63
|
+
}
|
64
|
+
];
|
65
|
+
|
66
|
+
// 动作定义
|
67
|
+
actions: RendererAction[] = [
|
68
|
+
{
|
69
|
+
actionType: 'reload',
|
70
|
+
actionLabel: '重新加载',
|
71
|
+
description: '触发组件数据刷新并重新渲染'
|
72
|
+
},
|
73
|
+
{
|
74
|
+
actionType: 'setValue',
|
75
|
+
actionLabel: '更新数据',
|
76
|
+
description: '触发组件数据更新'
|
77
|
+
}
|
78
|
+
];
|
79
|
+
|
40
80
|
// 普通容器类渲染器配置
|
41
81
|
regions = [
|
42
82
|
{key: 'toolbar', label: '工具栏', preferTag: '工具栏内容'},
|
@@ -46,91 +86,93 @@ export class PagePlugin extends BasePlugin {
|
|
46
86
|
wrapper = ContainerWrapper;
|
47
87
|
|
48
88
|
panelTitle = '页面';
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
joinValues: false,
|
70
|
-
extractValue: true,
|
71
|
-
inline: false,
|
72
|
-
options: [
|
73
|
-
{
|
74
|
-
label: '自动',
|
75
|
-
value: 'auto'
|
89
|
+
panelBodyCreator = (context: BaseEventContext) => {
|
90
|
+
return [
|
91
|
+
getSchemaTpl('tabs', [
|
92
|
+
{
|
93
|
+
title: '常规',
|
94
|
+
body: [
|
95
|
+
{
|
96
|
+
type: 'checkboxes',
|
97
|
+
name: 'regions',
|
98
|
+
label: '区域展示',
|
99
|
+
pipeIn: (value: any) =>
|
100
|
+
Array.isArray(value)
|
101
|
+
? value
|
102
|
+
: ['auto', 'body', 'toolbar', 'aside', 'header'],
|
103
|
+
pipeOut: (value: any) => {
|
104
|
+
return Array.isArray(value) && ~value.indexOf('auto')
|
105
|
+
? undefined
|
106
|
+
: value.length
|
107
|
+
? value
|
108
|
+
: ['auto', 'body', 'toolbar', 'aside', 'header'];
|
76
109
|
},
|
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
|
-
|
110
|
+
joinValues: false,
|
111
|
+
extractValue: true,
|
112
|
+
inline: false,
|
113
|
+
options: [
|
114
|
+
{
|
115
|
+
label: '自动',
|
116
|
+
value: 'auto'
|
117
|
+
},
|
118
|
+
{
|
119
|
+
label: '内容区',
|
120
|
+
value: 'body',
|
121
|
+
disabledOn:
|
122
|
+
'!Array.isArray(this.regions) || ~this.regions.indexOf("auto")'
|
123
|
+
},
|
124
|
+
{
|
125
|
+
label: '边栏',
|
126
|
+
value: 'aside',
|
127
|
+
disabledOn:
|
128
|
+
'!Array.isArray(this.regions) ||~this.regions.indexOf("auto")'
|
129
|
+
},
|
130
|
+
{
|
131
|
+
label: '工具栏',
|
132
|
+
value: 'toolbar',
|
133
|
+
disabledOn:
|
134
|
+
'!Array.isArray(this.regions) ||~this.regions.indexOf("auto")'
|
135
|
+
},
|
136
|
+
{
|
137
|
+
label: '顶部',
|
138
|
+
value: 'header',
|
139
|
+
disabledOn:
|
140
|
+
'!Array.isArray(this.regions) ||~this.regions.indexOf("auto")'
|
141
|
+
}
|
142
|
+
]
|
143
|
+
},
|
103
144
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
145
|
+
{
|
146
|
+
label: '标题',
|
147
|
+
name: 'title',
|
148
|
+
type: 'input-text'
|
149
|
+
},
|
109
150
|
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
151
|
+
{
|
152
|
+
label: '副标题',
|
153
|
+
name: 'subTitle',
|
154
|
+
type: 'input-text'
|
155
|
+
},
|
115
156
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
157
|
+
{
|
158
|
+
label: '提示',
|
159
|
+
name: 'remark',
|
160
|
+
type: 'textarea',
|
161
|
+
visibleOn: 'this.title',
|
162
|
+
description:
|
163
|
+
'标题附近会出现一个提示图标,鼠标放上去会提示该内容。'
|
164
|
+
},
|
165
|
+
getSchemaTpl('data')
|
166
|
+
]
|
167
|
+
},
|
126
168
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
169
|
+
{
|
170
|
+
title: '接口',
|
171
|
+
body: [
|
172
|
+
getSchemaTpl('api', {
|
173
|
+
label: '数据初始化接口',
|
174
|
+
name: 'initApi',
|
175
|
+
sampleBuilder: (schema: any) => `{
|
134
176
|
"status": 0,
|
135
177
|
"msg": "",
|
136
178
|
|
@@ -140,167 +182,211 @@ export class PagePlugin extends BasePlugin {
|
|
140
182
|
"a": "sample"
|
141
183
|
}
|
142
184
|
}`
|
143
|
-
|
144
|
-
|
145
|
-
getSchemaTpl('initFetch'),
|
185
|
+
}),
|
146
186
|
|
147
|
-
|
148
|
-
label: '开启定时刷新',
|
149
|
-
type: 'switch',
|
150
|
-
name: 'interval',
|
151
|
-
visibleOn: 'data.initApi',
|
152
|
-
pipeIn: (value: any) => !!value,
|
153
|
-
pipeOut: (value: any) => (value ? 3000 : undefined),
|
154
|
-
mode: 'inline'
|
155
|
-
},
|
187
|
+
getSchemaTpl('initFetch'),
|
156
188
|
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
189
|
+
getSchemaTpl('switch', {
|
190
|
+
label: '开启定时刷新',
|
191
|
+
name: 'interval',
|
192
|
+
visibleOn: 'data.initApi',
|
193
|
+
pipeIn: (value: any) => !!value,
|
194
|
+
pipeOut: (value: any) => (value ? 3000 : undefined)
|
195
|
+
}),
|
163
196
|
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
description: '设置自动定时刷新时是否显示loading'
|
171
|
-
},
|
197
|
+
{
|
198
|
+
name: 'interval',
|
199
|
+
type: 'input-number',
|
200
|
+
visibleOn: 'typeof this.interval === "number"',
|
201
|
+
step: 500
|
202
|
+
},
|
172
203
|
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
'定时刷新一旦设置会一直刷新,除非给出表达式,条件满足后则不刷新了。'
|
180
|
-
},
|
204
|
+
getSchemaTpl('switch', {
|
205
|
+
name: 'silentPolling',
|
206
|
+
label: '静默刷新',
|
207
|
+
visibleOn: '!!data.interval',
|
208
|
+
description: '设置自动定时刷新时是否显示loading'
|
209
|
+
}),
|
181
210
|
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
{
|
191
|
-
label: '获取成功提示',
|
192
|
-
type: 'input-text',
|
193
|
-
name: 'fetchSuccess'
|
194
|
-
},
|
195
|
-
|
196
|
-
{
|
197
|
-
label: '获取失败提示',
|
198
|
-
type: 'input-text',
|
199
|
-
name: 'fetchFailed'
|
200
|
-
},
|
211
|
+
{
|
212
|
+
name: 'stopAutoRefreshWhen',
|
213
|
+
label: '停止定时刷新检测表达式',
|
214
|
+
type: 'input-text',
|
215
|
+
visibleOn: '!!data.interval',
|
216
|
+
description:
|
217
|
+
'定时刷新一旦设置会一直刷新,除非给出表达式,条件满足后则不刷新了。'
|
218
|
+
},
|
201
219
|
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
220
|
+
{
|
221
|
+
label: '默认消息提示',
|
222
|
+
type: 'combo',
|
223
|
+
name: 'messages',
|
224
|
+
multiLine: true,
|
225
|
+
description:
|
226
|
+
'设置 ajax 默认提示信息,当 ajax 没有返回 msg 信息时有用,如果 ajax 返回携带了 msg 值,则还是以 ajax 返回为主',
|
227
|
+
items: [
|
228
|
+
{
|
229
|
+
label: '获取成功提示',
|
230
|
+
type: 'input-text',
|
231
|
+
name: 'fetchSuccess'
|
232
|
+
},
|
207
233
|
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
]
|
214
|
-
}
|
215
|
-
]
|
216
|
-
},
|
234
|
+
{
|
235
|
+
label: '获取失败提示',
|
236
|
+
type: 'input-text',
|
237
|
+
name: 'fetchFailed'
|
238
|
+
},
|
217
239
|
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
name: 'headerClassName',
|
224
|
-
label: '头部CSS类名'
|
225
|
-
}),
|
226
|
-
getSchemaTpl('className', {
|
227
|
-
name: 'bodyClassName',
|
228
|
-
label: '内容CSS类名'
|
229
|
-
}),
|
240
|
+
{
|
241
|
+
label: '保存成功提示',
|
242
|
+
type: 'input-text',
|
243
|
+
name: 'saveSuccess'
|
244
|
+
},
|
230
245
|
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
246
|
+
{
|
247
|
+
label: '保存失败提示',
|
248
|
+
type: 'input-text',
|
249
|
+
name: 'saveFailed'
|
250
|
+
}
|
251
|
+
]
|
252
|
+
}
|
253
|
+
]
|
254
|
+
},
|
255
|
+
{
|
256
|
+
title: '外观',
|
257
|
+
className: 'p-none',
|
258
|
+
body: [
|
259
|
+
getSchemaTpl('collapseGroup', [
|
260
|
+
...getSchemaTpl('style:common'),
|
261
|
+
getSchemaTpl('style:className', {
|
262
|
+
isFormItem: false,
|
263
|
+
schema: [
|
264
|
+
getSchemaTpl('className', {
|
265
|
+
name: 'headerClassName',
|
266
|
+
label: '头部CSS类名'
|
267
|
+
}),
|
268
|
+
getSchemaTpl('className', {
|
269
|
+
name: 'bodyClassName',
|
270
|
+
label: '内容CSS类名'
|
271
|
+
}),
|
235
272
|
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
getSchemaTpl('style')
|
241
|
-
]
|
242
|
-
},
|
273
|
+
getSchemaTpl('className', {
|
274
|
+
name: 'asideClassName',
|
275
|
+
label: '边栏CSS类名'
|
276
|
+
}),
|
243
277
|
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
278
|
+
getSchemaTpl('className', {
|
279
|
+
name: 'toolbarClassName',
|
280
|
+
label: '工具栏CSS类名'
|
281
|
+
})
|
282
|
+
]
|
283
|
+
})
|
284
|
+
])
|
285
|
+
]
|
286
|
+
},
|
287
|
+
{
|
288
|
+
title: '事件',
|
289
|
+
className: 'p-none',
|
290
|
+
body: [
|
291
|
+
getSchemaTpl('eventControl', {
|
292
|
+
name: 'onEvent',
|
293
|
+
...getEventControlConfig(this.manager, context)
|
294
|
+
})
|
295
|
+
]
|
296
|
+
},
|
297
|
+
{
|
298
|
+
title: '其他',
|
299
|
+
body: [
|
300
|
+
{
|
301
|
+
type: 'combo',
|
302
|
+
name: 'pullRefresh',
|
303
|
+
multiLine: true,
|
304
|
+
noBorder: true,
|
305
|
+
items: [
|
306
|
+
{
|
307
|
+
type: 'switch',
|
308
|
+
label: '移动端下拉刷新',
|
309
|
+
name: 'disabled',
|
310
|
+
mode: 'horizontal',
|
311
|
+
horizontal: {
|
312
|
+
justify: true,
|
313
|
+
left: 8
|
314
|
+
},
|
315
|
+
inputClassName: 'is-inline ',
|
316
|
+
trueValue: false,
|
317
|
+
falseValue: true
|
318
|
+
},
|
319
|
+
{
|
320
|
+
name: 'pullingText',
|
321
|
+
label: '下拉过程提示文案',
|
322
|
+
type: 'input-text',
|
323
|
+
visibleOn: '!this.disabled'
|
324
|
+
},
|
325
|
+
{
|
326
|
+
name: 'loosingText',
|
327
|
+
label: '释放过程提示文案',
|
328
|
+
type: 'input-text',
|
329
|
+
visibleOn: '!this.disabled'
|
330
|
+
}
|
331
|
+
]
|
332
|
+
}
|
248
333
|
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
334
|
+
// {
|
335
|
+
// type: 'combo',
|
336
|
+
// name: 'definitions',
|
337
|
+
// multiple: true,
|
338
|
+
// multiLine: true,
|
339
|
+
// label: '定义',
|
340
|
+
// description: '定义类型,定义完成后可被子节点引用。',
|
341
|
+
// pipeIn: (value: any) =>
|
342
|
+
// value
|
343
|
+
// ? Object.keys(value).map(key => ({
|
344
|
+
// key,
|
345
|
+
// value: value[key]
|
346
|
+
// }))
|
347
|
+
// : [],
|
348
|
+
// pipeOut: (value: any) =>
|
349
|
+
// Array.isArray(value)
|
350
|
+
// ? value.reduce(
|
351
|
+
// (obj, current) => ({
|
352
|
+
// ...obj,
|
353
|
+
// [current.key || '']: current.value
|
354
|
+
// ? current.value
|
355
|
+
// : {type: 'tpl', tpl: '内容'}
|
356
|
+
// }),
|
357
|
+
// {}
|
358
|
+
// )
|
359
|
+
// : undefined,
|
360
|
+
// items: [
|
361
|
+
// {
|
362
|
+
// type: 'input-text',
|
363
|
+
// name: 'key',
|
364
|
+
// label: 'Key',
|
365
|
+
// required: true
|
366
|
+
// },
|
282
367
|
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
368
|
+
// {
|
369
|
+
// children: ({index}: any) => (
|
370
|
+
// <Button
|
371
|
+
// size="sm"
|
372
|
+
// level="danger"
|
373
|
+
// // onClick={this.handleEditDefinitionDetail.bind(
|
374
|
+
// // this,
|
375
|
+
// // index
|
376
|
+
// // )}
|
377
|
+
// block
|
378
|
+
// >
|
379
|
+
// 配置详情
|
380
|
+
// </Button>
|
381
|
+
// )
|
382
|
+
// }
|
383
|
+
// ]
|
384
|
+
// }
|
385
|
+
]
|
386
|
+
}
|
387
|
+
])
|
388
|
+
];
|
389
|
+
};
|
304
390
|
}
|
305
391
|
|
306
392
|
registerEditorPlugin(PagePlugin);
|
package/src/plugin/Panel.tsx
CHANGED
@@ -115,14 +115,11 @@ export class PanelPlugin extends BasePlugin {
|
|
115
115
|
{
|
116
116
|
title: '外观',
|
117
117
|
body: [
|
118
|
-
{
|
118
|
+
getSchemaTpl('switch', {
|
119
119
|
name: 'affixFooter',
|
120
120
|
label: '固定底部',
|
121
|
-
|
122
|
-
|
123
|
-
mode: 'inline',
|
124
|
-
className: 'block'
|
125
|
-
},
|
121
|
+
value: false
|
122
|
+
}),
|
126
123
|
|
127
124
|
getSchemaTpl('horizontal', {
|
128
125
|
visibleOn:
|
@@ -220,6 +217,7 @@ export class PanelPlugin extends BasePlugin {
|
|
220
217
|
) {
|
221
218
|
const path = context.path;
|
222
219
|
const schema = context.schema;
|
220
|
+
const store = this.manager.store;
|
223
221
|
|
224
222
|
if (
|
225
223
|
context.info.renderer.name === 'form' &&
|
@@ -231,7 +229,8 @@ export class PanelPlugin extends BasePlugin {
|
|
231
229
|
icon: 'fa fa-list-alt',
|
232
230
|
title: this.panelTitle,
|
233
231
|
render: this.manager.makeSchemaFormRender({
|
234
|
-
body: this.panelBodyCreator(context)
|
232
|
+
body: this.panelBodyCreator(context),
|
233
|
+
panelById: store.activeId
|
235
234
|
})
|
236
235
|
});
|
237
236
|
} else {
|
package/src/plugin/Plain.tsx
CHANGED
@@ -58,14 +58,11 @@ export class PlainPlugin extends BasePlugin {
|
|
58
58
|
: {
|
59
59
|
title: '外观',
|
60
60
|
body: [
|
61
|
-
{
|
62
|
-
label: '内联模式',
|
63
|
-
type: 'switch',
|
61
|
+
getSchemaTpl('switch', {
|
64
62
|
name: 'inline',
|
65
|
-
|
66
|
-
className: 'w-full',
|
63
|
+
label: '内联模式',
|
67
64
|
value: true
|
68
|
-
},
|
65
|
+
}),
|
69
66
|
|
70
67
|
getSchemaTpl('className')
|
71
68
|
]
|