@luck-design-biz/luckda 1.0.2-2 → 1.0.2-20
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/Builder/index.js +13 -10
- package/es/components/ComplexItem/index.js +5 -3
- package/es/components/ComplexItem/service.js +6 -3
- package/es/components/LDActions/index.js +1 -0
- package/es/components/LdAutoForm/index.js +5 -4
- package/es/components/LdCard/index.js +10 -8
- package/es/components/LdCom/index.js +3 -2
- package/es/components/LdFormList/index.js +10 -7
- package/es/components/LdGrid/index.js +11 -12
- package/es/components/LdGridForm/index.js +5 -4
- package/es/helper/FromItems.js +64 -5
- package/es/helper/action.js +2 -0
- package/es/helper/ldBuilder.js +5 -4
- package/es/helper/ldComBuild.js +16 -11
- package/es/locales/zh-CN.js +61 -6
- package/es/lowcode/constants/api-url.js +359 -190
- package/es/lowcode/constants/event-topics.js +4 -0
- package/es/lowcode/constants/index.js +5 -4
- package/es/lowcode/engine/meta/box.props.default.json +1 -1
- package/es/lowcode/engine/meta/box.props.json +1 -1
- package/es/lowcode/engine/meta/cardlist.props.json +3 -5
- package/es/lowcode/engine/meta/components-list.json +6 -0
- package/es/lowcode/engine/meta/dialog.props.default.json +4 -1
- package/es/lowcode/engine/meta/dialog.props.json +24 -4
- package/es/lowcode/engine/meta/drawer.props.json +1 -1
- package/es/lowcode/engine/meta/fielddate.props.default.json +1 -0
- package/es/lowcode/engine/meta/fielddate.props.json +48 -1
- package/es/lowcode/engine/meta/fieldeditor.props.json +0 -1
- package/es/lowcode/engine/meta/fieldgroup.props.json +0 -1
- package/es/lowcode/engine/meta/fieldyear.props.json +0 -1
- package/es/lowcode/engine/meta/form.props.json +3 -19
- package/es/lowcode/engine/meta/grouptree.props.json +0 -1
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +5 -0
- package/es/lowcode/engine/meta/jsx.props.default.json +1 -2
- package/es/lowcode/engine/meta/jsx.props.json +4 -3
- package/es/lowcode/engine/meta/layout.props.default.json +1 -1
- package/es/lowcode/engine/meta/layout.props.json +1 -1
- package/es/lowcode/engine/meta/proxy.props.default.json +15 -0
- package/es/lowcode/engine/meta/proxy.props.json +66 -0
- package/es/lowcode/engine/meta/section.props.json +2 -2
- package/es/lowcode/engine/meta/table.props.json +0 -7
- package/es/lowcode/engine/meta/tabs.props.json +1 -1
- package/es/lowcode/engine/meta/tree.props.json +1 -5
- package/es/lowcode/engine/provider/ContextProvider/index.js +45 -9
- package/es/lowcode/engine/provider/ContextProvider/router.js +21 -1
- package/es/lowcode/engine/provider/ContextProvider/usePageDataStore.js +36 -30
- package/es/lowcode/engine/provider/ContextProvider/usePageVar.js +11 -5
- package/es/lowcode/engine/provider/ContextProvider/useTodo.js +2 -4
- package/es/lowcode/engine/provider/EventBusProvider.js +14 -4
- package/es/lowcode/engine/provider/PageProxyProvider.js +95 -0
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +10 -12
- package/es/lowcode/engine/tools/helper.js +25 -1
- package/es/lowcode/engine/tools/initDS.js +4 -4
- package/es/lowcode/painter/Design.js +1 -0
- package/es/lowcode/painter/DesignOperator.js +135 -27
- package/es/lowcode/painter/DesignToolbar.js +102 -188
- package/es/lowcode/painter/History.js +300 -0
- package/es/lowcode/painter/Panel.js +1 -1
- package/es/lowcode/painter/Ribbon.js +37 -1
- package/es/lowcode/painter/components/AdvancePanel.js +55 -51
- package/es/lowcode/painter/components/DragDrop/DragDropContext.js +10 -3
- package/es/lowcode/painter/components/TipIcon.js +12 -4
- package/es/lowcode/painter/components/TreeEditor.js +76 -8
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +10 -6
- package/es/lowcode/painter/components/code-editor/DiffEditor.js +41 -0
- package/es/lowcode/painter/components/field-setting/FieldAttrs.js +2 -2
- package/es/lowcode/painter/components/field-setting/SettingUI.js +56 -5
- package/es/lowcode/painter/components/field-setting/index.js +24 -1
- package/es/lowcode/painter/components/shortcut-modal/KeyIcon.js +11 -0
- package/es/lowcode/painter/components/shortcut-modal/index.js +208 -0
- package/es/lowcode/painter/panel-section/BlockEditor/index.js +10 -19
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +4 -1
- package/es/lowcode/painter/panel-section/ConditionCheck.js +70 -0
- package/es/lowcode/painter/panel-section/DataSetSelector.js +6 -3
- package/es/lowcode/painter/panel-section/DialogSize.js +76 -0
- package/es/lowcode/painter/panel-section/DialogWidthHeight.js +60 -0
- package/es/lowcode/painter/panel-section/FieldsSetting.js +1 -1
- package/es/lowcode/painter/panel-section/IconConditionSelector.js +2 -2
- package/es/lowcode/painter/panel-section/JSEditor/ToolBar.js +174 -0
- package/es/lowcode/painter/panel-section/JSEditor/index.js +181 -0
- package/es/lowcode/painter/panel-section/JSEditor/index.less +4 -0
- package/es/lowcode/painter/panel-section/PageLayoutDisplay.js +7 -2
- package/es/lowcode/painter/panel-section/ProxyLinker.js +137 -0
- package/es/lowcode/painter/panel-section/ProxyParams.js +28 -0
- package/es/lowcode/painter/panel-section/ProxyParamsSetter.js +240 -0
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +37 -26
- package/es/lowcode/painter/style/action-bind-modal.less +1 -1
- package/es/lowcode/painter/style/components.less +1 -1
- package/es/lowcode/painter/style/history.less +46 -0
- package/es/lowcode/painter/style/outline.less +1 -1
- package/es/lowcode/painter/style/panel-item.less +1 -0
- package/es/lowcode/preview/DebugTool.js +78 -0
- package/es/lowcode/preview/DebugToolDetail.js +103 -0
- package/es/lowcode/preview/index.js +10 -17
- package/es/lowcode/preview/useDebugSettings.js +62 -0
- package/es/lowcode/view/Canvas.js +5 -1
- package/es/lowcode/view/ErrorBoundary.js +80 -0
- package/es/lowcode/view/Page.js +11 -6
- package/es/lowcode/view/lc-components/Box/FunctionDesign.js +4 -2
- package/es/lowcode/view/lc-components/Box/index.less +2 -2
- package/es/lowcode/view/lc-components/Box/meta.json +1 -1
- package/es/lowcode/view/lc-components/CardList/index.js +3 -0
- package/es/lowcode/view/lc-components/CardList/meta.json +3 -5
- package/es/lowcode/view/lc-components/Dialog/index.js +13 -5
- package/es/lowcode/view/lc-components/Dialog/meta.json +24 -4
- package/es/lowcode/view/lc-components/Drawer/index.js +5 -3
- package/es/lowcode/view/lc-components/Drawer/meta.json +1 -1
- package/es/lowcode/view/lc-components/FieldDate/meta.json +48 -1
- package/es/lowcode/view/lc-components/FieldEditor/meta.json +0 -1
- package/es/lowcode/view/lc-components/FieldGroup/meta.json +0 -1
- package/es/lowcode/view/lc-components/FieldYear/meta.json +0 -1
- package/es/lowcode/view/lc-components/Form/index.js +15 -19
- package/es/lowcode/view/lc-components/Form/meta.json +3 -19
- package/es/lowcode/view/lc-components/GroupTree/meta.json +0 -1
- package/es/lowcode/view/lc-components/JSX/RuntimeComp.js +32 -16
- package/es/lowcode/view/lc-components/JSX/meta.json +4 -3
- package/es/lowcode/view/lc-components/Layout/meta.json +1 -1
- package/es/lowcode/view/lc-components/PageLayout/index.js +1 -1
- package/es/lowcode/view/lc-components/Proxy/FunctionDesign.js +17 -0
- package/es/lowcode/view/lc-components/Proxy/FunctionLive.js +23 -0
- package/es/lowcode/view/lc-components/Proxy/FunctionPreview.js +23 -0
- package/es/lowcode/view/lc-components/Proxy/index.js +42 -0
- package/es/lowcode/view/lc-components/Proxy/index.less +5 -0
- package/es/lowcode/view/lc-components/Proxy/meta.json +66 -0
- package/es/lowcode/view/lc-components/Section/meta.json +2 -2
- package/es/lowcode/view/lc-components/Table/components/TopImex.js +16 -13
- package/es/lowcode/view/lc-components/Table/index.js +11 -3
- package/es/lowcode/view/lc-components/Table/meta.json +0 -7
- package/es/lowcode/view/lc-components/Tabs/index.js +6 -2
- package/es/lowcode/view/lc-components/Tabs/meta.json +1 -1
- package/es/lowcode/view/lc-components/Tree/index.js +3 -0
- package/es/lowcode/view/lc-components/Tree/meta.json +1 -5
- package/es/lowcode/view/lc-components/Wrapper.js +9 -1
- package/es/upload/FilesWall/index.js +16 -6
- package/es/upload/Form/gridForm.js +16 -6
- package/es/upload/FormItem/index.js +16 -4
- package/es/utils/action.js +3 -2
- package/es/utils/form.js +4 -3
- package/es/utils/grid.js +10 -2
- package/lib/components/Builder/index.js +13 -10
- package/lib/components/ComplexItem/index.js +5 -3
- package/lib/components/ComplexItem/service.js +6 -3
- package/lib/components/LDActions/index.js +1 -0
- package/lib/components/LdAutoForm/index.js +3 -2
- package/lib/components/LdCard/index.js +10 -8
- package/lib/components/LdCom/index.js +3 -2
- package/lib/components/LdFormList/index.js +9 -6
- package/lib/components/LdGrid/index.js +11 -12
- package/lib/components/LdGridForm/index.js +3 -2
- package/lib/helper/FromItems.js +64 -5
- package/lib/helper/action.js +2 -0
- package/lib/helper/ldBuilder.js +4 -4
- package/lib/helper/ldComBuild.js +14 -9
- package/lib/locales/zh-CN.js +61 -6
- package/lib/lowcode/constants/api-url.js +360 -190
- package/lib/lowcode/constants/event-topics.js +5 -1
- package/lib/lowcode/constants/index.js +6 -5
- package/lib/lowcode/engine/meta/box.props.default.json +1 -1
- package/lib/lowcode/engine/meta/box.props.json +1 -1
- package/lib/lowcode/engine/meta/cardlist.props.json +3 -5
- package/lib/lowcode/engine/meta/components-list.json +6 -0
- package/lib/lowcode/engine/meta/dialog.props.default.json +4 -1
- package/lib/lowcode/engine/meta/dialog.props.json +24 -4
- package/lib/lowcode/engine/meta/drawer.props.json +1 -1
- package/lib/lowcode/engine/meta/fielddate.props.default.json +1 -0
- package/lib/lowcode/engine/meta/fielddate.props.json +48 -1
- package/lib/lowcode/engine/meta/fieldeditor.props.json +0 -1
- package/lib/lowcode/engine/meta/fieldgroup.props.json +0 -1
- package/lib/lowcode/engine/meta/fieldyear.props.json +0 -1
- package/lib/lowcode/engine/meta/form.props.json +3 -19
- package/lib/lowcode/engine/meta/grouptree.props.json +0 -1
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +5 -0
- package/lib/lowcode/engine/meta/jsx.props.default.json +1 -2
- package/lib/lowcode/engine/meta/jsx.props.json +4 -3
- package/lib/lowcode/engine/meta/layout.props.default.json +1 -1
- package/lib/lowcode/engine/meta/layout.props.json +1 -1
- package/lib/lowcode/engine/meta/proxy.props.default.json +15 -0
- package/lib/lowcode/engine/meta/proxy.props.json +66 -0
- package/lib/lowcode/engine/meta/section.props.json +2 -2
- package/lib/lowcode/engine/meta/table.props.json +0 -7
- package/lib/lowcode/engine/meta/tabs.props.json +1 -1
- package/lib/lowcode/engine/meta/tree.props.json +1 -5
- package/lib/lowcode/engine/provider/ContextProvider/index.js +50 -13
- package/lib/lowcode/engine/provider/ContextProvider/router.js +22 -1
- package/lib/lowcode/engine/provider/ContextProvider/usePageDataStore.js +37 -31
- package/lib/lowcode/engine/provider/ContextProvider/usePageVar.js +10 -4
- package/lib/lowcode/engine/provider/ContextProvider/useTodo.js +1 -3
- package/lib/lowcode/engine/provider/EventBusProvider.js +14 -4
- package/lib/lowcode/engine/provider/PageProxyProvider.js +103 -0
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +10 -12
- package/lib/lowcode/engine/tools/helper.js +25 -0
- package/lib/lowcode/engine/tools/initDS.js +4 -4
- package/lib/lowcode/painter/Design.js +1 -0
- package/lib/lowcode/painter/DesignOperator.js +132 -24
- package/lib/lowcode/painter/DesignToolbar.js +98 -184
- package/lib/lowcode/painter/History.js +308 -0
- package/lib/lowcode/painter/Panel.js +1 -1
- package/lib/lowcode/painter/Ribbon.js +37 -1
- package/lib/lowcode/painter/components/AdvancePanel.js +53 -49
- package/lib/lowcode/painter/components/DragDrop/DragDropContext.js +10 -3
- package/lib/lowcode/painter/components/TipIcon.js +12 -4
- package/lib/lowcode/painter/components/TreeEditor.js +76 -8
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +10 -6
- package/lib/lowcode/painter/components/code-editor/DiffEditor.js +49 -0
- package/lib/lowcode/painter/components/field-setting/FieldAttrs.js +2 -2
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +55 -4
- package/lib/lowcode/painter/components/field-setting/index.js +24 -1
- package/lib/lowcode/painter/components/shortcut-modal/KeyIcon.js +18 -0
- package/lib/lowcode/painter/components/shortcut-modal/index.js +215 -0
- package/lib/lowcode/painter/panel-section/BlockEditor/index.js +9 -18
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +4 -1
- package/lib/lowcode/painter/panel-section/ConditionCheck.js +78 -0
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +6 -3
- package/lib/lowcode/painter/panel-section/DialogSize.js +83 -0
- package/lib/lowcode/painter/panel-section/DialogWidthHeight.js +67 -0
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +1 -1
- package/lib/lowcode/painter/panel-section/IconConditionSelector.js +2 -2
- package/lib/lowcode/painter/panel-section/JSEditor/ToolBar.js +181 -0
- package/lib/lowcode/painter/panel-section/JSEditor/index.js +189 -0
- package/lib/lowcode/painter/panel-section/JSEditor/index.less +4 -0
- package/lib/lowcode/painter/panel-section/PageLayoutDisplay.js +7 -2
- package/lib/lowcode/painter/panel-section/ProxyLinker.js +145 -0
- package/lib/lowcode/painter/panel-section/ProxyParams.js +35 -0
- package/lib/lowcode/painter/panel-section/ProxyParamsSetter.js +248 -0
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +37 -26
- package/lib/lowcode/painter/style/action-bind-modal.less +1 -1
- package/lib/lowcode/painter/style/components.less +1 -1
- package/lib/lowcode/painter/style/history.less +46 -0
- package/lib/lowcode/painter/style/outline.less +1 -1
- package/lib/lowcode/painter/style/panel-item.less +1 -0
- package/lib/lowcode/preview/DebugTool.js +86 -0
- package/lib/lowcode/preview/DebugToolDetail.js +111 -0
- package/lib/lowcode/preview/index.js +10 -18
- package/lib/lowcode/preview/useDebugSettings.js +69 -0
- package/lib/lowcode/view/Canvas.js +5 -1
- package/lib/lowcode/view/ErrorBoundary.js +88 -0
- package/lib/lowcode/view/Page.js +12 -7
- package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +4 -2
- package/lib/lowcode/view/lc-components/Box/index.less +2 -2
- package/lib/lowcode/view/lc-components/Box/meta.json +1 -1
- package/lib/lowcode/view/lc-components/CardList/index.js +3 -0
- package/lib/lowcode/view/lc-components/CardList/meta.json +3 -5
- package/lib/lowcode/view/lc-components/Dialog/index.js +11 -3
- package/lib/lowcode/view/lc-components/Dialog/meta.json +24 -4
- package/lib/lowcode/view/lc-components/Drawer/index.js +3 -1
- package/lib/lowcode/view/lc-components/Drawer/meta.json +1 -1
- package/lib/lowcode/view/lc-components/FieldDate/meta.json +48 -1
- package/lib/lowcode/view/lc-components/FieldEditor/meta.json +0 -1
- package/lib/lowcode/view/lc-components/FieldGroup/meta.json +0 -1
- package/lib/lowcode/view/lc-components/FieldYear/meta.json +0 -1
- package/lib/lowcode/view/lc-components/Form/index.js +15 -19
- package/lib/lowcode/view/lc-components/Form/meta.json +3 -19
- package/lib/lowcode/view/lc-components/GroupTree/meta.json +0 -1
- package/lib/lowcode/view/lc-components/JSX/RuntimeComp.js +33 -16
- package/lib/lowcode/view/lc-components/JSX/meta.json +4 -3
- package/lib/lowcode/view/lc-components/Layout/meta.json +1 -1
- package/lib/lowcode/view/lc-components/PageLayout/index.js +1 -1
- package/lib/lowcode/view/lc-components/Proxy/FunctionDesign.js +24 -0
- package/lib/lowcode/view/lc-components/Proxy/FunctionLive.js +30 -0
- package/lib/lowcode/view/lc-components/Proxy/FunctionPreview.js +30 -0
- package/lib/lowcode/view/lc-components/Proxy/index.js +50 -0
- package/lib/lowcode/view/lc-components/Proxy/index.less +5 -0
- package/lib/lowcode/view/lc-components/Proxy/meta.json +66 -0
- package/lib/lowcode/view/lc-components/Section/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Table/components/TopImex.js +16 -13
- package/lib/lowcode/view/lc-components/Table/index.js +11 -3
- package/lib/lowcode/view/lc-components/Table/meta.json +0 -7
- package/lib/lowcode/view/lc-components/Tabs/index.js +5 -1
- package/lib/lowcode/view/lc-components/Tabs/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Tree/index.js +3 -0
- package/lib/lowcode/view/lc-components/Tree/meta.json +1 -5
- package/lib/lowcode/view/lc-components/Wrapper.js +8 -0
- package/lib/upload/FilesWall/index.js +13 -3
- package/lib/upload/Form/gridForm.js +13 -3
- package/lib/upload/FormItem/index.js +15 -3
- package/lib/utils/action.js +6 -0
- package/lib/utils/form.js +3 -2
- package/lib/utils/grid.js +11 -3
- package/package.json +1 -2
- package/es/lowcode/painter/panel-section/JSEditor.js +0 -49
- package/es/lowcode/view/errorBoundary.js +0 -61
- package/lib/lowcode/painter/panel-section/JSEditor.js +0 -57
- package/lib/lowcode/view/errorBoundary.js +0 -69
|
@@ -12,8 +12,9 @@ import LdPop from "../LdPop";
|
|
|
12
12
|
import { readModlue, noAuthTransformCode } from "../../services";
|
|
13
13
|
import { doAction as doActionUtils } from "../../helper/action";
|
|
14
14
|
export var LuckDaContext = /*#__PURE__*/createContext();
|
|
15
|
-
export var useLDCtx = function useLDCtx() {
|
|
16
|
-
|
|
15
|
+
export var useLDCtx = function useLDCtx(pageProxy) {
|
|
16
|
+
var ctx = useContext(LuckDaContext);
|
|
17
|
+
return ctx[(pageProxy === null || pageProxy === void 0 ? void 0 : pageProxy.proxyCode) || 'master'];
|
|
17
18
|
};
|
|
18
19
|
var builder = function builder(WrappedComponent, moduleCode) {
|
|
19
20
|
var Component = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
@@ -117,14 +118,16 @@ var builder = function builder(WrappedComponent, moduleCode) {
|
|
|
117
118
|
label: '模块缺少数据集'
|
|
118
119
|
});
|
|
119
120
|
return /*#__PURE__*/React.createElement(LuckDaContext.Provider, {
|
|
120
|
-
value:
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
121
|
+
value: {
|
|
122
|
+
master: _objectSpread(_objectSpread({}, moduleData), {}, {
|
|
123
|
+
doAction: doAction,
|
|
124
|
+
openPop: openPop,
|
|
125
|
+
closePop: closePop,
|
|
126
|
+
readFieldProps: readFieldProps,
|
|
127
|
+
setFieldProps: setFieldProps,
|
|
128
|
+
moduleCode: moduleCode
|
|
129
|
+
})
|
|
130
|
+
}
|
|
128
131
|
}, /*#__PURE__*/React.createElement(WrappedComponent, _extends({
|
|
129
132
|
ref: ref
|
|
130
133
|
}, moduleData || {}, {
|
|
@@ -42,7 +42,7 @@ var Index = function Index(_ref) {
|
|
|
42
42
|
keyName: keyField,
|
|
43
43
|
titleKey: "title",
|
|
44
44
|
api: ( /*#__PURE__*/function () {
|
|
45
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(get) {
|
|
45
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(get, post) {
|
|
46
46
|
var res, formatData, detail;
|
|
47
47
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
48
48
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -51,7 +51,9 @@ var Index = function Index(_ref) {
|
|
|
51
51
|
return fetchContent(dataModel, _objectSpread({
|
|
52
52
|
datasetCode: dataSetCode,
|
|
53
53
|
moduleCode: moduleCode
|
|
54
|
-
}, get)
|
|
54
|
+
}, get), {
|
|
55
|
+
_AutoFilter: post
|
|
56
|
+
});
|
|
55
57
|
case 2:
|
|
56
58
|
res = _context.sent;
|
|
57
59
|
formatData = (res === null || res === void 0 ? void 0 : res.data.map(function (i) {
|
|
@@ -72,7 +74,7 @@ var Index = function Index(_ref) {
|
|
|
72
74
|
}
|
|
73
75
|
}, _callee);
|
|
74
76
|
}));
|
|
75
|
-
return function (_x) {
|
|
77
|
+
return function (_x, _x2) {
|
|
76
78
|
return _ref2.apply(this, arguments);
|
|
77
79
|
};
|
|
78
80
|
}()),
|
|
@@ -4,18 +4,21 @@ import { stringify } from 'qs';
|
|
|
4
4
|
import { request } from '@luck-design-biz/base/utils';
|
|
5
5
|
import api from "@/services/ApiConfig";
|
|
6
6
|
export var fetchContent = /*#__PURE__*/function () {
|
|
7
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(dmCode, get) {
|
|
7
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(dmCode, get, post) {
|
|
8
8
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9
9
|
while (1) switch (_context.prev = _context.next) {
|
|
10
10
|
case 0:
|
|
11
|
-
return _context.abrupt("return", request("".concat(api.API_HOST, "/").concat(dmCode, "/ui/builder/complex/noAuthFetchContent?").concat(stringify(get))
|
|
11
|
+
return _context.abrupt("return", request("".concat(api.API_HOST, "/").concat(dmCode, "/ui/builder/complex/noAuthFetchContent?").concat(stringify(get)), {
|
|
12
|
+
method: 'POST',
|
|
13
|
+
body: post
|
|
14
|
+
}));
|
|
12
15
|
case 1:
|
|
13
16
|
case "end":
|
|
14
17
|
return _context.stop();
|
|
15
18
|
}
|
|
16
19
|
}, _callee);
|
|
17
20
|
}));
|
|
18
|
-
return function fetchContent(_x, _x2) {
|
|
21
|
+
return function fetchContent(_x, _x2, _x3) {
|
|
19
22
|
return _ref.apply(this, arguments);
|
|
20
23
|
};
|
|
21
24
|
}();
|
|
@@ -28,6 +28,7 @@ var DisplayComp = function DisplayComp(_ref) {
|
|
|
28
28
|
return /*#__PURE__*/React.createElement(Button, _extends({}, props, {
|
|
29
29
|
disabled: action.serialEffect === 'disable',
|
|
30
30
|
className: classNames(styles[action.riskLevel], _defineProperty({}, className, !!className)),
|
|
31
|
+
type: action.riskLevel,
|
|
31
32
|
onClick: onClick
|
|
32
33
|
}), children);
|
|
33
34
|
};
|
|
@@ -2,14 +2,14 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["columns", "resources", "actions", "doAction", "ldId", "dataSetKey", "filedsRewrite", "mainFormLdId", "mainDataSetKey", "onValueChange", "onQuery", "onAdd", "onUpdate", "moduleCode", "defaultDataSourceFormat", "ticketData", "relationKey", "fields", "setVerifyRules"];
|
|
6
|
-
import React, { createRef
|
|
5
|
+
var _excluded = ["columns", "resources", "actions", "doAction", "ldId", "dataSetKey", "filedsRewrite", "mainFormLdId", "mainDataSetKey", "onValueChange", "onQuery", "onAdd", "onUpdate", "moduleCode", "defaultDataSourceFormat", "ticketData", "relationKey", "fields", "setVerifyRules", "pageProxy"];
|
|
6
|
+
import React, { createRef } from 'react';
|
|
7
7
|
import { reduce, keyBy, isEmpty, pick, union, omit, forEach, debounce, isNil } from 'lodash';
|
|
8
8
|
import { BasicDivider } from 'luck-design';
|
|
9
9
|
import { AutoForm } from '@luck-design-biz/base/FormList';
|
|
10
10
|
import ldBuilder from "../../helper/ldBuilder";
|
|
11
11
|
import { getFormItem, formItemDataFormat, dataFormat, behaviorCall } from "../../utils";
|
|
12
|
-
import {
|
|
12
|
+
import { useLDCtx } from "../Builder";
|
|
13
13
|
var didMount = false;
|
|
14
14
|
var debounceFunc = debounce(function (fields, changedValues, allValues, props) {
|
|
15
15
|
forEach(changedValues, function (val, key) {
|
|
@@ -57,8 +57,9 @@ var buildLdAutoForm = function buildLdAutoForm(_ref) {
|
|
|
57
57
|
_ref$fields = _ref.fields,
|
|
58
58
|
fields = _ref$fields === void 0 ? [] : _ref$fields,
|
|
59
59
|
setVerifyRules = _ref.setVerifyRules,
|
|
60
|
+
pageProxy = _ref.pageProxy,
|
|
60
61
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
61
|
-
var _ref2 =
|
|
62
|
+
var _ref2 = useLDCtx(pageProxy) || {},
|
|
62
63
|
setFieldProps = _ref2.setFieldProps;
|
|
63
64
|
var defaultValues = /*#__PURE__*/createRef({});
|
|
64
65
|
var isMain = ldId === mainFormLdId;
|
|
@@ -104,11 +104,13 @@ var LdCard = function LdCard(_ref2) {
|
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
106
|
},
|
|
107
|
-
onLdQuery: function onLdQuery() {
|
|
108
|
-
var
|
|
109
|
-
doQuery({
|
|
107
|
+
onLdQuery: function onLdQuery(_params) {
|
|
108
|
+
var _getDvaApp2;
|
|
109
|
+
if (_params) doQuery({
|
|
110
110
|
params: _params,
|
|
111
111
|
callback: afterInit
|
|
112
|
+
});else (_getDvaApp2 = getDvaApp()) === null || _getDvaApp2 === void 0 || _getDvaApp2._store.dispatch({
|
|
113
|
+
type: "".concat(namespace, "/doQuery")
|
|
112
114
|
});
|
|
113
115
|
}
|
|
114
116
|
});
|
|
@@ -220,11 +222,11 @@ var LdIndex = function LdIndex(_ref4) {
|
|
|
220
222
|
label: '此数据集为树形数据集,请选择非树形数据集'
|
|
221
223
|
});
|
|
222
224
|
var Component = useCreation(function () {
|
|
223
|
-
var
|
|
224
|
-
(
|
|
225
|
-
if (!((
|
|
226
|
-
var
|
|
227
|
-
(
|
|
225
|
+
var _getDvaApp3, _getDvaApp4;
|
|
226
|
+
(_getDvaApp3 = getDvaApp()) === null || _getDvaApp3 === void 0 || _getDvaApp3.unmodel(namespace);
|
|
227
|
+
if (!((_getDvaApp4 = getDvaApp()) !== null && _getDvaApp4 !== void 0 && _getDvaApp4._store.getState()[namespace])) {
|
|
228
|
+
var _getDvaApp5;
|
|
229
|
+
(_getDvaApp5 = getDvaApp()) === null || _getDvaApp5 === void 0 || _getDvaApp5.model(createModel(namespace, _objectSpread(_objectSpread({
|
|
228
230
|
isFlow: !!props.isFlow
|
|
229
231
|
}, overModel), {}, {
|
|
230
232
|
dataSetKey: props.dataSetKey,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["options"];
|
|
3
|
+
var _excluded = ["options", "pageProxy"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { Button, Tabs } from 'luck-design/antd';
|
|
6
6
|
import { Collapse, ButtonRadio } from '@luck-design-biz/base';
|
|
@@ -11,9 +11,10 @@ export var LdCollapse = ldComBuilder(Collapse);
|
|
|
11
11
|
export var LdButtonRadio = function LdButtonRadio(_ref) {
|
|
12
12
|
var _ref$options = _ref.options,
|
|
13
13
|
options = _ref$options === void 0 ? [] : _ref$options,
|
|
14
|
+
pageProxy = _ref.pageProxy,
|
|
14
15
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
16
|
return /*#__PURE__*/React.createElement(ButtonRadio, _extends({}, props, {
|
|
16
|
-
options: filterOptions(options)
|
|
17
|
+
options: filterOptions(options, pageProxy)
|
|
17
18
|
}));
|
|
18
19
|
};
|
|
19
20
|
export var LdIconFont = ldComBuilder(IconFont);
|
|
@@ -6,7 +6,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
|
6
6
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
7
7
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
8
8
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
9
|
-
var _excluded = ["namespace", "formState", "formMode", "formOperates", "loading", "apiRef", "wrapperRef", "readOnly", "mainFormLdId", "renderFormList", "renderAffixLeft", "renderAffixRight", "beforeSubmit", "showSaveBtn", "saveBtnTitle", "affixLayout", "getContainer", "onValueChange", "afterSubmit", "renderFormExtra", "bpmButtonProps", "setVerifyRules", "afterSubmitLoading", "showConfigBtn", "affixBarZIndex"],
|
|
9
|
+
var _excluded = ["namespace", "formState", "formMode", "formOperates", "loading", "apiRef", "wrapperRef", "pageProxy", "readOnly", "mainFormLdId", "renderFormList", "renderAffixLeft", "renderAffixRight", "beforeSubmit", "showSaveBtn", "saveBtnTitle", "affixLayout", "getContainer", "onValueChange", "afterSubmit", "renderFormExtra", "bpmButtonProps", "setVerifyRules", "afterSubmitLoading", "validateErrorCallback", "showConfigBtn", "affixBarZIndex"],
|
|
10
10
|
_excluded2 = ["dataSets", "doAction", "resources"],
|
|
11
11
|
_excluded3 = ["id", "header", "title", "readOnly", "extraConfig", "renderTopLeft", "serial"],
|
|
12
12
|
_excluded4 = ["ldId", "initData", "overModel"];
|
|
@@ -22,7 +22,7 @@ import { FormList, FormListAffix, FormBtn } from '@luck-design-biz/base/FormList
|
|
|
22
22
|
import buildLdAutoForm from "../LdAutoForm";
|
|
23
23
|
import buildLdGridForm from "../LdGridForm";
|
|
24
24
|
import { Collapse } from '@luck-design-biz/base';
|
|
25
|
-
import {
|
|
25
|
+
import { useLDCtx } from "../Builder";
|
|
26
26
|
import { LuckDaPopContext } from "../LdPop";
|
|
27
27
|
import createModel from "./model";
|
|
28
28
|
import { onBatchSubmitAction } from "../../helper/action";
|
|
@@ -38,6 +38,7 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
38
38
|
loading = _ref.loading,
|
|
39
39
|
apiRef = _ref.apiRef,
|
|
40
40
|
wrapperRef = _ref.wrapperRef,
|
|
41
|
+
pageProxy = _ref.pageProxy,
|
|
41
42
|
readOnly = _ref.readOnly,
|
|
42
43
|
mainFormLdId = _ref.mainFormLdId,
|
|
43
44
|
renderFormList = _ref.renderFormList,
|
|
@@ -59,6 +60,7 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
59
60
|
bpmButtonProps = _ref$bpmButtonProps === void 0 ? {} : _ref$bpmButtonProps,
|
|
60
61
|
setVerifyRules = _ref.setVerifyRules,
|
|
61
62
|
afterSubmitLoading = _ref.afterSubmitLoading,
|
|
63
|
+
validateErrorCallback = _ref.validateErrorCallback,
|
|
62
64
|
_ref$showConfigBtn = _ref.showConfigBtn,
|
|
63
65
|
showConfigBtn = _ref$showConfigBtn === void 0 ? true : _ref$showConfigBtn,
|
|
64
66
|
affixBarZIndex = _ref.affixBarZIndex,
|
|
@@ -82,7 +84,7 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
82
84
|
}, []);
|
|
83
85
|
var _ref2 = useContext(LuckDaPopContext) || {},
|
|
84
86
|
defaultLayout = _ref2.affixLayout;
|
|
85
|
-
var _ref3 =
|
|
87
|
+
var _ref3 = useLDCtx(pageProxy) || {},
|
|
86
88
|
dataSets = _ref3.dataSets,
|
|
87
89
|
doAction = _ref3.doAction,
|
|
88
90
|
resources = _ref3.resources,
|
|
@@ -221,9 +223,9 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
221
223
|
formUid: formUid,
|
|
222
224
|
mainDataSetKey: mainDataSetKey
|
|
223
225
|
}, function (success, mainKey, res) {
|
|
224
|
-
afterSubmitLoading && afterSubmitLoading(res);
|
|
225
226
|
setSubmitLoading(false);
|
|
226
227
|
if (success) {
|
|
228
|
+
afterSubmitLoading === null || afterSubmitLoading === void 0 || afterSubmitLoading(res);
|
|
227
229
|
var mainFormData = res.detail[res.list[0]];
|
|
228
230
|
if (afterSubmit) {
|
|
229
231
|
afterSubmit(success, mainKey, res);
|
|
@@ -231,10 +233,11 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
231
233
|
var _formListRef$current, _formListRef$current2;
|
|
232
234
|
props.parentModelName && ((_formListRef$current = formListRef.current) === null || _formListRef$current === void 0 ? void 0 : _formListRef$current.doParentsQuery());
|
|
233
235
|
(_formListRef$current2 = formListRef.current) === null || _formListRef$current2 === void 0 || _formListRef$current2.onQuery(null, _defineProperty({}, mainFormLdId, mainFormData), function () {
|
|
234
|
-
|
|
236
|
+
var _formListRef$current4;
|
|
237
|
+
(_formListRef$current4 = formListRef.current) === null || _formListRef$current4 === void 0 || _formListRef$current4.setFormMode('info');
|
|
235
238
|
});
|
|
236
239
|
}
|
|
237
|
-
}
|
|
240
|
+
} else validateErrorCallback === null || validateErrorCallback === void 0 || validateErrorCallback();
|
|
238
241
|
});
|
|
239
242
|
};
|
|
240
243
|
var formConfig = _objectSpread(_objectSpread({
|
|
@@ -290,7 +293,7 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
290
293
|
getContainer: getContainer
|
|
291
294
|
}), sortBy([].concat(_toConsumableArray(formList), _toConsumableArray(formExtra)), function (o) {
|
|
292
295
|
var _o$props;
|
|
293
|
-
return o.order || ((_o$props = o.props) === null || _o$props === void 0 ? void 0 : _o$props.order);
|
|
296
|
+
return (o === null || o === void 0 ? void 0 : o.order) || (o === null || o === void 0 || (_o$props = o.props) === null || _o$props === void 0 ? void 0 : _o$props.order);
|
|
294
297
|
}).map(function (formProps) {
|
|
295
298
|
var _formProps$type = formProps.type,
|
|
296
299
|
type = _formProps$type === void 0 ? 'auto' : _formProps$type;
|
|
@@ -77,10 +77,12 @@ var LdGrid = function LdGrid(_ref) {
|
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
79
|
},
|
|
80
|
-
onLdQuery: function onLdQuery() {
|
|
81
|
-
var
|
|
82
|
-
doQuery({
|
|
80
|
+
onLdQuery: function onLdQuery(_params) {
|
|
81
|
+
var _getDvaApp2;
|
|
82
|
+
if (_params) doQuery({
|
|
83
83
|
params: _params
|
|
84
|
+
});else (_getDvaApp2 = getDvaApp()) === null || _getDvaApp2 === void 0 || _getDvaApp2._store.dispatch({
|
|
85
|
+
type: "".concat(namespace, "/doQuery")
|
|
84
86
|
});
|
|
85
87
|
}
|
|
86
88
|
});
|
|
@@ -100,7 +102,7 @@ var LdGrid = function LdGrid(_ref) {
|
|
|
100
102
|
*/
|
|
101
103
|
var _columns = useCreation(function () {
|
|
102
104
|
if (columnsReset) {
|
|
103
|
-
if (isFunction) {
|
|
105
|
+
if (isFunction(columnsReset)) {
|
|
104
106
|
return columnsReset(columns);
|
|
105
107
|
}
|
|
106
108
|
return columnsReset;
|
|
@@ -144,9 +146,6 @@ var LdGrid = function LdGrid(_ref) {
|
|
|
144
146
|
unclosableSet: unclosableSet,
|
|
145
147
|
onQuery: onQuery
|
|
146
148
|
});
|
|
147
|
-
|
|
148
|
-
// console.log('_columns',columns,_columns)
|
|
149
|
-
|
|
150
149
|
return /*#__PURE__*/React.createElement(GridList, _extends({
|
|
151
150
|
columns: _columns
|
|
152
151
|
// 资源串、行为配置
|
|
@@ -184,11 +183,11 @@ var LdIndex = function LdIndex(_ref2) {
|
|
|
184
183
|
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
185
184
|
var isTreeGrid = isNil(_isTreeGrid) ? includes(props.isTree, props.dataSetKey) : _isTreeGrid;
|
|
186
185
|
var Component = useCreation(function () {
|
|
187
|
-
var
|
|
188
|
-
(
|
|
189
|
-
if (!((
|
|
190
|
-
var
|
|
191
|
-
(
|
|
186
|
+
var _getDvaApp3, _getDvaApp4;
|
|
187
|
+
(_getDvaApp3 = getDvaApp()) === null || _getDvaApp3 === void 0 || _getDvaApp3.unmodel(namespace);
|
|
188
|
+
if (!((_getDvaApp4 = getDvaApp()) !== null && _getDvaApp4 !== void 0 && _getDvaApp4._store.getState()[namespace])) {
|
|
189
|
+
var _getDvaApp5, _props$pagination;
|
|
190
|
+
(_getDvaApp5 = getDvaApp()) === null || _getDvaApp5 === void 0 || _getDvaApp5.model(createModel(namespace, _objectSpread(_objectSpread({
|
|
192
191
|
behaviorKey: isTreeGrid ? 'readTree' : 'readGrid'
|
|
193
192
|
}, overModel), {}, {
|
|
194
193
|
pageSize: overModel.pageSize || ((_props$pagination = props.pagination) === null || _props$pagination === void 0 ? void 0 : _props$pagination.pageSize) || props.pageSize,
|
|
@@ -2,15 +2,15 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["columns", "resources", "actions", "doAction", "ldId", "dataSetKey", "columnsRewrite", "columnsReset", "onQuery", "onAdd", "onUpdate", "onDelete", "mainFormLdId", "mainDataSetKey", "onValueChange", "type", "afterOperate", "moduleCode", "defaultDataSourceFormat", "ticketData", "className", "formRef", "formMode", "fields", "setVerifyRules"];
|
|
6
|
-
import React, { createRef
|
|
5
|
+
var _excluded = ["columns", "resources", "actions", "doAction", "ldId", "dataSetKey", "columnsRewrite", "columnsReset", "onQuery", "onAdd", "onUpdate", "onDelete", "mainFormLdId", "mainDataSetKey", "onValueChange", "type", "afterOperate", "moduleCode", "defaultDataSourceFormat", "ticketData", "className", "formRef", "formMode", "fields", "setVerifyRules", "pageProxy"];
|
|
6
|
+
import React, { createRef } from 'react';
|
|
7
7
|
import { reduce, keyBy, isEmpty, pick, omit } from 'lodash';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import ldBuilder from "../../helper/ldBuilder";
|
|
10
10
|
import { GridForm } from '@luck-design-biz/base/FormList';
|
|
11
11
|
import { getFormColumn, formItemDataFormat, dataFormat, behaviorCall } from "../../utils";
|
|
12
12
|
import { defaultComName } from "../../helper/form";
|
|
13
|
-
import {
|
|
13
|
+
import { useLDCtx } from "../Builder";
|
|
14
14
|
import styles from "./index.less";
|
|
15
15
|
var buildLdGridForm = function buildLdGridForm(_ref) {
|
|
16
16
|
var _ref$columns = _ref.columns,
|
|
@@ -53,8 +53,9 @@ var buildLdGridForm = function buildLdGridForm(_ref) {
|
|
|
53
53
|
formMode = _ref.formMode,
|
|
54
54
|
fields = _ref.fields,
|
|
55
55
|
setVerifyRules = _ref.setVerifyRules,
|
|
56
|
+
pageProxy = _ref.pageProxy,
|
|
56
57
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
57
|
-
var _ref2 =
|
|
58
|
+
var _ref2 = useLDCtx(pageProxy) || {},
|
|
58
59
|
setFieldProps = _ref2.setFieldProps;
|
|
59
60
|
var defaultValues = /*#__PURE__*/createRef({});
|
|
60
61
|
var isMain = ldId === mainFormLdId;
|
package/es/helper/FromItems.js
CHANGED
|
@@ -9,7 +9,7 @@ var _excluded = ["onBlur"],
|
|
|
9
9
|
_excluded4 = ["handleValueChange", "config"],
|
|
10
10
|
_excluded5 = ["onBlur"],
|
|
11
11
|
_excluded6 = ["handleValueChange", "config"],
|
|
12
|
-
_excluded7 = ["onChange"],
|
|
12
|
+
_excluded7 = ["onChange", "format"],
|
|
13
13
|
_excluded8 = ["handleValueChange", "config"],
|
|
14
14
|
_excluded9 = ["handleValueChange", "onChange", "params", "extraFilter"],
|
|
15
15
|
_excluded10 = ["onChange"],
|
|
@@ -18,7 +18,7 @@ var _excluded = ["onBlur"],
|
|
|
18
18
|
_excluded13 = ["handleValueChange", "config", "allowClear"],
|
|
19
19
|
_excluded14 = ["renderInfoMode"],
|
|
20
20
|
_excluded15 = ["onChange"],
|
|
21
|
-
_excluded16 = ["handleValueChange", "config", "selectorProps", "suppressSelect"],
|
|
21
|
+
_excluded16 = ["handleValueChange", "config", "selectorProps", "suppressSelect", "auth", "leafOnly"],
|
|
22
22
|
_excluded17 = ["onClose"],
|
|
23
23
|
_excluded18 = ["handleValueChange", "config"],
|
|
24
24
|
_excluded19 = ["onChange"],
|
|
@@ -40,6 +40,60 @@ import { DatadicDropDown as DatedicFormItem, UserSelectDropDown as UserItem } fr
|
|
|
40
40
|
import buildUploadFormItem from "../upload/FormItem";
|
|
41
41
|
import ComplexItem from "../components/ComplexItem";
|
|
42
42
|
import { LC_COMPONENT_UNIT_KEY, LC_FORMITEM_UNIT } from "../lowcode/constants";
|
|
43
|
+
var data_config = {
|
|
44
|
+
'YYYY-MM-DD HH:mm:ss': {
|
|
45
|
+
type: 'date',
|
|
46
|
+
showTime: {
|
|
47
|
+
format: 'HH:mm:ss'
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
'YYYY-MM-DD HH:mm': {
|
|
51
|
+
type: 'date',
|
|
52
|
+
showTime: {
|
|
53
|
+
format: 'HH:mm'
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
'YYYY-MM-DD HH': {
|
|
57
|
+
type: 'date',
|
|
58
|
+
showTime: {
|
|
59
|
+
format: 'HH'
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
'YYYY-MM-DD': {
|
|
63
|
+
type: 'date',
|
|
64
|
+
showTime: false
|
|
65
|
+
},
|
|
66
|
+
'YYYY-MM': {
|
|
67
|
+
type: 'month',
|
|
68
|
+
showTime: false
|
|
69
|
+
},
|
|
70
|
+
'YYYY-wo': {
|
|
71
|
+
type: 'week',
|
|
72
|
+
showTime: false
|
|
73
|
+
},
|
|
74
|
+
'YYYY': {
|
|
75
|
+
type: 'year',
|
|
76
|
+
showTime: false
|
|
77
|
+
},
|
|
78
|
+
'HH:mm:ss': {
|
|
79
|
+
type: 'time',
|
|
80
|
+
showTime: {
|
|
81
|
+
format: 'HH:mm:ss'
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
'HH:mm': {
|
|
85
|
+
type: 'time',
|
|
86
|
+
showTime: {
|
|
87
|
+
format: 'HH:mm'
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
'mm:ss': {
|
|
91
|
+
type: 'time',
|
|
92
|
+
showTime: {
|
|
93
|
+
format: 'mm:ss'
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
43
97
|
export var getNumberItem = function getNumberItem() {
|
|
44
98
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
45
99
|
handleValueChange = _ref.handleValueChange,
|
|
@@ -104,13 +158,14 @@ export var getDateItem = function getDateItem() {
|
|
|
104
158
|
_ref7$config = _ref7.config,
|
|
105
159
|
_ref7$config2 = _ref7$config === void 0 ? {} : _ref7$config,
|
|
106
160
|
_onChange = _ref7$config2.onChange,
|
|
161
|
+
format = _ref7$config2.format,
|
|
107
162
|
_config = _objectWithoutProperties(_ref7$config2, _excluded7),
|
|
108
163
|
props = _objectWithoutProperties(_ref7, _excluded8);
|
|
109
164
|
return /*#__PURE__*/React.createElement(BasicFormItem, _extends({}, props, {
|
|
110
165
|
$attrs: _defineProperty(_defineProperty({}, LC_COMPONENT_UNIT_KEY, LC_FORMITEM_UNIT), 'data-__component', 'FieldDate'),
|
|
111
166
|
type: "datePicker",
|
|
112
|
-
config: _objectSpread(_objectSpread({}, _config), {}, {
|
|
113
|
-
|
|
167
|
+
config: _objectSpread(_objectSpread(_objectSpread({}, data_config[format]), _config), {}, {
|
|
168
|
+
format: format,
|
|
114
169
|
onChange: function onChange(date, dateString) {
|
|
115
170
|
handleValueChange && handleValueChange(date);
|
|
116
171
|
_onChange && _onChange(date, dateString);
|
|
@@ -235,10 +290,14 @@ export var getGroupItem = function getGroupItem(_ref19) {
|
|
|
235
290
|
_ref19$selectorProps = _ref19.selectorProps,
|
|
236
291
|
selectorProps = _ref19$selectorProps === void 0 ? {} : _ref19$selectorProps,
|
|
237
292
|
suppressSelect = _ref19.suppressSelect,
|
|
293
|
+
_ref19$auth = _ref19.auth,
|
|
294
|
+
auth = _ref19$auth === void 0 ? false : _ref19$auth,
|
|
295
|
+
_ref19$leafOnly = _ref19.leafOnly,
|
|
296
|
+
leafOnly = _ref19$leafOnly === void 0 ? false : _ref19$leafOnly,
|
|
238
297
|
props = _objectWithoutProperties(_ref19, _excluded16);
|
|
239
298
|
return /*#__PURE__*/React.createElement(TreeSelector, _extends({}, props, {
|
|
240
299
|
$attrs: _defineProperty(_defineProperty({}, LC_COMPONENT_UNIT_KEY, LC_FORMITEM_UNIT), 'data-__component', 'FieldGroup'),
|
|
241
|
-
api: "/api/base/group/sysGroupTree/noAuthReadJurisTree?sclassKey=".concat(props.sclassKey),
|
|
300
|
+
api: "/api/base/group/sysGroupTree/".concat(auth ? 'noAuthReadJurisTree' : 'noAuthReadNoJurisTree', "?sclassKey=").concat(props.sclassKey, "&ex=").concat(escape(leafOnly ? 'ichildren!=0' : '')),
|
|
242
301
|
selectorProps: _objectSpread(_objectSpread({}, selectorProps), {}, {
|
|
243
302
|
suppressSelect: suppressSelect
|
|
244
303
|
}),
|
package/es/helper/action.js
CHANGED
package/es/helper/ldBuilder.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import React
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
-
import {
|
|
4
|
+
import { useLDCtx } from "../components/Builder";
|
|
5
5
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
6
6
|
export var ErrorWrapper = styled.span.withConfig({
|
|
7
7
|
displayName: "ErrorWrapper",
|
|
@@ -13,8 +13,9 @@ var builder = function builder(wrapped) {
|
|
|
13
13
|
dataSetKey = props.dataSetKey,
|
|
14
14
|
wrapper = props.wrapper,
|
|
15
15
|
className = props.className,
|
|
16
|
-
style = props.style
|
|
17
|
-
|
|
16
|
+
style = props.style,
|
|
17
|
+
pageProxy = props.pageProxy;
|
|
18
|
+
var _ref = useLDCtx(pageProxy) || {},
|
|
18
19
|
resources = _ref.resources,
|
|
19
20
|
actions = _ref.actions,
|
|
20
21
|
_ref$dataSets = _ref.dataSets,
|
package/es/helper/ldComBuild.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["$css"],
|
|
5
|
-
_excluded2 = ["className", "$css"];
|
|
6
|
-
import React, {
|
|
4
|
+
var _excluded = ["$css", "pageProxy"],
|
|
5
|
+
_excluded2 = ["className", "$css", "pageProxy"];
|
|
6
|
+
import React, { forwardRef } from 'react';
|
|
7
7
|
import { useCreation } from 'ahooks';
|
|
8
8
|
import { includes, intersectionWith, isNil } from 'lodash';
|
|
9
9
|
import { ChildrenUtil } from '@luck-design-biz/base/utils';
|
|
10
|
-
import {
|
|
10
|
+
import { useLDCtx } from "../components/Builder";
|
|
11
11
|
import classNames from 'classnames';
|
|
12
12
|
import styles from "./index.less";
|
|
13
|
-
export var getResources = function getResources() {
|
|
14
|
-
var _ref =
|
|
13
|
+
export var getResources = function getResources(pageProxy) {
|
|
14
|
+
var _ref = useLDCtx(pageProxy) || {},
|
|
15
15
|
_ref$resources = _ref.resources,
|
|
16
16
|
resources = _ref$resources === void 0 ? [] : _ref$resources;
|
|
17
17
|
return resources;
|
|
@@ -19,26 +19,29 @@ export var getResources = function getResources() {
|
|
|
19
19
|
export var ldComBuilder = function ldComBuilder(Com) {
|
|
20
20
|
var Component = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
21
21
|
var $css = _ref2.$css,
|
|
22
|
+
pageProxy = _ref2.pageProxy,
|
|
22
23
|
props = _objectWithoutProperties(_ref2, _excluded);
|
|
23
|
-
var resources = getResources();
|
|
24
|
+
var resources = getResources(pageProxy);
|
|
24
25
|
var hasResources = useCreation(function () {
|
|
25
26
|
return isNil(props === null || props === void 0 ? void 0 : props.resource) || includes(resources, props.resource);
|
|
26
27
|
}, [props === null || props === void 0 ? void 0 : props.resource, resources]);
|
|
27
28
|
if (hasResources) {
|
|
28
29
|
return /*#__PURE__*/React.createElement(Com, _extends({}, props, {
|
|
30
|
+
pageProxy: pageProxy,
|
|
29
31
|
ref: ref
|
|
30
32
|
}));
|
|
31
33
|
}
|
|
32
34
|
return props.serialEffect === 'hidden' ? /*#__PURE__*/React.createElement(React.Fragment, null) : /*#__PURE__*/React.createElement(Com, _extends({}, props, {
|
|
33
35
|
disabled: true,
|
|
36
|
+
pageProxy: pageProxy,
|
|
34
37
|
ref: ref
|
|
35
38
|
}));
|
|
36
39
|
});
|
|
37
40
|
return Component;
|
|
38
41
|
};
|
|
39
|
-
export var filterOptions = function filterOptions(options) {
|
|
40
|
-
var key = arguments.length >
|
|
41
|
-
var resources = getResources();
|
|
42
|
+
export var filterOptions = function filterOptions(options, pageProxy) {
|
|
43
|
+
var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'resource';
|
|
44
|
+
var resources = getResources(pageProxy);
|
|
42
45
|
return intersectionWith(options, resources, function (arrVal, othVal) {
|
|
43
46
|
return !arrVal[key] || arrVal[key] === othVal;
|
|
44
47
|
});
|
|
@@ -47,9 +50,11 @@ export var deepFilterCom = function deepFilterCom(Com, childMark) {
|
|
|
47
50
|
var Component = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
48
51
|
var className = _ref3.className,
|
|
49
52
|
$css = _ref3.$css,
|
|
53
|
+
pageProxy = _ref3.pageProxy,
|
|
50
54
|
props = _objectWithoutProperties(_ref3, _excluded2);
|
|
51
|
-
var resources = getResources();
|
|
55
|
+
var resources = getResources(pageProxy);
|
|
52
56
|
var com = /*#__PURE__*/React.createElement(Com, _extends({}, props, {
|
|
57
|
+
pageProxy: pageProxy,
|
|
53
58
|
className: classNames(styles.ldLabs, _defineProperty({}, className, !!className)),
|
|
54
59
|
ref: ref
|
|
55
60
|
}));
|