@luck-design-biz/luckda 0.0.25-6 → 0.0.25-8
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/LDActions/index.js +8 -10
- package/es/components/LDActions/index.less +7 -4
- package/es/components/LdAutoForm/index.js +26 -8
- package/es/components/LdFormList/index.js +37 -22
- package/es/components/LdGrid/index.js +14 -7
- package/es/components/LdGridForm/index.js +18 -6
- package/es/components/LdTree/index.js +33 -15
- package/es/helper/form.js +15 -8
- package/es/locales/zh-CN.js +16 -10
- package/es/lowcode/constants/api-url.js +120 -32
- package/es/lowcode/constants/event-topics.js +2 -0
- package/es/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +4 -2
- package/es/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +4 -2
- package/es/lowcode/engine/meta/box.props.json +3 -3
- package/es/lowcode/engine/meta/button.props.json +3 -3
- package/es/lowcode/engine/meta/components-list.json +6 -0
- package/es/lowcode/engine/meta/dialog.props.default.json +10 -5
- package/es/lowcode/engine/meta/dialog.props.json +72 -42
- package/es/lowcode/engine/meta/drawer.props.json +8 -20
- package/es/lowcode/engine/meta/form.props.json +16 -10
- package/es/lowcode/engine/meta/imex.props.default.json +8 -1
- package/es/lowcode/engine/meta/imex.props.json +54 -22
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +53 -3
- package/es/lowcode/engine/meta/layout.props.json +2 -2
- package/es/lowcode/engine/meta/page.props.json +2 -2
- package/es/lowcode/engine/meta/pagelayout.props.default.json +14 -0
- package/es/lowcode/engine/meta/pagelayout.props.json +47 -0
- package/es/lowcode/engine/meta/section.props.json +2 -2
- package/es/lowcode/engine/meta/split.props.default.json +1 -1
- package/es/lowcode/engine/meta/split.props.json +4 -4
- package/es/lowcode/engine/meta/table.props.json +17 -11
- package/es/lowcode/engine/meta/tabs.props.json +3 -3
- package/es/lowcode/engine/meta/tree.props.default.json +2 -0
- package/es/lowcode/engine/meta/tree.props.json +62 -6
- package/es/lowcode/engine/provider/ContextProvider/index.js +20 -43
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +69 -24
- package/es/lowcode/engine/tools/dataProcess.js +4 -0
- package/es/lowcode/engine/tools/helper.js +2 -3
- package/es/lowcode/engine/tools/useCanvasRender.js +3 -2
- package/es/lowcode/engine/tools/usePageDataStore.js +176 -0
- package/es/lowcode/engine/tools/usePromiseState.js +12 -23
- package/es/lowcode/engine/tools/useTodo.js +20 -10
- package/es/lowcode/painter/DesignOperator.js +12 -23
- package/es/lowcode/painter/DesignToolbar.js +10 -45
- package/es/lowcode/painter/Outline.js +2 -4
- package/es/lowcode/painter/Panel.js +29 -28
- package/es/lowcode/painter/components/ActionBindModal.js +30 -24
- package/es/lowcode/painter/components/AdvancePanel.js +6 -1
- package/es/lowcode/painter/components/AttrsPanel.js +38 -29
- package/es/lowcode/painter/components/DragDrop/DragDropContext.js +1 -1
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +3 -2
- package/es/lowcode/painter/components/field-setting/CheckFrontRules.js +108 -0
- package/es/lowcode/painter/components/field-setting/CheckRules.js +1 -26
- package/es/lowcode/painter/components/field-setting/FieldRulesModal.js +33 -13
- package/es/lowcode/painter/components/field-setting/SettingUI.js +162 -30
- package/es/lowcode/painter/components/field-setting/index.js +32 -63
- package/es/lowcode/painter/components/field-setting/meta/frontRules.js +53 -0
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +14 -17
- package/es/lowcode/painter/panel-section/ButtonType.js +4 -2
- package/es/lowcode/painter/panel-section/DataSetSelector.js +4 -1
- package/es/lowcode/painter/panel-section/FieldsSetting.js +53 -8
- package/es/lowcode/painter/panel-section/ImpExp.js +93 -6
- package/es/lowcode/painter/panel-section/ImpExpAlone.js +109 -0
- package/es/lowcode/painter/panel-section/PageLayoutDisplay.js +95 -0
- package/es/lowcode/painter/panel-section/SerialsSelector.js +4 -2
- package/es/lowcode/painter/panel-section/SplitDisplay.js +25 -110
- package/es/lowcode/painter/panel-section/StylePanel/index.js +10 -4
- package/es/lowcode/painter/panel-section/TreeRootEditor.js +2 -2
- package/es/lowcode/painter/style/action-bind-modal.less +3 -3
- package/es/lowcode/painter/style/design.less +1 -1
- package/es/lowcode/painter/style/page-layout-display.less +28 -0
- package/es/lowcode/painter/style/panel-item.less +1 -1
- package/es/lowcode/painter/style/split-display.less +0 -9
- package/es/lowcode/preview/index.js +4 -2
- package/es/lowcode/view/Canvas.js +6 -7
- package/es/lowcode/view/Page.js +2 -3
- package/es/lowcode/view/lc-components/Box/FunctionDesign.js +3 -2
- package/es/lowcode/view/lc-components/Box/meta.json +3 -3
- package/es/lowcode/view/lc-components/Button/index.js +2 -6
- package/es/lowcode/view/lc-components/Button/meta.json +3 -3
- package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +3 -10
- package/es/lowcode/view/lc-components/Dialog/index.js +114 -19
- package/es/lowcode/view/lc-components/Dialog/meta.json +65 -42
- package/es/lowcode/view/lc-components/Drawer/meta.json +8 -20
- package/es/lowcode/view/lc-components/Form/FunctionDesign.js +23 -33
- package/es/lowcode/view/lc-components/Form/FunctionPreview.js +8 -1
- package/es/lowcode/view/lc-components/Form/index.js +113 -21
- package/es/lowcode/view/lc-components/Form/meta.json +16 -10
- package/es/lowcode/view/lc-components/ImEx/FunctionDesign.js +8 -3
- package/es/lowcode/view/lc-components/ImEx/index.js +260 -10
- package/es/lowcode/view/lc-components/ImEx/index.less +7 -0
- package/es/lowcode/view/lc-components/ImEx/meta.json +55 -23
- package/es/lowcode/view/lc-components/Layout/FunctionDesign.js +12 -19
- package/es/lowcode/view/lc-components/Layout/meta.json +2 -2
- package/es/lowcode/view/lc-components/Page/meta.json +2 -2
- package/es/lowcode/view/lc-components/PageContent/index.js +8 -9
- package/es/lowcode/view/lc-components/PageFooter/index.js +2 -5
- package/es/lowcode/view/lc-components/PageHeader/index.js +5 -6
- package/es/lowcode/view/lc-components/PageLayout/FunctionDesign.js +63 -0
- package/es/lowcode/view/lc-components/PageLayout/FunctionLive.js +10 -0
- package/es/lowcode/view/lc-components/PageLayout/FunctionPreview.js +10 -0
- package/es/lowcode/view/lc-components/PageLayout/index.js +32 -0
- package/es/lowcode/view/lc-components/PageLayout/meta.json +47 -0
- package/es/lowcode/view/lc-components/PageModal/index.js +12 -15
- package/es/lowcode/view/lc-components/Section/FunctionDesign.js +3 -9
- package/es/lowcode/view/lc-components/Section/meta.json +2 -2
- package/es/lowcode/view/lc-components/Split/FunctionDesign.js +19 -20
- package/es/lowcode/view/lc-components/Split/index.js +5 -9
- package/es/lowcode/view/lc-components/Split/meta.json +4 -4
- package/es/lowcode/view/lc-components/Table/components/TopImex.js +138 -0
- package/es/lowcode/view/lc-components/Table/index.js +124 -39
- package/es/lowcode/view/lc-components/Table/meta.json +17 -11
- package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +10 -17
- package/es/lowcode/view/lc-components/Tabs/index.js +3 -1
- package/es/lowcode/view/lc-components/Tabs/meta.json +3 -3
- package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +2 -1
- package/es/lowcode/view/lc-components/Tree/index.js +67 -18
- package/es/lowcode/view/lc-components/Tree/meta.json +62 -7
- package/es/lowcode/view/lc-components/Wrapper.js +9 -11
- package/es/services.js +0 -24
- package/es/upload/FilesWall/file.png +0 -0
- package/es/upload/FilesWall/index.js +422 -0
- package/es/upload/FilesWall/index.less +74 -0
- package/es/upload/Form/index.js +2 -1
- package/es/upload/FormItem/index.js +3 -5
- package/es/upload/index.js +2 -1
- package/es/utils/action.js +2 -2
- package/lib/components/LDActions/index.js +7 -9
- package/lib/components/LDActions/index.less +7 -4
- package/lib/components/LdAutoForm/index.js +25 -7
- package/lib/components/LdFormList/index.js +36 -21
- package/lib/components/LdGrid/index.js +14 -7
- package/lib/components/LdGridForm/index.js +16 -4
- package/lib/components/LdTree/index.js +33 -15
- package/lib/helper/form.js +14 -7
- package/lib/locales/zh-CN.js +16 -10
- package/lib/lowcode/constants/api-url.js +123 -32
- package/lib/lowcode/constants/event-topics.js +3 -1
- package/lib/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +4 -2
- package/lib/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +4 -2
- package/lib/lowcode/engine/meta/box.props.json +3 -3
- package/lib/lowcode/engine/meta/button.props.json +3 -3
- package/lib/lowcode/engine/meta/components-list.json +6 -0
- package/lib/lowcode/engine/meta/dialog.props.default.json +10 -5
- package/lib/lowcode/engine/meta/dialog.props.json +72 -42
- package/lib/lowcode/engine/meta/drawer.props.json +8 -20
- package/lib/lowcode/engine/meta/form.props.json +16 -10
- package/lib/lowcode/engine/meta/imex.props.default.json +8 -1
- package/lib/lowcode/engine/meta/imex.props.json +54 -22
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +53 -3
- package/lib/lowcode/engine/meta/layout.props.json +2 -2
- package/lib/lowcode/engine/meta/page.props.json +2 -2
- package/lib/lowcode/engine/meta/pagelayout.props.default.json +14 -0
- package/lib/lowcode/engine/meta/pagelayout.props.json +47 -0
- package/lib/lowcode/engine/meta/section.props.json +2 -2
- package/lib/lowcode/engine/meta/split.props.default.json +1 -1
- package/lib/lowcode/engine/meta/split.props.json +4 -4
- package/lib/lowcode/engine/meta/table.props.json +17 -11
- package/lib/lowcode/engine/meta/tabs.props.json +3 -3
- package/lib/lowcode/engine/meta/tree.props.default.json +2 -0
- package/lib/lowcode/engine/meta/tree.props.json +62 -6
- package/lib/lowcode/engine/provider/ContextProvider/index.js +36 -43
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +68 -23
- package/lib/lowcode/engine/tools/dataProcess.js +4 -0
- package/lib/lowcode/engine/tools/helper.js +2 -3
- package/lib/lowcode/engine/tools/useCanvasRender.js +3 -2
- package/lib/lowcode/engine/tools/usePageDataStore.js +183 -0
- package/lib/lowcode/engine/tools/usePromiseState.js +11 -21
- package/lib/lowcode/engine/tools/useTodo.js +19 -9
- package/lib/lowcode/painter/DesignOperator.js +11 -22
- package/lib/lowcode/painter/DesignToolbar.js +9 -44
- package/lib/lowcode/painter/Outline.js +1 -3
- package/lib/lowcode/painter/Panel.js +28 -27
- package/lib/lowcode/painter/components/ActionBindModal.js +28 -22
- package/lib/lowcode/painter/components/AdvancePanel.js +6 -1
- package/lib/lowcode/painter/components/AttrsPanel.js +37 -28
- package/lib/lowcode/painter/components/DragDrop/DragDropContext.js +1 -1
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +3 -2
- package/lib/lowcode/painter/components/field-setting/CheckFrontRules.js +116 -0
- package/lib/lowcode/painter/components/field-setting/CheckRules.js +1 -26
- package/lib/lowcode/painter/components/field-setting/FieldRulesModal.js +34 -13
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +159 -27
- package/lib/lowcode/painter/components/field-setting/index.js +32 -63
- package/lib/lowcode/painter/components/field-setting/meta/frontRules.js +59 -0
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +13 -16
- package/lib/lowcode/painter/panel-section/ButtonType.js +4 -2
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +4 -1
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +53 -8
- package/lib/lowcode/painter/panel-section/ImpExp.js +92 -5
- package/lib/lowcode/painter/panel-section/ImpExpAlone.js +115 -0
- package/lib/lowcode/painter/panel-section/PageLayoutDisplay.js +103 -0
- package/lib/lowcode/painter/panel-section/SerialsSelector.js +4 -2
- package/lib/lowcode/painter/panel-section/SplitDisplay.js +24 -109
- package/lib/lowcode/painter/panel-section/StylePanel/index.js +10 -4
- package/lib/lowcode/painter/panel-section/TreeRootEditor.js +2 -2
- package/lib/lowcode/painter/style/action-bind-modal.less +3 -3
- package/lib/lowcode/painter/style/design.less +1 -1
- package/lib/lowcode/painter/style/page-layout-display.less +28 -0
- package/lib/lowcode/painter/style/panel-item.less +1 -1
- package/lib/lowcode/painter/style/split-display.less +0 -9
- package/lib/lowcode/preview/index.js +4 -2
- package/lib/lowcode/view/Canvas.js +5 -6
- package/lib/lowcode/view/Page.js +2 -3
- package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +3 -2
- package/lib/lowcode/view/lc-components/Box/meta.json +3 -3
- package/lib/lowcode/view/lc-components/Button/index.js +2 -6
- package/lib/lowcode/view/lc-components/Button/meta.json +3 -3
- package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +2 -9
- package/lib/lowcode/view/lc-components/Dialog/index.js +114 -19
- package/lib/lowcode/view/lc-components/Dialog/meta.json +65 -42
- package/lib/lowcode/view/lc-components/Drawer/meta.json +8 -20
- package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +20 -31
- package/lib/lowcode/view/lc-components/Form/FunctionPreview.js +8 -1
- package/lib/lowcode/view/lc-components/Form/index.js +110 -18
- package/lib/lowcode/view/lc-components/Form/meta.json +16 -10
- package/lib/lowcode/view/lc-components/ImEx/FunctionDesign.js +8 -3
- package/lib/lowcode/view/lc-components/ImEx/index.js +257 -8
- package/lib/lowcode/view/lc-components/ImEx/index.less +7 -0
- package/lib/lowcode/view/lc-components/ImEx/meta.json +55 -23
- package/lib/lowcode/view/lc-components/Layout/FunctionDesign.js +11 -18
- package/lib/lowcode/view/lc-components/Layout/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Page/meta.json +2 -2
- package/lib/lowcode/view/lc-components/PageContent/index.js +7 -8
- package/lib/lowcode/view/lc-components/PageFooter/index.js +2 -5
- package/lib/lowcode/view/lc-components/PageHeader/index.js +4 -5
- package/lib/lowcode/view/lc-components/PageLayout/FunctionDesign.js +71 -0
- package/lib/lowcode/view/lc-components/PageLayout/FunctionLive.js +17 -0
- package/lib/lowcode/view/lc-components/PageLayout/FunctionPreview.js +17 -0
- package/lib/lowcode/view/lc-components/PageLayout/index.js +40 -0
- package/lib/lowcode/view/lc-components/PageLayout/meta.json +47 -0
- package/lib/lowcode/view/lc-components/PageModal/index.js +11 -14
- package/lib/lowcode/view/lc-components/Section/FunctionDesign.js +2 -8
- package/lib/lowcode/view/lc-components/Section/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +19 -20
- package/lib/lowcode/view/lc-components/Split/index.js +2 -6
- package/lib/lowcode/view/lc-components/Split/meta.json +4 -4
- package/lib/lowcode/view/lc-components/Table/components/TopImex.js +145 -0
- package/lib/lowcode/view/lc-components/Table/index.js +123 -38
- package/lib/lowcode/view/lc-components/Table/meta.json +17 -11
- package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +11 -18
- package/lib/lowcode/view/lc-components/Tabs/index.js +3 -1
- package/lib/lowcode/view/lc-components/Tabs/meta.json +3 -3
- package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Tree/index.js +65 -16
- package/lib/lowcode/view/lc-components/Tree/meta.json +62 -7
- package/lib/lowcode/view/lc-components/Wrapper.js +8 -10
- package/lib/services.js +0 -25
- package/lib/upload/FilesWall/file.png +0 -0
- package/lib/upload/FilesWall/index.js +429 -0
- package/lib/upload/FilesWall/index.less +74 -0
- package/lib/upload/Form/index.js +2 -1
- package/lib/upload/FormItem/index.js +3 -5
- package/lib/upload/index.js +8 -1
- package/lib/utils/action.js +2 -2
- package/package.json +5 -4
|
@@ -8,14 +8,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
13
|
var _ahooks = require("ahooks");
|
|
15
14
|
var _utils = require("@luck-design-biz/base/utils");
|
|
15
|
+
var _lodash = require("lodash");
|
|
16
16
|
var _ContextProvider = require("../../../engine/provider/ContextProvider");
|
|
17
17
|
var _index = _interopRequireDefault(require("./index"));
|
|
18
|
-
var _dataProcess = require("../../../engine/tools/dataProcess");
|
|
19
18
|
var _boxPropsDefault = _interopRequireDefault(require("../../../engine/meta/box.props.default.json"));
|
|
20
19
|
var _excluded = ["children", "id", "display"];
|
|
21
20
|
var FunctionDesign = function FunctionDesign(_ref) {
|
|
@@ -24,41 +23,41 @@ var FunctionDesign = function FunctionDesign(_ref) {
|
|
|
24
23
|
display = _ref.display,
|
|
25
24
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
26
25
|
var ctx = (0, _ContextProvider.useContext)();
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var refreshChild = (0, _ahooks.useMemoizedFn)(function (
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
drop(current.children, ratioArr.length).forEach(function (boxId) {
|
|
35
|
-
(0,
|
|
26
|
+
var current = (0, _ContextProvider.useGet)({
|
|
27
|
+
id: id
|
|
28
|
+
});
|
|
29
|
+
var refreshChild = (0, _ahooks.useMemoizedFn)(function () {
|
|
30
|
+
var _current$children;
|
|
31
|
+
var ratioArr = display.ratio.split(':');
|
|
32
|
+
if (ratioArr.length === ((_current$children = current.children) === null || _current$children === void 0 ? void 0 : _current$children.length)) return;
|
|
33
|
+
(0, _lodash.drop)(current.children, ratioArr.length).forEach(function (boxId) {
|
|
34
|
+
(0, _ContextProvider.deleteNode)(boxId);
|
|
36
35
|
});
|
|
37
36
|
ratioArr.forEach(function (_, index) {
|
|
38
|
-
var _current$
|
|
39
|
-
if (!((_current$
|
|
40
|
-
(0,
|
|
37
|
+
var _current$children2;
|
|
38
|
+
if (!((_current$children2 = current.children) !== null && _current$children2 !== void 0 && _current$children2[index])) {
|
|
39
|
+
(0, _ContextProvider.addNode)(id, "box_".concat((0, _utils.suid)()), (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _boxPropsDefault.default), {}, {
|
|
41
40
|
buildIn: true
|
|
42
41
|
}));
|
|
43
42
|
}
|
|
44
43
|
});
|
|
45
|
-
setPageData(_pageData);
|
|
46
44
|
});
|
|
47
45
|
(0, _ahooks.useCreation)(function () {
|
|
48
46
|
if (children !== null && children !== void 0 && children.length) return;
|
|
49
47
|
ctx.$subscriber(ctx.topics.COMPONENT_APPEND).once(function (_ref2) {
|
|
50
|
-
var compId = _ref2.id
|
|
51
|
-
pageData = _ref2.pageData;
|
|
48
|
+
var compId = _ref2.id;
|
|
52
49
|
if (compId !== id) return;
|
|
53
|
-
refreshChild(
|
|
50
|
+
refreshChild();
|
|
54
51
|
}).watch();
|
|
55
52
|
}, []);
|
|
56
53
|
(0, _react.useEffect)(function () {
|
|
57
54
|
var cmid = ctx.$subscriber(ctx.topics.COMPONENT_MODIFY).on(function (_ref3) {
|
|
58
55
|
var compId = _ref3.id,
|
|
59
|
-
|
|
56
|
+
newValue = _ref3.newValue;
|
|
60
57
|
if (compId !== id) return;
|
|
61
|
-
|
|
58
|
+
if (newValue.hasOwnProperty('display')) {
|
|
59
|
+
refreshChild();
|
|
60
|
+
}
|
|
62
61
|
}).watch();
|
|
63
62
|
return function () {
|
|
64
63
|
return ctx.$unsubscriber(ctx.topics.COMPONENT_MODIFY, cmid);
|
|
@@ -29,13 +29,11 @@ var LCSplit = function LCSplit(_ref) {
|
|
|
29
29
|
children = _ref.children,
|
|
30
30
|
css = _ref.css,
|
|
31
31
|
display = _ref.display;
|
|
32
|
-
var prevDisplay = (0, _ahooks.usePrevious)(display);
|
|
33
32
|
var ref = (0, _react.useRef)();
|
|
34
33
|
var getTargetDom = (0, _ahooks.useMemoizedFn)(function () {
|
|
35
34
|
return ref.current;
|
|
36
35
|
});
|
|
37
36
|
var _useCreation = (0, _ahooks.useCreation)(function () {
|
|
38
|
-
if ((0, _lodash.isNil)(display.ratio)) return {};
|
|
39
37
|
var arr = display.ratio.split(':').map(function (r) {
|
|
40
38
|
return parseInt(r);
|
|
41
39
|
});
|
|
@@ -53,7 +51,7 @@ var LCSplit = function LCSplit(_ref) {
|
|
|
53
51
|
}, /*#__PURE__*/_react.default.createElement(Div, {
|
|
54
52
|
ref: ref,
|
|
55
53
|
$css: css
|
|
56
|
-
},
|
|
54
|
+
}, /*#__PURE__*/_react.default.createElement(_base.MemorySplit, {
|
|
57
55
|
split: display.split
|
|
58
56
|
}, ratioArr.map(function (r, i) {
|
|
59
57
|
return /*#__PURE__*/_react.default.createElement(_base.MemorySplit.Pane, {
|
|
@@ -61,8 +59,6 @@ var LCSplit = function LCSplit(_ref) {
|
|
|
61
59
|
initialSize: "".concat(r / total * 100, "%"),
|
|
62
60
|
key: i
|
|
63
61
|
}, children === null || children === void 0 ? void 0 : children[i]);
|
|
64
|
-
}))
|
|
65
|
-
split: display.type === 'ltb' ? 'horizontal' : 'vertical'
|
|
66
|
-
}, children === null || children === void 0 ? void 0 : children[1], children === null || children === void 0 ? void 0 : children[2])))));
|
|
62
|
+
}))));
|
|
67
63
|
};
|
|
68
64
|
var _default = exports.default = LCSplit;
|
|
@@ -27,26 +27,26 @@
|
|
|
27
27
|
]
|
|
28
28
|
}
|
|
29
29
|
],
|
|
30
|
-
"css": "background-color: transparent",
|
|
30
|
+
"css": "width: 100%, height: 100%, background-color: transparent",
|
|
31
31
|
"advance": {
|
|
32
32
|
"events": [
|
|
33
33
|
{
|
|
34
34
|
"key": "onMount",
|
|
35
35
|
"name": "组件首次渲染时",
|
|
36
36
|
"desc": "在组件首次渲染时,执行方法",
|
|
37
|
-
"func": "(
|
|
37
|
+
"func": "function onMount() {\n\t\n}"
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
"key": "onUnmount",
|
|
41
41
|
"name": "组件卸载时",
|
|
42
42
|
"desc": "在组件卸载时,执行方法。",
|
|
43
|
-
"func": "(
|
|
43
|
+
"func": "function onUnmount() {\n\t\n}"
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
"key": "onChange",
|
|
47
47
|
"name": "尺寸变化事件",
|
|
48
48
|
"desc": "在面板尺寸发生变化时,执行方法",
|
|
49
|
-
"func": "(value)
|
|
49
|
+
"func": "function onChange(value) {\n\t\n}"
|
|
50
50
|
}
|
|
51
51
|
]
|
|
52
52
|
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.TopUpload = exports.TopExport = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
+
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
|
+
var _antd = require("luck-design/antd");
|
|
15
|
+
var _apiUrl = require("../../../../constants/api-url");
|
|
16
|
+
var _lodash = require("lodash");
|
|
17
|
+
var _ahooks = require("ahooks");
|
|
18
|
+
var _index = _interopRequireDefault(require("../../ImEx/index.less"));
|
|
19
|
+
var _excluded = ["options"],
|
|
20
|
+
_excluded2 = ["options", "apiUrl", "tableRef"];
|
|
21
|
+
var TopUpload = exports.TopUpload = function TopUpload(_ref) {
|
|
22
|
+
var options = _ref.options,
|
|
23
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
24
|
+
var UploadConfig = {
|
|
25
|
+
name: 'file',
|
|
26
|
+
action: 'https://660d2bd96ddfa2943b33731c.mockapi.io/api/upload',
|
|
27
|
+
headers: {
|
|
28
|
+
authorization: 'authorization-text'
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Upload, UploadConfig, /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
32
|
+
type: "primary"
|
|
33
|
+
}, "\u5BFC\u5165"));
|
|
34
|
+
};
|
|
35
|
+
var TopExport = exports.TopExport = function TopExport(_ref2) {
|
|
36
|
+
var options = _ref2.options,
|
|
37
|
+
apiUrl = _ref2.apiUrl,
|
|
38
|
+
tableRef = _ref2.tableRef,
|
|
39
|
+
props = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
|
|
40
|
+
var _useRequest = (0, _ahooks.useRequest)(_apiUrl.exportExcel, {
|
|
41
|
+
manual: true
|
|
42
|
+
}),
|
|
43
|
+
loading = _useRequest.loading,
|
|
44
|
+
runAsync = _useRequest.runAsync,
|
|
45
|
+
data = _useRequest.data;
|
|
46
|
+
var fecthExcelState = function fecthExcelState(payload, procress, resolve, reject) {
|
|
47
|
+
// 查询进度
|
|
48
|
+
(0, _apiUrl.readExportExcelState)(payload).then(function (ret) {
|
|
49
|
+
var cpage = ret.cpage,
|
|
50
|
+
total = ret.total,
|
|
51
|
+
downloadUrl = ret.downloadUrl;
|
|
52
|
+
if (cpage >= total) {
|
|
53
|
+
resolve("".concat(window.location.origin, "/api").concat(downloadUrl));
|
|
54
|
+
} else {
|
|
55
|
+
procress(cpage / total * 100);
|
|
56
|
+
fecthExcelState(payload, procress, resolve, reject);
|
|
57
|
+
}
|
|
58
|
+
}).catch(function () {
|
|
59
|
+
reject();
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
var handleExportAll = function handleExportAll(procress) {
|
|
63
|
+
return new Promise( /*#__PURE__*/function () {
|
|
64
|
+
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(resolve, reject) {
|
|
65
|
+
var joiner, payload;
|
|
66
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
67
|
+
while (1) switch (_context.prev = _context.next) {
|
|
68
|
+
case 0:
|
|
69
|
+
joiner = apiUrl.indexOf('?') !== -1 ? '&' : '?';
|
|
70
|
+
_context.next = 3;
|
|
71
|
+
return runAsync({
|
|
72
|
+
apiUrl: "".concat(apiUrl).concat(joiner, "token=").concat(window.cookie.get(window.appConfig.authSaveKey)),
|
|
73
|
+
code: options.export
|
|
74
|
+
});
|
|
75
|
+
case 3:
|
|
76
|
+
payload = _context.sent;
|
|
77
|
+
if (payload && typeof payload === 'string') {
|
|
78
|
+
fecthExcelState(payload, procress, resolve, reject);
|
|
79
|
+
} else {
|
|
80
|
+
reject();
|
|
81
|
+
}
|
|
82
|
+
case 5:
|
|
83
|
+
case "end":
|
|
84
|
+
return _context.stop();
|
|
85
|
+
}
|
|
86
|
+
}, _callee);
|
|
87
|
+
}));
|
|
88
|
+
return function (_x, _x2) {
|
|
89
|
+
return _ref3.apply(this, arguments);
|
|
90
|
+
};
|
|
91
|
+
}());
|
|
92
|
+
};
|
|
93
|
+
var doExportAll = function doExportAll(onExportAll) {
|
|
94
|
+
var key = 'exportAll';
|
|
95
|
+
var notificationConfig = {
|
|
96
|
+
key: key,
|
|
97
|
+
duration: null,
|
|
98
|
+
message: '正在导出数据...',
|
|
99
|
+
placement: 'bottomRight',
|
|
100
|
+
closeIcon: /*#__PURE__*/_react.default.createElement("div", null),
|
|
101
|
+
icon: /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
102
|
+
type: "cloud-download",
|
|
103
|
+
className: _index.default.exportTheme
|
|
104
|
+
})
|
|
105
|
+
};
|
|
106
|
+
var process = function process(i) {
|
|
107
|
+
_antd.notification.open((0, _objectSpread2.default)((0, _objectSpread2.default)({}, notificationConfig), {}, {
|
|
108
|
+
description: /*#__PURE__*/_react.default.createElement(_antd.Progress, {
|
|
109
|
+
percent: i
|
|
110
|
+
})
|
|
111
|
+
}));
|
|
112
|
+
};
|
|
113
|
+
_antd.notification.open((0, _objectSpread2.default)((0, _objectSpread2.default)({}, notificationConfig), {}, {
|
|
114
|
+
description: /*#__PURE__*/_react.default.createElement(_antd.Progress, {
|
|
115
|
+
percent: 0
|
|
116
|
+
})
|
|
117
|
+
}));
|
|
118
|
+
onExportAll(process).then(function (ret) {
|
|
119
|
+
if (ret) {
|
|
120
|
+
window.location.href = ret;
|
|
121
|
+
}
|
|
122
|
+
_antd.notification.close(key);
|
|
123
|
+
}).catch(function () {
|
|
124
|
+
return _antd.notification.open((0, _objectSpread2.default)((0, _objectSpread2.default)({}, notificationConfig), {}, {
|
|
125
|
+
icon: /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
126
|
+
type: "cloud-download",
|
|
127
|
+
className: _index.default.exportErrorTheme
|
|
128
|
+
}),
|
|
129
|
+
message: '导出失败',
|
|
130
|
+
duration: 4
|
|
131
|
+
}));
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
135
|
+
type: "primary",
|
|
136
|
+
onClick: function onClick() {
|
|
137
|
+
if (!(0, _lodash.isString)(options.export)) {
|
|
138
|
+
// 默认右击导出行为
|
|
139
|
+
tableRef.doExportAll(tableRef.props.onExportAll);
|
|
140
|
+
} else {
|
|
141
|
+
doExportAll(handleExportAll);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}, "\u5BFC\u51FA");
|
|
145
|
+
};
|
|
@@ -14,6 +14,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
14
14
|
var _ahooks = require("ahooks");
|
|
15
15
|
var _lodash = require("lodash");
|
|
16
16
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
|
+
var _base = require("@luck-design-biz/base");
|
|
17
18
|
var _ContextProvider = require("../../../engine/provider/ContextProvider");
|
|
18
19
|
var _Wrapper = _interopRequireDefault(require("../Wrapper"));
|
|
19
20
|
var _index = require("../../../../index");
|
|
@@ -21,6 +22,7 @@ var _TopFilter = _interopRequireDefault(require("./components/TopFilter"));
|
|
|
21
22
|
var _helper = require("../../../engine/tools/helper");
|
|
22
23
|
var _tablePropsDefault = _interopRequireDefault(require("../../../engine/meta/table.props.default.json"));
|
|
23
24
|
var _constants = require("../../../constants");
|
|
25
|
+
var _TopImex = require("./components/TopImex");
|
|
24
26
|
var LCTable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
25
27
|
var id = _ref.id,
|
|
26
28
|
className = _ref.className,
|
|
@@ -63,8 +65,20 @@ var LCTable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
63
65
|
var ctx = (0, _ContextProvider.useContext)();
|
|
64
66
|
var _useRemoteSource = (0, _ContextProvider.useRemoteSource)(),
|
|
65
67
|
module = _useRemoteSource.module;
|
|
68
|
+
var apiRef = (0, _react.useRef)();
|
|
66
69
|
var wrapperRef = (0, _react.useRef)();
|
|
67
70
|
var instanceRef = (0, _react.useRef)();
|
|
71
|
+
(0, _react.useImperativeHandle)(apiRef, function () {
|
|
72
|
+
return {
|
|
73
|
+
/**
|
|
74
|
+
* 获取表格实例
|
|
75
|
+
* @method
|
|
76
|
+
*/
|
|
77
|
+
getInstance: function getInstance() {
|
|
78
|
+
return instanceRef.current;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
});
|
|
68
82
|
var _pagination = (0, _ahooks.useCreation)(function () {
|
|
69
83
|
return {
|
|
70
84
|
isFlow: !pagination,
|
|
@@ -97,11 +111,28 @@ var LCTable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
97
111
|
};
|
|
98
112
|
return action;
|
|
99
113
|
}(function (data, rowIndex, params) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
114
|
+
var doAction = function doAction() {
|
|
115
|
+
ctx.doAction(action.actionPool, {
|
|
116
|
+
data: data,
|
|
117
|
+
rowIndex: rowIndex,
|
|
118
|
+
params: params,
|
|
119
|
+
datasetCode: dataset.code
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
if (action.riskLevel === 'danger') {
|
|
123
|
+
_base.Modal.confirm({
|
|
124
|
+
title: "\u786E\u8BA4\u6267\u884C".concat(action.name, "\u884C\u4E3A\u64CD\u4F5C\u5417\uFF1F"),
|
|
125
|
+
onOk: doAction
|
|
126
|
+
});
|
|
127
|
+
} else if (action.riskLevel === 'destroy') {
|
|
128
|
+
(0, _base.recheck)({
|
|
129
|
+
title: "\u786E\u8BA4\u6267\u884C".concat(action.name, "\u884C\u4E3A\u64CD\u4F5C\u5417\uFF1F"),
|
|
130
|
+
checkWords: "\u6267\u884C".concat(action.name),
|
|
131
|
+
onOk: doAction
|
|
132
|
+
});
|
|
133
|
+
} else {
|
|
134
|
+
doAction();
|
|
135
|
+
}
|
|
105
136
|
}),
|
|
106
137
|
resource: action.serial,
|
|
107
138
|
style: action.riskLevel === 'default' ? null : {
|
|
@@ -134,24 +165,29 @@ var LCTable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
134
165
|
data: data,
|
|
135
166
|
isSelected: isSelected,
|
|
136
167
|
SelectedRows: SelectedRows,
|
|
137
|
-
params: params
|
|
168
|
+
params: params,
|
|
169
|
+
datasetCode: dataset.code
|
|
138
170
|
});
|
|
139
171
|
},
|
|
140
172
|
onChange: function onChange(rows, nodes, params) {
|
|
141
173
|
ctx.doAction(advance.events.onRowSelected, {
|
|
142
174
|
rows: rows,
|
|
143
175
|
nodes: nodes,
|
|
144
|
-
params: params
|
|
176
|
+
params: params,
|
|
177
|
+
datasetCode: dataset.code
|
|
145
178
|
});
|
|
146
179
|
}
|
|
147
180
|
}
|
|
148
181
|
} : false;
|
|
149
182
|
}, [rowSelection, suppressRowSelectionPagination, rowSelectionMode, defaultRowSelectedCode, rowSelectableCode]);
|
|
150
183
|
var _export = (0, _ahooks.useCreation)(function () {
|
|
151
|
-
|
|
152
|
-
enableExportAll: !!impexp.export
|
|
153
|
-
apiUrl: (0, _lodash.isString)(impexp.export) ? impexp.export : void 0
|
|
184
|
+
var _temp = {
|
|
185
|
+
enableExportAll: !!impexp.export
|
|
154
186
|
};
|
|
187
|
+
if ((0, _lodash.isString)(impexp.export)) {
|
|
188
|
+
_temp.apiUrl = impexp.export;
|
|
189
|
+
}
|
|
190
|
+
return _temp;
|
|
155
191
|
}, [impexp.export]);
|
|
156
192
|
var _batchActions = (0, _ahooks.useCreation)(function () {
|
|
157
193
|
return {
|
|
@@ -165,7 +201,8 @@ var LCTable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
165
201
|
onBatchOperationsClick: function onBatchOperationsClick(key, selectedRows) {
|
|
166
202
|
ctx.doAction(action.actionPool, {
|
|
167
203
|
key: key,
|
|
168
|
-
selectedRows: selectedRows
|
|
204
|
+
selectedRows: selectedRows,
|
|
205
|
+
datasetCode: dataset.code
|
|
169
206
|
});
|
|
170
207
|
}
|
|
171
208
|
};
|
|
@@ -207,17 +244,42 @@ var LCTable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
207
244
|
}, [fields, formatDataSource, getDataPath, columnsRewrite, columnsReset, modelParams, draggable]);
|
|
208
245
|
var renderFunctionArea = (0, _ahooks.useMemoizedFn)(function () {
|
|
209
246
|
var _topActionGroup$todoL;
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
247
|
+
var resultComp = [];
|
|
248
|
+
if (!!(topActionGroup !== null && topActionGroup !== void 0 && (_topActionGroup$todoL = topActionGroup.todoList) !== null && _topActionGroup$todoL !== void 0 && _topActionGroup$todoL.length)) {
|
|
249
|
+
resultComp.push( /*#__PURE__*/_react.default.createElement(_index.LDActions, (0, _extends2.default)({}, topActionGroup, {
|
|
250
|
+
doAction: function doAction(action) {
|
|
251
|
+
return ctx.doAction(action, {
|
|
252
|
+
datasetCode: dataset.code
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
})));
|
|
256
|
+
}
|
|
257
|
+
if (impexp.import) {
|
|
258
|
+
var _ref2;
|
|
259
|
+
var _getProps = (_ref2 = instanceRef.current || ref.current) === null || _ref2 === void 0 ? void 0 : _ref2.getProps(),
|
|
260
|
+
apiUrl = _getProps.apiUrl;
|
|
261
|
+
resultComp.push( /*#__PURE__*/_react.default.createElement(_TopImex.TopUpload, {
|
|
262
|
+
apiUrl: apiUrl,
|
|
263
|
+
options: impexp,
|
|
264
|
+
tableRef: instanceRef.current || ref.current
|
|
265
|
+
}));
|
|
266
|
+
}
|
|
267
|
+
if (impexp.export) {
|
|
268
|
+
var _ref3;
|
|
269
|
+
var _getProps2 = (_ref3 = instanceRef.current || ref.current) === null || _ref3 === void 0 ? void 0 : _ref3.getProps(),
|
|
270
|
+
_apiUrl = _getProps2.apiUrl;
|
|
271
|
+
resultComp.push( /*#__PURE__*/_react.default.createElement(_TopImex.TopExport, {
|
|
272
|
+
apiUrl: _apiUrl,
|
|
273
|
+
options: impexp,
|
|
274
|
+
tableRef: instanceRef.current || ref.current
|
|
275
|
+
}));
|
|
276
|
+
}
|
|
277
|
+
return resultComp;
|
|
217
278
|
});
|
|
218
279
|
var renderFilterArea = (0, _ahooks.useMemoizedFn)(function () {
|
|
219
280
|
return topFilter ? /*#__PURE__*/_react.default.createElement(_TopFilter.default, {
|
|
220
|
-
filter: topFilter
|
|
281
|
+
filter: topFilter,
|
|
282
|
+
instance: instanceRef
|
|
221
283
|
}) : null;
|
|
222
284
|
});
|
|
223
285
|
var _wrapperProps = (0, _ahooks.useCreation)(function () {
|
|
@@ -235,31 +297,32 @@ var LCTable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
235
297
|
};
|
|
236
298
|
});
|
|
237
299
|
var _readFilter = (0, _ahooks.useMemoizedFn)(function (params, filters) {
|
|
238
|
-
return ctx.
|
|
300
|
+
return ctx.setPagePublicResource((0, _defineProperty2.default)({}, id, {
|
|
239
301
|
params: params,
|
|
240
302
|
filters: filters
|
|
241
|
-
});
|
|
303
|
+
}));
|
|
242
304
|
});
|
|
243
305
|
var _handleGridReady = (0, _ahooks.useMemoizedFn)(function (params, instance) {
|
|
244
|
-
instanceRef.current = instance;
|
|
245
306
|
onGridReady === null || onGridReady === void 0 || onGridReady(params, instance);
|
|
246
307
|
ctx.doAction(advance.events.onMount, {
|
|
247
308
|
params: params,
|
|
248
|
-
|
|
309
|
+
datasetCode: dataset.code
|
|
249
310
|
});
|
|
250
311
|
});
|
|
251
312
|
var _handleRowClick = (0, _ahooks.useMemoizedFn)(function (data, rowIndex, params) {
|
|
252
313
|
ctx.doAction(advance.events.onRowClick, {
|
|
253
314
|
data: data,
|
|
254
315
|
rowIndex: rowIndex,
|
|
255
|
-
params: params
|
|
316
|
+
params: params,
|
|
317
|
+
datasetCode: dataset.code
|
|
256
318
|
});
|
|
257
319
|
});
|
|
258
320
|
var _handleRowDoubleClick = (0, _ahooks.useMemoizedFn)(function (data, rowIndex, params) {
|
|
259
321
|
ctx.doAction(advance.events.onRowDoubleClick, {
|
|
260
322
|
data: data,
|
|
261
323
|
rowIndex: rowIndex,
|
|
262
|
-
params: params
|
|
324
|
+
params: params,
|
|
325
|
+
datasetCode: dataset.code
|
|
263
326
|
});
|
|
264
327
|
});
|
|
265
328
|
var _handleRowDragged = (0, _ahooks.useMemoizedFn)(function (toId, fromId, params) {
|
|
@@ -267,12 +330,14 @@ var LCTable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
267
330
|
ctx.doAction(advance.events.onRowDragged, {
|
|
268
331
|
toId: toId,
|
|
269
332
|
fromId: fromId,
|
|
270
|
-
params: params
|
|
333
|
+
params: params,
|
|
334
|
+
datasetCode: dataset.code
|
|
271
335
|
});
|
|
272
336
|
} else {
|
|
273
|
-
|
|
337
|
+
var _actionsPool = [['drag', {
|
|
274
338
|
category: 'page-action',
|
|
275
|
-
code:
|
|
339
|
+
code: "function onRowDragged(toId, fromId, params){return {data: { toId, fromId }};}",
|
|
340
|
+
code1: JSON.stringify({
|
|
276
341
|
moduleCode: module.moduleCode,
|
|
277
342
|
datasetCode: dataset.code,
|
|
278
343
|
data: {
|
|
@@ -280,39 +345,59 @@ var LCTable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
280
345
|
fromId: fromId
|
|
281
346
|
}
|
|
282
347
|
})
|
|
283
|
-
}]]
|
|
348
|
+
}]];
|
|
349
|
+
ctx.doAction(_actionsPool, {
|
|
350
|
+
toId: toId,
|
|
351
|
+
fromId: fromId,
|
|
352
|
+
params: params,
|
|
353
|
+
datasetCode: dataset.code
|
|
354
|
+
});
|
|
284
355
|
}
|
|
285
356
|
});
|
|
286
357
|
var _afterInit = (0, _ahooks.useMemoizedFn)(function (res, dispatch, props) {
|
|
287
358
|
ctx.doAction(advance.events.afterInit, {
|
|
288
359
|
res: res,
|
|
289
360
|
dispatch: dispatch,
|
|
290
|
-
props: props
|
|
361
|
+
props: props,
|
|
362
|
+
datasetCode: dataset.code
|
|
291
363
|
});
|
|
292
364
|
});
|
|
293
365
|
var _afterQuery = (0, _ahooks.useMemoizedFn)(function (res) {
|
|
294
366
|
ctx.doAction(advance.events.afterQuery, {
|
|
295
|
-
res: res
|
|
296
|
-
|
|
297
|
-
});
|
|
298
|
-
(0, _ahooks.useUnmount)(function () {
|
|
299
|
-
ctx.doAction(advance.events.onUnmount, {
|
|
300
|
-
instance: instanceRef.current
|
|
367
|
+
res: res,
|
|
368
|
+
datasetCode: dataset.code
|
|
301
369
|
});
|
|
302
370
|
});
|
|
371
|
+
(0, _react.useEffect)(function () {
|
|
372
|
+
var tid = ctx.$subscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED).on(function (_ref5) {
|
|
373
|
+
var resource = _ref5.resource;
|
|
374
|
+
ctx.doAction(advance.events.onPagePublicResourceChanged, {
|
|
375
|
+
resource: resource,
|
|
376
|
+
instance: instanceRef.current
|
|
377
|
+
});
|
|
378
|
+
}).watch();
|
|
379
|
+
return function () {
|
|
380
|
+
ctx.$unsubscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED, tid);
|
|
381
|
+
ctx.doAction(advance.events.onUnmount, {
|
|
382
|
+
datasetCode: dataset === null || dataset === void 0 ? void 0 : dataset.code
|
|
383
|
+
});
|
|
384
|
+
};
|
|
385
|
+
}, []);
|
|
303
386
|
var getTargetDom = (0, _ahooks.useMemoizedFn)(function () {
|
|
304
387
|
return wrapperRef.current;
|
|
305
388
|
});
|
|
306
389
|
return /*#__PURE__*/_react.default.createElement(_Wrapper.default, {
|
|
307
390
|
id: id,
|
|
308
391
|
displayName: "Table",
|
|
309
|
-
getTargetDom: getTargetDom
|
|
392
|
+
getTargetDom: getTargetDom,
|
|
393
|
+
api: apiRef
|
|
310
394
|
}, /*#__PURE__*/_react.default.createElement(_index.LdGrid, (0, _extends2.default)({
|
|
311
|
-
ref: ref,
|
|
395
|
+
ref: ref || instanceRef,
|
|
312
396
|
wrapper: wrapperRef,
|
|
313
397
|
wrapperProps: _wrapperProps,
|
|
314
398
|
width: width,
|
|
315
399
|
height: height,
|
|
400
|
+
_loading: ctx.loading,
|
|
316
401
|
bordered: bordered,
|
|
317
402
|
className: (0, _classnames.default)((0, _defineProperty2.default)({}, className, !!className)),
|
|
318
403
|
ldId: id,
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"name": "顶部按钮组",
|
|
62
62
|
"type": "_ActionsEditor",
|
|
63
63
|
"default": { "display": "button", "max": 2, "moreText": "操作", "todoList": [] },
|
|
64
|
-
"defaultCode": "function todo(
|
|
64
|
+
"defaultCode": "function todo() { \n \n}",
|
|
65
65
|
"wrapper": "collapse"
|
|
66
66
|
},
|
|
67
67
|
{
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"name": "表格操作项",
|
|
101
101
|
"type": "_ActionsEditor",
|
|
102
102
|
"default": { "display": "text", "max": 2, "moreText": "更多操作", "todoList": [] },
|
|
103
|
-
"defaultCode": "function onActionClick(data) {\n\n}",
|
|
103
|
+
"defaultCode": "function onActionClick(data, rowIndex, params) {\n\n}",
|
|
104
104
|
"wrapper": "collapse",
|
|
105
105
|
"wrapperProps": { "suppressIcon": true }
|
|
106
106
|
}
|
|
@@ -344,55 +344,61 @@
|
|
|
344
344
|
"key": "onMount",
|
|
345
345
|
"name": "组件首次渲染时",
|
|
346
346
|
"desc": "在组件首次渲染时,执行方法",
|
|
347
|
-
"func": "(params
|
|
347
|
+
"func": "function onMount(params) {\n\t\n}"
|
|
348
348
|
},
|
|
349
349
|
{
|
|
350
350
|
"key": "onUnmount",
|
|
351
351
|
"name": "组件卸载时",
|
|
352
352
|
"desc": "在组件卸载时,执行方法。",
|
|
353
|
-
"func": "(
|
|
353
|
+
"func": "function onUnmount() {\n\t\n}"
|
|
354
354
|
},
|
|
355
355
|
{
|
|
356
356
|
"key": "onRowClick",
|
|
357
357
|
"name": "行单击",
|
|
358
358
|
"desc": "单击表格行时,执行方法",
|
|
359
|
-
"func": "(data, rowIndex, params)
|
|
359
|
+
"func": "function onRowClick(data, rowIndex, params) {\n\t\n}"
|
|
360
360
|
},
|
|
361
361
|
{
|
|
362
362
|
"key": "onRowDoubleClick",
|
|
363
363
|
"name": "行双击",
|
|
364
364
|
"desc": "双击表格行时,执行方法",
|
|
365
|
-
"func": "(data, rowIndex, params)
|
|
365
|
+
"func": "function onRowDoubleClick(data, rowIndex, params) {\n\t\n}"
|
|
366
366
|
},
|
|
367
367
|
{
|
|
368
368
|
"key": "onRowSelected",
|
|
369
369
|
"name": "行选择",
|
|
370
370
|
"desc": "选中行时,执行方法",
|
|
371
|
-
"func": "(data, isSelected, SelectedRows, params)
|
|
371
|
+
"func": "function onRowSelected(data, isSelected, SelectedRows, params) {\n\t\n}"
|
|
372
372
|
},
|
|
373
373
|
{
|
|
374
374
|
"key": "onRowSelectChange",
|
|
375
375
|
"name": "行选择变化",
|
|
376
376
|
"desc": "行选中发生变化时,执行方法",
|
|
377
|
-
"func": "(rows, nodes, params)
|
|
377
|
+
"func": "function onRowSelectChange(rows, nodes, params) {\n\t\n}"
|
|
378
378
|
},
|
|
379
379
|
{
|
|
380
380
|
"key": "onRowDragged",
|
|
381
381
|
"name": "行拖拽后",
|
|
382
382
|
"desc": "拖拽行使其顺序发生变化后,执行方法",
|
|
383
|
-
"func": "(toId, fromId, params)
|
|
383
|
+
"func": "function onRowDragged(toId, fromId, params) {\n\t\n}"
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"key": "onPagePublicResourceChanged",
|
|
387
|
+
"name": "页面共享资源变化后",
|
|
388
|
+
"desc": "当页面共享资源发生变化后(pagePublicResourceChanged),执行方法",
|
|
389
|
+
"func": "function onPagePublicResourceChanged(resource, instance) {\n\t\n}"
|
|
384
390
|
},
|
|
385
391
|
{
|
|
386
392
|
"key": "afterInit",
|
|
387
393
|
"name": "初始化后的回调",
|
|
388
394
|
"desc": "组件及数据加载完成后,执行方法",
|
|
389
|
-
"func": "(res, dispatch, props)
|
|
395
|
+
"func": "function afterInit(res, dispatch, props) {\n\t\n}"
|
|
390
396
|
},
|
|
391
397
|
{
|
|
392
398
|
"key": "afterQuery",
|
|
393
399
|
"name": "数据读取回调",
|
|
394
400
|
"desc": "读取数据源后执行方法,返回接口中原始数据",
|
|
395
|
-
"func": "(res)
|
|
401
|
+
"func": "function afterQuery(res) {\n\t\n}"
|
|
396
402
|
}
|
|
397
403
|
]
|
|
398
404
|
}
|