amis-editor 4.2.0-beta.2 → 5.1.9-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
package/src/plugin/CRUD.tsx
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {toast} from 'amis';
|
|
2
|
-
|
|
3
2
|
import get from 'lodash/get';
|
|
4
3
|
import cloneDeep from 'lodash/cloneDeep';
|
|
5
4
|
import React from 'react';
|
|
@@ -23,6 +22,7 @@ import {isObject, JSONPipeIn} from '../util';
|
|
|
23
22
|
import {setVariable} from 'amis-core';
|
|
24
23
|
import {ActionSchema} from 'amis/lib/renderers/Action';
|
|
25
24
|
import {getEnv} from 'mobx-state-tree';
|
|
25
|
+
import {EditorNodeType} from '../store/node';
|
|
26
26
|
import {normalizeApi} from 'amis-core';
|
|
27
27
|
|
|
28
28
|
interface ColumnItem {
|
|
@@ -82,10 +82,10 @@ export class CRUDPlugin extends BasePlugin {
|
|
|
82
82
|
total: 0
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
-
if (Array.isArray(schema
|
|
85
|
+
if (Array.isArray(schema?.columns)) {
|
|
86
86
|
const item = {};
|
|
87
87
|
schema.columns.forEach((control: any) => {
|
|
88
|
-
if (control
|
|
88
|
+
if (control?.name) {
|
|
89
89
|
setVariable(item, control.name, 'sample');
|
|
90
90
|
}
|
|
91
91
|
});
|
|
@@ -209,33 +209,19 @@ export class CRUDPlugin extends BasePlugin {
|
|
|
209
209
|
body: [
|
|
210
210
|
getSchemaTpl('api', {
|
|
211
211
|
label: '接口地址',
|
|
212
|
-
sampleBuilder: (schema: any) =>
|
|
213
|
-
|
|
214
|
-
items: [],
|
|
215
|
-
total: 0
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
if (Array.isArray(schema.columns)) {
|
|
219
|
-
const item = {};
|
|
220
|
-
schema.columns.forEach((control: any) => {
|
|
221
|
-
if (control.name) {
|
|
222
|
-
setVariable(item, control.name, 'sample');
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
data.items.push(item);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
return JSON.stringify(
|
|
212
|
+
sampleBuilder: (schema: any) =>
|
|
213
|
+
JSON.stringify(
|
|
230
214
|
{
|
|
231
215
|
status: 0,
|
|
232
216
|
msg: '',
|
|
233
|
-
data:
|
|
217
|
+
data: [
|
|
218
|
+
{id: 1, name: 'Jack'},
|
|
219
|
+
{id: 2, name: 'Rose'}
|
|
220
|
+
]
|
|
234
221
|
},
|
|
235
222
|
null,
|
|
236
223
|
2
|
|
237
|
-
)
|
|
238
|
-
}
|
|
224
|
+
)
|
|
239
225
|
}),
|
|
240
226
|
{
|
|
241
227
|
type: 'button',
|
|
@@ -397,7 +383,7 @@ export class CRUDPlugin extends BasePlugin {
|
|
|
397
383
|
|
|
398
384
|
valueSchema.bulkActions = [];
|
|
399
385
|
/** 统一api格式 */
|
|
400
|
-
valueSchema.api = normalizeApi(valueSchema.api);
|
|
386
|
+
valueSchema.api = typeof valueSchema.api === 'string' ? valueSchema.api : normalizeApi(valueSchema.api);
|
|
401
387
|
hasFeatures &&
|
|
402
388
|
features.forEach((item: string) => {
|
|
403
389
|
if (itemBtns.includes(item)) {
|
|
@@ -554,11 +540,8 @@ export class CRUDPlugin extends BasePlugin {
|
|
|
554
540
|
{
|
|
555
541
|
title: '常规',
|
|
556
542
|
body: [
|
|
557
|
-
{
|
|
543
|
+
getSchemaTpl('switch', {
|
|
558
544
|
name: 'filter',
|
|
559
|
-
type: 'switch',
|
|
560
|
-
mode: 'inline',
|
|
561
|
-
className: 'block',
|
|
562
545
|
label: '启用查询条件',
|
|
563
546
|
pipeIn: (value: any) => !!value,
|
|
564
547
|
pipeOut: (value: any, originValue: any) => {
|
|
@@ -582,7 +565,7 @@ export class CRUDPlugin extends BasePlugin {
|
|
|
582
565
|
|
|
583
566
|
return null;
|
|
584
567
|
}
|
|
585
|
-
},
|
|
568
|
+
}),
|
|
586
569
|
|
|
587
570
|
{
|
|
588
571
|
type: 'divider'
|
|
@@ -632,14 +615,12 @@ export class CRUDPlugin extends BasePlugin {
|
|
|
632
615
|
]
|
|
633
616
|
},
|
|
634
617
|
|
|
635
|
-
// {
|
|
636
|
-
//
|
|
637
|
-
//
|
|
638
|
-
//
|
|
639
|
-
//
|
|
640
|
-
//
|
|
641
|
-
// pipeIn: defaultValue(false)
|
|
642
|
-
// },
|
|
618
|
+
// getSchemaTpl('switch', {
|
|
619
|
+
// name: 'defaultChecked',
|
|
620
|
+
// label: '默认是否全部勾选',
|
|
621
|
+
// visibleOn: 'data.bulkActions && data.bulkActions.length',
|
|
622
|
+
// pipeIn: defaultValue(false)
|
|
623
|
+
// }),
|
|
643
624
|
|
|
644
625
|
{
|
|
645
626
|
type: 'divider'
|
|
@@ -700,12 +681,9 @@ export class CRUDPlugin extends BasePlugin {
|
|
|
700
681
|
hiddenOn: 'this.mode && this.mode !== "table" || this.pickerMode'
|
|
701
682
|
},
|
|
702
683
|
|
|
703
|
-
{
|
|
684
|
+
getSchemaTpl('switch', {
|
|
704
685
|
name: 'syncLocation',
|
|
705
686
|
label: '同步地址栏',
|
|
706
|
-
type: 'switch',
|
|
707
|
-
mode: 'inline',
|
|
708
|
-
className: 'block',
|
|
709
687
|
pipeIn: defaultValue(true),
|
|
710
688
|
labelRemark: {
|
|
711
689
|
className: 'm-l-xs',
|
|
@@ -715,7 +693,7 @@ export class CRUDPlugin extends BasePlugin {
|
|
|
715
693
|
'开启后会把查询条件数据和分页信息同步到地址栏中,页面中出现多个时,建议只保留一个同步地址栏,否则会相互影响。',
|
|
716
694
|
placement: 'left'
|
|
717
695
|
}
|
|
718
|
-
},
|
|
696
|
+
}),
|
|
719
697
|
|
|
720
698
|
{
|
|
721
699
|
label: '默认参数',
|
|
@@ -734,12 +712,9 @@ export class CRUDPlugin extends BasePlugin {
|
|
|
734
712
|
type: 'divider'
|
|
735
713
|
},
|
|
736
714
|
|
|
737
|
-
{
|
|
715
|
+
getSchemaTpl('switch', {
|
|
738
716
|
name: 'keepItemSelectionOnPageChange',
|
|
739
717
|
label: '保留条目选择',
|
|
740
|
-
type: 'switch',
|
|
741
|
-
mode: 'inline',
|
|
742
|
-
className: 'block',
|
|
743
718
|
visbileOn:
|
|
744
719
|
'this.bulkActions && this.bulkActions.length || this.itemActions && this.itemActions.length',
|
|
745
720
|
labelRemark: {
|
|
@@ -750,7 +725,7 @@ export class CRUDPlugin extends BasePlugin {
|
|
|
750
725
|
'默认分页、搜索后,用户选择条目会被清空,开启此选项后会保留用户选择,可以实现跨页面批量操作。',
|
|
751
726
|
placement: 'left'
|
|
752
727
|
}
|
|
753
|
-
},
|
|
728
|
+
}),
|
|
754
729
|
|
|
755
730
|
{
|
|
756
731
|
name: 'labelTpl',
|
|
@@ -782,23 +757,20 @@ export class CRUDPlugin extends BasePlugin {
|
|
|
782
757
|
body: [
|
|
783
758
|
getSchemaTpl('api', {
|
|
784
759
|
label: '数据拉取接口',
|
|
785
|
-
sampleBuilder: (
|
|
760
|
+
sampleBuilder: () => {
|
|
786
761
|
const data: any = {
|
|
787
762
|
items: [],
|
|
788
763
|
total: 0
|
|
789
764
|
};
|
|
765
|
+
const columns: any[] = context?.schema?.columns ?? [];
|
|
766
|
+
const row = {};
|
|
790
767
|
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
});
|
|
798
|
-
|
|
799
|
-
data.items.push(item);
|
|
800
|
-
}
|
|
801
|
-
|
|
768
|
+
columns.forEach(column => {
|
|
769
|
+
if (column.name) {
|
|
770
|
+
setVariable(row, column.name, 'sample');
|
|
771
|
+
}
|
|
772
|
+
});
|
|
773
|
+
data.items.push(row);
|
|
802
774
|
return JSON.stringify(
|
|
803
775
|
{
|
|
804
776
|
status: 0,
|
|
@@ -847,12 +819,9 @@ export class CRUDPlugin extends BasePlugin {
|
|
|
847
819
|
className: 'm-t-n-sm'
|
|
848
820
|
},
|
|
849
821
|
|
|
850
|
-
{
|
|
822
|
+
getSchemaTpl('switch', {
|
|
851
823
|
name: 'loadDataOnce',
|
|
852
824
|
label: '一次性拉取',
|
|
853
|
-
type: 'switch',
|
|
854
|
-
mode: 'inline',
|
|
855
|
-
className: 'block',
|
|
856
825
|
labelRemark: {
|
|
857
826
|
className: 'm-l-xs',
|
|
858
827
|
trigger: 'click',
|
|
@@ -861,18 +830,15 @@ export class CRUDPlugin extends BasePlugin {
|
|
|
861
830
|
'开启后,数据只会在初始的时候拉取,后续分页、排序不再请求接口,都由前端直接完成。',
|
|
862
831
|
placement: 'left'
|
|
863
832
|
}
|
|
864
|
-
},
|
|
833
|
+
}),
|
|
865
834
|
|
|
866
|
-
{
|
|
835
|
+
getSchemaTpl('switch', {
|
|
867
836
|
label: '开启定时刷新',
|
|
868
|
-
type: 'switch',
|
|
869
837
|
name: 'interval',
|
|
870
838
|
visibleOn: 'data.api',
|
|
871
839
|
pipeIn: (value: any) => !!value,
|
|
872
|
-
pipeOut: (value: any) => (value ? 3000 : undefined)
|
|
873
|
-
|
|
874
|
-
className: 'block'
|
|
875
|
-
},
|
|
840
|
+
pipeOut: (value: any) => (value ? 3000 : undefined)
|
|
841
|
+
}),
|
|
876
842
|
|
|
877
843
|
{
|
|
878
844
|
name: 'interval',
|
|
@@ -883,14 +849,12 @@ export class CRUDPlugin extends BasePlugin {
|
|
|
883
849
|
description: '设置后将自动定时刷新,单位 ms'
|
|
884
850
|
},
|
|
885
851
|
|
|
886
|
-
{
|
|
852
|
+
getSchemaTpl('switch', {
|
|
887
853
|
name: 'silentPolling',
|
|
888
854
|
label: '静默刷新',
|
|
889
|
-
type: 'switch',
|
|
890
|
-
mode: 'inline',
|
|
891
855
|
visibleOn: '!!data.interval',
|
|
892
856
|
description: '设置自动定时刷新时是否显示loading'
|
|
893
|
-
},
|
|
857
|
+
}),
|
|
894
858
|
|
|
895
859
|
{
|
|
896
860
|
name: 'stopAutoRefreshWhen',
|
|
@@ -901,27 +865,21 @@ export class CRUDPlugin extends BasePlugin {
|
|
|
901
865
|
'定时刷新一旦设置会一直刷新,除非给出表达式,条件满足后则不刷新了。'
|
|
902
866
|
},
|
|
903
867
|
|
|
904
|
-
{
|
|
868
|
+
getSchemaTpl('switch', {
|
|
905
869
|
name: 'stopAutoRefreshWhenModalIsOpen',
|
|
906
870
|
label: '当有弹框时关闭自动刷新',
|
|
907
|
-
type: 'switch',
|
|
908
871
|
visibleOn: '!!data.interval',
|
|
909
|
-
mode: 'inline',
|
|
910
|
-
className: 'block',
|
|
911
872
|
description: '弹框打开关闭自动刷新,关闭弹框又恢复'
|
|
912
|
-
},
|
|
873
|
+
}),
|
|
913
874
|
|
|
914
875
|
{
|
|
915
876
|
type: 'divider'
|
|
916
877
|
},
|
|
917
878
|
|
|
918
|
-
{
|
|
879
|
+
getSchemaTpl('switch', {
|
|
919
880
|
name: 'draggable',
|
|
920
|
-
label: '是否可拖拽排序'
|
|
921
|
-
|
|
922
|
-
mode: 'inline',
|
|
923
|
-
className: 'block'
|
|
924
|
-
},
|
|
881
|
+
label: '是否可拖拽排序'
|
|
882
|
+
}),
|
|
925
883
|
|
|
926
884
|
getSchemaTpl('api', {
|
|
927
885
|
label: '顺序保存接口',
|
|
@@ -1502,49 +1460,34 @@ export class CRUDPlugin extends BasePlugin {
|
|
|
1502
1460
|
]
|
|
1503
1461
|
},
|
|
1504
1462
|
|
|
1505
|
-
{
|
|
1463
|
+
getSchemaTpl('switch', {
|
|
1506
1464
|
name: 'filterTogglable',
|
|
1507
|
-
type: 'switch',
|
|
1508
1465
|
label: '是否可显隐查询条件',
|
|
1509
|
-
mode: 'inline',
|
|
1510
|
-
className: 'block',
|
|
1511
1466
|
visibleOn: 'data.filter'
|
|
1512
|
-
},
|
|
1467
|
+
}),
|
|
1513
1468
|
|
|
1514
|
-
{
|
|
1469
|
+
getSchemaTpl('switch', {
|
|
1515
1470
|
name: 'filterDefaultVisible',
|
|
1516
|
-
type: 'switch',
|
|
1517
1471
|
label: '查询条件默认是否可见',
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
visibleOn: 'data.filter && data.filterTogglable'
|
|
1522
|
-
},
|
|
1472
|
+
visibleOn: 'data.filter && data.filterTogglable',
|
|
1473
|
+
pipeIn: defaultValue(true)
|
|
1474
|
+
}),
|
|
1523
1475
|
|
|
1524
|
-
{
|
|
1476
|
+
getSchemaTpl('switch', {
|
|
1525
1477
|
name: 'hideQuickSaveBtn',
|
|
1526
|
-
label: '隐藏顶部快速保存提示'
|
|
1527
|
-
|
|
1528
|
-
mode: 'inline',
|
|
1529
|
-
className: 'block'
|
|
1530
|
-
},
|
|
1478
|
+
label: '隐藏顶部快速保存提示'
|
|
1479
|
+
}),
|
|
1531
1480
|
|
|
1532
|
-
{
|
|
1481
|
+
getSchemaTpl('switch', {
|
|
1533
1482
|
name: 'alwaysShowPagination',
|
|
1534
|
-
label: '是否总是显示分页'
|
|
1535
|
-
|
|
1536
|
-
mode: 'inline',
|
|
1537
|
-
className: 'block'
|
|
1538
|
-
},
|
|
1483
|
+
label: '是否总是显示分页'
|
|
1484
|
+
}),
|
|
1539
1485
|
|
|
1540
|
-
{
|
|
1486
|
+
getSchemaTpl('switch', {
|
|
1541
1487
|
name: 'hideCheckToggler',
|
|
1542
|
-
type: 'switch',
|
|
1543
1488
|
label: '隐藏选择按钮',
|
|
1544
|
-
mode: 'inline',
|
|
1545
|
-
className: 'block',
|
|
1546
1489
|
visibleOn: 'data.checkOnItemClick'
|
|
1547
|
-
},
|
|
1490
|
+
}),
|
|
1548
1491
|
|
|
1549
1492
|
getSchemaTpl('className'),
|
|
1550
1493
|
|
|
@@ -1573,13 +1516,10 @@ export class CRUDPlugin extends BasePlugin {
|
|
|
1573
1516
|
type: 'input-number'
|
|
1574
1517
|
},
|
|
1575
1518
|
|
|
1576
|
-
{
|
|
1519
|
+
getSchemaTpl('switch', {
|
|
1577
1520
|
name: 'keepItemSelectionOnPageChange',
|
|
1578
|
-
label: '翻页时保留选择'
|
|
1579
|
-
|
|
1580
|
-
mode: 'inline',
|
|
1581
|
-
className: 'block'
|
|
1582
|
-
},
|
|
1521
|
+
label: '翻页时保留选择'
|
|
1522
|
+
}),
|
|
1583
1523
|
|
|
1584
1524
|
{
|
|
1585
1525
|
name: 'maxKeepItemSelectionLength',
|
|
@@ -1640,33 +1580,24 @@ export class CRUDPlugin extends BasePlugin {
|
|
|
1640
1580
|
'data.bulkActions && data.bulkActions.length || data.pickerMode'
|
|
1641
1581
|
},
|
|
1642
1582
|
|
|
1643
|
-
{
|
|
1583
|
+
getSchemaTpl('switch', {
|
|
1644
1584
|
name: 'checkOnItemClick',
|
|
1645
|
-
type: 'switch',
|
|
1646
1585
|
label: '开启单条点击整个区域选中',
|
|
1647
|
-
mode: 'inline',
|
|
1648
|
-
className: 'block',
|
|
1649
1586
|
visibleOn:
|
|
1650
1587
|
'data.bulkActions && data.bulkActions.length || data.pickerMode'
|
|
1651
|
-
},
|
|
1588
|
+
}),
|
|
1652
1589
|
|
|
1653
|
-
{
|
|
1590
|
+
getSchemaTpl('switch', {
|
|
1654
1591
|
name: 'autoJumpToTopOnPagerChange',
|
|
1655
|
-
type: 'switch',
|
|
1656
1592
|
label: '自动跳顶部',
|
|
1657
|
-
mode: 'inline',
|
|
1658
|
-
className: 'block',
|
|
1659
1593
|
description: '当切分页的时候,是否自动跳顶部'
|
|
1660
|
-
},
|
|
1594
|
+
}),
|
|
1661
1595
|
|
|
1662
|
-
{
|
|
1596
|
+
getSchemaTpl('switch', {
|
|
1663
1597
|
name: 'syncResponse2Query',
|
|
1664
|
-
type: 'switch',
|
|
1665
1598
|
label: '同步查询条件',
|
|
1666
|
-
mode: 'inline',
|
|
1667
|
-
className: 'block',
|
|
1668
1599
|
description: '查询后将返回的数据同步到查询条件上'
|
|
1669
|
-
}
|
|
1600
|
+
})
|
|
1670
1601
|
]
|
|
1671
1602
|
}
|
|
1672
1603
|
]);
|
|
@@ -1830,6 +1761,17 @@ export class CRUDPlugin extends BasePlugin {
|
|
|
1830
1761
|
}, 20);
|
|
1831
1762
|
}
|
|
1832
1763
|
}
|
|
1764
|
+
|
|
1765
|
+
async buildDataSchemas(node: EditorNodeType, region?: EditorNodeType) {
|
|
1766
|
+
const child: EditorNodeType = node.children.find(
|
|
1767
|
+
item => !!~['table', 'table2', 'cards', 'list'].indexOf(item.type)
|
|
1768
|
+
);
|
|
1769
|
+
|
|
1770
|
+
if (!child?.info?.plugin?.buildDataSchemas) {
|
|
1771
|
+
return;
|
|
1772
|
+
}
|
|
1773
|
+
return child.info.plugin.buildDataSchemas(child);
|
|
1774
|
+
}
|
|
1833
1775
|
}
|
|
1834
1776
|
|
|
1835
1777
|
registerEditorPlugin(CRUDPlugin);
|
package/src/plugin/Card.tsx
CHANGED
package/src/plugin/Cards.tsx
CHANGED
|
@@ -126,22 +126,18 @@ export class CardsPlugin extends BasePlugin {
|
|
|
126
126
|
{
|
|
127
127
|
title: '外观',
|
|
128
128
|
body: [
|
|
129
|
-
{
|
|
129
|
+
getSchemaTpl('switch', {
|
|
130
130
|
name: 'showHeader',
|
|
131
|
-
type: 'switch',
|
|
132
|
-
mode: 'inline',
|
|
133
|
-
className: 'block',
|
|
134
131
|
label: '是否显示头部',
|
|
135
132
|
pipeIn: defaultValue(true)
|
|
136
|
-
},
|
|
137
|
-
|
|
133
|
+
}),
|
|
134
|
+
|
|
135
|
+
getSchemaTpl('switch', {
|
|
138
136
|
name: 'showFooter',
|
|
139
|
-
type: 'switch',
|
|
140
|
-
mode: 'inline',
|
|
141
|
-
className: 'block',
|
|
142
137
|
label: '是否显示底部',
|
|
143
138
|
pipeIn: defaultValue(true)
|
|
144
|
-
},
|
|
139
|
+
}),
|
|
140
|
+
|
|
145
141
|
getSchemaTpl('className', {
|
|
146
142
|
label: 'CSS 类名'
|
|
147
143
|
}),
|
|
@@ -172,12 +168,10 @@ export class CardsPlugin extends BasePlugin {
|
|
|
172
168
|
label: '每行显示个数',
|
|
173
169
|
description: '不设置时,由卡片 CSS 类名决定'
|
|
174
170
|
},
|
|
175
|
-
{
|
|
171
|
+
getSchemaTpl('switch', {
|
|
176
172
|
name: 'masonryLayout',
|
|
177
|
-
type: 'switch',
|
|
178
|
-
mode: 'inline',
|
|
179
173
|
label: '启用瀑布流'
|
|
180
|
-
}
|
|
174
|
+
})
|
|
181
175
|
]
|
|
182
176
|
},
|
|
183
177
|
{
|
package/src/plugin/Carousel.tsx
CHANGED
package/src/plugin/Chart.tsx
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
import {defaultValue, getSchemaTpl} from '../component/schemaTpl';
|
|
11
11
|
import {diff} from '../util';
|
|
12
12
|
import AMisCodeEditor from '../component/Panel/AMisCodeEditor';
|
|
13
|
+
import {RendererAction} from '../event-action';
|
|
13
14
|
|
|
14
15
|
const ChartConfigEditor = ({value, onChange}: any) => {
|
|
15
16
|
return (
|
|
@@ -55,6 +56,20 @@ export class ChartPlugin extends BasePlugin {
|
|
|
55
56
|
...this.scaffold
|
|
56
57
|
};
|
|
57
58
|
|
|
59
|
+
// 动作定义
|
|
60
|
+
actions: RendererAction[] = [
|
|
61
|
+
{
|
|
62
|
+
actionType: 'reload',
|
|
63
|
+
actionLabel: '重新加载',
|
|
64
|
+
description: '触发组件数据刷新并重新渲染'
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
actionType: 'setValue',
|
|
68
|
+
actionLabel: '更新数据',
|
|
69
|
+
description: '触发组件数据更新'
|
|
70
|
+
}
|
|
71
|
+
];
|
|
72
|
+
|
|
58
73
|
panelTitle = '图表';
|
|
59
74
|
panelBodyCreator = (context: BaseEventContext) => {
|
|
60
75
|
return [
|
|
@@ -67,15 +82,14 @@ export class ChartPlugin extends BasePlugin {
|
|
|
67
82
|
description:
|
|
68
83
|
'接口可以返回配置,或者数据,建议返回数据可映射到 Echarts 配置中'
|
|
69
84
|
}),
|
|
70
|
-
|
|
85
|
+
|
|
86
|
+
getSchemaTpl('switch', {
|
|
71
87
|
label: '初始是否拉取',
|
|
72
|
-
type: 'switch',
|
|
73
88
|
name: 'initFetch',
|
|
74
89
|
visibleOn: 'data.api',
|
|
75
|
-
pipeIn: defaultValue(true)
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
},
|
|
90
|
+
pipeIn: defaultValue(true)
|
|
91
|
+
}),
|
|
92
|
+
|
|
79
93
|
{
|
|
80
94
|
name: 'interval',
|
|
81
95
|
label: '定时刷新间隔',
|
|
@@ -144,8 +158,10 @@ export class ChartPlugin extends BasePlugin {
|
|
|
144
158
|
<pre>debugger; // 可以浏览器中断点调试\n\n// 查看原始数据\nconsole.log(config)\n\n// 返回新的结果 \nreturn {}</pre>
|
|
145
159
|
`
|
|
146
160
|
},
|
|
147
|
-
|
|
148
|
-
|
|
161
|
+
|
|
162
|
+
getSchemaTpl('switch', {
|
|
163
|
+
label: 'Chart 配置完全替换',
|
|
164
|
+
name: 'replaceChartOption',
|
|
149
165
|
labelRemark: {
|
|
150
166
|
trigger: 'click',
|
|
151
167
|
className: 'm-l-xs',
|
|
@@ -153,12 +169,8 @@ export class ChartPlugin extends BasePlugin {
|
|
|
153
169
|
content:
|
|
154
170
|
'默认为追加模式,新的配置会跟旧的配置合并,如果勾选将直接完全覆盖。',
|
|
155
171
|
placement: 'left'
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
type: 'switch',
|
|
159
|
-
mode: 'inline',
|
|
160
|
-
className: 'block'
|
|
161
|
-
}
|
|
172
|
+
}
|
|
173
|
+
})
|
|
162
174
|
]
|
|
163
175
|
},
|
|
164
176
|
{
|