@luck-design-biz/luckda 0.0.25-13 → 0.0.25-15
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/es/components/LdFormList/index.js +7 -5
- package/es/locales/zh-CN.js +0 -1
- package/es/lowcode/engine/meta/components-list.json +2 -2
- package/es/lowcode/engine/meta/form.props.default.json +2 -2
- package/es/lowcode/engine/meta/form.props.json +2 -2
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +58 -4
- package/es/lowcode/engine/meta/table.props.default.json +2 -1
- package/es/lowcode/engine/meta/table.props.json +2 -1
- package/es/lowcode/engine/provider/ContextProvider/index.js +59 -16
- package/es/lowcode/painter/DesignToolbar.js +3 -4
- package/es/lowcode/painter/components/PreviewIframe.js +55 -0
- package/es/lowcode/painter/panel-section/DataSetSelector.js +1 -1
- package/es/lowcode/painter/panel-section/ImpExp.js +64 -55
- package/es/lowcode/painter/panel-section/ImpExpAlone.js +38 -22
- package/es/lowcode/painter/panel-section/PageLayoutDisplay.js +18 -1
- package/es/lowcode/view/lc-components/Box/FunctionDesign.js +1 -1
- package/es/lowcode/view/lc-components/Form/index.js +69 -65
- package/es/lowcode/view/lc-components/Form/meta.json +2 -2
- package/es/lowcode/view/lc-components/PageLayout/index.js +4 -2
- package/es/lowcode/view/lc-components/Table/components/TopImex.js +4 -1
- package/es/lowcode/view/lc-components/Table/index.js +158 -159
- package/es/lowcode/view/lc-components/Table/meta.json +56 -16
- package/lib/components/LdFormList/index.js +7 -5
- package/lib/locales/zh-CN.js +0 -1
- package/lib/lowcode/engine/meta/components-list.json +2 -2
- package/lib/lowcode/engine/meta/form.props.default.json +2 -2
- package/lib/lowcode/engine/meta/form.props.json +2 -2
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +58 -4
- package/lib/lowcode/engine/meta/table.props.default.json +2 -1
- package/lib/lowcode/engine/meta/table.props.json +2 -1
- package/lib/lowcode/engine/provider/ContextProvider/index.js +59 -16
- package/lib/lowcode/painter/DesignToolbar.js +3 -4
- package/lib/lowcode/painter/components/PreviewIframe.js +63 -0
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +1 -1
- package/lib/lowcode/painter/panel-section/ImpExp.js +63 -54
- package/lib/lowcode/painter/panel-section/ImpExpAlone.js +37 -21
- package/lib/lowcode/painter/panel-section/PageLayoutDisplay.js +18 -1
- package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +1 -1
- package/lib/lowcode/view/lc-components/Form/index.js +69 -65
- package/lib/lowcode/view/lc-components/Form/meta.json +2 -2
- package/lib/lowcode/view/lc-components/PageLayout/index.js +4 -2
- package/lib/lowcode/view/lc-components/Table/components/TopImex.js +4 -1
- package/lib/lowcode/view/lc-components/Table/index.js +156 -157
- package/lib/lowcode/view/lc-components/Table/meta.json +56 -16
- package/package.json +5 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { useMemoizedFn, useSetState, useUpdateEffect } from 'ahooks';
|
|
4
|
-
import { Checkbox, Row, Col, Input, Switch, Select, Tooltip, Spin } from 'luck-design/antd';
|
|
4
|
+
import { Checkbox, Row, Col, Input, Switch, Select, Tooltip, Spin, Radio } from 'luck-design/antd';
|
|
5
5
|
import { Segmented } from 'luck-design/antd';
|
|
6
6
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
7
7
|
import PanelItem from "../components/PanelItem";
|
|
@@ -10,7 +10,6 @@ import { useRemoteSource } from "../../engine/provider/ContextProvider";
|
|
|
10
10
|
import styles from "../style/impexp.less";
|
|
11
11
|
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel-section.impexp';
|
|
12
12
|
var ImpExp = function ImpExp(_ref) {
|
|
13
|
-
var _ref2;
|
|
14
13
|
var defaultValue = _ref.defaultValue,
|
|
15
14
|
onChange = _ref.onChange;
|
|
16
15
|
var _useSetState = useSetState(defaultValue || {}),
|
|
@@ -38,13 +37,15 @@ var ImpExp = function ImpExp(_ref) {
|
|
|
38
37
|
var handleSegmentChange = useMemoizedFn(function (field, e) {
|
|
39
38
|
var _value = field;
|
|
40
39
|
setState({
|
|
41
|
-
type: _value
|
|
40
|
+
type: _value,
|
|
41
|
+
customType: false,
|
|
42
|
+
customParam: undefined
|
|
42
43
|
});
|
|
43
44
|
});
|
|
44
|
-
var handleSwitchChange = useMemoizedFn(function (
|
|
45
|
-
var _value =
|
|
45
|
+
var handleSwitchChange = useMemoizedFn(function (e) {
|
|
46
|
+
var _value = e.target.value;
|
|
46
47
|
setState({
|
|
47
|
-
customType: _value,
|
|
48
|
+
customType: _value === '2',
|
|
48
49
|
customParam: undefined
|
|
49
50
|
});
|
|
50
51
|
});
|
|
@@ -62,12 +63,18 @@ var ImpExp = function ImpExp(_ref) {
|
|
|
62
63
|
onChange: handleSegmentChange,
|
|
63
64
|
defaultValue: state.type,
|
|
64
65
|
block: true
|
|
65
|
-
})), /*#__PURE__*/React.createElement(PanelItem, {
|
|
66
|
-
|
|
66
|
+
})), state.type === 'import' && /*#__PURE__*/React.createElement(PanelItem, {
|
|
67
|
+
suppressPadding: true
|
|
68
|
+
}, /*#__PURE__*/React.createElement(Radio.Group, {
|
|
69
|
+
onChange: handleSwitchChange,
|
|
70
|
+
defaultValue: !state.customType ? '1' : '2'
|
|
71
|
+
}, /*#__PURE__*/React.createElement(Radio, {
|
|
72
|
+
value: "1"
|
|
73
|
+
}, "\u6A21\u7248ID"), /*#__PURE__*/React.createElement(Radio, {
|
|
74
|
+
value: "2"
|
|
75
|
+
}, "\u81EA\u5B9A\u4E49\u884C\u4E3A"))), state.type === 'import' && /*#__PURE__*/React.createElement(PanelItem, {
|
|
67
76
|
suppressPadding: true
|
|
68
|
-
}, /*#__PURE__*/React.createElement(
|
|
69
|
-
span: 14
|
|
70
|
-
}, !state.customType && state.type === 'import' ? /*#__PURE__*/React.createElement(Input, {
|
|
77
|
+
}, !state.customType ? /*#__PURE__*/React.createElement(Input, {
|
|
71
78
|
size: "small",
|
|
72
79
|
value: isString(state.customParam) ? state.customParam : '',
|
|
73
80
|
onChange: function onChange(e) {
|
|
@@ -85,24 +92,33 @@ var ImpExp = function ImpExp(_ref) {
|
|
|
85
92
|
id: "".concat(_I18N_PREFIX_, ".expType.placeholder"),
|
|
86
93
|
label: '请选择自定义行为'
|
|
87
94
|
})
|
|
88
|
-
},
|
|
95
|
+
}, impTypeList.map(function (opt) {
|
|
89
96
|
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
90
97
|
key: opt.key,
|
|
91
98
|
value: opt.value
|
|
92
99
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
93
100
|
title: opt.label
|
|
94
101
|
}, opt.label));
|
|
95
|
-
}))), state.type === '
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
textAlign: 'center'
|
|
99
|
-
}
|
|
100
|
-
}, /*#__PURE__*/React.createElement(Switch, {
|
|
102
|
+
}))), state.type === 'export' && /*#__PURE__*/React.createElement(PanelItem, {
|
|
103
|
+
suppressPadding: true
|
|
104
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
101
105
|
size: "small",
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
+
style: {
|
|
107
|
+
width: '100%'
|
|
108
|
+
},
|
|
109
|
+
value: isString(state.customParam) ? state.customParam : undefined,
|
|
110
|
+
onChange: handleSelectChange,
|
|
111
|
+
placeholder: formatMessage({
|
|
112
|
+
id: "".concat(_I18N_PREFIX_, ".expType.placeholder"),
|
|
113
|
+
label: '请选择自定义行为'
|
|
114
|
+
})
|
|
115
|
+
}, expTypeList === null || expTypeList === void 0 ? void 0 : expTypeList.map(function (opt) {
|
|
116
|
+
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
117
|
+
key: opt.key,
|
|
118
|
+
value: opt.value
|
|
119
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
120
|
+
title: opt.label
|
|
121
|
+
}, opt.label));
|
|
106
122
|
}))));
|
|
107
123
|
};
|
|
108
124
|
export default ImpExp;
|
|
@@ -5,7 +5,7 @@ import { useMemoizedFn } from 'ahooks';
|
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import { Tooltip } from 'luck-design/antd';
|
|
7
7
|
import styles from "../style/page-layout-display.less";
|
|
8
|
-
var _TYPES_ = ['lr', 'lmr', 'ltb'];
|
|
8
|
+
var _TYPES_ = ['lr', 'tb', 'lmr', 'ltb'];
|
|
9
9
|
var PageLayoutDisplay = function PageLayoutDisplay(_ref) {
|
|
10
10
|
var defaultValue = _ref.defaultValue,
|
|
11
11
|
onChange = _ref.onChange;
|
|
@@ -44,6 +44,23 @@ var PageLayoutDisplay = function PageLayoutDisplay(_ref) {
|
|
|
44
44
|
flex: 3
|
|
45
45
|
},
|
|
46
46
|
className: styles['item-block']
|
|
47
|
+
})), _type === 'tb' && /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
style: {
|
|
49
|
+
flex: 1,
|
|
50
|
+
display: 'flex',
|
|
51
|
+
flexDirection: 'column'
|
|
52
|
+
}
|
|
53
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
style: {
|
|
55
|
+
height: '50%',
|
|
56
|
+
borderBottom: '1px solid #eee'
|
|
57
|
+
},
|
|
58
|
+
className: styles['item-block']
|
|
59
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
60
|
+
style: {
|
|
61
|
+
height: '50%'
|
|
62
|
+
},
|
|
63
|
+
className: styles['item-block']
|
|
47
64
|
})), _type === 'lmr' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
48
65
|
style: {
|
|
49
66
|
flex: 1,
|
|
@@ -17,7 +17,7 @@ var FunctionDesign = function FunctionDesign(_ref) {
|
|
|
17
17
|
return !children || React.Children.count(children) === 0;
|
|
18
18
|
}, [children]);
|
|
19
19
|
return /*#__PURE__*/React.createElement(Index, _extends({
|
|
20
|
-
className: classNames(styles['lc-component-box-design'], _defineProperty(_defineProperty({}, styles.placeholder, isEmpty),
|
|
20
|
+
className: classNames(styles['lc-component-box-design'], _defineProperty(_defineProperty({}, styles.placeholder, isEmpty), className, !!className)),
|
|
21
21
|
style: _objectSpread({
|
|
22
22
|
minHeight: 60
|
|
23
23
|
}, style)
|
|
@@ -20,12 +20,12 @@ import RuntimeComp from "../JSX/RuntimeComp";
|
|
|
20
20
|
import defaultMeta from "../../../engine/meta/form.props.default.json";
|
|
21
21
|
import styles from "./index.less";
|
|
22
22
|
var _I18N_PREFIX_ = 'lc.form.validator';
|
|
23
|
-
var Header = function Header(
|
|
24
|
-
var
|
|
25
|
-
header =
|
|
26
|
-
title =
|
|
27
|
-
ldId =
|
|
28
|
-
children =
|
|
23
|
+
var Header = function Header(_ref2) {
|
|
24
|
+
var _ref2$header = _ref2.header,
|
|
25
|
+
header = _ref2$header === void 0 ? 'collapse' : _ref2$header,
|
|
26
|
+
title = _ref2.title,
|
|
27
|
+
ldId = _ref2.ldId,
|
|
28
|
+
children = _ref2.children;
|
|
29
29
|
if (header === 'collapse' || header === 'collapseFollow') return /*#__PURE__*/React.createElement(Collapse, {
|
|
30
30
|
title: title || ldId,
|
|
31
31
|
id: ldId,
|
|
@@ -53,28 +53,37 @@ var getMthodParams = function getMthodParams(methodStr) {
|
|
|
53
53
|
}
|
|
54
54
|
return [];
|
|
55
55
|
};
|
|
56
|
-
var
|
|
56
|
+
var useCombinedRefs = function useCombinedRefs(forwardedRef) {
|
|
57
|
+
var innerRef = useRef(null);
|
|
58
|
+
useEffect(function () {
|
|
59
|
+
if (!forwardedRef) return;
|
|
60
|
+
if (typeof forwardedRef === 'function') {
|
|
61
|
+
forwardedRef(innerRef.current);
|
|
62
|
+
} else {
|
|
63
|
+
forwardedRef.current = innerRef.current;
|
|
64
|
+
}
|
|
65
|
+
}, [forwardedRef]);
|
|
66
|
+
return forwardedRef || innerRef;
|
|
67
|
+
};
|
|
68
|
+
var LCForm = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
57
69
|
var _ctx$pagePublicResour2;
|
|
58
|
-
var id =
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
renderFormLeft = _ref2.renderFormLeft,
|
|
72
|
-
renderFormRight = _ref2.renderFormRight,
|
|
73
|
-
children = _ref2.children;
|
|
70
|
+
var id = _ref3.id,
|
|
71
|
+
className = _ref3.className,
|
|
72
|
+
blocks = _ref3.blocks,
|
|
73
|
+
advance = _ref3.advance,
|
|
74
|
+
initData = _ref3.initData,
|
|
75
|
+
readOnly = _ref3.readOnly,
|
|
76
|
+
showSave = _ref3.showSave,
|
|
77
|
+
saveTitle = _ref3.saveTitle,
|
|
78
|
+
getContainer = _ref3.getContainer,
|
|
79
|
+
settingLayout = _ref3.settingLayout,
|
|
80
|
+
renderFormLeft = _ref3.renderFormLeft,
|
|
81
|
+
renderFormRight = _ref3.renderFormRight,
|
|
82
|
+
children = _ref3.children;
|
|
74
83
|
var apiRef = useRef();
|
|
75
|
-
var
|
|
84
|
+
var wrapperRef = useRef();
|
|
85
|
+
var formRef = useCombinedRefs(ref);
|
|
76
86
|
var promiseRef = useRef(null);
|
|
77
|
-
var formRef = useRef();
|
|
78
87
|
var ctx = useContext();
|
|
79
88
|
var remoteSource = useRemoteSource();
|
|
80
89
|
var _initData = useCreation(function () {
|
|
@@ -88,30 +97,30 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
88
97
|
})) || [];
|
|
89
98
|
}, [remoteSource.serials]);
|
|
90
99
|
var _blocks = useCreation(function () {
|
|
91
|
-
return blocks.filter(function (
|
|
92
|
-
var hidden =
|
|
100
|
+
return blocks.filter(function (_ref4) {
|
|
101
|
+
var hidden = _ref4.hidden;
|
|
93
102
|
return !hidden;
|
|
94
103
|
});
|
|
95
104
|
}, [blocks]);
|
|
96
105
|
useMount(function () {
|
|
97
106
|
ctx.doAction(advance.events.onMount, {
|
|
98
|
-
instance:
|
|
107
|
+
instance: formRef.current
|
|
99
108
|
});
|
|
100
109
|
});
|
|
101
110
|
useEffect(function () {
|
|
102
|
-
var tid = ctx.$subscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED).on(function (
|
|
103
|
-
var resource =
|
|
104
|
-
prevResource =
|
|
111
|
+
var tid = ctx.$subscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED).on(function (_ref5) {
|
|
112
|
+
var resource = _ref5.resource,
|
|
113
|
+
prevResource = _ref5.prevResource;
|
|
105
114
|
ctx.doAction(advance.events.onPagePublicResourceChanged, {
|
|
106
115
|
resource: resource,
|
|
107
116
|
prevResource: prevResource,
|
|
108
|
-
instance:
|
|
117
|
+
instance: formRef.current
|
|
109
118
|
});
|
|
110
119
|
}).watch();
|
|
111
120
|
return function () {
|
|
112
121
|
ctx.$unsubscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED, tid);
|
|
113
122
|
ctx.doAction(advance.events.onUnmount, {
|
|
114
|
-
instance:
|
|
123
|
+
instance: formRef.current
|
|
115
124
|
});
|
|
116
125
|
};
|
|
117
126
|
}, []);
|
|
@@ -122,7 +131,7 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
122
131
|
* @method
|
|
123
132
|
*/
|
|
124
133
|
getInstance: function getInstance() {
|
|
125
|
-
return
|
|
134
|
+
return formRef.current;
|
|
126
135
|
},
|
|
127
136
|
/**
|
|
128
137
|
* 提交表格数据
|
|
@@ -132,9 +141,9 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
132
141
|
return new Promise(function (resolve) {
|
|
133
142
|
var _ctx$pagePublicResour;
|
|
134
143
|
promiseRef.current = resolve;
|
|
135
|
-
var instance =
|
|
136
|
-
var
|
|
137
|
-
formMode =
|
|
144
|
+
var instance = formRef.current;
|
|
145
|
+
var _ref6 = ((_ctx$pagePublicResour = ctx.pagePublicResource) === null || _ctx$pagePublicResour === void 0 ? void 0 : _ctx$pagePublicResour[id]) || initData || _initData || {},
|
|
146
|
+
formMode = _ref6.formMode;
|
|
138
147
|
if (formMode === 'add') {
|
|
139
148
|
instance.onAdd();
|
|
140
149
|
} else if (formMode === 'update') {
|
|
@@ -160,7 +169,7 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
160
169
|
* @returns {Block}
|
|
161
170
|
*/
|
|
162
171
|
getBlock: function getBlock(blockId) {
|
|
163
|
-
var instance =
|
|
172
|
+
var instance = formRef.current;
|
|
164
173
|
var block = instance.formRefs[blockId];
|
|
165
174
|
if (!block) {
|
|
166
175
|
console.e('未发现区块');
|
|
@@ -229,7 +238,7 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
229
238
|
};
|
|
230
239
|
});
|
|
231
240
|
var getTargetDom = useMemoizedFn(function () {
|
|
232
|
-
return
|
|
241
|
+
return wrapperRef.current;
|
|
233
242
|
});
|
|
234
243
|
var handleDefaultDataSourceFormat = useMemoizedFn(function (defaultDataSourceFormat, defaultValues) {
|
|
235
244
|
if (isNil(defaultDataSourceFormat)) return function () {
|
|
@@ -237,10 +246,10 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
237
246
|
};
|
|
238
247
|
return executeCode(ctx, defaultDataSourceFormat, ['defaultValues'], defaultValues);
|
|
239
248
|
});
|
|
240
|
-
var handleDataSourceFormat = useMemoizedFn(function (dataSourceFormat, dataSetKey,
|
|
241
|
-
var values =
|
|
242
|
-
submitData =
|
|
243
|
-
behaviorKey =
|
|
249
|
+
var handleDataSourceFormat = useMemoizedFn(function (dataSourceFormat, dataSetKey, _ref7) {
|
|
250
|
+
var values = _ref7.values,
|
|
251
|
+
submitData = _ref7.submitData,
|
|
252
|
+
behaviorKey = _ref7.behaviorKey;
|
|
244
253
|
if (isNil(dataSourceFormat)) return _defineProperty({}, dataSetKey, submitData);
|
|
245
254
|
return executeCode(ctx, dataSourceFormat, ['dataSetKey', 'values', 'submitData', 'behaviorKey'], dataSetKey, values, submitData, behaviorKey);
|
|
246
255
|
});
|
|
@@ -251,8 +260,8 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
251
260
|
if (isNil(actionsColumnReset)) return columns;
|
|
252
261
|
return executeCode(ctx, actionsColumnReset, ['columns'], columns);
|
|
253
262
|
});
|
|
254
|
-
var handleGridFormReady = useMemoizedFn(function (onGridFormReady,
|
|
255
|
-
if (!isNil(onGridFormReady)) return executeCode(ctx, onGridFormReady, ['ref', 'params', 'gridForm'],
|
|
263
|
+
var handleGridFormReady = useMemoizedFn(function (onGridFormReady, _ref, params, gridForm) {
|
|
264
|
+
if (!isNil(onGridFormReady)) return executeCode(ctx, onGridFormReady, ['ref', 'params', 'gridForm'], _ref, params, gridForm);
|
|
256
265
|
});
|
|
257
266
|
var handleResetActions = useMemoizedFn(function (resetActions, data, index, actionList, params) {
|
|
258
267
|
if (isNil(resetActions)) return actionList;
|
|
@@ -278,8 +287,8 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
278
287
|
props.config.rules = props.config.rules || [];
|
|
279
288
|
if ((_verifyListObj$length = verifyListObj.length) !== null && _verifyListObj$length !== void 0 && _verifyListObj$length.expression) props.config.rules.push({
|
|
280
289
|
validator: function validator(rule, value, callback) {
|
|
281
|
-
var
|
|
282
|
-
var length = executeCode(ctx, verifyListObj.length.expression, ['cValue'], (
|
|
290
|
+
var _formRef$current;
|
|
291
|
+
var length = executeCode(ctx, verifyListObj.length.expression, ['cValue'], (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.getCValue());
|
|
283
292
|
if (value.length > length) callback("".concat(formatMessage({
|
|
284
293
|
id: "".concat(_I18N_PREFIX_, ".maxLength"),
|
|
285
294
|
label: '字数不得超过'
|
|
@@ -292,8 +301,8 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
292
301
|
});
|
|
293
302
|
if ((_verifyListObj$min = verifyListObj.min) !== null && _verifyListObj$min !== void 0 && _verifyListObj$min.expression) props.config.rules.push({
|
|
294
303
|
validator: function validator(rule, value, callback) {
|
|
295
|
-
var
|
|
296
|
-
var min = executeCode(ctx, verifyListObj.min.expression, ['cValue'], (
|
|
304
|
+
var _formRef$current2;
|
|
305
|
+
var min = executeCode(ctx, verifyListObj.min.expression, ['cValue'], (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : _formRef$current2.getCValue());
|
|
297
306
|
if (value < min) callback(formatMessage({
|
|
298
307
|
id: "".concat(_I18N_PREFIX_, ".numberBelowMin"),
|
|
299
308
|
label: '低于最小值'
|
|
@@ -303,8 +312,8 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
303
312
|
});
|
|
304
313
|
if ((_verifyListObj$max = verifyListObj.max) !== null && _verifyListObj$max !== void 0 && _verifyListObj$max.expression) props.config.rules.push({
|
|
305
314
|
validator: function validator(rule, value, callback) {
|
|
306
|
-
var
|
|
307
|
-
var max = executeCode(ctx, verifyListObj.max.expression, ['cValue'], (
|
|
315
|
+
var _formRef$current3;
|
|
316
|
+
var max = executeCode(ctx, verifyListObj.max.expression, ['cValue'], (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : _formRef$current3.getCValue());
|
|
308
317
|
if (value > max) callback(formatMessage({
|
|
309
318
|
id: "".concat(_I18N_PREFIX_, ".numberExceedMax"),
|
|
310
319
|
label: '超过最大值'
|
|
@@ -317,8 +326,8 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
317
326
|
if (verifyListObj.mobile) props.config.type = 'mobile';
|
|
318
327
|
if ((_verifyListObj$rules = verifyListObj.rules) !== null && _verifyListObj$rules !== void 0 && _verifyListObj$rules.expression) props.config.rules.push({
|
|
319
328
|
validator: function validator(rule, value, callback) {
|
|
320
|
-
var
|
|
321
|
-
executeCode(ctx, verifyListObj.rules.expression, ['cValue', 'rule', 'value', 'callback'], (
|
|
329
|
+
var _formRef$current4;
|
|
330
|
+
executeCode(ctx, verifyListObj.rules.expression, ['cValue', 'rule', 'value', 'callback'], (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : _formRef$current4.getCValue(), rule, value, callback);
|
|
322
331
|
}
|
|
323
332
|
});
|
|
324
333
|
return props;
|
|
@@ -393,8 +402,8 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
393
402
|
columnsReset: function columnsReset(columns) {
|
|
394
403
|
return handleColumnsReset(item.columnsReset, columns);
|
|
395
404
|
},
|
|
396
|
-
onGridFormReady: function onGridFormReady(
|
|
397
|
-
return handleGridFormReady(item.onGridFormReady,
|
|
405
|
+
onGridFormReady: function onGridFormReady(_ref, params, gridForm) {
|
|
406
|
+
return handleGridFormReady(item.onGridFormReady, _ref, params, gridForm);
|
|
398
407
|
}
|
|
399
408
|
});
|
|
400
409
|
if (item.actionsColumnReset) data = _objectSpread(_objectSpread({}, data), {}, {
|
|
@@ -466,7 +475,7 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
466
475
|
});
|
|
467
476
|
var beforeSubmit = useMemoizedFn(function (values, data) {
|
|
468
477
|
return new Promise( /*#__PURE__*/function () {
|
|
469
|
-
var
|
|
478
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve) {
|
|
470
479
|
var _data;
|
|
471
480
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
472
481
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -494,7 +503,7 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
494
503
|
}, _callee);
|
|
495
504
|
}));
|
|
496
505
|
return function (_x) {
|
|
497
|
-
return
|
|
506
|
+
return _ref9.apply(this, arguments);
|
|
498
507
|
};
|
|
499
508
|
}());
|
|
500
509
|
});
|
|
@@ -521,13 +530,8 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
521
530
|
displayName: "Form",
|
|
522
531
|
getTargetDom: getTargetDom,
|
|
523
532
|
api: apiRef
|
|
524
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
525
|
-
ref: boxRef,
|
|
526
|
-
style: {
|
|
527
|
-
width: width,
|
|
528
|
-
height: height
|
|
529
|
-
}
|
|
530
533
|
}, /*#__PURE__*/React.createElement(LdFormList, {
|
|
534
|
+
wrapperRef: wrapperRef,
|
|
531
535
|
id: id,
|
|
532
536
|
ldId: id,
|
|
533
537
|
className: classNames(styles['lc-component-form'], _defineProperty({}, className, !!className)),
|
|
@@ -535,7 +539,7 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
535
539
|
renderFormExtra: renderFormExtra,
|
|
536
540
|
mainFormLdId: "block_main",
|
|
537
541
|
initData: ((_ctx$pagePublicResour2 = ctx.pagePublicResource) === null || _ctx$pagePublicResour2 === void 0 ? void 0 : _ctx$pagePublicResour2[id]) || initData || _initData,
|
|
538
|
-
ref:
|
|
542
|
+
ref: formRef,
|
|
539
543
|
readOnly: readOnly,
|
|
540
544
|
showSaveBtn: showSave,
|
|
541
545
|
saveBtnTitle: saveTitle,
|
|
@@ -559,7 +563,7 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
559
563
|
}
|
|
560
564
|
return (_promiseRef$current = promiseRef.current) === null || _promiseRef$current === void 0 ? void 0 : _promiseRef$current.call.apply(_promiseRef$current, [promiseRef].concat(rest));
|
|
561
565
|
}
|
|
562
|
-
}))
|
|
566
|
+
}));
|
|
563
567
|
});
|
|
564
568
|
LCForm.defaultProps = omitBadProps(defaultMeta);
|
|
565
569
|
export default LCForm;
|
|
@@ -27,9 +27,11 @@ var LCPageLayout = function LCPageLayout(_ref) {
|
|
|
27
27
|
}, /*#__PURE__*/React.createElement(StyledLayout, {
|
|
28
28
|
wrapperRef: ref,
|
|
29
29
|
$css: css
|
|
30
|
-
},
|
|
30
|
+
}, display === 'tb' ? /*#__PURE__*/React.createElement(Layout.Main, null, (children === null || children === void 0 ? void 0 : children.length) === display.split('').length ? /*#__PURE__*/React.createElement(MemorySplit, {
|
|
31
|
+
split: "horizontal"
|
|
32
|
+
}, children === null || children === void 0 ? void 0 : children[0], children === null || children === void 0 ? void 0 : children[1]) : null) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Layout.Sider, null, children === null || children === void 0 ? void 0 : children[0]), /*#__PURE__*/React.createElement(Layout.Main, null, (children === null || children === void 0 ? void 0 : children.length) === display.split('').length ? /*#__PURE__*/React.createElement(React.Fragment, null, display === 'lr' ? children === null || children === void 0 ? void 0 : children[1] : /*#__PURE__*/React.createElement(MemorySplit, {
|
|
31
33
|
split: display === 'ltb' ? 'horizontal' : 'vertical'
|
|
32
|
-
}, children === null || children === void 0 ? void 0 : children[1], children === null || children === void 0 ? void 0 : children[2])) : null)));
|
|
34
|
+
}, children === null || children === void 0 ? void 0 : children[1], children === null || children === void 0 ? void 0 : children[2])) : null))));
|
|
33
35
|
};
|
|
34
36
|
LCPageLayout.defaultProps = omitBadProps(defaultMeta);
|
|
35
37
|
export default LCPageLayout;
|
|
@@ -215,7 +215,7 @@ export var TopUpload = function TopUpload(_ref4) {
|
|
|
215
215
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
216
216
|
type: "primary",
|
|
217
217
|
onClick: function onClick() {
|
|
218
|
-
if (!options.import) {
|
|
218
|
+
if (!isString(options.import)) {
|
|
219
219
|
return message.info("\u672A\u914D\u7F6E".concat(options.importType ? '行为' : '模版', "\uFF01"));
|
|
220
220
|
}
|
|
221
221
|
setVisible(true);
|
|
@@ -416,6 +416,9 @@ export var TopExport = function TopExport(_ref5) {
|
|
|
416
416
|
return /*#__PURE__*/React.createElement(Button, {
|
|
417
417
|
type: "primary",
|
|
418
418
|
onClick: function onClick() {
|
|
419
|
+
if (isString(options.export) && !options.export) {
|
|
420
|
+
return message.info("\u672A\u914D\u7F6E\u884C\u4E3A\uFF01");
|
|
421
|
+
}
|
|
419
422
|
doExportAll(handleExportAll);
|
|
420
423
|
}
|
|
421
424
|
}, "\u5BFC\u51FA");
|