amis 1.9.0-beta.13 → 1.9.0-beta.14
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/lib/actions/AjaxAction.d.ts +8 -5
- package/lib/actions/AjaxAction.js +27 -21
- package/lib/actions/AjaxAction.js.map +2 -2
- package/lib/actions/BroadcastAction.js +1 -1
- package/lib/actions/BroadcastAction.js.map +2 -2
- package/lib/actions/CmptAction.js +7 -9
- package/lib/actions/CmptAction.js.map +2 -2
- package/lib/actions/CopyAction.d.ts +5 -2
- package/lib/actions/CopyAction.js +8 -6
- package/lib/actions/CopyAction.js.map +2 -2
- package/lib/actions/DialogAction.d.ts +9 -3
- package/lib/actions/DialogAction.js +6 -6
- package/lib/actions/DialogAction.js.map +2 -2
- package/lib/actions/EmailAction.d.ts +8 -5
- package/lib/actions/EmailAction.js +4 -5
- package/lib/actions/EmailAction.js.map +2 -2
- package/lib/actions/LinkAction.d.ts +17 -11
- package/lib/actions/LinkAction.js +6 -5
- package/lib/actions/LinkAction.js.map +2 -2
- package/lib/actions/LoopAction.d.ts +4 -1
- package/lib/actions/LoopAction.js +22 -20
- package/lib/actions/LoopAction.js.map +2 -2
- package/lib/actions/PageAction.d.ts +4 -1
- package/lib/actions/PageAction.js +3 -2
- package/lib/actions/PageAction.js.map +2 -2
- package/lib/actions/ToastAction.js +6 -6
- package/lib/actions/ToastAction.js.map +2 -2
- package/lib/index.js +1 -1
- package/lib/renderers/Action.js +0 -2
- package/lib/renderers/Action.js.map +2 -2
- package/lib/renderers/Form/Combo.js +22 -3
- package/lib/renderers/Form/Combo.js.map +2 -2
- package/lib/renderers/Form/InputTree.js +1 -1
- package/lib/renderers/Form/InputTree.js.map +2 -2
- package/lib/renderers/Wizard.js +3 -3
- package/lib/renderers/Wizard.js.map +2 -2
- package/lib/schemaExtend.js +11 -24
- package/lib/schemaExtend.js.map +2 -2
- package/lib/store/table.js +1 -1
- package/lib/store/table.js.map +2 -2
- package/lib/themes/ang-ie11.css +30 -34
- package/lib/themes/ang.css +31 -34
- package/lib/themes/ang.css.map +1 -1
- package/lib/themes/antd-ie11.css +30 -34
- package/lib/themes/antd.css +31 -34
- package/lib/themes/antd.css.map +1 -1
- package/lib/themes/cxd-ie11.css +30 -34
- package/lib/themes/cxd.css +31 -34
- package/lib/themes/cxd.css.map +1 -1
- package/lib/themes/dark-ie11.css +30 -34
- package/lib/themes/dark.css +31 -34
- package/lib/themes/dark.css.map +1 -1
- package/lib/themes/default-ie11.css +30 -34
- package/lib/themes/default.css +31 -34
- package/lib/themes/default.css.map +1 -1
- package/lib/utils/handleAction.js +1 -1
- package/lib/utils/handleAction.js.map +2 -2
- package/package.json +2 -2
- package/scss/_properties.scss +1 -0
- package/scss/components/_button.scss +37 -39
- package/sdk/ang-ie11.css +38 -39
- package/sdk/ang.css +39 -39
- package/sdk/antd-ie11.css +38 -39
- package/sdk/antd.css +39 -39
- package/sdk/barcode.js +51 -51
- package/sdk/charts.js +14 -14
- package/sdk/codemirror.js +7 -7
- package/sdk/color-picker.js +65 -65
- package/sdk/cropperjs.js +2 -2
- package/sdk/cxd-ie11.css +38 -39
- package/sdk/cxd.css +39 -39
- package/sdk/dark-ie11.css +38 -39
- package/sdk/dark.css +39 -39
- package/sdk/exceljs.js +1 -1
- package/sdk/markdown.js +69 -69
- package/sdk/papaparse.js +1 -1
- package/sdk/renderers/Form/CityDB.js +1 -1
- package/sdk/rest.js +16 -16
- package/sdk/rich-text.js +62 -62
- package/sdk/sdk-ie11.css +38 -39
- package/sdk/sdk.css +39 -39
- package/sdk/sdk.js +1248 -1248
- package/sdk/thirds/hls.js/hls.js +1 -1
- package/sdk/thirds/mpegts.js/mpegts.js +1 -1
- package/sdk/tinymce.js +57 -57
- package/src/actions/AjaxAction.ts +31 -22
- package/src/actions/BroadcastAction.ts +1 -1
- package/src/actions/CmptAction.ts +2 -3
- package/src/actions/CopyAction.ts +12 -6
- package/src/actions/DialogAction.ts +11 -5
- package/src/actions/EmailAction.ts +10 -10
- package/src/actions/LinkAction.ts +31 -14
- package/src/actions/LoopAction.ts +11 -6
- package/src/actions/PageAction.ts +5 -2
- package/src/actions/ToastAction.ts +9 -2
- package/src/renderers/Action.tsx +1 -1
- package/src/renderers/Form/Combo.tsx +19 -3
- package/src/renderers/Form/InputTree.tsx +1 -1
- package/src/renderers/Wizard.tsx +3 -3
- package/src/schemaExtend.ts +12 -23
- package/src/store/table.ts +1 -1
- package/src/utils/handleAction.ts +1 -1
@@ -1,9 +1,9 @@
|
|
1
|
+
import omit from 'lodash/omit';
|
1
2
|
import {Api} from '../types';
|
2
3
|
import {normalizeApiResponseData} from '../utils/api';
|
3
4
|
import {ServerError} from '../utils/errors';
|
4
|
-
import {createObject, isEmpty
|
5
|
+
import {createObject, isEmpty} from '../utils/helper';
|
5
6
|
import {RendererEvent} from '../utils/renderer-event';
|
6
|
-
import {filter} from '../utils/tpl';
|
7
7
|
import {
|
8
8
|
RendererAction,
|
9
9
|
ListenerAction,
|
@@ -12,12 +12,15 @@ import {
|
|
12
12
|
} from './Action';
|
13
13
|
|
14
14
|
export interface IAjaxAction extends ListenerAction {
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
args: {
|
16
|
+
api: Api;
|
17
|
+
messages: {
|
18
|
+
success: string;
|
19
|
+
failed: string;
|
20
|
+
};
|
21
|
+
options: object;
|
22
|
+
[propName: string]: any;
|
19
23
|
};
|
20
|
-
options: object;
|
21
24
|
}
|
22
25
|
|
23
26
|
/**
|
@@ -33,17 +36,21 @@ export class AjaxAction implements RendererAction {
|
|
33
36
|
renderer: ListenerContext,
|
34
37
|
event: RendererEvent<any>
|
35
38
|
) {
|
39
|
+
if (!renderer.props.env?.fetcher) {
|
40
|
+
throw new Error('env.fetcher is required!');
|
41
|
+
}
|
42
|
+
|
36
43
|
const env = event.context.env;
|
37
44
|
try {
|
38
45
|
const result = await env.fetcher(
|
39
|
-
action.api as string,
|
40
|
-
action.args,
|
41
|
-
action.options ?? {}
|
46
|
+
action.args?.api as string,
|
47
|
+
omit(action.args ?? {}, ['api', 'options', 'messages']),
|
48
|
+
action.args?.options ?? {}
|
42
49
|
);
|
43
50
|
|
44
51
|
if (!isEmpty(result.data) || result.ok) {
|
45
52
|
const responseData = normalizeApiResponseData(result.data);
|
46
|
-
//
|
53
|
+
// 记录请求返回的数据
|
47
54
|
event.setData(
|
48
55
|
createObject(
|
49
56
|
event.data,
|
@@ -58,20 +65,22 @@ export class AjaxAction implements RendererAction {
|
|
58
65
|
|
59
66
|
if (!result.ok) {
|
60
67
|
throw new ServerError(
|
61
|
-
|
68
|
+
action.args?.messages?.failed ?? result.msg,
|
62
69
|
result
|
63
70
|
);
|
64
71
|
} else {
|
65
|
-
|
66
|
-
|
67
|
-
(
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
72
|
+
const msg = action.args?.messages?.success ?? result.msg;
|
73
|
+
msg &&
|
74
|
+
env.notify(
|
75
|
+
'success',
|
76
|
+
msg,
|
77
|
+
result.msgTimeout !== undefined
|
78
|
+
? {
|
79
|
+
closeButton: true,
|
80
|
+
timeout: result.msgTimeout
|
81
|
+
}
|
82
|
+
: undefined
|
83
|
+
);
|
75
84
|
}
|
76
85
|
|
77
86
|
return result.data;
|
@@ -49,11 +49,10 @@ export class CmptAction implements RendererAction {
|
|
49
49
|
|
50
50
|
// 数据更新
|
51
51
|
if (action.actionType === 'setValue') {
|
52
|
-
const value = dataMapping(action.value, event.data);
|
53
52
|
if (component.setData) {
|
54
|
-
return component.setData(value);
|
53
|
+
return component.setData(action.args?.value);
|
55
54
|
} else {
|
56
|
-
return component.props.onChange?.(value);
|
55
|
+
return component.props.onChange?.(action.args?.value);
|
57
56
|
}
|
58
57
|
}
|
59
58
|
|
@@ -4,13 +4,15 @@ import {
|
|
4
4
|
RendererAction,
|
5
5
|
ListenerAction,
|
6
6
|
ListenerContext,
|
7
|
-
LoopStatus,
|
8
7
|
registerAction
|
9
8
|
} from './Action';
|
10
9
|
|
11
10
|
export interface ICopyAction extends ListenerAction {
|
12
|
-
|
13
|
-
|
11
|
+
args: {
|
12
|
+
content: string;
|
13
|
+
copyFormat?: string;
|
14
|
+
[propName: string]: any;
|
15
|
+
};
|
14
16
|
}
|
15
17
|
|
16
18
|
/**
|
@@ -26,9 +28,13 @@ export class CopyAction implements RendererAction {
|
|
26
28
|
renderer: ListenerContext,
|
27
29
|
event: RendererEvent<any>
|
28
30
|
) {
|
29
|
-
if (
|
30
|
-
|
31
|
-
|
31
|
+
if (!renderer.props.env?.copy) {
|
32
|
+
throw new Error('env.copy is required!');
|
33
|
+
}
|
34
|
+
|
35
|
+
if (action.args?.content) {
|
36
|
+
renderer.props.env.copy?.(action.args.content, {
|
37
|
+
format: action.args?.copyFormat ?? 'text/html'
|
32
38
|
});
|
33
39
|
}
|
34
40
|
}
|
@@ -8,12 +8,18 @@ import {
|
|
8
8
|
} from './Action';
|
9
9
|
|
10
10
|
export interface IAlertAction extends ListenerAction {
|
11
|
-
|
11
|
+
args: {
|
12
|
+
msg: string;
|
13
|
+
[propName: string]: any;
|
14
|
+
};
|
12
15
|
}
|
13
16
|
|
14
17
|
export interface IConfirmAction extends ListenerAction {
|
15
|
-
|
16
|
-
|
18
|
+
args: {
|
19
|
+
title: string;
|
20
|
+
msg: string;
|
21
|
+
[propName: string]: any;
|
22
|
+
};
|
17
23
|
}
|
18
24
|
|
19
25
|
export interface IDialogAction extends ListenerAction {
|
@@ -76,7 +82,7 @@ export class AlertAction implements RendererAction {
|
|
76
82
|
renderer: ListenerContext,
|
77
83
|
event: RendererEvent<any>
|
78
84
|
) {
|
79
|
-
event.context.env.alert?.(action.msg);
|
85
|
+
event.context.env.alert?.(action.args?.msg);
|
80
86
|
}
|
81
87
|
}
|
82
88
|
|
@@ -89,7 +95,7 @@ export class ConfirmAction implements RendererAction {
|
|
89
95
|
renderer: ListenerContext,
|
90
96
|
event: RendererEvent<any>
|
91
97
|
) {
|
92
|
-
event.context.env.confirm?.(action.msg, action.title);
|
98
|
+
event.context.env.confirm?.(action.args?.msg, action.args?.title);
|
93
99
|
}
|
94
100
|
}
|
95
101
|
|
@@ -11,11 +11,14 @@ import {
|
|
11
11
|
} from './Action';
|
12
12
|
|
13
13
|
export interface IEmailAction extends ListenerAction {
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
args: {
|
15
|
+
to: string;
|
16
|
+
cc: string;
|
17
|
+
bcc: string;
|
18
|
+
subject: string;
|
19
|
+
body: string;
|
20
|
+
[propName: string]: any;
|
21
|
+
};
|
19
22
|
}
|
20
23
|
|
21
24
|
/**
|
@@ -31,11 +34,8 @@ export class EmailAction implements RendererAction {
|
|
31
34
|
renderer: ListenerContext,
|
32
35
|
event: RendererEvent<any>
|
33
36
|
) {
|
34
|
-
const mailTo =
|
35
|
-
const mailInfo =
|
36
|
-
pick(action, 'cc', 'bcc', 'subject', 'body'),
|
37
|
-
val => filter(val, action.args)
|
38
|
-
);
|
37
|
+
const mailTo = action.args?.to;
|
38
|
+
const mailInfo = pick(action.args ?? {}, 'cc', 'bcc', 'subject', 'body');
|
39
39
|
const mailStr = qs.stringify(mailInfo);
|
40
40
|
const mailto = `mailto:${mailTo}?${mailStr}`;
|
41
41
|
|
@@ -3,6 +3,7 @@ import {buildApi} from '../utils/api';
|
|
3
3
|
import {isEmpty, isObject, qsstringify} from '../utils/helper';
|
4
4
|
import {RendererEvent} from '../utils/renderer-event';
|
5
5
|
import {filter} from '../utils/tpl';
|
6
|
+
import omit from 'lodash/omit';
|
6
7
|
import {
|
7
8
|
RendererAction,
|
8
9
|
ListenerAction,
|
@@ -11,20 +12,26 @@ import {
|
|
11
12
|
} from './Action';
|
12
13
|
|
13
14
|
export interface ILinkAction extends ListenerAction {
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
args: {
|
16
|
+
link: string;
|
17
|
+
url?: never;
|
18
|
+
blank?: boolean;
|
19
|
+
params?: {
|
20
|
+
[key: string]: string;
|
21
|
+
};
|
22
|
+
[propName: string]: any;
|
19
23
|
};
|
20
24
|
}
|
21
25
|
|
22
26
|
export interface IUrlAction extends ListenerAction {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
27
|
+
args: {
|
28
|
+
url: string;
|
29
|
+
link?: never;
|
30
|
+
blank?: boolean;
|
31
|
+
params?: {
|
32
|
+
[key: string]: string;
|
33
|
+
};
|
34
|
+
[propName: string]: any;
|
28
35
|
};
|
29
36
|
}
|
30
37
|
|
@@ -37,7 +44,7 @@ export interface IUrlAction extends ListenerAction {
|
|
37
44
|
*/
|
38
45
|
export class LinkAction implements RendererAction {
|
39
46
|
async run(
|
40
|
-
action:
|
47
|
+
action: ListenerAction,
|
41
48
|
renderer: ListenerContext,
|
42
49
|
event: RendererEvent<any>
|
43
50
|
) {
|
@@ -48,16 +55,26 @@ export class LinkAction implements RendererAction {
|
|
48
55
|
// 通过buildApi兼容较复杂的url情况
|
49
56
|
let urlObj = buildApi(
|
50
57
|
{
|
51
|
-
url: (action.url || action.link) as string,
|
58
|
+
url: (action.args?.url || action.args?.link) as string,
|
52
59
|
method: 'get'
|
53
60
|
},
|
54
|
-
{
|
61
|
+
{
|
62
|
+
...(action.args?.params ?? {}),
|
63
|
+
...omit(action.args ?? {}, ['params', 'blank', 'url', 'link'])
|
64
|
+
},
|
55
65
|
{
|
56
66
|
autoAppend: true
|
57
67
|
}
|
58
68
|
);
|
59
69
|
|
60
|
-
renderer.props.env.jumpTo(
|
70
|
+
renderer.props.env.jumpTo(
|
71
|
+
urlObj.url,
|
72
|
+
{
|
73
|
+
actionType: action.actionType,
|
74
|
+
...action.args
|
75
|
+
},
|
76
|
+
action.args
|
77
|
+
);
|
61
78
|
}
|
62
79
|
}
|
63
80
|
|
@@ -13,7 +13,10 @@ import {
|
|
13
13
|
import {resolveVariable} from '../utils/tpl-builtin';
|
14
14
|
|
15
15
|
export interface ILoopAction extends ListenerAction, LogicAction {
|
16
|
-
|
16
|
+
args: {
|
17
|
+
loopName: string;
|
18
|
+
[propName: string]: any;
|
19
|
+
};
|
17
20
|
}
|
18
21
|
|
19
22
|
/**
|
@@ -30,18 +33,19 @@ export class LoopAction implements RendererAction {
|
|
30
33
|
event: RendererEvent<any>,
|
31
34
|
mergeData: any
|
32
35
|
) {
|
33
|
-
|
34
|
-
|
36
|
+
const loopName = action.args?.loopName;
|
37
|
+
if (typeof loopName !== 'string') {
|
38
|
+
console.error('loopName 必须是字符串类型');
|
35
39
|
return;
|
36
40
|
}
|
37
41
|
|
38
|
-
const loopData = resolveVariable(
|
42
|
+
const loopData = resolveVariable(loopName, mergeData) || [];
|
39
43
|
|
40
44
|
// 必须是数组
|
41
45
|
if (!loopData) {
|
42
|
-
console.
|
46
|
+
console.error(`没有找到数据 ${loopName}`);
|
43
47
|
} else if (!Array.isArray(loopData)) {
|
44
|
-
console.
|
48
|
+
console.error(`${loopName} 数据不是数组`);
|
45
49
|
} else if (action.children?.length) {
|
46
50
|
// 暂存一下
|
47
51
|
const protoData = event.data;
|
@@ -62,6 +66,7 @@ export class LoopAction implements RendererAction {
|
|
62
66
|
if (renderer.loopStatus === LoopStatus.BREAK || event.stoped) {
|
63
67
|
// 还原事件数据
|
64
68
|
event.setData(protoData);
|
69
|
+
event.stopPropagation();
|
65
70
|
break;
|
66
71
|
}
|
67
72
|
}
|
@@ -7,7 +7,10 @@ import {
|
|
7
7
|
} from './Action';
|
8
8
|
|
9
9
|
export interface IPageGoAction extends ListenerAction {
|
10
|
-
|
10
|
+
args: {
|
11
|
+
delta?: number;
|
12
|
+
[propName: string]: any;
|
13
|
+
};
|
11
14
|
}
|
12
15
|
|
13
16
|
/**
|
@@ -40,7 +43,7 @@ export class PageGoAction implements RendererAction {
|
|
40
43
|
renderer: ListenerContext,
|
41
44
|
event: RendererEvent<any>
|
42
45
|
) {
|
43
|
-
window.history.go(action.delta || 0);
|
46
|
+
window.history.go(action.args?.delta || 0);
|
44
47
|
}
|
45
48
|
}
|
46
49
|
|
@@ -32,8 +32,15 @@ export class ToastAction implements RendererAction {
|
|
32
32
|
renderer: ListenerContext,
|
33
33
|
event: RendererEvent<any>
|
34
34
|
) {
|
35
|
-
|
36
|
-
|
35
|
+
if (!renderer.props.env?.notify) {
|
36
|
+
throw new Error('env.notify is required!');
|
37
|
+
}
|
38
|
+
|
39
|
+
event.context.env.notify?.(
|
40
|
+
action.args?.msgType || 'info',
|
41
|
+
String(action.args?.msg),
|
42
|
+
action.args
|
43
|
+
);
|
37
44
|
}
|
38
45
|
}
|
39
46
|
|
package/src/renderers/Action.tsx
CHANGED
@@ -614,7 +614,7 @@ export class Action extends React.Component<ActionProps, ActionState> {
|
|
614
614
|
const {onAction, disabled, countDown, env} = this.props;
|
615
615
|
|
616
616
|
// https://reactjs.org/docs/legacy-event-pooling.html
|
617
|
-
e.persist();
|
617
|
+
// e.persist(); // react 17之后去掉 event pooling 了,这个应该没用了
|
618
618
|
let onClick = this.props.onClick;
|
619
619
|
|
620
620
|
if (typeof onClick === 'string') {
|
@@ -434,7 +434,7 @@ export default class ComboControl extends React.Component<ComboProps> {
|
|
434
434
|
}
|
435
435
|
|
436
436
|
getValueAsArray(props = this.props) {
|
437
|
-
const {flat, joinValues, delimiter} = props;
|
437
|
+
const {flat, joinValues, delimiter, type} = props;
|
438
438
|
let value = props.value;
|
439
439
|
|
440
440
|
if (joinValues && flat && typeof value === 'string') {
|
@@ -581,7 +581,7 @@ export default class ComboControl extends React.Component<ComboProps> {
|
|
581
581
|
}
|
582
582
|
|
583
583
|
handleChange(values: any, diff: any, {index}: any) {
|
584
|
-
const {flat, store, joinValues, delimiter, disabled, submitOnChange} =
|
584
|
+
const {flat, store, joinValues, delimiter, disabled, submitOnChange, type} =
|
585
585
|
this.props;
|
586
586
|
|
587
587
|
if (disabled) {
|
@@ -595,7 +595,23 @@ export default class ComboControl extends React.Component<ComboProps> {
|
|
595
595
|
value = value.join(delimiter || ',');
|
596
596
|
}
|
597
597
|
|
598
|
-
|
598
|
+
if (type === 'input-kv') {
|
599
|
+
let hasDuplicateKey = false;
|
600
|
+
const keys: {[key: string]: boolean} = {};
|
601
|
+
for (const item of value) {
|
602
|
+
if (keys[item.key]) {
|
603
|
+
hasDuplicateKey = true;
|
604
|
+
} else {
|
605
|
+
keys[item.key] = true;
|
606
|
+
}
|
607
|
+
}
|
608
|
+
// 有重复值就不触发修改,因为 KV 模式下无法支持重复值
|
609
|
+
if (!hasDuplicateKey) {
|
610
|
+
this.props.onChange(value, submitOnChange, true);
|
611
|
+
}
|
612
|
+
} else {
|
613
|
+
this.props.onChange(value, submitOnChange, true);
|
614
|
+
}
|
599
615
|
|
600
616
|
store.forms.forEach(
|
601
617
|
form =>
|
@@ -122,7 +122,7 @@ export default class TreeControl extends React.Component<TreeProps> {
|
|
122
122
|
onChange && onChange(resetValue ?? '');
|
123
123
|
}
|
124
124
|
if (action.actionType === 'expand') {
|
125
|
-
this.treeRef.syncUnFolded(this.props, action.openLevel);
|
125
|
+
this.treeRef.syncUnFolded(this.props, action.args.openLevel);
|
126
126
|
}
|
127
127
|
if (action.actionType === 'collapse') {
|
128
128
|
this.treeRef.syncUnFolded(this.props, 0);
|
package/src/renderers/Wizard.tsx
CHANGED
@@ -648,7 +648,7 @@ export default class Wizard extends React.Component<WizardProps, WizardState> {
|
|
648
648
|
const previous = store.data;
|
649
649
|
const final = {...previous, ...values};
|
650
650
|
|
651
|
-
if (await this.dispatchEvent('change',
|
651
|
+
if (await this.dispatchEvent('change', final)) {
|
652
652
|
return;
|
653
653
|
}
|
654
654
|
|
@@ -692,7 +692,7 @@ export default class Wizard extends React.Component<WizardProps, WizardState> {
|
|
692
692
|
onFinished
|
693
693
|
} = this.props;
|
694
694
|
|
695
|
-
if (await this.dispatchEvent('finished',
|
695
|
+
if (await this.dispatchEvent('finished', store.data)) {
|
696
696
|
return;
|
697
697
|
}
|
698
698
|
|
@@ -719,7 +719,7 @@ export default class Wizard extends React.Component<WizardProps, WizardState> {
|
|
719
719
|
formStore
|
720
720
|
.saveRemote(action.api || step.api || api!, store.data, {
|
721
721
|
onSuccess: () => {
|
722
|
-
this.dispatchEvent('submitSucc',
|
722
|
+
this.dispatchEvent('submitSucc', store.data);
|
723
723
|
|
724
724
|
if (
|
725
725
|
!isEffectiveApi(finnalAsyncApi, store.data) ||
|
package/src/schemaExtend.ts
CHANGED
@@ -19,22 +19,15 @@ addSchemaFilter(function (schema: Schema, renderer, props?: any) {
|
|
19
19
|
const arr: Array<any> = [];
|
20
20
|
Object.keys(value).forEach(key => {
|
21
21
|
const valueType = typeof value[key];
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
valueType === 'string' ||
|
32
|
-
valueType === 'number' ||
|
33
|
-
valueType === 'boolean'
|
34
|
-
? value[key]
|
35
|
-
: JSON.stringify(value[key])
|
36
|
-
});
|
37
|
-
}
|
22
|
+
arr.push({
|
23
|
+
key: key || '',
|
24
|
+
value:
|
25
|
+
valueType === 'string' ||
|
26
|
+
valueType === 'number' ||
|
27
|
+
valueType === 'boolean'
|
28
|
+
? value[key]
|
29
|
+
: JSON.stringify(value[key])
|
30
|
+
});
|
38
31
|
});
|
39
32
|
return arr;
|
40
33
|
},
|
@@ -52,12 +45,7 @@ addSchemaFilter(function (schema: Schema, renderer, props?: any) {
|
|
52
45
|
} catch (e) {}
|
53
46
|
}
|
54
47
|
|
55
|
-
|
56
|
-
if (key in obj) {
|
57
|
-
obj[key + '___tmp'] = value;
|
58
|
-
} else {
|
59
|
-
obj[key] = value;
|
60
|
-
}
|
48
|
+
obj[key] = value;
|
61
49
|
});
|
62
50
|
return obj;
|
63
51
|
},
|
@@ -67,7 +55,8 @@ addSchemaFilter(function (schema: Schema, renderer, props?: any) {
|
|
67
55
|
type: 'input-text',
|
68
56
|
unique: true,
|
69
57
|
name: 'key',
|
70
|
-
required: true
|
58
|
+
required: true,
|
59
|
+
validateOnChange: true
|
71
60
|
},
|
72
61
|
{
|
73
62
|
placeholder: schema.valuePlaceholder ?? 'Value',
|
package/src/store/table.ts
CHANGED
@@ -497,7 +497,7 @@ export const TableStore = iRendererStore
|
|
497
497
|
prev.has.push(current);
|
498
498
|
} else {
|
499
499
|
groups.push({
|
500
|
-
label: current.groupName,
|
500
|
+
label: current.groupName || ' ', // 如果中间没有配置groupName,那么样式会错乱,这里加一个空白字符,当做一个占位表头
|
501
501
|
colSpan: 1,
|
502
502
|
rowSpan: 1,
|
503
503
|
index: current.index,
|
@@ -13,7 +13,7 @@ export default function handleAction(
|
|
13
13
|
data?: any
|
14
14
|
) {
|
15
15
|
// https://reactjs.org/docs/legacy-event-pooling.html
|
16
|
-
e.persist();
|
16
|
+
// e.persist(); // react 17之后去掉 event pooling 了,这个应该没用了
|
17
17
|
|
18
18
|
const onAction = props.onAction;
|
19
19
|
let onClick: any = action.onClick;
|