@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
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
4
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
|
+
import React, { useState } from 'react';
|
|
6
|
+
import { useDebounceFn } from 'ahooks';
|
|
7
|
+
import { Form, Select } from 'luck-design/antd';
|
|
8
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
9
|
+
import useDebugSettings from "./useDebugSettings";
|
|
10
|
+
import { fetchSearchUser } from "../constants/api-url";
|
|
11
|
+
var DebugToolDetail = function DebugToolDetail(_ref) {
|
|
12
|
+
var form = _ref.form;
|
|
13
|
+
var _useDebugSettings = useDebugSettings(),
|
|
14
|
+
_useDebugSettings2 = _slicedToArray(_useDebugSettings, 2),
|
|
15
|
+
debugSettings = _useDebugSettings2[0],
|
|
16
|
+
setDebugSetting = _useDebugSettings2[1];
|
|
17
|
+
var _useState = useState([]),
|
|
18
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
+
userOptions = _useState2[0],
|
|
20
|
+
setUserOptions = _useState2[1];
|
|
21
|
+
var _useDebounceFn = useDebounceFn( /*#__PURE__*/function () {
|
|
22
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(value) {
|
|
23
|
+
var _yield$fetchSearchUse, code, list, detail;
|
|
24
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
25
|
+
while (1) switch (_context.prev = _context.next) {
|
|
26
|
+
case 0:
|
|
27
|
+
_context.next = 2;
|
|
28
|
+
return fetchSearchUser({
|
|
29
|
+
sname: value
|
|
30
|
+
});
|
|
31
|
+
case 2:
|
|
32
|
+
_yield$fetchSearchUse = _context.sent;
|
|
33
|
+
code = _yield$fetchSearchUse.code;
|
|
34
|
+
list = _yield$fetchSearchUse.list;
|
|
35
|
+
detail = _yield$fetchSearchUse.detail;
|
|
36
|
+
if (code === 1) {
|
|
37
|
+
setUserOptions(list.map(function (id) {
|
|
38
|
+
var item = detail[id];
|
|
39
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
40
|
+
key: "".concat(item.sloginid),
|
|
41
|
+
label: item.sname
|
|
42
|
+
});
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
case 7:
|
|
46
|
+
case "end":
|
|
47
|
+
return _context.stop();
|
|
48
|
+
}
|
|
49
|
+
}, _callee);
|
|
50
|
+
}));
|
|
51
|
+
return function (_x) {
|
|
52
|
+
return _ref2.apply(this, arguments);
|
|
53
|
+
};
|
|
54
|
+
}(), {
|
|
55
|
+
wait: 500
|
|
56
|
+
}),
|
|
57
|
+
handleSearch = _useDebounceFn.run;
|
|
58
|
+
return /*#__PURE__*/React.createElement(Form, {
|
|
59
|
+
layout: "vertical"
|
|
60
|
+
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
61
|
+
label: formatMessage({
|
|
62
|
+
id: 'luckda.lowcode.design.toolbar.selectUser',
|
|
63
|
+
label: '模拟登录人'
|
|
64
|
+
})
|
|
65
|
+
}, form.getFieldDecorator('account')( /*#__PURE__*/React.createElement(Select, {
|
|
66
|
+
placeholder: formatMessage({
|
|
67
|
+
id: 'luckda.lowcode.design.toolbar.placeholder.selectUser',
|
|
68
|
+
label: '请选择模拟登录人'
|
|
69
|
+
}),
|
|
70
|
+
allowClear: true,
|
|
71
|
+
size: "small",
|
|
72
|
+
style: {
|
|
73
|
+
width: '100%'
|
|
74
|
+
},
|
|
75
|
+
filterOption: false,
|
|
76
|
+
labelInValue: true,
|
|
77
|
+
defaultValue: debugSettings.account ? {
|
|
78
|
+
value: debugSettings.account,
|
|
79
|
+
label: debugSettings.accountName
|
|
80
|
+
} : void 0,
|
|
81
|
+
showSearch: true,
|
|
82
|
+
onSearch: handleSearch,
|
|
83
|
+
onChange: function onChange(_opt) {
|
|
84
|
+
if (_opt) {
|
|
85
|
+
setDebugSetting('account', _opt.key);
|
|
86
|
+
setDebugSetting('accountName', _opt.label);
|
|
87
|
+
} else {
|
|
88
|
+
setDebugSetting('account', void 0);
|
|
89
|
+
setDebugSetting('accountName', void 0);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}, userOptions.map(function (_ref3) {
|
|
93
|
+
var key = _ref3.key,
|
|
94
|
+
label = _ref3.label;
|
|
95
|
+
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
96
|
+
key: key,
|
|
97
|
+
value: key
|
|
98
|
+
}, label);
|
|
99
|
+
})))));
|
|
100
|
+
};
|
|
101
|
+
export default Form.create({
|
|
102
|
+
name: 'debug_tool'
|
|
103
|
+
})(DebugToolDetail);
|
|
@@ -1,28 +1,21 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import React
|
|
3
|
-
import { useUpdateEffect } from 'ahooks';
|
|
2
|
+
import React from 'react';
|
|
4
3
|
import EventBusProvider from "../engine/provider/EventBusProvider";
|
|
5
4
|
import ContextProvider from "../engine/provider/ContextProvider";
|
|
6
5
|
import Page from "../view/Page";
|
|
7
6
|
import { RUNTIME } from "../constants/index";
|
|
7
|
+
import DebugTool from "./DebugTool";
|
|
8
|
+
import useDebugSettings from "./useDebugSettings";
|
|
8
9
|
var Preview = function Preview(_ref) {
|
|
9
|
-
var code = _ref.code
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
useUpdateEffect(function () {
|
|
16
|
-
setCurrentKey(void 0);
|
|
17
|
-
setTimeout(function () {
|
|
18
|
-
setCurrentKey(userId);
|
|
19
|
-
});
|
|
20
|
-
}, [userId]);
|
|
21
|
-
return code && currentKey ? /*#__PURE__*/React.createElement(EventBusProvider, {
|
|
22
|
-
key: code,
|
|
10
|
+
var code = _ref.code;
|
|
11
|
+
var _useDebugSettings = useDebugSettings(),
|
|
12
|
+
_useDebugSettings2 = _slicedToArray(_useDebugSettings, 1),
|
|
13
|
+
debugSettings = _useDebugSettings2[0];
|
|
14
|
+
return /*#__PURE__*/React.createElement(EventBusProvider, {
|
|
15
|
+
key: "".concat(code, ":").concat(debugSettings.account),
|
|
23
16
|
runtime: RUNTIME.PREVIEW
|
|
24
17
|
}, /*#__PURE__*/React.createElement(ContextProvider, {
|
|
25
18
|
code: code
|
|
26
|
-
}, /*#__PURE__*/React.createElement(Page, null)
|
|
19
|
+
}, /*#__PURE__*/React.createElement(Page, null), /*#__PURE__*/React.createElement(DebugTool, null)));
|
|
27
20
|
};
|
|
28
21
|
export default Preview;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
+
import { create } from 'zustand';
|
|
4
|
+
import { immer } from 'zustand/middleware/immer';
|
|
5
|
+
import { subscribeWithSelector } from 'zustand/middleware';
|
|
6
|
+
import { useMemoizedFn, useAsyncEffect } from 'ahooks';
|
|
7
|
+
import { isNil } from 'lodash';
|
|
8
|
+
import { COOKIE_VIRTUAL_ACCOUNT_KEY } from "../constants";
|
|
9
|
+
import { fetchSearchUser } from "../constants/api-url";
|
|
10
|
+
export var useDebugSettingsStore = create()(immer(subscribeWithSelector(function () {
|
|
11
|
+
return {
|
|
12
|
+
account: window.cookie.get(COOKIE_VIRTUAL_ACCOUNT_KEY)
|
|
13
|
+
};
|
|
14
|
+
})));
|
|
15
|
+
var useDebugSettings = function useDebugSettings() {
|
|
16
|
+
var debugSettings = useDebugSettingsStore(function (store) {
|
|
17
|
+
return store;
|
|
18
|
+
});
|
|
19
|
+
useAsyncEffect( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
20
|
+
var _yield$fetchSearchUse, code, list, detail;
|
|
21
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
22
|
+
while (1) switch (_context.prev = _context.next) {
|
|
23
|
+
case 0:
|
|
24
|
+
if (!(debugSettings.account && isNil(debugSettings.accountName))) {
|
|
25
|
+
_context.next = 8;
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
_context.next = 3;
|
|
29
|
+
return fetchSearchUser({
|
|
30
|
+
sloginidListIn: [debugSettings.account]
|
|
31
|
+
});
|
|
32
|
+
case 3:
|
|
33
|
+
_yield$fetchSearchUse = _context.sent;
|
|
34
|
+
code = _yield$fetchSearchUse.code;
|
|
35
|
+
list = _yield$fetchSearchUse.list;
|
|
36
|
+
detail = _yield$fetchSearchUse.detail;
|
|
37
|
+
if (code === 1) {
|
|
38
|
+
useDebugSettingsStore.setState(function (store) {
|
|
39
|
+
store.accountName = detail[list[0]].sname;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
case 8:
|
|
43
|
+
case "end":
|
|
44
|
+
return _context.stop();
|
|
45
|
+
}
|
|
46
|
+
}, _callee);
|
|
47
|
+
})), []);
|
|
48
|
+
var setDebugSetting = useMemoizedFn(function (key, value) {
|
|
49
|
+
useDebugSettingsStore.setState(function (store) {
|
|
50
|
+
if (key === 'account') {
|
|
51
|
+
window.cookie.set(COOKIE_VIRTUAL_ACCOUNT_KEY, value);
|
|
52
|
+
}
|
|
53
|
+
if (isNil(value)) {
|
|
54
|
+
delete store[key];
|
|
55
|
+
} else {
|
|
56
|
+
store[key] = value;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
return [debugSettings, setDebugSetting];
|
|
61
|
+
};
|
|
62
|
+
export default useDebugSettings;
|
|
@@ -48,7 +48,11 @@ var Canvas = function Canvas(_ref) {
|
|
|
48
48
|
return function () {
|
|
49
49
|
var _advance$events3;
|
|
50
50
|
unsub();
|
|
51
|
-
|
|
51
|
+
var varKeys = (pageVars || []).map(function (v) {
|
|
52
|
+
return v.name;
|
|
53
|
+
});
|
|
54
|
+
useStateStore.getState().clear(varKeys);
|
|
55
|
+
ctx._deleteRemoteApis(varKeys);
|
|
52
56
|
ctx.doAction(advance === null || advance === void 0 || (_advance$events3 = advance.events) === null || _advance$events3 === void 0 ? void 0 : _advance$events3.onPageUnmount);
|
|
53
57
|
};
|
|
54
58
|
}, []);
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
+
import React, { PureComponent } from 'react';
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
var Wrapper = styled.div.withConfig({
|
|
8
|
+
displayName: "Wrapper",
|
|
9
|
+
componentId: "luckda-6530__sc-1ge5tx6-0"
|
|
10
|
+
})(["width:100%;height:100%;overflow:auto;"]);
|
|
11
|
+
var Title = styled.h3.withConfig({
|
|
12
|
+
displayName: "Title",
|
|
13
|
+
componentId: "luckda-6530__sc-1ge5tx6-1"
|
|
14
|
+
})(["white-space:pre-line;color:var(--luck-color-danger);fontSize:1.5rem;"]);
|
|
15
|
+
var Content = styled.p.withConfig({
|
|
16
|
+
displayName: "Content",
|
|
17
|
+
componentId: "luckda-6530__sc-1ge5tx6-2"
|
|
18
|
+
})(["white-space:pre-line;color:var(--luck-color-danger);"]);
|
|
19
|
+
var ErrorBoundary = /*#__PURE__*/function (_PureComponent) {
|
|
20
|
+
_inherits(ErrorBoundary, _PureComponent);
|
|
21
|
+
var _super = _createSuper(ErrorBoundary);
|
|
22
|
+
function ErrorBoundary(props) {
|
|
23
|
+
var _this;
|
|
24
|
+
_classCallCheck(this, ErrorBoundary);
|
|
25
|
+
_this = _super.call(this, props);
|
|
26
|
+
_this.state = {
|
|
27
|
+
hasError: false,
|
|
28
|
+
error: '',
|
|
29
|
+
errorInfo: ''
|
|
30
|
+
};
|
|
31
|
+
return _this;
|
|
32
|
+
}
|
|
33
|
+
_createClass(ErrorBoundary, [{
|
|
34
|
+
key: "componentWillReceiveProps",
|
|
35
|
+
value: function componentWillReceiveProps(nextProps) {
|
|
36
|
+
if (nextProps.children !== this.props.children && this.state.hasError) {
|
|
37
|
+
var _this$props$onErrorCa, _this$props;
|
|
38
|
+
// 重置 hasError 为 false 以便重新渲染子组件
|
|
39
|
+
(_this$props$onErrorCa = (_this$props = this.props).onErrorCatch) === null || _this$props$onErrorCa === void 0 || _this$props$onErrorCa.call(_this$props);
|
|
40
|
+
this.setState({
|
|
41
|
+
hasError: false,
|
|
42
|
+
error: '',
|
|
43
|
+
errorInfo: ''
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
key: "componentDidCatch",
|
|
49
|
+
value: function componentDidCatch(error, errorInfo) {
|
|
50
|
+
var _this$props$onErrorCa2, _this$props2;
|
|
51
|
+
// 在此处记录错误信息
|
|
52
|
+
console.error(error);
|
|
53
|
+
(_this$props$onErrorCa2 = (_this$props2 = this.props).onErrorCatch) === null || _this$props$onErrorCa2 === void 0 || _this$props$onErrorCa2.call(_this$props2, error, errorInfo);
|
|
54
|
+
this.setState({
|
|
55
|
+
hasError: true,
|
|
56
|
+
error: error,
|
|
57
|
+
errorInfo: errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.componentStack
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
key: "render",
|
|
62
|
+
value: function render() {
|
|
63
|
+
if (this.state.hasError) {
|
|
64
|
+
// 如果有错误,显示备用 UI
|
|
65
|
+
return /*#__PURE__*/React.createElement(Wrapper, null, /*#__PURE__*/React.createElement(Title, {
|
|
66
|
+
dangerouslySetInnerHTML: {
|
|
67
|
+
__html: this.state.error
|
|
68
|
+
}
|
|
69
|
+
}), /*#__PURE__*/React.createElement(Content, {
|
|
70
|
+
dangerouslySetInnerHTML: {
|
|
71
|
+
__html: this.state.errorInfo
|
|
72
|
+
}
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
return this.props.children;
|
|
76
|
+
}
|
|
77
|
+
}]);
|
|
78
|
+
return ErrorBoundary;
|
|
79
|
+
}(PureComponent);
|
|
80
|
+
export default ErrorBoundary;
|
package/es/lowcode/view/Page.js
CHANGED
|
@@ -8,13 +8,14 @@ import { useMemoizedFn, useCreation, useBoolean } from 'ahooks';
|
|
|
8
8
|
import { Skeleton } from 'luck-design/antd';
|
|
9
9
|
import classNames from 'classnames';
|
|
10
10
|
import { useRemoteSource, useContext } from "../engine/provider/ContextProvider";
|
|
11
|
+
import { usePageProxyContext } from "../engine/provider/PageProxyProvider";
|
|
11
12
|
import initDS from "../engine/tools/initDS";
|
|
12
13
|
import Loading from "./Loading";
|
|
13
14
|
import Wrapper from "./lc-components/Wrapper";
|
|
14
15
|
import Canvas from "./Canvas";
|
|
15
16
|
import { LC_BUILDIN_UNIT_KEY } from "../constants";
|
|
16
17
|
import useCombinedRefs from "../engine/tools/useCombinedRefs";
|
|
17
|
-
import ErrorBoundary from "./
|
|
18
|
+
import ErrorBoundary from "./ErrorBoundary";
|
|
18
19
|
import styles from "./style/page.less";
|
|
19
20
|
var LCPage = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
20
21
|
var className = _ref.className,
|
|
@@ -28,21 +29,25 @@ var LCPage = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
28
29
|
loadMount = _useBoolean2[0],
|
|
29
30
|
setTrue = _useBoolean2[1].setTrue;
|
|
30
31
|
var ctx = useContext();
|
|
31
|
-
var
|
|
32
|
-
|
|
32
|
+
var ppCtx = usePageProxyContext();
|
|
33
|
+
var handlePageLoadMount = useMemoizedFn(function (_ref2, topId) {
|
|
34
|
+
var proxyCode = _ref2.proxyCode;
|
|
35
|
+
if ((ppCtx === null || ppCtx === void 0 ? void 0 : ppCtx.proxyCode) !== proxyCode) return;
|
|
36
|
+
_dsRef.current = initDS(ctx, ppCtx === null || ppCtx === void 0 ? void 0 : ppCtx.proxyCode);
|
|
33
37
|
setTrue();
|
|
38
|
+
ctx.$unsubscriber(ctx.topics.PAGE_LOAD_MOUNT, topId);
|
|
34
39
|
});
|
|
35
40
|
useCreation(function () {
|
|
36
|
-
ctx.$subscriber(ctx.topics.PAGE_LOAD_MOUNT).
|
|
41
|
+
ctx.$subscriber(ctx.topics.PAGE_LOAD_MOUNT).on(handlePageLoadMount).watch();
|
|
37
42
|
}, []);
|
|
38
43
|
var getTargetDom = useMemoizedFn(function () {
|
|
39
44
|
return _rootRef.current;
|
|
40
45
|
});
|
|
41
|
-
var
|
|
46
|
+
var handleErrorCatch = useMemoizedFn(function () {
|
|
42
47
|
ctx.$publisher(ctx.topics.COMPONENT_ACTIVE, null);
|
|
43
48
|
});
|
|
44
49
|
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
45
|
-
|
|
50
|
+
onErrorCatch: handleErrorCatch
|
|
46
51
|
}, /*#__PURE__*/React.createElement(Wrapper, {
|
|
47
52
|
id: LC_BUILDIN_UNIT_KEY.PAGE_ROOT,
|
|
48
53
|
getTargetDom: getTargetDom
|
|
@@ -17,10 +17,12 @@ var FunctionDesign = function FunctionDesign(_ref) {
|
|
|
17
17
|
return !children || React.Children.count(children) === 0;
|
|
18
18
|
}, [children]);
|
|
19
19
|
return /*#__PURE__*/React.createElement(Index, _extends({
|
|
20
|
-
className: classNames(styles['lc-component-box-design'], _defineProperty(
|
|
20
|
+
className: classNames(styles['lc-component-box-design'], _defineProperty({}, className, !!className)),
|
|
21
21
|
style: _objectSpread({
|
|
22
22
|
minHeight: 60
|
|
23
23
|
}, style)
|
|
24
|
-
}, props), isEmpty ?
|
|
24
|
+
}, props), isEmpty ? /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
className: styles.placeholder
|
|
26
|
+
}, "\u70B9\u51FB\u7EC4\u4EF6\u5E93\u7684\u7EC4\u4EF6\u6216\u62D6\u62FD\u7EC4\u4EF6\u5230\u8FD9\u91CC") : children);
|
|
25
27
|
};
|
|
26
28
|
export default FunctionDesign;
|
|
@@ -7,6 +7,7 @@ import classNames from 'classnames';
|
|
|
7
7
|
import { isNil, keyBy } from 'lodash';
|
|
8
8
|
import { Modal, recheck, IconFont } from '@luck-design-biz/base';
|
|
9
9
|
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
10
|
+
import { usePageProxyContext } from "../../../engine/provider/PageProxyProvider";
|
|
10
11
|
import Wrapper from "../Wrapper";
|
|
11
12
|
import { LdCard, LDActions } from "../../../../index";
|
|
12
13
|
import TopFilter from "../Table/components/TopFilter";
|
|
@@ -45,6 +46,7 @@ var LCCardList = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
45
46
|
renderContent = _ref.renderContent,
|
|
46
47
|
describeLines = _ref.describeLines;
|
|
47
48
|
var ctx = useContext();
|
|
49
|
+
var ppCtx = usePageProxyContext();
|
|
48
50
|
var apiRef = useRef();
|
|
49
51
|
var wrapperRef = useRef();
|
|
50
52
|
var instanceRef = useCombinedRefs(ref);
|
|
@@ -253,6 +255,7 @@ var LCCardList = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
253
255
|
ref: instanceRef,
|
|
254
256
|
wrapper: wrapperRef,
|
|
255
257
|
wrapperProps: _wrapperProps,
|
|
258
|
+
pageProxy: ppCtx,
|
|
256
259
|
_loading: ctx.loading,
|
|
257
260
|
className: classNames(_defineProperty({}, className, !!className)),
|
|
258
261
|
ldId: id,
|
|
@@ -98,7 +98,6 @@
|
|
|
98
98
|
"name": "图标地址",
|
|
99
99
|
"type": "_JSEditor",
|
|
100
100
|
"defaultCode": "function avatarUrl(record) { \n return null; \n}",
|
|
101
|
-
"mustConfirm": true,
|
|
102
101
|
"wrapper": "collapse",
|
|
103
102
|
"wrapperProps": {
|
|
104
103
|
"suppressIcon": true
|
|
@@ -115,7 +114,7 @@
|
|
|
115
114
|
"name": "标题内容",
|
|
116
115
|
"type": "_JSEditor",
|
|
117
116
|
"defaultCode": "function renderTitle(record) { \n return record.sname; \n}",
|
|
118
|
-
"
|
|
117
|
+
"isjsx": true,
|
|
119
118
|
"wrapper": "collapse",
|
|
120
119
|
"wrapperProps": {
|
|
121
120
|
"suppressIcon": true
|
|
@@ -138,7 +137,7 @@
|
|
|
138
137
|
"name": "描述内容",
|
|
139
138
|
"type": "_JSEditor",
|
|
140
139
|
"defaultCode": "function renderDescribe(record) { \n return record.describe; \n}",
|
|
141
|
-
"
|
|
140
|
+
"isjsx": true,
|
|
142
141
|
"wrapper": "collapse",
|
|
143
142
|
"wrapperProps": {
|
|
144
143
|
"suppressIcon": true
|
|
@@ -149,7 +148,7 @@
|
|
|
149
148
|
"name": "自定义",
|
|
150
149
|
"type": "_JSEditor",
|
|
151
150
|
"defaultCode": "function renderContent(record) { \n return null; \n}",
|
|
152
|
-
"
|
|
151
|
+
"isjsx": true,
|
|
153
152
|
"wrapper": "collapse",
|
|
154
153
|
"wrapperProps": {
|
|
155
154
|
"suppressIcon": true
|
|
@@ -232,7 +231,6 @@
|
|
|
232
231
|
"name": "不可选卡片",
|
|
233
232
|
"type": "_JSEditor",
|
|
234
233
|
"defaultCode": "function disabledCheckbox(record) { \n return false; \n}",
|
|
235
|
-
"mustConfirm": true,
|
|
236
234
|
"wrapper": "collapse",
|
|
237
235
|
"wrapperProps": {
|
|
238
236
|
"suppressIcon": true
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
4
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
@@ -8,10 +9,10 @@ import { useMemoizedFn, useUpdateEffect, useCreation } from 'ahooks';
|
|
|
8
9
|
import { Modal, Button } from 'luck-design/antd';
|
|
9
10
|
import classNames from 'classnames';
|
|
10
11
|
import styled from 'styled-components';
|
|
11
|
-
import { isNil } from 'lodash';
|
|
12
|
+
import { isNil, isObject, isBoolean } from 'lodash';
|
|
12
13
|
import { LDActions } from "../../../../index";
|
|
13
14
|
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
14
|
-
import { omitBadProps } from "../../../engine/tools/helper";
|
|
15
|
+
import { omitBadProps, executeCode } from "../../../engine/tools/helper";
|
|
15
16
|
import defaultMeta from "../../../engine/meta/dialog.props.default.json";
|
|
16
17
|
import usePromiseState from "../../../engine/tools/usePromiseState";
|
|
17
18
|
import Wrapper from "../Wrapper";
|
|
@@ -40,6 +41,8 @@ var LCDialog = function LCDialog(_ref) {
|
|
|
40
41
|
footer = _ref.footer,
|
|
41
42
|
btnGroup = _ref.btnGroup,
|
|
42
43
|
advance = _ref.advance,
|
|
44
|
+
size = _ref.size,
|
|
45
|
+
style = _ref.style,
|
|
43
46
|
$apiRef = _ref.$apiRef,
|
|
44
47
|
$designProps = _ref.$designProps;
|
|
45
48
|
var ctx = useContext();
|
|
@@ -68,7 +71,9 @@ var LCDialog = function LCDialog(_ref) {
|
|
|
68
71
|
if (open) {
|
|
69
72
|
ctx.doAction(advance.events.onOpen);
|
|
70
73
|
} else {
|
|
74
|
+
_setTitle(title);
|
|
71
75
|
ctx.doAction(advance.events.onClose);
|
|
76
|
+
setLoading(false);
|
|
72
77
|
}
|
|
73
78
|
}, [open]);
|
|
74
79
|
useUpdateEffect(function () {
|
|
@@ -93,7 +98,7 @@ var LCDialog = function LCDialog(_ref) {
|
|
|
93
98
|
}, _callee, null, [[1,, 4, 7]]);
|
|
94
99
|
})));
|
|
95
100
|
var _footer = useCreation(function () {
|
|
96
|
-
if (!footer) return {
|
|
101
|
+
if (isBoolean(footer) && !footer || isObject(footer) && !footer.checked || isObject(footer) && footer.code && !executeCode(ctx, footer.code)) return {
|
|
97
102
|
footer: null
|
|
98
103
|
};
|
|
99
104
|
return {
|
|
@@ -114,7 +119,7 @@ var LCDialog = function LCDialog(_ref) {
|
|
|
114
119
|
onClick: handleOk
|
|
115
120
|
}, okText))
|
|
116
121
|
};
|
|
117
|
-
}, [footer, btnGroup, loading, cancelText, okText]);
|
|
122
|
+
}, [footer, btnGroup, loading, cancelText, okText, open]);
|
|
118
123
|
var getTargetDom = useMemoizedFn(function () {
|
|
119
124
|
var _domRef$current;
|
|
120
125
|
return (_domRef$current = domRef.current) === null || _domRef$current === void 0 ? void 0 : _domRef$current.closest('.ant-modal-content');
|
|
@@ -179,7 +184,10 @@ var LCDialog = function LCDialog(_ref) {
|
|
|
179
184
|
onCancel: function onCancel() {
|
|
180
185
|
return setOpen(false);
|
|
181
186
|
},
|
|
182
|
-
destroyOnClose: destroyOnClose
|
|
187
|
+
destroyOnClose: destroyOnClose,
|
|
188
|
+
style: size === 'full' || height === '100vh' ? _objectSpread(_objectSpread({}, style), {}, {
|
|
189
|
+
top: '0px'
|
|
190
|
+
}) : style
|
|
183
191
|
}, $designProps), /*#__PURE__*/React.createElement("div", {
|
|
184
192
|
style: {
|
|
185
193
|
height: 0,
|
|
@@ -20,10 +20,16 @@
|
|
|
20
20
|
"type": "_I18nInput",
|
|
21
21
|
"default": "对话框"
|
|
22
22
|
},
|
|
23
|
+
{
|
|
24
|
+
"key": "size",
|
|
25
|
+
"name": "#展现尺寸",
|
|
26
|
+
"type": "_DialogSize",
|
|
27
|
+
"default": "custom"
|
|
28
|
+
},
|
|
23
29
|
{
|
|
24
30
|
"key": "width",
|
|
25
31
|
"name": "对话框宽度",
|
|
26
|
-
"type": "
|
|
32
|
+
"type": "_DialogWidthHeight",
|
|
27
33
|
"options": [
|
|
28
34
|
{
|
|
29
35
|
"label": "px",
|
|
@@ -42,12 +48,18 @@
|
|
|
42
48
|
"value": "auto"
|
|
43
49
|
}
|
|
44
50
|
],
|
|
51
|
+
"sizeOptions":{
|
|
52
|
+
"small": "540px",
|
|
53
|
+
"default": "700px",
|
|
54
|
+
"large": "1150px",
|
|
55
|
+
"full": "100vw"
|
|
56
|
+
},
|
|
45
57
|
"default": "700px"
|
|
46
58
|
},
|
|
47
59
|
{
|
|
48
60
|
"key": "height",
|
|
49
61
|
"name": "内容区高度",
|
|
50
|
-
"type": "
|
|
62
|
+
"type": "_DialogWidthHeight",
|
|
51
63
|
"options": [
|
|
52
64
|
{
|
|
53
65
|
"label": "px",
|
|
@@ -62,6 +74,12 @@
|
|
|
62
74
|
"value": "auto"
|
|
63
75
|
}
|
|
64
76
|
],
|
|
77
|
+
"sizeOptions":{
|
|
78
|
+
"small": "40vh",
|
|
79
|
+
"default": "60vh",
|
|
80
|
+
"large": "85vh",
|
|
81
|
+
"full": "100vh"
|
|
82
|
+
},
|
|
65
83
|
"default": "50vh"
|
|
66
84
|
},
|
|
67
85
|
{
|
|
@@ -140,8 +158,10 @@
|
|
|
140
158
|
"key": "footer",
|
|
141
159
|
"name": "显示footer",
|
|
142
160
|
"desc": "是否显示底部按钮区域",
|
|
143
|
-
"type": "
|
|
144
|
-
"default":
|
|
161
|
+
"type": "_ConditionCheck",
|
|
162
|
+
"default": {
|
|
163
|
+
"checked": true
|
|
164
|
+
}
|
|
145
165
|
},
|
|
146
166
|
{
|
|
147
167
|
"key": "okText",
|
|
@@ -9,12 +9,12 @@ import { useMemoizedFn, useUpdateEffect } from 'ahooks';
|
|
|
9
9
|
import { Drawer, Button } from 'luck-design/antd';
|
|
10
10
|
import classNames from 'classnames';
|
|
11
11
|
import styled from 'styled-components';
|
|
12
|
-
import { isNil } from 'lodash';
|
|
12
|
+
import { isNil, isObject, isBoolean } from 'lodash';
|
|
13
13
|
import Wrapper from "../Wrapper";
|
|
14
14
|
import { LDActions } from "../../../../index";
|
|
15
15
|
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
16
16
|
import usePromiseState from "../../../engine/tools/usePromiseState";
|
|
17
|
-
import { omitBadProps } from "../../../engine/tools/helper";
|
|
17
|
+
import { omitBadProps, executeCode } from "../../../engine/tools/helper";
|
|
18
18
|
import defaultMeta from "../../../engine/meta/drawer.props.default.json";
|
|
19
19
|
import styles from "./index.less";
|
|
20
20
|
var Footer = styled.div.withConfig({
|
|
@@ -71,7 +71,9 @@ var LCDrawer = function LCDrawer(_ref) {
|
|
|
71
71
|
if (open) {
|
|
72
72
|
ctx.doAction(advance.events.onOpen);
|
|
73
73
|
} else {
|
|
74
|
+
_setTitle(title);
|
|
74
75
|
ctx.doAction(advance.events.onClose);
|
|
76
|
+
setLoading(false);
|
|
75
77
|
}
|
|
76
78
|
}, [open]);
|
|
77
79
|
useUpdateEffect(function () {
|
|
@@ -171,7 +173,7 @@ var LCDrawer = function LCDrawer(_ref) {
|
|
|
171
173
|
visibility: 'hidden'
|
|
172
174
|
},
|
|
173
175
|
ref: domRef
|
|
174
|
-
}), children, footer ? /*#__PURE__*/React.createElement(Footer, {
|
|
176
|
+
}), children, isBoolean(footer) && footer || isObject(footer) && (footer.check || footer.code && executeCode(ctx, footer.code)) ? /*#__PURE__*/React.createElement(Footer, {
|
|
175
177
|
className: "ant-drawer-footer"
|
|
176
178
|
}, /*#__PURE__*/React.createElement(LDActions, _extends({}, btnGroup, {
|
|
177
179
|
doAction: function doAction(action) {
|