@luck-design-biz/luckda 0.0.25-17 → 0.0.25-19
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/LdGrid/index.js +6 -9
- package/es/locales/zh-CN.js +5 -1
- package/es/lowcode/constants/event-topics.js +1 -1
- package/es/lowcode/engine/launcher.js +2 -0
- package/es/lowcode/engine/meta/form.props.json +0 -6
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +5 -17
- package/es/lowcode/engine/meta/page.props.json +6 -0
- package/es/lowcode/engine/meta/table.props.json +10 -4
- package/es/lowcode/engine/meta/tree.props.default.json +6 -6
- package/es/lowcode/engine/meta/tree.props.json +57 -63
- package/es/lowcode/engine/provider/ContextProvider/index.js +30 -33
- package/es/lowcode/engine/provider/ContextProvider/usePageState.js +21 -0
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +8 -13
- package/es/lowcode/engine/tools/diff.js +1 -1
- package/es/lowcode/engine/tools/helper.js +24 -12
- package/es/lowcode/engine/tools/useCombinedRefs.js +14 -0
- package/es/lowcode/painter/DesignToolbar.js +52 -23
- package/es/lowcode/painter/components/PreviewIframe.js +1 -1
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
- package/es/lowcode/painter/style/design.less +1 -0
- package/es/lowcode/preview/index.js +2 -4
- package/es/lowcode/view/Canvas.js +15 -2
- package/es/lowcode/view/lc-components/Form/index.js +42 -64
- package/es/lowcode/view/lc-components/Form/meta.json +0 -6
- package/es/lowcode/view/lc-components/Page/meta.json +6 -0
- package/es/lowcode/view/lc-components/PageLayout/index.js +2 -2
- package/es/lowcode/view/lc-components/Table/components/TopImex.js +2 -2
- package/es/lowcode/view/lc-components/Table/index.js +181 -195
- package/es/lowcode/view/lc-components/Table/meta.json +10 -4
- package/es/lowcode/view/lc-components/Tree/index.js +0 -20
- package/es/lowcode/view/lc-components/Tree/meta.json +57 -63
- package/lib/components/LdGrid/index.js +6 -9
- package/lib/locales/zh-CN.js +5 -1
- package/lib/lowcode/constants/event-topics.js +2 -2
- package/lib/lowcode/engine/launcher.js +2 -0
- package/lib/lowcode/engine/meta/form.props.json +0 -6
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +5 -17
- package/lib/lowcode/engine/meta/page.props.json +6 -0
- package/lib/lowcode/engine/meta/table.props.json +10 -4
- package/lib/lowcode/engine/meta/tree.props.default.json +6 -6
- package/lib/lowcode/engine/meta/tree.props.json +57 -63
- package/lib/lowcode/engine/provider/ContextProvider/index.js +29 -32
- package/lib/lowcode/engine/provider/ContextProvider/usePageState.js +28 -0
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +8 -13
- package/lib/lowcode/engine/tools/diff.js +1 -1
- package/lib/lowcode/engine/tools/helper.js +26 -12
- package/lib/lowcode/engine/tools/useCombinedRefs.js +20 -0
- package/lib/lowcode/painter/DesignToolbar.js +51 -22
- package/lib/lowcode/painter/components/PreviewIframe.js +1 -1
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
- package/lib/lowcode/painter/style/design.less +1 -0
- package/lib/lowcode/preview/index.js +2 -4
- package/lib/lowcode/view/Canvas.js +15 -2
- package/lib/lowcode/view/lc-components/Form/index.js +42 -64
- package/lib/lowcode/view/lc-components/Form/meta.json +0 -6
- package/lib/lowcode/view/lc-components/Page/meta.json +6 -0
- package/lib/lowcode/view/lc-components/PageLayout/index.js +2 -2
- package/lib/lowcode/view/lc-components/Table/components/TopImex.js +2 -2
- package/lib/lowcode/view/lc-components/Table/index.js +178 -192
- package/lib/lowcode/view/lc-components/Table/meta.json +10 -4
- package/lib/lowcode/view/lc-components/Tree/index.js +0 -20
- package/lib/lowcode/view/lc-components/Tree/meta.json +57 -63
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ import { useLocation } from 'umi';
|
|
|
11
11
|
import classNames from 'classnames';
|
|
12
12
|
import { useMemoizedFn, useRequest, useDebounceFn, useCookieState } from 'ahooks';
|
|
13
13
|
import { Select, Button, Icon, Divider, Modal, message, Drawer } from 'luck-design/antd';
|
|
14
|
-
import {
|
|
14
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
15
15
|
import { useContext, useGet, resetPageData, useTemporalStore } from "../engine/provider/ContextProvider";
|
|
16
16
|
import JsonEditor from "../painter/components/code-editor/JsonEditor";
|
|
17
17
|
import PreviewIframe from "./components/PreviewIframe";
|
|
@@ -52,15 +52,13 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
52
52
|
undo: state.undo,
|
|
53
53
|
redo: state.redo,
|
|
54
54
|
pastStates: state.pastStates,
|
|
55
|
-
futureStates: state.futureStates
|
|
56
|
-
clear: state.clear
|
|
55
|
+
futureStates: state.futureStates
|
|
57
56
|
};
|
|
58
57
|
}),
|
|
59
58
|
canUndo = _useTemporalStore.canUndo,
|
|
60
59
|
canRedo = _useTemporalStore.canRedo,
|
|
61
60
|
undo = _useTemporalStore.undo,
|
|
62
|
-
redo = _useTemporalStore.redo
|
|
63
|
-
clear = _useTemporalStore.clear;
|
|
61
|
+
redo = _useTemporalStore.redo;
|
|
64
62
|
var _useCookieState = useCookieState(COOKIE_VIRTUAL_ACCOUNT_KEY),
|
|
65
63
|
_useCookieState2 = _slicedToArray(_useCookieState, 2),
|
|
66
64
|
userId = _useCookieState2[0],
|
|
@@ -69,7 +67,7 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
69
67
|
manual: true
|
|
70
68
|
}),
|
|
71
69
|
clearCacheLoading = _useRequest.loading,
|
|
72
|
-
runClearCache = _useRequest.
|
|
70
|
+
runClearCache = _useRequest.runAsync;
|
|
73
71
|
var _useRequest2 = useRequest(fetchUpdatePageData, {
|
|
74
72
|
manual: true,
|
|
75
73
|
debounceWait: 300
|
|
@@ -95,21 +93,39 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
95
93
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
96
94
|
while (1) switch (_context.prev = _context.next) {
|
|
97
95
|
case 0:
|
|
98
|
-
|
|
96
|
+
message.loading({
|
|
97
|
+
content: formatMessage({
|
|
98
|
+
id: 'luckda.lowcode.design.toolbar.save.on',
|
|
99
|
+
label: '保存中...'
|
|
100
|
+
}),
|
|
101
|
+
key: 'saveLoading'
|
|
102
|
+
});
|
|
103
|
+
_context.next = 3;
|
|
99
104
|
return runAsync({
|
|
100
105
|
pageData: JSON.stringify(pageData),
|
|
101
106
|
pageCode: getLDMetaAttr('pageCode')
|
|
102
107
|
});
|
|
103
|
-
case
|
|
108
|
+
case 3:
|
|
104
109
|
_yield$runAsync = _context.sent;
|
|
105
110
|
code = _yield$runAsync.code;
|
|
106
111
|
if (code === 1) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
112
|
+
message.success({
|
|
113
|
+
content: formatMessage({
|
|
114
|
+
id: 'luckda.lowcode.design.toolbar.save.success',
|
|
115
|
+
label: '保存成功'
|
|
116
|
+
}),
|
|
117
|
+
key: 'saveLoading'
|
|
118
|
+
});
|
|
119
|
+
} else {
|
|
120
|
+
message.error({
|
|
121
|
+
content: formatMessage({
|
|
122
|
+
id: 'luckda.lowcode.design.toolbar.save.error',
|
|
123
|
+
label: '保存失败'
|
|
124
|
+
}),
|
|
125
|
+
key: 'saveLoading'
|
|
126
|
+
});
|
|
111
127
|
}
|
|
112
|
-
case
|
|
128
|
+
case 6:
|
|
113
129
|
case "end":
|
|
114
130
|
return _context.stop();
|
|
115
131
|
}
|
|
@@ -269,7 +285,7 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
269
285
|
fontSize: 12,
|
|
270
286
|
margin: '0 4px 0 2px'
|
|
271
287
|
},
|
|
272
|
-
|
|
288
|
+
disabled: clearCacheLoading,
|
|
273
289
|
onClick: handleClearCache
|
|
274
290
|
}, formatMessage({
|
|
275
291
|
id: 'luckda.lowcode.design.toolbar.clear',
|
|
@@ -280,16 +296,29 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
280
296
|
fontSize: 12,
|
|
281
297
|
margin: '0 4px 0 2px'
|
|
282
298
|
},
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
299
|
+
disabled: updatePageDataLoading,
|
|
300
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
301
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
302
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
303
|
+
case 0:
|
|
304
|
+
_context3.next = 2;
|
|
305
|
+
return handleSave();
|
|
306
|
+
case 2:
|
|
307
|
+
context.$publisher(context.topics.COMPONENT_ACTIVE, null);
|
|
308
|
+
setShowPreview(true);
|
|
309
|
+
case 4:
|
|
310
|
+
case "end":
|
|
311
|
+
return _context3.stop();
|
|
312
|
+
}
|
|
313
|
+
}, _callee3);
|
|
314
|
+
}))
|
|
287
315
|
}, formatMessage({
|
|
288
316
|
id: 'luckda.lowcode.design.toolbar.preview',
|
|
289
317
|
label: '预览'
|
|
290
318
|
})), /*#__PURE__*/React.createElement(Button, {
|
|
291
319
|
size: "small",
|
|
292
320
|
type: "primary",
|
|
321
|
+
disabled: updatePageDataLoading,
|
|
293
322
|
style: {
|
|
294
323
|
fontSize: 12,
|
|
295
324
|
padding: '0 7px 0 0',
|
|
@@ -312,7 +341,7 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
312
341
|
return setShow(true);
|
|
313
342
|
}
|
|
314
343
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
315
|
-
type:
|
|
344
|
+
type: "eye"
|
|
316
345
|
})))), /*#__PURE__*/React.createElement(Modal, {
|
|
317
346
|
visible: show,
|
|
318
347
|
width: 1024,
|
|
@@ -371,10 +400,10 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
371
400
|
setUserId(void 0);
|
|
372
401
|
}
|
|
373
402
|
}
|
|
374
|
-
}, userOptions.map(function (
|
|
375
|
-
var key =
|
|
376
|
-
label =
|
|
377
|
-
rest = _objectWithoutProperties(
|
|
403
|
+
}, userOptions.map(function (_ref6) {
|
|
404
|
+
var key = _ref6.key,
|
|
405
|
+
label = _ref6.label,
|
|
406
|
+
rest = _objectWithoutProperties(_ref6, _excluded);
|
|
378
407
|
return /*#__PURE__*/React.createElement(Select.Option, _extends({
|
|
379
408
|
key: key,
|
|
380
409
|
value: key
|
|
@@ -13,7 +13,7 @@ var PreviewIframe = function PreviewIframe(_ref) {
|
|
|
13
13
|
return getCreateHistoryOptions().basename;
|
|
14
14
|
});
|
|
15
15
|
return /*#__PURE__*/React.createElement(Iframe, {
|
|
16
|
-
src: "".concat(basename === '/' ? '' : basename, "/byteman/preview?code=").concat(code, "&user=").concat(userId)
|
|
16
|
+
src: "".concat(basename === '/' ? '' : basename, "/byteman/preview?code=").concat(code, "&user=").concat(userId, "&pure=1")
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
19
|
export default PreviewIframe;
|
|
@@ -79,11 +79,11 @@ var MainPanel = function MainPanel() {
|
|
|
79
79
|
}), /*#__PURE__*/React.createElement(WidthHeight, {
|
|
80
80
|
field: "height",
|
|
81
81
|
label: formatMessage({
|
|
82
|
-
id: 'luckda.lowcode.painter.panel-section.style-panel.
|
|
82
|
+
id: 'luckda.lowcode.painter.panel-section.style-panel.height',
|
|
83
83
|
label: '高'
|
|
84
84
|
}),
|
|
85
85
|
placeholder: formatMessage({
|
|
86
|
-
id: 'luckda.lowcode.painter.panel-section.style-panel.
|
|
86
|
+
id: 'luckda.lowcode.painter.panel-section.style-panel.height',
|
|
87
87
|
label: '请输入宽高度'
|
|
88
88
|
})
|
|
89
89
|
}), /*#__PURE__*/React.createElement(Display, {
|
|
@@ -7,8 +7,7 @@ import Page from "../view/Page";
|
|
|
7
7
|
import { RUNTIME } from "../constants/index";
|
|
8
8
|
var Preview = function Preview(_ref) {
|
|
9
9
|
var code = _ref.code,
|
|
10
|
-
userId = _ref.userId
|
|
11
|
-
debug = _ref.debug;
|
|
10
|
+
userId = _ref.userId;
|
|
12
11
|
var _useState = useState(userId),
|
|
13
12
|
_useState2 = _slicedToArray(_useState, 2),
|
|
14
13
|
currentKey = _useState2[0],
|
|
@@ -22,8 +21,7 @@ var Preview = function Preview(_ref) {
|
|
|
22
21
|
return code && currentKey ? /*#__PURE__*/React.createElement(EventBusProvider, {
|
|
23
22
|
runtime: RUNTIME.PREVIEW
|
|
24
23
|
}, /*#__PURE__*/React.createElement(ContextProvider, {
|
|
25
|
-
code: code
|
|
26
|
-
debug: debug
|
|
24
|
+
code: code
|
|
27
25
|
}, /*#__PURE__*/React.createElement(Page, null))) : null;
|
|
28
26
|
};
|
|
29
27
|
export default Preview;
|
|
@@ -30,11 +30,24 @@ var Canvas = function Canvas(_ref) {
|
|
|
30
30
|
var _advance$events;
|
|
31
31
|
ctx.doAction(advance === null || advance === void 0 || (_advance$events = advance.events) === null || _advance$events === void 0 ? void 0 : _advance$events.onPageMount);
|
|
32
32
|
});
|
|
33
|
+
var handleStateChanged = useMemoizedFn(function (_ref2) {
|
|
34
|
+
var _advance$events2;
|
|
35
|
+
var state = _ref2.state,
|
|
36
|
+
prevState = _ref2.prevState,
|
|
37
|
+
diff = _ref2.diff;
|
|
38
|
+
ctx.doAction(advance === null || advance === void 0 || (_advance$events2 = advance.events) === null || _advance$events2 === void 0 ? void 0 : _advance$events2.onStateChanged, {
|
|
39
|
+
state: state,
|
|
40
|
+
prevState: prevState,
|
|
41
|
+
diff: diff
|
|
42
|
+
});
|
|
43
|
+
});
|
|
33
44
|
useEffect(function () {
|
|
34
45
|
ctx.$subscriber(ctx.topics.PAGE_LOAD_MOUNT).once(handleMount).watch();
|
|
46
|
+
var tid = ctx.$subscriber(ctx.topics.PAGE_STATE_CHANGED).on(handleStateChanged);
|
|
35
47
|
return function () {
|
|
36
|
-
var _advance$
|
|
37
|
-
ctx
|
|
48
|
+
var _advance$events3;
|
|
49
|
+
ctx.$unsubscriber(ctx.topics.PAGE_STATE_CHANGED, tid);
|
|
50
|
+
ctx.doAction(advance === null || advance === void 0 || (_advance$events3 = advance.events) === null || _advance$events3 === void 0 ? void 0 : _advance$events3.onPageUnmount);
|
|
38
51
|
};
|
|
39
52
|
}, []);
|
|
40
53
|
return /*#__PURE__*/React.createElement(PageRoot, {
|
|
@@ -5,7 +5,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
5
5
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
6
6
|
var _excluded = ["advance"];
|
|
7
7
|
import React, { useRef, forwardRef, Fragment, useImperativeHandle, useEffect } from 'react';
|
|
8
|
-
import { useMemoizedFn, useCreation,
|
|
8
|
+
import { useMemoizedFn, useCreation, useUnmount } from 'ahooks';
|
|
9
9
|
import classNames from 'classnames';
|
|
10
10
|
import { reduce, includes, isNil, cloneDeep, last, startsWith, isString } from 'lodash';
|
|
11
11
|
import { BasicDivider } from 'luck-design';
|
|
@@ -17,6 +17,7 @@ import { omitBadProps, executeCode, getLDMetaAttr } from "../../../engine/tools/
|
|
|
17
17
|
import { useContext, useRemoteSource, modifyNode } from "../../../engine/provider/ContextProvider";
|
|
18
18
|
import buildUploadForm from "../../../../upload/Form";
|
|
19
19
|
import RuntimeComp from "../JSX/RuntimeComp";
|
|
20
|
+
import useCombinedRefs from "../../../engine/tools/useCombinedRefs";
|
|
20
21
|
import defaultMeta from "../../../engine/meta/form.props.default.json";
|
|
21
22
|
import styles from "./index.less";
|
|
22
23
|
var _I18N_PREFIX_ = 'lc.form.validator';
|
|
@@ -53,20 +54,8 @@ var getMthodParams = function getMthodParams(methodStr) {
|
|
|
53
54
|
}
|
|
54
55
|
return [];
|
|
55
56
|
};
|
|
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
57
|
var LCForm = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
69
|
-
var _ctx$
|
|
58
|
+
var _ctx$state2;
|
|
70
59
|
var id = _ref3.id,
|
|
71
60
|
className = _ref3.className,
|
|
72
61
|
blocks = _ref3.blocks,
|
|
@@ -102,48 +91,31 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
102
91
|
return !hidden;
|
|
103
92
|
});
|
|
104
93
|
}, [blocks]);
|
|
105
|
-
|
|
106
|
-
ctx.doAction(advance.events.
|
|
94
|
+
useUnmount(function () {
|
|
95
|
+
return ctx.doAction(advance.events.onUnmount, {
|
|
107
96
|
instance: formRef.current
|
|
108
97
|
});
|
|
109
98
|
});
|
|
110
|
-
useEffect(function () {
|
|
111
|
-
var tid = ctx.$subscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED).on(function (_ref5) {
|
|
112
|
-
var resource = _ref5.resource,
|
|
113
|
-
prevResource = _ref5.prevResource;
|
|
114
|
-
ctx.doAction(advance.events.onPagePublicResourceChanged, {
|
|
115
|
-
resource: resource,
|
|
116
|
-
prevResource: prevResource,
|
|
117
|
-
instance: formRef.current
|
|
118
|
-
});
|
|
119
|
-
}).watch();
|
|
120
|
-
return function () {
|
|
121
|
-
ctx.$unsubscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED, tid);
|
|
122
|
-
ctx.doAction(advance.events.onUnmount, {
|
|
123
|
-
instance: formRef.current
|
|
124
|
-
});
|
|
125
|
-
};
|
|
126
|
-
}, []);
|
|
127
99
|
useImperativeHandle(apiRef, function () {
|
|
128
100
|
return {
|
|
129
|
-
/**
|
|
130
|
-
* 获取表格实例
|
|
131
|
-
* @method
|
|
101
|
+
/**
|
|
102
|
+
* 获取表格实例
|
|
103
|
+
* @method
|
|
132
104
|
*/
|
|
133
105
|
getInstance: function getInstance() {
|
|
134
106
|
return formRef.current;
|
|
135
107
|
},
|
|
136
|
-
/**
|
|
137
|
-
* 提交表格数据
|
|
138
|
-
* @method
|
|
108
|
+
/**
|
|
109
|
+
* 提交表格数据
|
|
110
|
+
* @method
|
|
139
111
|
*/
|
|
140
112
|
submit: function submit() {
|
|
141
113
|
return new Promise(function (resolve) {
|
|
142
|
-
var _ctx$
|
|
114
|
+
var _ctx$state;
|
|
143
115
|
promiseRef.current = resolve;
|
|
144
116
|
var instance = formRef.current;
|
|
145
|
-
var
|
|
146
|
-
formMode =
|
|
117
|
+
var _ref5 = ((_ctx$state = ctx.state) === null || _ctx$state === void 0 ? void 0 : _ctx$state[id]) || initData || _initData || {},
|
|
118
|
+
formMode = _ref5.formMode;
|
|
147
119
|
if (formMode === 'add') {
|
|
148
120
|
instance.onAdd();
|
|
149
121
|
} else if (formMode === 'update') {
|
|
@@ -151,22 +123,22 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
151
123
|
}
|
|
152
124
|
});
|
|
153
125
|
},
|
|
154
|
-
/**
|
|
155
|
-
* @typedef {Object} Field
|
|
156
|
-
* @property {Object} target - 字段引用
|
|
157
|
-
* @property {boolean} disabled - 字段不可维护
|
|
158
|
-
* @property {boolean} required - 字段必填
|
|
159
|
-
* @property {any} value - 字段值
|
|
126
|
+
/**
|
|
127
|
+
* @typedef {Object} Field
|
|
128
|
+
* @property {Object} target - 字段引用
|
|
129
|
+
* @property {boolean} disabled - 字段不可维护
|
|
130
|
+
* @property {boolean} required - 字段必填
|
|
131
|
+
* @property {any} value - 字段值
|
|
160
132
|
*/
|
|
161
|
-
/**
|
|
162
|
-
* @typedef {Object} Block
|
|
163
|
-
* @property {Object} target - 区块引用
|
|
164
|
-
* @property {function(fieldName): Field} getField - 获取区块下的表单域
|
|
133
|
+
/**
|
|
134
|
+
* @typedef {Object} Block
|
|
135
|
+
* @property {Object} target - 区块引用
|
|
136
|
+
* @property {function(fieldName): Field} getField - 获取区块下的表单域
|
|
165
137
|
*/
|
|
166
|
-
/**
|
|
167
|
-
* 获取区块
|
|
168
|
-
* @param {*} blockId - 区块ID
|
|
169
|
-
* @returns {Block}
|
|
138
|
+
/**
|
|
139
|
+
* 获取区块
|
|
140
|
+
* @param {*} blockId - 区块ID
|
|
141
|
+
* @returns {Block}
|
|
170
142
|
*/
|
|
171
143
|
getBlock: function getBlock(blockId) {
|
|
172
144
|
var instance = formRef.current;
|
|
@@ -246,10 +218,10 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
246
218
|
};
|
|
247
219
|
return executeCode(ctx, defaultDataSourceFormat, ['defaultValues'], defaultValues);
|
|
248
220
|
});
|
|
249
|
-
var handleDataSourceFormat = useMemoizedFn(function (dataSourceFormat, dataSetKey,
|
|
250
|
-
var values =
|
|
251
|
-
submitData =
|
|
252
|
-
behaviorKey =
|
|
221
|
+
var handleDataSourceFormat = useMemoizedFn(function (dataSourceFormat, dataSetKey, _ref6) {
|
|
222
|
+
var values = _ref6.values,
|
|
223
|
+
submitData = _ref6.submitData,
|
|
224
|
+
behaviorKey = _ref6.behaviorKey;
|
|
253
225
|
if (isNil(dataSourceFormat)) return _defineProperty({}, dataSetKey, submitData);
|
|
254
226
|
return executeCode(ctx, dataSourceFormat, ['dataSetKey', 'values', 'submitData', 'behaviorKey'], dataSetKey, values, submitData, behaviorKey);
|
|
255
227
|
});
|
|
@@ -475,7 +447,7 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
475
447
|
});
|
|
476
448
|
var beforeSubmit = useMemoizedFn(function (values, data) {
|
|
477
449
|
return new Promise( /*#__PURE__*/function () {
|
|
478
|
-
var
|
|
450
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve) {
|
|
479
451
|
var _data;
|
|
480
452
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
481
453
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -503,10 +475,15 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
503
475
|
}, _callee);
|
|
504
476
|
}));
|
|
505
477
|
return function (_x) {
|
|
506
|
-
return
|
|
478
|
+
return _ref8.apply(this, arguments);
|
|
507
479
|
};
|
|
508
480
|
}());
|
|
509
481
|
});
|
|
482
|
+
var afterInit = useMemoizedFn(function () {
|
|
483
|
+
ctx.doAction(advance.events.onMount, {
|
|
484
|
+
instance: formRef.current
|
|
485
|
+
});
|
|
486
|
+
});
|
|
510
487
|
var afterSubmit = useMemoizedFn(function (success, mainKey, res) {
|
|
511
488
|
ctx.doAction(advance.events.onSaveCallback, {
|
|
512
489
|
success: success,
|
|
@@ -538,7 +515,7 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
538
515
|
renderFormList: renderFormList,
|
|
539
516
|
renderFormExtra: renderFormExtra,
|
|
540
517
|
mainFormLdId: "block_main",
|
|
541
|
-
initData: ((_ctx$
|
|
518
|
+
initData: ((_ctx$state2 = ctx.state) === null || _ctx$state2 === void 0 ? void 0 : _ctx$state2[id]) || initData || _initData,
|
|
542
519
|
ref: formRef,
|
|
543
520
|
readOnly: readOnly,
|
|
544
521
|
showSaveBtn: showSave,
|
|
@@ -562,7 +539,8 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
562
539
|
rest[_key5] = arguments[_key5];
|
|
563
540
|
}
|
|
564
541
|
return (_promiseRef$current = promiseRef.current) === null || _promiseRef$current === void 0 ? void 0 : _promiseRef$current.call.apply(_promiseRef$current, [promiseRef].concat(rest));
|
|
565
|
-
}
|
|
542
|
+
},
|
|
543
|
+
afterInit: afterInit
|
|
566
544
|
}));
|
|
567
545
|
});
|
|
568
546
|
LCForm.defaultProps = omitBadProps(defaultMeta);
|
|
@@ -604,12 +604,6 @@
|
|
|
604
604
|
"name": "表单内容发生改变时的回调",
|
|
605
605
|
"desc": "表单内容发生改变时的回调",
|
|
606
606
|
"func": "function onChildChange(instance) {\n\t\n}"
|
|
607
|
-
},
|
|
608
|
-
{
|
|
609
|
-
"key": "onPagePublicResourceChanged",
|
|
610
|
-
"name": "页面共享资源变化后",
|
|
611
|
-
"desc": "当页面共享资源发生变化后(pagePublicResourceChanged),执行方法",
|
|
612
|
-
"func": "function onPagePublicResourceChanged(resource, prevResource, instance) {\n\t\n}"
|
|
613
607
|
}
|
|
614
608
|
]
|
|
615
609
|
}
|
|
@@ -32,6 +32,12 @@
|
|
|
32
32
|
"css": "background-color: transparent;",
|
|
33
33
|
"advance": {
|
|
34
34
|
"events": [
|
|
35
|
+
{
|
|
36
|
+
"key": "onStateChanged",
|
|
37
|
+
"name": "页面状态变化",
|
|
38
|
+
"desc": "在页面状态发生变化时,执行方法",
|
|
39
|
+
"func": "function onStateChanged(state, prevState, diff){\n\t\n}"
|
|
40
|
+
},
|
|
35
41
|
{
|
|
36
42
|
"key": "onPageMount",
|
|
37
43
|
"name": "页面首次渲染完成",
|
|
@@ -29,9 +29,9 @@ var LCPageLayout = function LCPageLayout(_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
31
|
split: "horizontal"
|
|
32
|
-
}, children) : null) : /*#__PURE__*/React.createElement(
|
|
32
|
+
}, children) : 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, {
|
|
33
33
|
split: display === 'ltb' ? 'horizontal' : 'vertical'
|
|
34
|
-
}, 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)]));
|
|
35
35
|
};
|
|
36
36
|
LCPageLayout.defaultProps = omitBadProps(defaultMeta);
|
|
37
37
|
export default LCPageLayout;
|
|
@@ -279,7 +279,7 @@ export var TopExport = function TopExport(_ref5) {
|
|
|
279
279
|
var handleExportAll = function handleExportAll(procress) {
|
|
280
280
|
return new Promise( /*#__PURE__*/function () {
|
|
281
281
|
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(resolve, reject) {
|
|
282
|
-
var isBehavior, strategy, behaviorKey, _exportExcelParams, _exportExcelPrefix, exportExcelResponse, _tableRef$
|
|
282
|
+
var isBehavior, strategy, behaviorKey, _exportExcelParams, _exportExcelPrefix, exportExcelResponse, _tableRef$current, joiner, labels, fieldInfo, defaultExcelParams, _exportExcelParams2, _exportExcelPrefix2, _exportExcelResponse;
|
|
283
283
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
284
284
|
while (1) switch (_context2.prev = _context2.next) {
|
|
285
285
|
case 0:
|
|
@@ -323,7 +323,7 @@ export var TopExport = function TopExport(_ref5) {
|
|
|
323
323
|
joiner = apiUrl.indexOf('?') !== -1 ? '&' : '?';
|
|
324
324
|
labels = [];
|
|
325
325
|
fieldInfo = [];
|
|
326
|
-
tableRef === null ||
|
|
326
|
+
(_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 || (_tableRef$current = _tableRef$current.gridApi) === null || _tableRef$current === void 0 || _tableRef$current.columnApi.getAllDisplayedColumns().forEach(function (column) {
|
|
327
327
|
if (column.colId !== 'luck-expand' && column.colId !== 'luck-select' && column.colId !== 'luck-index' && column.colId !== 'luck-actions' && column.colId !== 'fraction_drag'
|
|
328
328
|
// !column.colDef.draggable
|
|
329
329
|
) {
|