@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
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
|
-
import React, { useRef, forwardRef } from 'react';
|
|
4
|
+
import React, { useRef, useImperativeHandle, forwardRef, useEffect } from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { useMemoizedFn, useCreation, useUnmount } from 'ahooks';
|
|
7
7
|
import { isNil, isString, keyBy } from 'lodash';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
|
+
import { Modal, recheck } from '@luck-design-biz/base';
|
|
9
10
|
import { useContext, useRemoteSource } from "../../../engine/provider/ContextProvider";
|
|
10
11
|
import Wrapper from "../Wrapper";
|
|
11
12
|
import { LdGrid, LDActions } from "../../../../index";
|
|
@@ -13,6 +14,7 @@ import TopFilter from "./components/TopFilter";
|
|
|
13
14
|
import { omitBadProps, executeCode } from "../../../engine/tools/helper";
|
|
14
15
|
import defaultMeta from "../../../engine/meta/table.props.default.json";
|
|
15
16
|
import { LC_COMPONENT_UNIT_KEY, LC_COMPONENT_UNIT } from "../../../constants";
|
|
17
|
+
import { TopUpload, TopExport } from "./components/TopImex";
|
|
16
18
|
var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
17
19
|
var id = _ref.id,
|
|
18
20
|
className = _ref.className,
|
|
@@ -55,8 +57,20 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
55
57
|
var ctx = useContext();
|
|
56
58
|
var _useRemoteSource = useRemoteSource(),
|
|
57
59
|
module = _useRemoteSource.module;
|
|
60
|
+
var apiRef = useRef();
|
|
58
61
|
var wrapperRef = useRef();
|
|
59
62
|
var instanceRef = useRef();
|
|
63
|
+
useImperativeHandle(apiRef, function () {
|
|
64
|
+
return {
|
|
65
|
+
/**
|
|
66
|
+
* 获取表格实例
|
|
67
|
+
* @method
|
|
68
|
+
*/
|
|
69
|
+
getInstance: function getInstance() {
|
|
70
|
+
return instanceRef.current;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
});
|
|
60
74
|
var _pagination = useCreation(function () {
|
|
61
75
|
return {
|
|
62
76
|
isFlow: !pagination,
|
|
@@ -89,11 +103,28 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
89
103
|
};
|
|
90
104
|
return action;
|
|
91
105
|
}(function (data, rowIndex, params) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
106
|
+
var doAction = function doAction() {
|
|
107
|
+
ctx.doAction(action.actionPool, {
|
|
108
|
+
data: data,
|
|
109
|
+
rowIndex: rowIndex,
|
|
110
|
+
params: params,
|
|
111
|
+
datasetCode: dataset.code
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
if (action.riskLevel === 'danger') {
|
|
115
|
+
Modal.confirm({
|
|
116
|
+
title: "\u786E\u8BA4\u6267\u884C".concat(action.name, "\u884C\u4E3A\u64CD\u4F5C\u5417\uFF1F"),
|
|
117
|
+
onOk: doAction
|
|
118
|
+
});
|
|
119
|
+
} else if (action.riskLevel === 'destroy') {
|
|
120
|
+
recheck({
|
|
121
|
+
title: "\u786E\u8BA4\u6267\u884C".concat(action.name, "\u884C\u4E3A\u64CD\u4F5C\u5417\uFF1F"),
|
|
122
|
+
checkWords: "\u6267\u884C".concat(action.name),
|
|
123
|
+
onOk: doAction
|
|
124
|
+
});
|
|
125
|
+
} else {
|
|
126
|
+
doAction();
|
|
127
|
+
}
|
|
97
128
|
}),
|
|
98
129
|
resource: action.serial,
|
|
99
130
|
style: action.riskLevel === 'default' ? null : {
|
|
@@ -126,24 +157,29 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
126
157
|
data: data,
|
|
127
158
|
isSelected: isSelected,
|
|
128
159
|
SelectedRows: SelectedRows,
|
|
129
|
-
params: params
|
|
160
|
+
params: params,
|
|
161
|
+
datasetCode: dataset.code
|
|
130
162
|
});
|
|
131
163
|
},
|
|
132
164
|
onChange: function onChange(rows, nodes, params) {
|
|
133
165
|
ctx.doAction(advance.events.onRowSelected, {
|
|
134
166
|
rows: rows,
|
|
135
167
|
nodes: nodes,
|
|
136
|
-
params: params
|
|
168
|
+
params: params,
|
|
169
|
+
datasetCode: dataset.code
|
|
137
170
|
});
|
|
138
171
|
}
|
|
139
172
|
}
|
|
140
173
|
} : false;
|
|
141
174
|
}, [rowSelection, suppressRowSelectionPagination, rowSelectionMode, defaultRowSelectedCode, rowSelectableCode]);
|
|
142
175
|
var _export = useCreation(function () {
|
|
143
|
-
|
|
144
|
-
enableExportAll: !!impexp.export
|
|
145
|
-
apiUrl: isString(impexp.export) ? impexp.export : void 0
|
|
176
|
+
var _temp = {
|
|
177
|
+
enableExportAll: !!impexp.export
|
|
146
178
|
};
|
|
179
|
+
if (isString(impexp.export)) {
|
|
180
|
+
_temp.apiUrl = impexp.export;
|
|
181
|
+
}
|
|
182
|
+
return _temp;
|
|
147
183
|
}, [impexp.export]);
|
|
148
184
|
var _batchActions = useCreation(function () {
|
|
149
185
|
return {
|
|
@@ -157,7 +193,8 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
157
193
|
onBatchOperationsClick: function onBatchOperationsClick(key, selectedRows) {
|
|
158
194
|
ctx.doAction(action.actionPool, {
|
|
159
195
|
key: key,
|
|
160
|
-
selectedRows: selectedRows
|
|
196
|
+
selectedRows: selectedRows,
|
|
197
|
+
datasetCode: dataset.code
|
|
161
198
|
});
|
|
162
199
|
}
|
|
163
200
|
};
|
|
@@ -199,17 +236,42 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
199
236
|
}, [fields, formatDataSource, getDataPath, columnsRewrite, columnsReset, modelParams, draggable]);
|
|
200
237
|
var renderFunctionArea = useMemoizedFn(function () {
|
|
201
238
|
var _topActionGroup$todoL;
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
239
|
+
var resultComp = [];
|
|
240
|
+
if (!!(topActionGroup !== null && topActionGroup !== void 0 && (_topActionGroup$todoL = topActionGroup.todoList) !== null && _topActionGroup$todoL !== void 0 && _topActionGroup$todoL.length)) {
|
|
241
|
+
resultComp.push( /*#__PURE__*/React.createElement(LDActions, _extends({}, topActionGroup, {
|
|
242
|
+
doAction: function doAction(action) {
|
|
243
|
+
return ctx.doAction(action, {
|
|
244
|
+
datasetCode: dataset.code
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
})));
|
|
248
|
+
}
|
|
249
|
+
if (impexp.import) {
|
|
250
|
+
var _ref2;
|
|
251
|
+
var _getProps = (_ref2 = instanceRef.current || ref.current) === null || _ref2 === void 0 ? void 0 : _ref2.getProps(),
|
|
252
|
+
apiUrl = _getProps.apiUrl;
|
|
253
|
+
resultComp.push( /*#__PURE__*/React.createElement(TopUpload, {
|
|
254
|
+
apiUrl: apiUrl,
|
|
255
|
+
options: impexp,
|
|
256
|
+
tableRef: instanceRef.current || ref.current
|
|
257
|
+
}));
|
|
258
|
+
}
|
|
259
|
+
if (impexp.export) {
|
|
260
|
+
var _ref3;
|
|
261
|
+
var _getProps2 = (_ref3 = instanceRef.current || ref.current) === null || _ref3 === void 0 ? void 0 : _ref3.getProps(),
|
|
262
|
+
_apiUrl = _getProps2.apiUrl;
|
|
263
|
+
resultComp.push( /*#__PURE__*/React.createElement(TopExport, {
|
|
264
|
+
apiUrl: _apiUrl,
|
|
265
|
+
options: impexp,
|
|
266
|
+
tableRef: instanceRef.current || ref.current
|
|
267
|
+
}));
|
|
268
|
+
}
|
|
269
|
+
return resultComp;
|
|
209
270
|
});
|
|
210
271
|
var renderFilterArea = useMemoizedFn(function () {
|
|
211
272
|
return topFilter ? /*#__PURE__*/React.createElement(TopFilter, {
|
|
212
|
-
filter: topFilter
|
|
273
|
+
filter: topFilter,
|
|
274
|
+
instance: instanceRef
|
|
213
275
|
}) : null;
|
|
214
276
|
});
|
|
215
277
|
var _wrapperProps = useCreation(function () {
|
|
@@ -227,31 +289,32 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
227
289
|
};
|
|
228
290
|
});
|
|
229
291
|
var _readFilter = useMemoizedFn(function (params, filters) {
|
|
230
|
-
return ctx.
|
|
292
|
+
return ctx.setPagePublicResource(_defineProperty({}, id, {
|
|
231
293
|
params: params,
|
|
232
294
|
filters: filters
|
|
233
|
-
});
|
|
295
|
+
}));
|
|
234
296
|
});
|
|
235
297
|
var _handleGridReady = useMemoizedFn(function (params, instance) {
|
|
236
|
-
instanceRef.current = instance;
|
|
237
298
|
onGridReady === null || onGridReady === void 0 || onGridReady(params, instance);
|
|
238
299
|
ctx.doAction(advance.events.onMount, {
|
|
239
300
|
params: params,
|
|
240
|
-
|
|
301
|
+
datasetCode: dataset.code
|
|
241
302
|
});
|
|
242
303
|
});
|
|
243
304
|
var _handleRowClick = useMemoizedFn(function (data, rowIndex, params) {
|
|
244
305
|
ctx.doAction(advance.events.onRowClick, {
|
|
245
306
|
data: data,
|
|
246
307
|
rowIndex: rowIndex,
|
|
247
|
-
params: params
|
|
308
|
+
params: params,
|
|
309
|
+
datasetCode: dataset.code
|
|
248
310
|
});
|
|
249
311
|
});
|
|
250
312
|
var _handleRowDoubleClick = useMemoizedFn(function (data, rowIndex, params) {
|
|
251
313
|
ctx.doAction(advance.events.onRowDoubleClick, {
|
|
252
314
|
data: data,
|
|
253
315
|
rowIndex: rowIndex,
|
|
254
|
-
params: params
|
|
316
|
+
params: params,
|
|
317
|
+
datasetCode: dataset.code
|
|
255
318
|
});
|
|
256
319
|
});
|
|
257
320
|
var _handleRowDragged = useMemoizedFn(function (toId, fromId, params) {
|
|
@@ -259,12 +322,14 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
259
322
|
ctx.doAction(advance.events.onRowDragged, {
|
|
260
323
|
toId: toId,
|
|
261
324
|
fromId: fromId,
|
|
262
|
-
params: params
|
|
325
|
+
params: params,
|
|
326
|
+
datasetCode: dataset.code
|
|
263
327
|
});
|
|
264
328
|
} else {
|
|
265
|
-
|
|
329
|
+
var _actionsPool = [['drag', {
|
|
266
330
|
category: 'page-action',
|
|
267
|
-
code:
|
|
331
|
+
code: "function onRowDragged(toId, fromId, params){return {data: { toId, fromId }};}",
|
|
332
|
+
code1: JSON.stringify({
|
|
268
333
|
moduleCode: module.moduleCode,
|
|
269
334
|
datasetCode: dataset.code,
|
|
270
335
|
data: {
|
|
@@ -272,39 +337,59 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
272
337
|
fromId: fromId
|
|
273
338
|
}
|
|
274
339
|
})
|
|
275
|
-
}]]
|
|
340
|
+
}]];
|
|
341
|
+
ctx.doAction(_actionsPool, {
|
|
342
|
+
toId: toId,
|
|
343
|
+
fromId: fromId,
|
|
344
|
+
params: params,
|
|
345
|
+
datasetCode: dataset.code
|
|
346
|
+
});
|
|
276
347
|
}
|
|
277
348
|
});
|
|
278
349
|
var _afterInit = useMemoizedFn(function (res, dispatch, props) {
|
|
279
350
|
ctx.doAction(advance.events.afterInit, {
|
|
280
351
|
res: res,
|
|
281
352
|
dispatch: dispatch,
|
|
282
|
-
props: props
|
|
353
|
+
props: props,
|
|
354
|
+
datasetCode: dataset.code
|
|
283
355
|
});
|
|
284
356
|
});
|
|
285
357
|
var _afterQuery = useMemoizedFn(function (res) {
|
|
286
358
|
ctx.doAction(advance.events.afterQuery, {
|
|
287
|
-
res: res
|
|
288
|
-
|
|
289
|
-
});
|
|
290
|
-
useUnmount(function () {
|
|
291
|
-
ctx.doAction(advance.events.onUnmount, {
|
|
292
|
-
instance: instanceRef.current
|
|
359
|
+
res: res,
|
|
360
|
+
datasetCode: dataset.code
|
|
293
361
|
});
|
|
294
362
|
});
|
|
363
|
+
useEffect(function () {
|
|
364
|
+
var tid = ctx.$subscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED).on(function (_ref5) {
|
|
365
|
+
var resource = _ref5.resource;
|
|
366
|
+
ctx.doAction(advance.events.onPagePublicResourceChanged, {
|
|
367
|
+
resource: resource,
|
|
368
|
+
instance: instanceRef.current
|
|
369
|
+
});
|
|
370
|
+
}).watch();
|
|
371
|
+
return function () {
|
|
372
|
+
ctx.$unsubscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED, tid);
|
|
373
|
+
ctx.doAction(advance.events.onUnmount, {
|
|
374
|
+
datasetCode: dataset === null || dataset === void 0 ? void 0 : dataset.code
|
|
375
|
+
});
|
|
376
|
+
};
|
|
377
|
+
}, []);
|
|
295
378
|
var getTargetDom = useMemoizedFn(function () {
|
|
296
379
|
return wrapperRef.current;
|
|
297
380
|
});
|
|
298
381
|
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
299
382
|
id: id,
|
|
300
383
|
displayName: "Table",
|
|
301
|
-
getTargetDom: getTargetDom
|
|
384
|
+
getTargetDom: getTargetDom,
|
|
385
|
+
api: apiRef
|
|
302
386
|
}, /*#__PURE__*/React.createElement(LdGrid, _extends({
|
|
303
|
-
ref: ref,
|
|
387
|
+
ref: ref || instanceRef,
|
|
304
388
|
wrapper: wrapperRef,
|
|
305
389
|
wrapperProps: _wrapperProps,
|
|
306
390
|
width: width,
|
|
307
391
|
height: height,
|
|
392
|
+
_loading: ctx.loading,
|
|
308
393
|
bordered: bordered,
|
|
309
394
|
className: classNames(_defineProperty({}, className, !!className)),
|
|
310
395
|
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
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
5
|
var _excluded = ["children", "id", "items"];
|
|
6
6
|
import React, { useEffect } from 'react';
|
|
7
7
|
import Index from "./index";
|
|
8
8
|
import { useCreation } from 'ahooks';
|
|
9
|
+
import { differenceBy } from 'lodash';
|
|
9
10
|
import { suid } from '@luck-design-biz/base/utils';
|
|
10
|
-
import { useContext,
|
|
11
|
-
import { add, findNodeAndParent } from "../../../engine/tools/dataProcess";
|
|
11
|
+
import { useContext, useGet, addNode } from "../../../engine/provider/ContextProvider";
|
|
12
12
|
import boxDefaultMeta from "../../../engine/meta/box.props.default.json";
|
|
13
13
|
var FunctionDesign = function FunctionDesign(_ref) {
|
|
14
14
|
var children = _ref.children,
|
|
@@ -16,27 +16,24 @@ var FunctionDesign = function FunctionDesign(_ref) {
|
|
|
16
16
|
items = _ref.items,
|
|
17
17
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
18
18
|
var ctx = useContext();
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
var current = useGet({
|
|
20
|
+
id: id
|
|
21
|
+
});
|
|
22
22
|
useCreation(function () {
|
|
23
23
|
if (children !== null && children !== void 0 && children.length) return;
|
|
24
24
|
ctx.$subscriber(ctx.topics.COMPONENT_APPEND).once(function (_ref2) {
|
|
25
|
-
var compId = _ref2.id
|
|
26
|
-
pageData = _ref2.pageData;
|
|
25
|
+
var compId = _ref2.id;
|
|
27
26
|
if (compId !== id) return;
|
|
28
27
|
var boxId = "box_".concat(suid());
|
|
29
|
-
|
|
28
|
+
addNode(id, boxId, _objectSpread(_objectSpread({}, boxDefaultMeta), {}, {
|
|
30
29
|
buildIn: true,
|
|
31
30
|
tabId: items[0].id
|
|
32
31
|
}));
|
|
33
|
-
setPageData(pageData);
|
|
34
32
|
}).watch();
|
|
35
33
|
}, []);
|
|
36
34
|
useEffect(function () {
|
|
37
35
|
var cmid = ctx.$subscriber(ctx.topics.COMPONENT_MODIFY).on(function (_ref3) {
|
|
38
36
|
var compId = _ref3.id,
|
|
39
|
-
pageData = _ref3.pageData,
|
|
40
37
|
newValue = _ref3.newValue,
|
|
41
38
|
oldValue = _ref3.oldValue;
|
|
42
39
|
if (compId !== id || !newValue.hasOwnProperty('items')) return;
|
|
@@ -45,23 +42,19 @@ var FunctionDesign = function FunctionDesign(_ref) {
|
|
|
45
42
|
_differenceBy2 = _slicedToArray(_differenceBy, 1),
|
|
46
43
|
newItem = _differenceBy2[0];
|
|
47
44
|
var boxId = "box_".concat(suid());
|
|
48
|
-
|
|
45
|
+
addNode(id, boxId, _objectSpread(_objectSpread({}, boxDefaultMeta), {}, {
|
|
49
46
|
buildIn: true,
|
|
50
47
|
tabId: newItem.id
|
|
51
48
|
}));
|
|
52
|
-
setPageData(pageData);
|
|
53
49
|
} else if (newValue.items.length < oldValue.items.length) {
|
|
54
50
|
var _differenceBy3 = differenceBy(oldValue.items, newValue.items, 'id'),
|
|
55
51
|
_differenceBy4 = _slicedToArray(_differenceBy3, 1),
|
|
56
52
|
removeItem = _differenceBy4[0];
|
|
57
|
-
var _findNodeAndParent = findNodeAndParent(id, pageData),
|
|
58
|
-
current = _findNodeAndParent.node;
|
|
59
53
|
var _boxId = current.children.find(function (childId) {
|
|
60
54
|
return current[childId].props.tabId === removeItem.id;
|
|
61
55
|
});
|
|
62
56
|
ctx.$publisher(ctx.topics.COMPONENT_DELETE, {
|
|
63
|
-
id: _boxId
|
|
64
|
-
pageData: pageData
|
|
57
|
+
id: _boxId
|
|
65
58
|
});
|
|
66
59
|
}
|
|
67
60
|
}).watch();
|
|
@@ -12,7 +12,9 @@ import defaultMeta from "../../../engine/meta/tabs.props.default.json";
|
|
|
12
12
|
var StyledTabs = styled(Tabs).withConfig({
|
|
13
13
|
displayName: "StyledTabs",
|
|
14
14
|
componentId: "luckda-6530__sc-ht1jge-0"
|
|
15
|
-
})(["", ""], function (props) {
|
|
15
|
+
})([".ant-tabs-content{", " overflow-x:hidden;overflow-y:auto;}", ""], function (props) {
|
|
16
|
+
return props.type === 'line' ? 'height: calc(100% - 62px);' : 'height: calc(100% - 56px);';
|
|
17
|
+
}, function (props) {
|
|
16
18
|
return props.$css;
|
|
17
19
|
});
|
|
18
20
|
var LCTabs = function LCTabs(_ref) {
|
|
@@ -94,19 +94,19 @@
|
|
|
94
94
|
"key": "onMount",
|
|
95
95
|
"name": "组件首次渲染时",
|
|
96
96
|
"desc": "在组件首次渲染时,执行方法",
|
|
97
|
-
"func": "(
|
|
97
|
+
"func": "function onMount() {\n\t\n}"
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
"key": "onUnmount",
|
|
101
101
|
"name": "组件卸载时",
|
|
102
102
|
"desc": "在组件卸载时,执行方法。",
|
|
103
|
-
"func": "(
|
|
103
|
+
"func": "function onUnmount() {\n\t\n}"
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
106
|
"key": "onTabClick",
|
|
107
107
|
"name": "tab被点击的回调",
|
|
108
108
|
"desc": "当tab被点击时, 执行方法",
|
|
109
|
-
"func": "(tabKey, e)
|
|
109
|
+
"func": "function onTabClick(tabKey, e) {\n\t\n}"
|
|
110
110
|
}
|
|
111
111
|
]
|
|
112
112
|
}
|
|
@@ -63,7 +63,8 @@ var FunctionDesign = function FunctionDesign(_ref) {
|
|
|
63
63
|
className: styles['runtime-tree'],
|
|
64
64
|
draggable: false,
|
|
65
65
|
suppressInit: true,
|
|
66
|
-
onDataSetChange: handleDataSetChange
|
|
66
|
+
onDataSetChange: handleDataSetChange,
|
|
67
|
+
asyncLoad: false
|
|
67
68
|
}), children);
|
|
68
69
|
};
|
|
69
70
|
export default FunctionDesign;
|