@luck-design-biz/luckda 1.0.2-2 → 1.0.2-20temp
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 +37 -27
- 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 +18 -8
- 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 +24 -16
- package/es/components/LdGridForm/index.js +16 -7
- package/es/helper/FromItems.js +64 -5
- package/es/helper/action.js +2 -0
- package/es/helper/form.js +7 -1
- package/es/helper/ldBuilder.js +9 -5
- 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/services.js +24 -7
- 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 +40 -6
- package/es/utils/grid.js +12 -3
- package/lib/components/Builder/index.js +36 -26
- 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 +15 -5
- 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 +24 -16
- package/lib/components/LdGridForm/index.js +13 -4
- package/lib/helper/FromItems.js +64 -5
- package/lib/helper/action.js +2 -0
- package/lib/helper/form.js +7 -1
- package/lib/helper/ldBuilder.js +8 -5
- 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/services.js +25 -7
- 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 +40 -5
- package/lib/utils/grid.js +13 -4
- 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,300 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useRef, useState, useEffect } from 'react';
|
|
3
|
+
import { useRequest, useMemoizedFn, useInViewport } from 'ahooks';
|
|
4
|
+
import { Timeline, Avatar, Form, Input, Button, Spin } from 'luck-design/antd';
|
|
5
|
+
import { LuckModal } from 'luck-design';
|
|
6
|
+
import moment from 'moment';
|
|
7
|
+
import { isNil } from 'lodash';
|
|
8
|
+
import { recheck } from '@luck-design-biz/base';
|
|
9
|
+
import { useContext, useGet, resetPageData } from "../engine/provider/ContextProvider";
|
|
10
|
+
import TipIcon from "./components/TipIcon";
|
|
11
|
+
import DiffEditor from "./components/code-editor/DiffEditor";
|
|
12
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
13
|
+
import { getLDMetaAttr } from "../engine/tools/helper";
|
|
14
|
+
import { decompress } from "../engine/tools/dataProcess";
|
|
15
|
+
import styles from "./style/history.less";
|
|
16
|
+
import { fetchHistoryVersionList, fetchAddHistoryVersion, fetchDelHistoryVersion, fetchRecoverHistoryVersion } from "../constants/api-url";
|
|
17
|
+
var History = function History(_ref) {
|
|
18
|
+
var form = _ref.form;
|
|
19
|
+
var ref = useRef();
|
|
20
|
+
var editorRef = useRef();
|
|
21
|
+
var versionListRef = useRef(null);
|
|
22
|
+
var ctx = useContext();
|
|
23
|
+
var _useState = useState([]),
|
|
24
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
25
|
+
versionList = _useState2[0],
|
|
26
|
+
setVersionList = _useState2[1];
|
|
27
|
+
var _useState3 = useState(null),
|
|
28
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
29
|
+
version = _useState4[0],
|
|
30
|
+
setVersion = _useState4[1];
|
|
31
|
+
var _useState5 = useState(false),
|
|
32
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
33
|
+
visible = _useState6[0],
|
|
34
|
+
setVisible = _useState6[1];
|
|
35
|
+
var _useInViewport = useInViewport(ref),
|
|
36
|
+
_useInViewport2 = _slicedToArray(_useInViewport, 1),
|
|
37
|
+
inViewport = _useInViewport2[0];
|
|
38
|
+
var pageData = useGet();
|
|
39
|
+
var _useRequest = useRequest(fetchHistoryVersionList, {
|
|
40
|
+
manual: true,
|
|
41
|
+
onSuccess: function onSuccess(_ref2) {
|
|
42
|
+
var code = _ref2.code,
|
|
43
|
+
list = _ref2.list,
|
|
44
|
+
detail = _ref2.detail;
|
|
45
|
+
if (code === 1) {
|
|
46
|
+
versionListRef.current = list.map(function (id) {
|
|
47
|
+
return detail[id];
|
|
48
|
+
});
|
|
49
|
+
setVersionList(versionListRef.current);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}),
|
|
53
|
+
loading = _useRequest.loading,
|
|
54
|
+
runFetchHistoryVersionList = _useRequest.run;
|
|
55
|
+
var _useRequest2 = useRequest(fetchAddHistoryVersion, {
|
|
56
|
+
manual: true,
|
|
57
|
+
onSuccess: function onSuccess(_ref3) {
|
|
58
|
+
var code = _ref3.code;
|
|
59
|
+
if (code === 1) {
|
|
60
|
+
setVisible(false);
|
|
61
|
+
runFetchHistoryVersionList({
|
|
62
|
+
pageCode: getLDMetaAttr('pageCode')
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}),
|
|
67
|
+
addLoading = _useRequest2.loading,
|
|
68
|
+
runFetchAddHistoryVersion = _useRequest2.run;
|
|
69
|
+
var _useRequest3 = useRequest(fetchDelHistoryVersion, {
|
|
70
|
+
manual: true,
|
|
71
|
+
onSuccess: function onSuccess(_ref4) {
|
|
72
|
+
var code = _ref4.code;
|
|
73
|
+
if (code === 1) {
|
|
74
|
+
runFetchHistoryVersionList({
|
|
75
|
+
pageCode: getLDMetaAttr('pageCode')
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}),
|
|
80
|
+
deleteLoading = _useRequest3.loading,
|
|
81
|
+
runFetchDelHistoryVersion = _useRequest3.run;
|
|
82
|
+
var _useRequest4 = useRequest(fetchRecoverHistoryVersion, {
|
|
83
|
+
manual: true,
|
|
84
|
+
onSuccess: function onSuccess(_ref5) {
|
|
85
|
+
var code = _ref5.code;
|
|
86
|
+
return code === 1 && window.location.reload();
|
|
87
|
+
}
|
|
88
|
+
}),
|
|
89
|
+
runFetchRecoverHistoryVersion = _useRequest4.run;
|
|
90
|
+
var handleSearch = useMemoizedFn(function (value) {
|
|
91
|
+
if (isNil(value)) {
|
|
92
|
+
setVersionList(versionListRef.current);
|
|
93
|
+
} else {
|
|
94
|
+
setVersionList(versionListRef.current.filter(function (item) {
|
|
95
|
+
return JSON.stringify(item).includes(value);
|
|
96
|
+
}));
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
var handleAddVersion = useMemoizedFn(function () {
|
|
100
|
+
form.validateFields(function (err, values) {
|
|
101
|
+
if (!err) {
|
|
102
|
+
runFetchAddHistoryVersion({
|
|
103
|
+
pageCode: getLDMetaAttr('pageCode'),
|
|
104
|
+
backupName: values.title,
|
|
105
|
+
backupNote: values.note
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
var handleDeleteVersion = useMemoizedFn(function (item) {
|
|
111
|
+
recheck({
|
|
112
|
+
title: "".concat(formatMessage({
|
|
113
|
+
id: 'luckda.lowcode.version.delete',
|
|
114
|
+
label: '你确定要删除该历史版本吗?'
|
|
115
|
+
})),
|
|
116
|
+
checkWords: "".concat(item.backupName, "(").concat(item.backupUserName, ")"),
|
|
117
|
+
cancelText: formatMessage({
|
|
118
|
+
id: 'app.base.operate.cancel'
|
|
119
|
+
}),
|
|
120
|
+
okText: formatMessage({
|
|
121
|
+
id: 'app.base.operate.ok'
|
|
122
|
+
}),
|
|
123
|
+
onOk: function onOk() {
|
|
124
|
+
runFetchDelHistoryVersion({
|
|
125
|
+
uid: item.id
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
var handleRecoverVersion = useMemoizedFn(function () {
|
|
131
|
+
recheck({
|
|
132
|
+
title: "".concat(formatMessage({
|
|
133
|
+
id: 'luckda.lowcode.version.confirm.recover',
|
|
134
|
+
label: '你确定要还原到该历史版本吗?'
|
|
135
|
+
})),
|
|
136
|
+
checkWords: "".concat(version.backupName, "(").concat(version.backupUserName, ")"),
|
|
137
|
+
cancelText: formatMessage({
|
|
138
|
+
id: 'app.base.operate.cancel'
|
|
139
|
+
}),
|
|
140
|
+
okText: formatMessage({
|
|
141
|
+
id: 'luckda.lowcode.version.recover',
|
|
142
|
+
label: '还原版本'
|
|
143
|
+
}),
|
|
144
|
+
onOk: function onOk() {
|
|
145
|
+
return runFetchRecoverHistoryVersion({
|
|
146
|
+
uid: version.id
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
var handleUseVersion = useMemoizedFn(function () {
|
|
152
|
+
var code = editorRef.current.getModel().modified.getValue();
|
|
153
|
+
try {
|
|
154
|
+
var data = JSON.parse(code);
|
|
155
|
+
resetPageData(data);
|
|
156
|
+
setVersion(null);
|
|
157
|
+
} catch (e) {
|
|
158
|
+
console.error(e);
|
|
159
|
+
message.warning(formatMessage({
|
|
160
|
+
id: 'luckda.lowcode.error.pagedata',
|
|
161
|
+
label: '页面数据错误'
|
|
162
|
+
}));
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
useEffect(function () {
|
|
166
|
+
if (inViewport) {
|
|
167
|
+
runFetchHistoryVersionList({
|
|
168
|
+
pageCode: getLDMetaAttr('pageCode')
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}, [inViewport]);
|
|
172
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
173
|
+
ref: ref,
|
|
174
|
+
className: styles['lc-painter-history']
|
|
175
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
176
|
+
className: styles.historyToolbar
|
|
177
|
+
}, /*#__PURE__*/React.createElement(Input.Search, {
|
|
178
|
+
placeholder: formatMessage({
|
|
179
|
+
id: 'luckda.lowcode.version.placeholder.search',
|
|
180
|
+
label: '请输入查询内容'
|
|
181
|
+
}),
|
|
182
|
+
size: "small",
|
|
183
|
+
onSearch: handleSearch
|
|
184
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
185
|
+
type: "primary",
|
|
186
|
+
icon: "plus",
|
|
187
|
+
size: "small",
|
|
188
|
+
style: {
|
|
189
|
+
marginLeft: '8px',
|
|
190
|
+
flexShrink: 0
|
|
191
|
+
},
|
|
192
|
+
onClick: function onClick() {
|
|
193
|
+
return setVisible(true);
|
|
194
|
+
}
|
|
195
|
+
})), /*#__PURE__*/React.createElement(Spin, {
|
|
196
|
+
spinning: loading || deleteLoading
|
|
197
|
+
}, /*#__PURE__*/React.createElement(Timeline, null, versionList.map(function (item) {
|
|
198
|
+
return /*#__PURE__*/React.createElement(Timeline.Item, {
|
|
199
|
+
className: styles.timelineItem
|
|
200
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
201
|
+
className: styles.timelineItemHeader
|
|
202
|
+
}, /*#__PURE__*/React.createElement("div", null, item.backupName), /*#__PURE__*/React.createElement("div", {
|
|
203
|
+
className: styles.timelineItemActions
|
|
204
|
+
}, /*#__PURE__*/React.createElement(TipIcon, {
|
|
205
|
+
title: formatMessage({
|
|
206
|
+
id: 'app.base.operate.delete',
|
|
207
|
+
label: '删除'
|
|
208
|
+
}),
|
|
209
|
+
type: "delete",
|
|
210
|
+
style: {
|
|
211
|
+
color: 'var(--luck-color-danger)',
|
|
212
|
+
marginRight: 8
|
|
213
|
+
},
|
|
214
|
+
onClick: function onClick() {
|
|
215
|
+
return handleDeleteVersion(item);
|
|
216
|
+
}
|
|
217
|
+
}), /*#__PURE__*/React.createElement(TipIcon, {
|
|
218
|
+
title: formatMessage({
|
|
219
|
+
id: 'luckda.lowcode.version.diff',
|
|
220
|
+
label: '差异比对'
|
|
221
|
+
}),
|
|
222
|
+
type: "swap",
|
|
223
|
+
onClick: function onClick() {
|
|
224
|
+
ctx.$publisher(ctx.topics.COMPONENT_ACTIVE, null);
|
|
225
|
+
setVersion(item);
|
|
226
|
+
}
|
|
227
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
228
|
+
className: styles.timelineItemUser
|
|
229
|
+
}, /*#__PURE__*/React.createElement(Avatar, {
|
|
230
|
+
style: {
|
|
231
|
+
backgroundColor: 'var(--luck-ant-colorful-primary)',
|
|
232
|
+
verticalAlign: 'middle',
|
|
233
|
+
marginRight: '8px'
|
|
234
|
+
}
|
|
235
|
+
}, item.backupUserName.slice(-1)), item.backupUserName), /*#__PURE__*/React.createElement("div", {
|
|
236
|
+
className: styles.timelineItemTime
|
|
237
|
+
}, moment(item.backupTime).fromNow()));
|
|
238
|
+
})))), /*#__PURE__*/React.createElement(LuckModal, {
|
|
239
|
+
title: "".concat(version === null || version === void 0 ? void 0 : version.backupName, "(").concat(version === null || version === void 0 ? void 0 : version.backupUserName, ") \u21CB \u5F53\u524D\u7248\u672C"),
|
|
240
|
+
width: "80vw",
|
|
241
|
+
height: "80vh",
|
|
242
|
+
visible: !isNil(version),
|
|
243
|
+
fullScreen: true,
|
|
244
|
+
getContainer: function getContainer() {
|
|
245
|
+
return document.getElementById('lc-design-workspace');
|
|
246
|
+
},
|
|
247
|
+
okText: formatMessage({
|
|
248
|
+
id: 'luckda.lowcode.version.recover',
|
|
249
|
+
label: '还原版本'
|
|
250
|
+
}),
|
|
251
|
+
cancelText: formatMessage({
|
|
252
|
+
id: 'luckda.lowcode.version.use',
|
|
253
|
+
label: '使用'
|
|
254
|
+
}),
|
|
255
|
+
cancelButtonProps: {
|
|
256
|
+
onClick: handleUseVersion
|
|
257
|
+
},
|
|
258
|
+
onOk: handleRecoverVersion,
|
|
259
|
+
onClose: function onClose() {
|
|
260
|
+
return setVersion(null);
|
|
261
|
+
}
|
|
262
|
+
}, /*#__PURE__*/React.createElement(DiffEditor, {
|
|
263
|
+
ref: editorRef,
|
|
264
|
+
language: "json",
|
|
265
|
+
originalCode: version ? JSON.stringify(decompress(version === null || version === void 0 ? void 0 : version.pageData), null, '\t') : '',
|
|
266
|
+
modifiedCode: JSON.stringify(pageData, null, '\t')
|
|
267
|
+
})), /*#__PURE__*/React.createElement(LuckModal, {
|
|
268
|
+
title: formatMessage({
|
|
269
|
+
id: 'luckda.lowcode.version.add',
|
|
270
|
+
label: '添加到历史版本'
|
|
271
|
+
}),
|
|
272
|
+
size: "small",
|
|
273
|
+
visible: visible,
|
|
274
|
+
okButtonProps: {
|
|
275
|
+
loading: addLoading
|
|
276
|
+
},
|
|
277
|
+
onOk: handleAddVersion,
|
|
278
|
+
onClose: function onClose() {
|
|
279
|
+
return setVisible(false);
|
|
280
|
+
}
|
|
281
|
+
}, /*#__PURE__*/React.createElement(Form, null, /*#__PURE__*/React.createElement(Form.Item, null, form.getFieldDecorator('title', {
|
|
282
|
+
rules: [{
|
|
283
|
+
required: true
|
|
284
|
+
}]
|
|
285
|
+
})( /*#__PURE__*/React.createElement(Input, {
|
|
286
|
+
placeholder: formatMessage({
|
|
287
|
+
id: 'luckda.lowcode.version.placeholder.title',
|
|
288
|
+
label: '请输入版本标题'
|
|
289
|
+
})
|
|
290
|
+
}))), /*#__PURE__*/React.createElement(Form.Item, null, form.getFieldDecorator('note')( /*#__PURE__*/React.createElement(Input.TextArea, {
|
|
291
|
+
rows: 6,
|
|
292
|
+
placeholder: formatMessage({
|
|
293
|
+
id: 'luckda.lowcode.version.placeholder.note',
|
|
294
|
+
label: '请输入版本描述'
|
|
295
|
+
})
|
|
296
|
+
}))))));
|
|
297
|
+
};
|
|
298
|
+
export default Form.create({
|
|
299
|
+
name: 'version_form'
|
|
300
|
+
})(History);
|
|
@@ -109,7 +109,7 @@ var Panel = function Panel() {
|
|
|
109
109
|
oldValue: oldValue,
|
|
110
110
|
newValue: newValue
|
|
111
111
|
});
|
|
112
|
-
if (repositioning) context.$publisher(context.topics.COMPONENT_REPOSITIONING, {
|
|
112
|
+
if (repositioning || field === 'css') context.$publisher(context.topics.COMPONENT_REPOSITIONING, {
|
|
113
113
|
id: _id
|
|
114
114
|
});
|
|
115
115
|
});
|
|
@@ -7,6 +7,7 @@ import { Icon, Tooltip, Drawer } from 'luck-design/antd';
|
|
|
7
7
|
import Outline from "./Outline";
|
|
8
8
|
import Components from "./Components";
|
|
9
9
|
import I18n from "./I18n";
|
|
10
|
+
import History from "./History";
|
|
10
11
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
11
12
|
import Expect from "./expect";
|
|
12
13
|
import styles from "./style/ribbon.less";
|
|
@@ -47,6 +48,12 @@ var _DRAWER_I18N_ = {
|
|
|
47
48
|
title: '多语言文案管理',
|
|
48
49
|
fix: false
|
|
49
50
|
};
|
|
51
|
+
var _DRAWER_HISTORY_ = {
|
|
52
|
+
width: 240,
|
|
53
|
+
key: 'history',
|
|
54
|
+
title: '版本历史',
|
|
55
|
+
fix: false
|
|
56
|
+
};
|
|
50
57
|
var Ribbon = function Ribbon() {
|
|
51
58
|
var _useState = useState(null),
|
|
52
59
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -106,6 +113,21 @@ var Ribbon = function Ribbon() {
|
|
|
106
113
|
onClick: function onClick() {
|
|
107
114
|
return setDrawer((drawer === null || drawer === void 0 ? void 0 : drawer.key) === _DRAWER_I18N_.key ? null : _DRAWER_I18N_);
|
|
108
115
|
}
|
|
116
|
+
})), /*#__PURE__*/React.createElement(Tooltip, {
|
|
117
|
+
placement: "right",
|
|
118
|
+
title: formatMessage({
|
|
119
|
+
id: 'luckda.lowcode.history',
|
|
120
|
+
label: _DRAWER_HISTORY_.title
|
|
121
|
+
})
|
|
122
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
123
|
+
type: "history",
|
|
124
|
+
style: {
|
|
125
|
+
color: (drawer === null || drawer === void 0 ? void 0 : drawer.key) === _DRAWER_HISTORY_.key && '#1d79f2',
|
|
126
|
+
fontSize: 20
|
|
127
|
+
},
|
|
128
|
+
onClick: function onClick() {
|
|
129
|
+
return setDrawer((drawer === null || drawer === void 0 ? void 0 : drawer.key) === _DRAWER_HISTORY_.key ? null : _DRAWER_HISTORY_);
|
|
130
|
+
}
|
|
109
131
|
}))), /*#__PURE__*/React.createElement(Drawer, _extends({
|
|
110
132
|
title: drawer ? formatMessage({
|
|
111
133
|
id: "luckda.lowcode.".concat(drawer.key),
|
|
@@ -150,6 +172,20 @@ var Ribbon = function Ribbon() {
|
|
|
150
172
|
style: _objectSpread(_objectSpread({}, _DRAWER_PROPS.style), {}, {
|
|
151
173
|
display: (drawer === null || drawer === void 0 ? void 0 : drawer.key) === _DRAWER_I18N_.key ? 'block' : 'none'
|
|
152
174
|
})
|
|
153
|
-
}), /*#__PURE__*/React.createElement(Expect, null))
|
|
175
|
+
}), /*#__PURE__*/React.createElement(Expect, null)), /*#__PURE__*/React.createElement(Drawer, _extends({
|
|
176
|
+
title: drawer ? formatMessage({
|
|
177
|
+
id: "luckda.lowcode.".concat(drawer.key),
|
|
178
|
+
label: drawer.title
|
|
179
|
+
}) : '',
|
|
180
|
+
width: (drawer === null || drawer === void 0 ? void 0 : drawer.width) || 0,
|
|
181
|
+
visible: (drawer === null || drawer === void 0 ? void 0 : drawer.key) === _DRAWER_HISTORY_.key,
|
|
182
|
+
onClose: function onClose() {
|
|
183
|
+
return setDrawer(null);
|
|
184
|
+
}
|
|
185
|
+
}, _DRAWER_PROPS, {
|
|
186
|
+
style: _objectSpread(_objectSpread({}, _DRAWER_PROPS.style), {}, {
|
|
187
|
+
display: (drawer === null || drawer === void 0 ? void 0 : drawer.key) === _DRAWER_HISTORY_.key ? 'block' : 'none'
|
|
188
|
+
})
|
|
189
|
+
}), /*#__PURE__*/React.createElement(History, null)));
|
|
154
190
|
};
|
|
155
191
|
export default Ribbon;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
@@ -5,32 +6,31 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
5
6
|
var _excluded = ["events"],
|
|
6
7
|
_excluded2 = ["events"],
|
|
7
8
|
_excluded3 = ["render"],
|
|
8
|
-
_excluded4 = ["render"]
|
|
9
|
-
|
|
9
|
+
_excluded4 = ["render"],
|
|
10
|
+
_excluded5 = ["render"];
|
|
11
|
+
import React, { useRef, useState } from 'react';
|
|
10
12
|
import { useCreation, useMemoizedFn } from 'ahooks';
|
|
11
|
-
import { Menu, Dropdown, Button, Tooltip, Icon, Switch } from 'luck-design/antd';
|
|
13
|
+
import { Menu, Dropdown, Button, Tooltip, Icon, Switch, Badge } from 'luck-design/antd';
|
|
12
14
|
import styled from 'styled-components';
|
|
13
15
|
import { isNil, keyBy, keys, omit, reduce } from 'lodash';
|
|
14
16
|
import { useGet } from "../../engine/provider/ContextProvider";
|
|
15
17
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
16
18
|
import Collapse from "./Collapse";
|
|
17
|
-
import
|
|
18
|
-
import FullScreenEditor from "./code-editor/FullScreenEditor";
|
|
19
|
-
import JSEditor from "./code-editor/JSEditor";
|
|
20
|
-
import ActionBindModal from "./ActionBindModal";
|
|
19
|
+
import JSEditor from "../panel-section/JSEditor";
|
|
21
20
|
import { LC_BUILDIN_UNIT_KEY_LIST } from "../../constants";
|
|
22
21
|
var _I18N_PREFIX_ = 'luckda.lowcode.painter.advancePanel';
|
|
23
22
|
var EventItem = styled.div.withConfig({
|
|
24
23
|
displayName: "EventItem",
|
|
25
24
|
componentId: "luckda-6530__sc-6426fo-0"
|
|
26
|
-
})(["display:flex;align-items:center;justify-content:space-between;padding:4px 8px;border:1px solid #e5e6e8;border-radius:6px;margin-bottom:6px;font-size:12px;i{color:
|
|
25
|
+
})(["display:flex;align-items:center;justify-content:space-between;padding:4px 8px;border:1px solid #e5e6e8;border-radius:6px;margin-bottom:6px;font-size:12px;i{color:var(--ant-text-color);cursor:pointer;}i:not(:last-child){margin-right:6px;}"]);
|
|
27
26
|
var _DEFAULT_FUNC_ = 'function isTrue() {\n return true; \n}';
|
|
28
27
|
var AdvancePanel = function AdvancePanel(_ref) {
|
|
29
|
-
var _value$
|
|
28
|
+
var _value$render4, _Map$get;
|
|
30
29
|
var meta = _ref.meta,
|
|
31
30
|
nodeId = _ref.nodeId,
|
|
32
31
|
target = _ref.target,
|
|
33
32
|
onChange = _ref.onChange;
|
|
33
|
+
var jseditorTrigger = useRef(null);
|
|
34
34
|
var value = useGet(isNil(target) ? {
|
|
35
35
|
id: nodeId,
|
|
36
36
|
path: 'props.advance'
|
|
@@ -38,7 +38,6 @@ var AdvancePanel = function AdvancePanel(_ref) {
|
|
|
38
38
|
id: target.ancestorId,
|
|
39
39
|
path: "props.".concat(target.keyPath, ".advance")
|
|
40
40
|
});
|
|
41
|
-
var editorRef = useRef();
|
|
42
41
|
var _useState = useState((value === null || value === void 0 ? void 0 : value.events) || {}),
|
|
43
42
|
_useState2 = _slicedToArray(_useState, 2),
|
|
44
43
|
events = _useState2[0],
|
|
@@ -51,15 +50,12 @@ var AdvancePanel = function AdvancePanel(_ref) {
|
|
|
51
50
|
var _meta$advance;
|
|
52
51
|
return keyBy((meta === null || meta === void 0 || (_meta$advance = meta.advance) === null || _meta$advance === void 0 ? void 0 : _meta$advance.events) || [], 'key');
|
|
53
52
|
}, [meta]);
|
|
54
|
-
var _useState5 = useState((value === null || value === void 0 || (_value$render = value.render) === null || _value$render === void 0 ? void 0 : _value$render.code) || _DEFAULT_FUNC_),
|
|
55
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
56
|
-
editorValue = _useState6[0],
|
|
57
|
-
setEditorValue = _useState6[1];
|
|
58
53
|
var handleEventClick = useMemoizedFn(function (e) {
|
|
59
54
|
var payload = e.item.props.payload;
|
|
60
55
|
setEvent(_objectSpread(_objectSpread({}, payload), {}, {
|
|
61
56
|
actionPool: null
|
|
62
57
|
}));
|
|
58
|
+
jseditorTrigger.current.show();
|
|
63
59
|
});
|
|
64
60
|
var handleDeleteEvent = useMemoizedFn(function (ek) {
|
|
65
61
|
var _ref2 = value || {},
|
|
@@ -71,32 +67,46 @@ var AdvancePanel = function AdvancePanel(_ref) {
|
|
|
71
67
|
events: _events
|
|
72
68
|
}));
|
|
73
69
|
});
|
|
74
|
-
var handleComfirm = useMemoizedFn(function (
|
|
70
|
+
var handleComfirm = useMemoizedFn(function (_code) {
|
|
75
71
|
var _ref3 = value || {},
|
|
76
72
|
events = _ref3.events,
|
|
77
73
|
rest = _objectWithoutProperties(_ref3, _excluded2);
|
|
78
|
-
var _events = _objectSpread(_objectSpread({}, events), {}, _defineProperty({}, event.key,
|
|
74
|
+
var _events = _objectSpread(_objectSpread({}, events), {}, _defineProperty({}, event.key, [['coding', {
|
|
75
|
+
category: 'custom',
|
|
76
|
+
key: 'coding',
|
|
77
|
+
code: _code
|
|
78
|
+
}]]));
|
|
79
79
|
setEvents(_events);
|
|
80
|
+
setEvent(null);
|
|
80
81
|
onChange(_objectSpread(_objectSpread({}, rest), {}, {
|
|
81
82
|
events: _events
|
|
82
83
|
}));
|
|
83
84
|
});
|
|
84
|
-
var handleRenderComfirm = useMemoizedFn(function () {
|
|
85
|
-
var val = editorRef.current.editor.getValue();
|
|
85
|
+
var handleRenderComfirm = useMemoizedFn(function (_code) {
|
|
86
86
|
var _ref4 = value || {},
|
|
87
87
|
render = _ref4.render,
|
|
88
88
|
rest = _objectWithoutProperties(_ref4, _excluded3);
|
|
89
89
|
onChange(_objectSpread(_objectSpread({}, rest), {}, {
|
|
90
90
|
render: {
|
|
91
91
|
value: isNil(render === null || render === void 0 ? void 0 : render.value) ? true : render.value,
|
|
92
|
-
code:
|
|
92
|
+
code: _code
|
|
93
93
|
}
|
|
94
94
|
}));
|
|
95
95
|
});
|
|
96
|
-
var
|
|
96
|
+
var handleRenderClear = useMemoizedFn(function (_code) {
|
|
97
97
|
var _ref5 = value || {},
|
|
98
98
|
render = _ref5.render,
|
|
99
99
|
rest = _objectWithoutProperties(_ref5, _excluded4);
|
|
100
|
+
onChange(_objectSpread(_objectSpread({}, rest), {}, {
|
|
101
|
+
render: {
|
|
102
|
+
value: isNil(render === null || render === void 0 ? void 0 : render.value) ? true : render.value
|
|
103
|
+
}
|
|
104
|
+
}));
|
|
105
|
+
});
|
|
106
|
+
var handleRenderChange = useMemoizedFn(function (checked) {
|
|
107
|
+
var _ref6 = value || {},
|
|
108
|
+
render = _ref6.render,
|
|
109
|
+
rest = _objectWithoutProperties(_ref6, _excluded5);
|
|
100
110
|
onChange(_objectSpread(_objectSpread({}, rest), {}, {
|
|
101
111
|
render: {
|
|
102
112
|
value: checked,
|
|
@@ -104,9 +114,6 @@ var AdvancePanel = function AdvancePanel(_ref) {
|
|
|
104
114
|
}
|
|
105
115
|
}));
|
|
106
116
|
});
|
|
107
|
-
var handleEditorLayoutChange = function handleEditorLayoutChange(code) {
|
|
108
|
-
setEditorValue(code);
|
|
109
|
-
};
|
|
110
117
|
var eventsMenu = useCreation(function () {
|
|
111
118
|
var _meta$advance2;
|
|
112
119
|
return /*#__PURE__*/React.createElement(Menu, {
|
|
@@ -114,14 +121,14 @@ var AdvancePanel = function AdvancePanel(_ref) {
|
|
|
114
121
|
style: {
|
|
115
122
|
fontSize: 12
|
|
116
123
|
}
|
|
117
|
-
}, reduce((_meta$advance2 = meta.advance) === null || _meta$advance2 === void 0 ? void 0 : _meta$advance2.events, function (ret,
|
|
124
|
+
}, reduce((_meta$advance2 = meta.advance) === null || _meta$advance2 === void 0 ? void 0 : _meta$advance2.events, function (ret, e) {
|
|
118
125
|
var _value$events;
|
|
119
|
-
if (!(value !== null && value !== void 0 && (_value$events = value.events) !== null && _value$events !== void 0 && _value$events[
|
|
126
|
+
if (!(value !== null && value !== void 0 && (_value$events = value.events) !== null && _value$events !== void 0 && _value$events[e.key])) {
|
|
120
127
|
ret.push( /*#__PURE__*/React.createElement(Menu.Item, {
|
|
121
|
-
key:
|
|
122
|
-
payload:
|
|
128
|
+
key: e.key,
|
|
129
|
+
payload: e
|
|
123
130
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
124
|
-
title:
|
|
131
|
+
title: e.desc || e.name,
|
|
125
132
|
placement: "left",
|
|
126
133
|
getPopupContainer: function getPopupContainer() {
|
|
127
134
|
return document.getElementById('lc-design-workspace');
|
|
@@ -131,7 +138,7 @@ var AdvancePanel = function AdvancePanel(_ref) {
|
|
|
131
138
|
width: '100%',
|
|
132
139
|
fontSize: 12
|
|
133
140
|
}
|
|
134
|
-
},
|
|
141
|
+
}, e.name))));
|
|
135
142
|
}
|
|
136
143
|
return ret;
|
|
137
144
|
}, []));
|
|
@@ -147,23 +154,21 @@ var AdvancePanel = function AdvancePanel(_ref) {
|
|
|
147
154
|
},
|
|
148
155
|
suppressIcon: true,
|
|
149
156
|
extraRender: function extraRender() {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
onConfirm: handleRenderComfirm
|
|
161
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
157
|
+
var _value$render, _value$render2, _value$render3;
|
|
158
|
+
return /*#__PURE__*/React.createElement(JSEditor, {
|
|
159
|
+
defaultCode: (value === null || value === void 0 || (_value$render = value.render) === null || _value$render === void 0 ? void 0 : _value$render.code) || _DEFAULT_FUNC_,
|
|
160
|
+
onChange: handleRenderComfirm,
|
|
161
|
+
onClear: handleRenderClear
|
|
162
|
+
}, /*#__PURE__*/React.createElement(Badge, _extends({
|
|
163
|
+
dot: value === null || value === void 0 || (_value$render2 = value.render) === null || _value$render2 === void 0 ? void 0 : _value$render2.code
|
|
164
|
+
}, value !== null && value !== void 0 && (_value$render3 = value.render) !== null && _value$render3 !== void 0 && _value$render3.code ? {
|
|
165
|
+
color: "lime"
|
|
166
|
+
} : {}), /*#__PURE__*/React.createElement(Icon, {
|
|
162
167
|
type: "code"
|
|
163
|
-
}));
|
|
168
|
+
})));
|
|
164
169
|
}
|
|
165
170
|
}, /*#__PURE__*/React.createElement(Switch, {
|
|
166
|
-
checked: isNil(value === null || value === void 0 || (_value$
|
|
171
|
+
checked: isNil(value === null || value === void 0 || (_value$render4 = value.render) === null || _value$render4 === void 0 ? void 0 : _value$render4.value) ? true : value.render.value,
|
|
167
172
|
onChange: handleRenderChange
|
|
168
173
|
})), /*#__PURE__*/React.createElement(Collapse, {
|
|
169
174
|
field: "events",
|
|
@@ -185,9 +190,10 @@ var AdvancePanel = function AdvancePanel(_ref) {
|
|
|
185
190
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
186
191
|
type: "edit",
|
|
187
192
|
onClick: function onClick() {
|
|
188
|
-
|
|
193
|
+
setEvent(_objectSpread(_objectSpread({}, metaMap[ek]), {}, {
|
|
189
194
|
actionPool: events[ek]
|
|
190
195
|
}));
|
|
196
|
+
jseditorTrigger.current.show();
|
|
191
197
|
}
|
|
192
198
|
})), /*#__PURE__*/React.createElement(Tooltip, {
|
|
193
199
|
title: formatMessage({
|
|
@@ -212,13 +218,11 @@ var AdvancePanel = function AdvancePanel(_ref) {
|
|
|
212
218
|
}, formatMessage({
|
|
213
219
|
id: "".concat(_I18N_PREFIX_, ".addEventAction"),
|
|
214
220
|
label: '添加事件动作'
|
|
215
|
-
})))), /*#__PURE__*/React.createElement(
|
|
216
|
-
|
|
217
|
-
event: event,
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
return setEvent(null);
|
|
221
|
-
}
|
|
221
|
+
})))), /*#__PURE__*/React.createElement(JSEditor, {
|
|
222
|
+
trigger: jseditorTrigger,
|
|
223
|
+
defaultCode: ((_Map$get = new Map(event === null || event === void 0 ? void 0 : event.actionPool).get('coding')) === null || _Map$get === void 0 ? void 0 : _Map$get.code) || (event === null || event === void 0 ? void 0 : event.func),
|
|
224
|
+
onChange: handleComfirm,
|
|
225
|
+
showClear: false
|
|
222
226
|
}));
|
|
223
227
|
};
|
|
224
228
|
export default AdvancePanel;
|
|
@@ -45,9 +45,16 @@ export default function (_ref) {
|
|
|
45
45
|
break;
|
|
46
46
|
case 'add':
|
|
47
47
|
{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
ctx.$subscriber(ctx.topics.COMPONENT_ACTIVE).once(function () {
|
|
49
|
+
var compName = fromComp.component.toLowerCase();
|
|
50
|
+
var json = require("../../../engine/meta/".concat(compName, ".props.default.json"));
|
|
51
|
+
ctx.$publisher(ctx.topics.COMPONENT_SETTING_CLICK, {
|
|
52
|
+
data: json
|
|
53
|
+
});
|
|
54
|
+
}).watch();
|
|
55
|
+
ctx.$publisher(ctx.topics.COMPONENT_ACTIVE, {
|
|
56
|
+
target: id
|
|
57
|
+
});
|
|
51
58
|
}
|
|
52
59
|
break;
|
|
53
60
|
}
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["title", "type"];
|
|
3
|
+
var _excluded = ["title", "type", "loading", "component"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { Icon, Tooltip } from 'luck-design/antd';
|
|
6
6
|
var TipIcon = function TipIcon(_ref) {
|
|
7
7
|
var title = _ref.title,
|
|
8
8
|
type = _ref.type,
|
|
9
|
+
loading = _ref.loading,
|
|
10
|
+
component = _ref.component,
|
|
9
11
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
10
12
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
11
|
-
title: title
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
title: title,
|
|
14
|
+
getPopupContainer: function getPopupContainer() {
|
|
15
|
+
return document.getElementById('lc-design-workspace');
|
|
16
|
+
}
|
|
17
|
+
}, loading ? /*#__PURE__*/React.createElement(Icon, _extends({
|
|
18
|
+
type: "loading"
|
|
19
|
+
}, rest)) : /*#__PURE__*/React.createElement(Icon, _extends({
|
|
20
|
+
type: type,
|
|
21
|
+
component: component
|
|
14
22
|
}, rest)));
|
|
15
23
|
};
|
|
16
24
|
export default TipIcon;
|