amis-editor 4.2.0-beta.2 → 5.1.9-beta.0
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/Editor.d.ts +16 -0
- package/dist/component/RegionWrapper.d.ts +10 -0
- package/dist/component/VRenderer.d.ts +10 -0
- package/dist/component/base/BackTop.d.ts +1 -1
- package/dist/component/control/APIControl.d.ts +1158 -0
- 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 → control}/OptionControl.d.ts +23 -34
- package/dist/component/{Control → control}/PopoverEdit.d.ts +0 -0
- package/dist/component/control/StatusControl.d.ts +44 -0
- package/dist/component/control/SwitchMoreControl.d.ts +224 -0
- package/dist/component/control/ValidationControl.d.ts +65 -0
- 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/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 +55 -28
- 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 +1209 -474
- 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 +78 -136
- 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/dist/component/Control/APIControl.d.ts +0 -504
- package/dist/component/Control/ValidationControl.d.ts +0 -30
- package/dist/component/remarkTpl.d.ts +0 -150
@@ -1,6 +1,10 @@
|
|
1
1
|
import {getSchemaTpl, valuePipeOut} from '../../component/schemaTpl';
|
2
2
|
import {registerEditorPlugin} from '../../manager';
|
3
|
-
import {BasePlugin} from '../../plugin';
|
3
|
+
import {BasePlugin, BaseEventContext} from '../../plugin';
|
4
|
+
import {tipedLabel} from '../../component/control/BaseControl';
|
5
|
+
import {ValidatorTag} from '../../component/validator';
|
6
|
+
import {getEventControlConfig} from '../../util';
|
7
|
+
import {RendererAction, RendererEvent} from '../../event-action';
|
4
8
|
|
5
9
|
export class SwitchControlPlugin extends BasePlugin {
|
6
10
|
// 关联渲染器名字
|
@@ -36,72 +40,180 @@ export class SwitchControlPlugin extends BasePlugin {
|
|
36
40
|
]
|
37
41
|
};
|
38
42
|
|
43
|
+
notRenderFormZone = true;
|
44
|
+
|
39
45
|
panelTitle = '开关';
|
40
|
-
panelBody = [
|
41
|
-
getSchemaTpl('switchDefaultValue', {
|
42
|
-
pipeOut: (value: any, origin: any, data: any) =>
|
43
|
-
value ? data.trueValue : undefined
|
44
|
-
}),
|
45
|
-
{
|
46
|
-
type: 'switch',
|
47
|
-
name: 'value',
|
48
|
-
label: '默认勾选',
|
49
|
-
mode: 'inline',
|
50
|
-
className: 'w-full',
|
51
|
-
visibleOn: 'typeof this.value !== "undefined"',
|
52
|
-
pipeOut: (value: any, origin: any, data: any) =>
|
53
|
-
value ? data.trueValue : data.falseValue
|
54
|
-
},
|
55
|
-
{
|
56
|
-
name: 'option',
|
57
|
-
type: 'input-text',
|
58
|
-
label: '选项说明'
|
59
|
-
},
|
60
|
-
{
|
61
|
-
label: '选项位置',
|
62
|
-
name: 'optionAtLeft',
|
63
|
-
type: 'button-group-select',
|
64
|
-
size: 'sm',
|
65
|
-
value: false,
|
66
|
-
options: [
|
67
|
-
{
|
68
|
-
label: '左',
|
69
|
-
value: true
|
70
|
-
},
|
71
46
|
|
47
|
+
events: RendererEvent[] = [
|
48
|
+
{
|
49
|
+
eventName: 'change',
|
50
|
+
eventLabel: '值变化',
|
51
|
+
description: '开关值变化时触发',
|
52
|
+
dataSchema: [
|
72
53
|
{
|
73
|
-
|
74
|
-
|
54
|
+
type: 'object',
|
55
|
+
properties: {
|
56
|
+
'event.data.value': {
|
57
|
+
type: 'string',
|
58
|
+
title: '开关值'
|
59
|
+
}
|
60
|
+
}
|
75
61
|
}
|
76
62
|
]
|
77
|
-
}
|
78
|
-
|
79
|
-
type: 'input-text',
|
80
|
-
label: '勾选后的值',
|
81
|
-
name: 'trueValue',
|
82
|
-
value: true,
|
83
|
-
pipeOut: valuePipeOut
|
84
|
-
},
|
85
|
-
{
|
86
|
-
type: 'input-text',
|
87
|
-
label: '未勾选的值',
|
88
|
-
name: 'falseValue',
|
89
|
-
value: false,
|
90
|
-
pipeOut: valuePipeOut
|
91
|
-
},
|
92
|
-
|
93
|
-
{
|
94
|
-
name: 'onText',
|
95
|
-
type: 'input-text',
|
96
|
-
label: '开启时的文本'
|
97
|
-
},
|
63
|
+
}
|
64
|
+
];
|
98
65
|
|
66
|
+
// 动作定义
|
67
|
+
actions: RendererAction[] = [
|
99
68
|
{
|
100
|
-
|
101
|
-
|
102
|
-
|
69
|
+
actionType: 'setValue',
|
70
|
+
actionLabel: '赋值',
|
71
|
+
description: '触发组件数据更新'
|
103
72
|
}
|
104
73
|
];
|
74
|
+
|
75
|
+
panelJustify = true;
|
76
|
+
panelBodyCreator = (context: BaseEventContext) =>
|
77
|
+
getSchemaTpl('tabs', [
|
78
|
+
{
|
79
|
+
title: '属性',
|
80
|
+
body: getSchemaTpl('collapseGroup', [
|
81
|
+
{
|
82
|
+
title: '基本',
|
83
|
+
body: [
|
84
|
+
getSchemaTpl('formItemName', {
|
85
|
+
required: true
|
86
|
+
}),
|
87
|
+
getSchemaTpl('label'),
|
88
|
+
|
89
|
+
{
|
90
|
+
name: 'option',
|
91
|
+
type: 'input-text',
|
92
|
+
label: '说明'
|
93
|
+
},
|
94
|
+
|
95
|
+
{
|
96
|
+
type: 'ae-Switch-More',
|
97
|
+
bulk: true,
|
98
|
+
mode: 'normal',
|
99
|
+
label: '填充文本',
|
100
|
+
formType: 'extend',
|
101
|
+
form: {
|
102
|
+
body: [
|
103
|
+
{
|
104
|
+
name: 'onText',
|
105
|
+
type: 'input-text',
|
106
|
+
label: '开启时'
|
107
|
+
},
|
108
|
+
|
109
|
+
{
|
110
|
+
name: 'offText',
|
111
|
+
type: 'input-text',
|
112
|
+
label: '关闭时'
|
113
|
+
}
|
114
|
+
]
|
115
|
+
}
|
116
|
+
},
|
117
|
+
|
118
|
+
{
|
119
|
+
type: 'ae-Switch-More',
|
120
|
+
bulk: true,
|
121
|
+
mode: 'normal',
|
122
|
+
label: tipedLabel(
|
123
|
+
'值格式',
|
124
|
+
'默认勾选后的值 true,未勾选的值 false'
|
125
|
+
),
|
126
|
+
formType: 'extend',
|
127
|
+
form: {
|
128
|
+
body: [
|
129
|
+
{
|
130
|
+
type: 'input-text',
|
131
|
+
label: '勾选后的值',
|
132
|
+
name: 'trueValue',
|
133
|
+
value: true,
|
134
|
+
pipeOut: valuePipeOut,
|
135
|
+
onChange: (
|
136
|
+
value: string,
|
137
|
+
oldValue: string,
|
138
|
+
model: any,
|
139
|
+
form: any
|
140
|
+
) => {
|
141
|
+
if (oldValue === form.getValueByName('value')) {
|
142
|
+
form.setValueByName('value', value);
|
143
|
+
}
|
144
|
+
}
|
145
|
+
},
|
146
|
+
{
|
147
|
+
type: 'input-text',
|
148
|
+
label: '未勾选的值',
|
149
|
+
name: 'falseValue',
|
150
|
+
value: false,
|
151
|
+
pipeOut: valuePipeOut,
|
152
|
+
onChange: (
|
153
|
+
value: string,
|
154
|
+
oldValue: string,
|
155
|
+
model: any,
|
156
|
+
form: any
|
157
|
+
) => {
|
158
|
+
if (oldValue === form.getValueByName('value')) {
|
159
|
+
form.setValueByName('value', value);
|
160
|
+
}
|
161
|
+
}
|
162
|
+
}
|
163
|
+
]
|
164
|
+
}
|
165
|
+
},
|
166
|
+
|
167
|
+
getSchemaTpl('switch', {
|
168
|
+
name: 'value',
|
169
|
+
label: '默认开启',
|
170
|
+
pipeIn: (value: any, data: any) => {
|
171
|
+
const {trueValue = true} = data.data || {};
|
172
|
+
return value === trueValue ? true : false;
|
173
|
+
},
|
174
|
+
pipeOut: (value: any, origin: any, data: any) => {
|
175
|
+
return value
|
176
|
+
? data.trueValue || true
|
177
|
+
: data.falseValue || false;
|
178
|
+
}
|
179
|
+
}),
|
180
|
+
getSchemaTpl('labelRemark'),
|
181
|
+
getSchemaTpl('remark'),
|
182
|
+
getSchemaTpl('description')
|
183
|
+
]
|
184
|
+
},
|
185
|
+
getSchemaTpl('status', {isFormItem: true}),
|
186
|
+
getSchemaTpl('validation', {tag: ValidatorTag.Check})
|
187
|
+
])
|
188
|
+
},
|
189
|
+
{
|
190
|
+
title: '外观',
|
191
|
+
body: getSchemaTpl('collapseGroup', [
|
192
|
+
getSchemaTpl('style:formItem', {renderer: context.info.renderer}),
|
193
|
+
{
|
194
|
+
title: '说明',
|
195
|
+
body: [
|
196
|
+
getSchemaTpl('horizontal-align', {
|
197
|
+
name: 'optionAtLeft',
|
198
|
+
pipeIn: (v: boolean) => (v ? 'left' : 'right'),
|
199
|
+
pipeOut: (v: string) => (v === 'left' ? true : undefined)
|
200
|
+
})
|
201
|
+
]
|
202
|
+
},
|
203
|
+
getSchemaTpl('style:classNames')
|
204
|
+
])
|
205
|
+
},
|
206
|
+
{
|
207
|
+
title: '事件',
|
208
|
+
className: 'p-none',
|
209
|
+
body: [
|
210
|
+
getSchemaTpl('eventControl', {
|
211
|
+
name: 'onEvent',
|
212
|
+
...getEventControlConfig(this.manager, context)
|
213
|
+
})
|
214
|
+
]
|
215
|
+
}
|
216
|
+
]);
|
105
217
|
}
|
106
218
|
|
107
219
|
registerEditorPlugin(SwitchControlPlugin);
|
@@ -1,6 +1,9 @@
|
|
1
|
+
import React from 'react';
|
1
2
|
import {getSchemaTpl} from '../../component/schemaTpl';
|
2
3
|
import {registerEditorPlugin} from '../../manager';
|
3
|
-
import {BasePlugin} from '../../plugin';
|
4
|
+
import {BasePlugin, BaseEventContext} from '../../plugin';
|
5
|
+
import {getEventControlConfig} from '../../util';
|
6
|
+
import {RendererAction, RendererEvent} from '../../event-action';
|
4
7
|
|
5
8
|
export class TabsTransferPlugin extends BasePlugin {
|
6
9
|
// 关联渲染器名字
|
@@ -126,6 +129,90 @@ export class TabsTransferPlugin extends BasePlugin {
|
|
126
129
|
};
|
127
130
|
|
128
131
|
panelTitle = '组合穿梭器';
|
132
|
+
|
133
|
+
events: RendererEvent[] = [
|
134
|
+
{
|
135
|
+
eventName: 'change',
|
136
|
+
eventLabel: '值变化',
|
137
|
+
description: '选中值变化时触发',
|
138
|
+
dataSchema: [
|
139
|
+
{
|
140
|
+
type: 'object',
|
141
|
+
properties: {
|
142
|
+
'event.data.value': {
|
143
|
+
type: 'string',
|
144
|
+
title: '选中值'
|
145
|
+
}
|
146
|
+
}
|
147
|
+
}
|
148
|
+
]
|
149
|
+
},
|
150
|
+
{
|
151
|
+
eventName: 'selectAll',
|
152
|
+
eventLabel: '全选',
|
153
|
+
description: '选中所有选项',
|
154
|
+
dataSchema: [
|
155
|
+
{
|
156
|
+
type: 'object',
|
157
|
+
properties: {
|
158
|
+
'event.data.value': {
|
159
|
+
type: 'string',
|
160
|
+
title: '选中值'
|
161
|
+
}
|
162
|
+
}
|
163
|
+
}
|
164
|
+
]
|
165
|
+
},
|
166
|
+
{
|
167
|
+
eventName: 'tab-change',
|
168
|
+
eventLabel: '选项卡切换',
|
169
|
+
description: '选项卡切换时触发',
|
170
|
+
dataSchema: [
|
171
|
+
{
|
172
|
+
type: 'object',
|
173
|
+
properties: {
|
174
|
+
'event.data.key': {
|
175
|
+
type: 'string',
|
176
|
+
title: '当前激活的选项卡索引'
|
177
|
+
}
|
178
|
+
}
|
179
|
+
}
|
180
|
+
]
|
181
|
+
}
|
182
|
+
];
|
183
|
+
|
184
|
+
// 动作定义
|
185
|
+
actions: RendererAction[] = [
|
186
|
+
{
|
187
|
+
actionType: 'clear',
|
188
|
+
actionLabel: '清空',
|
189
|
+
description: '清空选中内容'
|
190
|
+
},
|
191
|
+
{
|
192
|
+
actionType: 'reset',
|
193
|
+
actionLabel: '重置',
|
194
|
+
description: '重置选择的内容'
|
195
|
+
},
|
196
|
+
{
|
197
|
+
actionType: 'changeTabKey',
|
198
|
+
actionLabel: '修改选中tab',
|
199
|
+
description: '修改当前选中tab,来选择其他选项',
|
200
|
+
desc: (info: any) => {
|
201
|
+
return (
|
202
|
+
<div>
|
203
|
+
<span className="variable-right">{info?.__rendererLabel}</span>
|
204
|
+
修改选中tab
|
205
|
+
</div>
|
206
|
+
);
|
207
|
+
}
|
208
|
+
},
|
209
|
+
{
|
210
|
+
actionType: 'setValue',
|
211
|
+
actionLabel: '赋值',
|
212
|
+
description: '触发组件数据更新'
|
213
|
+
}
|
214
|
+
];
|
215
|
+
|
129
216
|
panelDefinitions = {
|
130
217
|
options: {
|
131
218
|
label: '选项 Options',
|
@@ -168,92 +255,101 @@ export class TabsTransferPlugin extends BasePlugin {
|
|
168
255
|
}
|
169
256
|
};
|
170
257
|
|
171
|
-
|
172
|
-
getSchemaTpl('switchDefaultValue'),
|
258
|
+
// notRenderFormZone = true;
|
173
259
|
|
174
|
-
|
175
|
-
|
176
|
-
name: 'value',
|
177
|
-
label: '默认值',
|
178
|
-
source: '${options}',
|
179
|
-
multiple: true,
|
180
|
-
visibleOn: 'typeof this.value !== "undefined"'
|
181
|
-
},
|
260
|
+
panelBodyCreator = (context: BaseEventContext) => {
|
261
|
+
const renderer: any = context.info.renderer;
|
182
262
|
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
className: 'w-full'
|
189
|
-
},
|
263
|
+
return getSchemaTpl('tabs', [
|
264
|
+
{
|
265
|
+
title: '属性',
|
266
|
+
body: getSchemaTpl('collapseGroup', [
|
267
|
+
getSchemaTpl('switchDefaultValue'),
|
190
268
|
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
269
|
+
{
|
270
|
+
type: 'select',
|
271
|
+
name: 'value',
|
272
|
+
label: '默认值',
|
273
|
+
source: '${options}',
|
274
|
+
multiple: true,
|
275
|
+
visibleOn: 'typeof this.value !== "undefined"'
|
276
|
+
},
|
195
277
|
|
196
|
-
|
197
|
-
label: '查询时勾选展示模式',
|
198
|
-
name: 'searchResultMode',
|
199
|
-
type: 'select',
|
200
|
-
mode: 'inline',
|
201
|
-
className: 'w-full',
|
202
|
-
options: [
|
203
|
-
{
|
204
|
-
label: '列表形式',
|
205
|
-
value: 'list'
|
206
|
-
},
|
207
|
-
{
|
208
|
-
label: '表格形式',
|
209
|
-
value: 'table'
|
210
|
-
},
|
211
|
-
{
|
212
|
-
label: '树形选择形式',
|
213
|
-
value: 'tree'
|
214
|
-
},
|
215
|
-
{
|
216
|
-
label: '级联选择形式',
|
217
|
-
value: 'chained'
|
218
|
-
}
|
219
|
-
]
|
220
|
-
},
|
278
|
+
getSchemaTpl('searchable'),
|
221
279
|
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
mode: 'inline',
|
227
|
-
className: 'w-full'
|
228
|
-
},
|
280
|
+
getSchemaTpl('api', {
|
281
|
+
label: '检索接口',
|
282
|
+
name: 'searchApi'
|
283
|
+
}),
|
229
284
|
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
285
|
+
{
|
286
|
+
label: '查询时勾选展示模式',
|
287
|
+
name: 'searchResultMode',
|
288
|
+
type: 'select',
|
289
|
+
mode: 'inline',
|
290
|
+
className: 'w-full',
|
291
|
+
options: [
|
292
|
+
{
|
293
|
+
label: '列表形式',
|
294
|
+
value: 'list'
|
295
|
+
},
|
296
|
+
{
|
297
|
+
label: '表格形式',
|
298
|
+
value: 'table'
|
299
|
+
},
|
300
|
+
{
|
301
|
+
label: '树形选择形式',
|
302
|
+
value: 'tree'
|
303
|
+
},
|
304
|
+
{
|
305
|
+
label: '级联选择形式',
|
306
|
+
value: 'chained'
|
307
|
+
}
|
308
|
+
]
|
309
|
+
},
|
235
310
|
|
236
|
-
|
237
|
-
label: '右侧结果的标题文字',
|
238
|
-
name: 'resultTitle',
|
239
|
-
type: 'input-text'
|
240
|
-
},
|
311
|
+
getSchemaTpl('sortable'),
|
241
312
|
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
313
|
+
{
|
314
|
+
label: '左侧的标题文字',
|
315
|
+
name: 'selectTitle',
|
316
|
+
type: 'input-text'
|
317
|
+
},
|
318
|
+
|
319
|
+
{
|
320
|
+
label: '右侧结果的标题文字',
|
321
|
+
name: 'resultTitle',
|
322
|
+
type: 'input-text'
|
323
|
+
},
|
324
|
+
|
325
|
+
getSchemaTpl('fieldSet', {
|
326
|
+
title: '选项',
|
327
|
+
body: [
|
328
|
+
{
|
329
|
+
$ref: 'options',
|
330
|
+
name: 'options'
|
331
|
+
},
|
332
|
+
getSchemaTpl('source'),
|
333
|
+
getSchemaTpl('joinValues'),
|
334
|
+
getSchemaTpl('delimiter'),
|
335
|
+
getSchemaTpl('extractValue'),
|
336
|
+
getSchemaTpl('autoFill')
|
337
|
+
]
|
338
|
+
})
|
339
|
+
])
|
340
|
+
},
|
341
|
+
{
|
342
|
+
title: '事件',
|
343
|
+
className: 'p-none',
|
344
|
+
body: [
|
345
|
+
getSchemaTpl('eventControl', {
|
346
|
+
name: 'onEvent',
|
347
|
+
...getEventControlConfig(this.manager, context)
|
348
|
+
})
|
349
|
+
]
|
350
|
+
}
|
351
|
+
]);
|
352
|
+
};
|
257
353
|
}
|
258
354
|
|
259
355
|
registerEditorPlugin(TabsTransferPlugin);
|