@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,137 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
+
import React, { useState } from 'react';
|
|
5
|
+
import { getCreateHistoryOptions } from 'umi';
|
|
6
|
+
import { useRequest, useMemoizedFn } from 'ahooks';
|
|
7
|
+
import { TreeSelect, Tooltip, Button } from 'luck-design/antd';
|
|
8
|
+
import styled from 'styled-components';
|
|
9
|
+
import { reduce } from 'lodash';
|
|
10
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
11
|
+
import { useGet, modifyNode, getSelfAndParent } from "../../engine/provider/ContextProvider";
|
|
12
|
+
import { fetchMenuTree } from "../../constants/api-url";
|
|
13
|
+
import { getLDMetaAttr, dataToTree } from "../../engine/tools/helper";
|
|
14
|
+
import { LC_BUILDIN_UNIT_KEY } from "../../constants";
|
|
15
|
+
var Wrapper = styled.div.withConfig({
|
|
16
|
+
displayName: "Wrapper",
|
|
17
|
+
componentId: "luckda-6530__sc-r11awc-0"
|
|
18
|
+
})(["width:100%;display:flex;align-items:center;"]);
|
|
19
|
+
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel-section.proxy-linker';
|
|
20
|
+
var ProxyLinker = function ProxyLinker(_ref) {
|
|
21
|
+
var nodeId = _ref.nodeId,
|
|
22
|
+
defaultValue = _ref.defaultValue,
|
|
23
|
+
onChange = _ref.onChange;
|
|
24
|
+
var _proxyCode = useGet({
|
|
25
|
+
id: nodeId,
|
|
26
|
+
path: 'props.proxyCode'
|
|
27
|
+
}) || defaultValue;
|
|
28
|
+
var _useState = useState([]),
|
|
29
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
30
|
+
menuTree = _useState2[0],
|
|
31
|
+
setMenuTree = _useState2[1];
|
|
32
|
+
var _useRequest = useRequest(function () {
|
|
33
|
+
return fetchMenuTree({
|
|
34
|
+
dataModelKey: getLDMetaAttr('dataModelKey'),
|
|
35
|
+
menuType: 'SITE'
|
|
36
|
+
});
|
|
37
|
+
}, {
|
|
38
|
+
onSuccess: function onSuccess(_ref2) {
|
|
39
|
+
var code = _ref2.code,
|
|
40
|
+
list = _ref2.list,
|
|
41
|
+
detail = _ref2.detail;
|
|
42
|
+
if (code === 1) {
|
|
43
|
+
var data = reduce(list, function (res, _id) {
|
|
44
|
+
var _item = detail[_id];
|
|
45
|
+
if (_item.accessType === -1 || _item.accessType === 0 && _item.moduleCode) {
|
|
46
|
+
var isLeaf = _item.accessType === 0;
|
|
47
|
+
res.push({
|
|
48
|
+
id: _id,
|
|
49
|
+
parentId: _item.parentId,
|
|
50
|
+
key: _item.moduleCode,
|
|
51
|
+
value: _item.moduleCode,
|
|
52
|
+
title: isLeaf ? "".concat(_item.name, "(").concat(_item.code, ")") : _item.name,
|
|
53
|
+
disabled: !isLeaf
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return res;
|
|
57
|
+
}, []);
|
|
58
|
+
setMenuTree(dataToTree(data));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}),
|
|
62
|
+
loading = _useRequest.loading,
|
|
63
|
+
refresh = _useRequest.refresh;
|
|
64
|
+
var handleAddMenu = useMemoizedFn(function () {
|
|
65
|
+
var _getCreateHistoryOpti = getCreateHistoryOptions(),
|
|
66
|
+
basename = _getCreateHistoryOpti.basename;
|
|
67
|
+
var url = "".concat(basename === '/' ? '' : basename, "/ccm-dev/page-set/").concat(getLDMetaAttr('dataModelKey'), "?activeKey=menuManage");
|
|
68
|
+
window.open(url, '_blank');
|
|
69
|
+
});
|
|
70
|
+
var handleEditPage = useMemoizedFn(function () {
|
|
71
|
+
var _getCreateHistoryOpti2 = getCreateHistoryOptions(),
|
|
72
|
+
basename = _getCreateHistoryOpti2.basename;
|
|
73
|
+
var url = "".concat(basename === '/' ? '' : basename, "/ccm-dev/page-set/").concat(getLDMetaAttr('dataModelKey'), "?activeKey=pageDesign&code=").concat(_proxyCode, "&mode=edit");
|
|
74
|
+
window.open(url, '_blank');
|
|
75
|
+
});
|
|
76
|
+
var handleSelect = useMemoizedFn(function (val) {
|
|
77
|
+
onChange(val);
|
|
78
|
+
var _getSelfAndParent = getSelfAndParent(LC_BUILDIN_UNIT_KEY.PAGE_ROOT),
|
|
79
|
+
pageRoot = _getSelfAndParent.node;
|
|
80
|
+
modifyNode(LC_BUILDIN_UNIT_KEY.PAGE_ROOT, {
|
|
81
|
+
proxy: _objectSpread(_objectSpread({}, pageRoot.props.proxy), {}, _defineProperty({}, nodeId, val))
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
return /*#__PURE__*/React.createElement(Wrapper, null, /*#__PURE__*/React.createElement(TreeSelect, {
|
|
85
|
+
showSearch: true,
|
|
86
|
+
style: {
|
|
87
|
+
width: 136
|
|
88
|
+
},
|
|
89
|
+
size: "small",
|
|
90
|
+
treeData: menuTree,
|
|
91
|
+
value: _proxyCode,
|
|
92
|
+
treeNodeFilterProp: "title",
|
|
93
|
+
getPopupContainer: function getPopupContainer() {
|
|
94
|
+
return document.getElementById('lc-design-workspace');
|
|
95
|
+
},
|
|
96
|
+
onSelect: handleSelect
|
|
97
|
+
}), /*#__PURE__*/React.createElement(Tooltip, {
|
|
98
|
+
title: formatMessage({
|
|
99
|
+
id: "".concat(_I18N_PREFIX_, ".add"),
|
|
100
|
+
label: '新建页面'
|
|
101
|
+
})
|
|
102
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
103
|
+
size: "small",
|
|
104
|
+
icon: "plus",
|
|
105
|
+
style: {
|
|
106
|
+
marginLeft: 4
|
|
107
|
+
},
|
|
108
|
+
onClick: handleAddMenu
|
|
109
|
+
})), /*#__PURE__*/React.createElement(Tooltip, {
|
|
110
|
+
title: formatMessage({
|
|
111
|
+
id: "".concat(_I18N_PREFIX_, ".edit"),
|
|
112
|
+
label: '编辑页面'
|
|
113
|
+
})
|
|
114
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
115
|
+
size: "small",
|
|
116
|
+
icon: "edit",
|
|
117
|
+
style: {
|
|
118
|
+
marginLeft: 4
|
|
119
|
+
},
|
|
120
|
+
disabled: !_proxyCode,
|
|
121
|
+
onClick: handleEditPage
|
|
122
|
+
})), /*#__PURE__*/React.createElement(Tooltip, {
|
|
123
|
+
title: formatMessage({
|
|
124
|
+
id: "".concat(_I18N_PREFIX_, ".sync"),
|
|
125
|
+
label: '同步数据'
|
|
126
|
+
})
|
|
127
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
128
|
+
size: "small",
|
|
129
|
+
icon: "cloud-sync",
|
|
130
|
+
style: {
|
|
131
|
+
marginLeft: 4
|
|
132
|
+
},
|
|
133
|
+
loading: loading,
|
|
134
|
+
onClick: refresh
|
|
135
|
+
})));
|
|
136
|
+
};
|
|
137
|
+
export default ProxyLinker;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button } from 'luck-design/antd';
|
|
3
|
+
import { useGet } from "../../engine/provider/ContextProvider";
|
|
4
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
5
|
+
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel-section.proxy-params';
|
|
6
|
+
export default function (_ref) {
|
|
7
|
+
var nodeId = _ref.nodeId,
|
|
8
|
+
defaultValue = _ref.defaultValue,
|
|
9
|
+
next = _ref.next;
|
|
10
|
+
var value = useGet({
|
|
11
|
+
id: nodeId,
|
|
12
|
+
path: 'props.proxyParams'
|
|
13
|
+
}) || defaultValue;
|
|
14
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
style: {
|
|
16
|
+
padding: '0 12px'
|
|
17
|
+
}
|
|
18
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
19
|
+
block: true,
|
|
20
|
+
size: "small",
|
|
21
|
+
onClick: function onClick() {
|
|
22
|
+
return next();
|
|
23
|
+
}
|
|
24
|
+
}, formatMessage({
|
|
25
|
+
id: _I18N_PREFIX_,
|
|
26
|
+
label: '页面参数配置'
|
|
27
|
+
}), "(", (value === null || value === void 0 ? void 0 : value.length) || 0, ")"));
|
|
28
|
+
}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import React, { useRef, useEffect } from 'react';
|
|
5
|
+
import { useMap, useMemoizedFn } from 'ahooks';
|
|
6
|
+
import { Button, Collapse, Icon, Form, Input, Select, InputNumber, Switch } from 'luck-design/antd';
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import { formatMessage, suid } from '@luck-design-biz/base/utils';
|
|
9
|
+
var SmallForm = styled(Form).withConfig({
|
|
10
|
+
displayName: "SmallForm",
|
|
11
|
+
componentId: "luckda-6530__sc-1aq87r3-0"
|
|
12
|
+
})(["font-size:12px;padding-top:8px;.ant-form-item{font-size:12px;margin-bottom:8px;.ant-form-item-label,.ant-form-item-control{height:24px;line-height:24px !important;}.ant-form-item-control.has-error{height:36px;.ant-form-explain{font-size:12px;}}label{font-size:12px;}}"]);
|
|
13
|
+
var SmallCollapse = styled(Collapse).withConfig({
|
|
14
|
+
displayName: "SmallCollapse",
|
|
15
|
+
componentId: "luckda-6530__sc-1aq87r3-1"
|
|
16
|
+
})(["font-size:12px;margin-bottom:8px;& > .ant-collapse-item > .ant-collapse-header{padding:4px 8px 4px 36px;}.ant-collapse-content > .ant-collapse-content-box{padding:4px 8px;}"]);
|
|
17
|
+
var ButtonWrapper = styled.div.withConfig({
|
|
18
|
+
displayName: "ButtonWrapper",
|
|
19
|
+
componentId: "luckda-6530__sc-1aq87r3-2"
|
|
20
|
+
})(["display:grid;grid-template-columns:1fr 1fr;gap:8px;"]);
|
|
21
|
+
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel-section.proxy-params-setter';
|
|
22
|
+
var _OPTIONS_ = [{
|
|
23
|
+
label: formatMessage({
|
|
24
|
+
id: "".concat(_I18N_PREFIX_, ".param-origin.state"),
|
|
25
|
+
label: '页面全局状态'
|
|
26
|
+
}),
|
|
27
|
+
value: 'state'
|
|
28
|
+
}, {
|
|
29
|
+
label: formatMessage({
|
|
30
|
+
id: "".concat(_I18N_PREFIX_, ".param-origin.global"),
|
|
31
|
+
label: '页面全局变量'
|
|
32
|
+
}),
|
|
33
|
+
value: 'global'
|
|
34
|
+
}, {
|
|
35
|
+
label: formatMessage({
|
|
36
|
+
id: "".concat(_I18N_PREFIX_, ".param-origin.url"),
|
|
37
|
+
label: '页面URL参数'
|
|
38
|
+
}),
|
|
39
|
+
value: 'url'
|
|
40
|
+
}, {
|
|
41
|
+
label: formatMessage({
|
|
42
|
+
id: "".concat(_I18N_PREFIX_, ".param-origin.string"),
|
|
43
|
+
label: '字符串常量'
|
|
44
|
+
}),
|
|
45
|
+
value: 'string'
|
|
46
|
+
}, {
|
|
47
|
+
label: formatMessage({
|
|
48
|
+
id: "".concat(_I18N_PREFIX_, ".param-origin.num"),
|
|
49
|
+
label: '数字常量'
|
|
50
|
+
}),
|
|
51
|
+
value: 'num'
|
|
52
|
+
}, {
|
|
53
|
+
label: formatMessage({
|
|
54
|
+
id: "".concat(_I18N_PREFIX_, ".param-origin.bool"),
|
|
55
|
+
label: '布尔常量'
|
|
56
|
+
}),
|
|
57
|
+
value: 'bool'
|
|
58
|
+
}];
|
|
59
|
+
var ParamForm = Form.create({
|
|
60
|
+
name: 'param_form',
|
|
61
|
+
onValuesChange: function onValuesChange(props, _, allValues) {
|
|
62
|
+
props.onChange(props.id, allValues);
|
|
63
|
+
}
|
|
64
|
+
})(function (_ref) {
|
|
65
|
+
var form = _ref.form,
|
|
66
|
+
getForm = _ref.getForm,
|
|
67
|
+
defaultValue = _ref.defaultValue;
|
|
68
|
+
useEffect(function () {
|
|
69
|
+
getForm(form);
|
|
70
|
+
}, []);
|
|
71
|
+
var formItemCol = {
|
|
72
|
+
labelCol: {
|
|
73
|
+
span: 8
|
|
74
|
+
},
|
|
75
|
+
wrapperCol: {
|
|
76
|
+
span: 16
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
return /*#__PURE__*/React.createElement(SmallForm, {
|
|
80
|
+
hideRequiredMark: true,
|
|
81
|
+
layout: "horizontal"
|
|
82
|
+
}, /*#__PURE__*/React.createElement(Form.Item, _extends({
|
|
83
|
+
label: formatMessage({
|
|
84
|
+
id: "".concat(_I18N_PREFIX_, ".param-name"),
|
|
85
|
+
label: '参数名称'
|
|
86
|
+
})
|
|
87
|
+
}, formItemCol), form.getFieldDecorator('name', {
|
|
88
|
+
initialValue: defaultValue.name,
|
|
89
|
+
rules: [{
|
|
90
|
+
required: true,
|
|
91
|
+
message: formatMessage({
|
|
92
|
+
id: "".concat(_I18N_PREFIX_, ".warn.param-name"),
|
|
93
|
+
label: '请输入参数名称'
|
|
94
|
+
})
|
|
95
|
+
}]
|
|
96
|
+
})( /*#__PURE__*/React.createElement(Input, {
|
|
97
|
+
size: "small"
|
|
98
|
+
}))), /*#__PURE__*/React.createElement(Form.Item, _extends({
|
|
99
|
+
label: formatMessage({
|
|
100
|
+
id: "".concat(_I18N_PREFIX_, ".param-origin"),
|
|
101
|
+
label: '参数来源'
|
|
102
|
+
})
|
|
103
|
+
}, formItemCol), form.getFieldDecorator('origin', {
|
|
104
|
+
initialValue: defaultValue.origin || 'state'
|
|
105
|
+
})( /*#__PURE__*/React.createElement(Select, {
|
|
106
|
+
size: "small"
|
|
107
|
+
}, _OPTIONS_.map(function (item) {
|
|
108
|
+
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
109
|
+
key: item.value,
|
|
110
|
+
value: item.value
|
|
111
|
+
}, item.label);
|
|
112
|
+
})))), ['state', 'global', 'url', 'string'].includes(form.getFieldValue('origin')) && /*#__PURE__*/React.createElement(Form.Item, _extends({
|
|
113
|
+
label: formatMessage({
|
|
114
|
+
id: "".concat(_I18N_PREFIX_, ".param-value"),
|
|
115
|
+
label: '值或变量名'
|
|
116
|
+
})
|
|
117
|
+
}, formItemCol), form.getFieldDecorator('value', {
|
|
118
|
+
initialValue: defaultValue.value,
|
|
119
|
+
rules: [{
|
|
120
|
+
required: true,
|
|
121
|
+
message: formatMessage({
|
|
122
|
+
id: "".concat(_I18N_PREFIX_, ".warn.param-value"),
|
|
123
|
+
label: '请输入参数值或变量名'
|
|
124
|
+
})
|
|
125
|
+
}]
|
|
126
|
+
})( /*#__PURE__*/React.createElement(Input, {
|
|
127
|
+
size: "small"
|
|
128
|
+
}))), form.getFieldValue('origin') === 'num' && /*#__PURE__*/React.createElement(Form.Item, _extends({
|
|
129
|
+
label: formatMessage({
|
|
130
|
+
id: "".concat(_I18N_PREFIX_, ".param-value"),
|
|
131
|
+
label: '值或变量名'
|
|
132
|
+
})
|
|
133
|
+
}, formItemCol), form.getFieldDecorator('value', {
|
|
134
|
+
initialValue: defaultValue.value || 0
|
|
135
|
+
})( /*#__PURE__*/React.createElement(InputNumber, {
|
|
136
|
+
size: "small"
|
|
137
|
+
}))), form.getFieldValue('origin') === 'bool' && /*#__PURE__*/React.createElement(Form.Item, _extends({
|
|
138
|
+
label: formatMessage({
|
|
139
|
+
id: "".concat(_I18N_PREFIX_, ".param-value"),
|
|
140
|
+
label: '值或变量名'
|
|
141
|
+
})
|
|
142
|
+
}, formItemCol), form.getFieldDecorator('value', {
|
|
143
|
+
initialValue: defaultValue.value || false,
|
|
144
|
+
valuePropName: 'checked'
|
|
145
|
+
})( /*#__PURE__*/React.createElement(Switch, {
|
|
146
|
+
size: "small"
|
|
147
|
+
}))));
|
|
148
|
+
});
|
|
149
|
+
var ProxyParamsSetter = function ProxyParamsSetter(_ref2) {
|
|
150
|
+
var defaultValue = _ref2.defaultValue,
|
|
151
|
+
onChange = _ref2.onChange;
|
|
152
|
+
var formsRef = useRef([]);
|
|
153
|
+
var _useMap = useMap(defaultValue.map(function (item) {
|
|
154
|
+
return [item.id, item];
|
|
155
|
+
})),
|
|
156
|
+
_useMap2 = _slicedToArray(_useMap, 2),
|
|
157
|
+
map = _useMap2[0],
|
|
158
|
+
_useMap2$ = _useMap2[1],
|
|
159
|
+
set = _useMap2$.set,
|
|
160
|
+
remove = _useMap2$.remove;
|
|
161
|
+
var handleAdd = useMemoizedFn(function () {
|
|
162
|
+
var _id = suid();
|
|
163
|
+
set(_id, {
|
|
164
|
+
id: _id,
|
|
165
|
+
origin: 'state'
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
var handleSave = useMemoizedFn(function () {
|
|
169
|
+
var isValid = true;
|
|
170
|
+
formsRef.current.some(function (_form) {
|
|
171
|
+
_form.validateFields(function (err, val) {
|
|
172
|
+
isValid = !err;
|
|
173
|
+
});
|
|
174
|
+
return !isValid;
|
|
175
|
+
});
|
|
176
|
+
if (!isValid) return;
|
|
177
|
+
onChange(Array.from(map).map(function (_ref3) {
|
|
178
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
179
|
+
id = _ref4[0],
|
|
180
|
+
item = _ref4[1];
|
|
181
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
182
|
+
id: id
|
|
183
|
+
});
|
|
184
|
+
}));
|
|
185
|
+
});
|
|
186
|
+
var handleChange = useMemoizedFn(function (id, val) {
|
|
187
|
+
set(id, val);
|
|
188
|
+
});
|
|
189
|
+
var handleDelete = useMemoizedFn(function (id, index) {
|
|
190
|
+
formsRef.current = [];
|
|
191
|
+
remove(id);
|
|
192
|
+
});
|
|
193
|
+
return /*#__PURE__*/React.createElement("div", null, Array.from(map).map(function (_ref5, index) {
|
|
194
|
+
var _ref6 = _slicedToArray(_ref5, 2),
|
|
195
|
+
id = _ref6[0],
|
|
196
|
+
item = _ref6[1];
|
|
197
|
+
return /*#__PURE__*/React.createElement(SmallCollapse, {
|
|
198
|
+
key: id,
|
|
199
|
+
activeKey: "panel"
|
|
200
|
+
}, /*#__PURE__*/React.createElement(Collapse.Panel, {
|
|
201
|
+
header: "".concat(formatMessage({
|
|
202
|
+
id: "".concat(_I18N_PREFIX_, ".param"),
|
|
203
|
+
label: "\u9875\u9762\u53C2\u6570"
|
|
204
|
+
})).concat(index + 1),
|
|
205
|
+
key: "panel",
|
|
206
|
+
extra: /*#__PURE__*/React.createElement(Icon, {
|
|
207
|
+
type: "minus-circle",
|
|
208
|
+
style: {
|
|
209
|
+
color: 'var(--luck-color-danger)'
|
|
210
|
+
},
|
|
211
|
+
onClick: function onClick() {
|
|
212
|
+
return handleDelete(id);
|
|
213
|
+
}
|
|
214
|
+
})
|
|
215
|
+
}, /*#__PURE__*/React.createElement(ParamForm, {
|
|
216
|
+
id: id,
|
|
217
|
+
defaultValue: item,
|
|
218
|
+
getForm: function getForm(_form) {
|
|
219
|
+
return formsRef.current[index] = _form;
|
|
220
|
+
},
|
|
221
|
+
onChange: handleChange
|
|
222
|
+
})));
|
|
223
|
+
}), /*#__PURE__*/React.createElement(ButtonWrapper, null, /*#__PURE__*/React.createElement(Button, {
|
|
224
|
+
size: "small",
|
|
225
|
+
block: true,
|
|
226
|
+
onClick: handleAdd
|
|
227
|
+
}, formatMessage({
|
|
228
|
+
id: "".concat(_I18N_PREFIX_, ".add"),
|
|
229
|
+
label: '添加参数'
|
|
230
|
+
})), /*#__PURE__*/React.createElement(Button, {
|
|
231
|
+
size: "small",
|
|
232
|
+
block: true,
|
|
233
|
+
type: "primary",
|
|
234
|
+
onClick: handleSave
|
|
235
|
+
}, formatMessage({
|
|
236
|
+
id: "".concat(_I18N_PREFIX_, ".save"),
|
|
237
|
+
label: '保存并返回'
|
|
238
|
+
}))));
|
|
239
|
+
};
|
|
240
|
+
export default ProxyParamsSetter;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useCallback, useState } from 'react';
|
|
2
3
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
4
|
+
import { useLatest } from 'ahooks';
|
|
3
5
|
import { Button } from 'luck-design/antd';
|
|
4
6
|
import Collapse from "../../components/Collapse";
|
|
5
|
-
import PopConfirm from "../../components/PopConfirm";
|
|
6
7
|
import CssEditor from "../../components/code-editor/CssEditor";
|
|
7
|
-
import FullScreenEditor from "../../components/code-editor/FullScreenEditor";
|
|
8
8
|
import styles from "../../style/style-panel.less";
|
|
9
9
|
import { useStyle, useStyleDispatch, useEditor, styleToEditor } from "./StyleContext";
|
|
10
10
|
import WidthHeight from "./WidthHeight";
|
|
@@ -18,6 +18,7 @@ import BorderRadius from "./BorderRadius";
|
|
|
18
18
|
import Shadow from "./Shadow";
|
|
19
19
|
import Opacity from "./Opacity";
|
|
20
20
|
import Pointer from "./Pointer";
|
|
21
|
+
import { LuckModal } from 'luck-design';
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* 主样式面板
|
|
@@ -26,21 +27,20 @@ var MainPanel = function MainPanel() {
|
|
|
26
27
|
var style = useStyle(true);
|
|
27
28
|
var dispatch = useStyleDispatch();
|
|
28
29
|
var editorRef = useEditor();
|
|
30
|
+
var _useState = useState(false),
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
show = _useState2[0],
|
|
33
|
+
setShow = _useState2[1];
|
|
34
|
+
var lasestStyle = useLatest(style);
|
|
29
35
|
var handleCodeChange = useCallback(function (code) {
|
|
30
36
|
dispatch({
|
|
31
37
|
type: 'code',
|
|
32
38
|
payload: code
|
|
33
39
|
});
|
|
40
|
+
// editorRef.current.editor.setValue(code)
|
|
34
41
|
}, []);
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
type: 'code',
|
|
38
|
-
payload: code
|
|
39
|
-
});
|
|
40
|
-
editorRef.current.editor.setValue(code);
|
|
41
|
-
}, []);
|
|
42
|
-
var handleEditorLoad = useCallback(function () {
|
|
43
|
-
styleToEditor(style).then(function (css) {
|
|
42
|
+
var handleOnload = useCallback(function () {
|
|
43
|
+
styleToEditor(lasestStyle.current).then(function (css) {
|
|
44
44
|
editorRef.current.editor.setValue(css);
|
|
45
45
|
});
|
|
46
46
|
}, []);
|
|
@@ -53,24 +53,35 @@ var MainPanel = function MainPanel() {
|
|
|
53
53
|
})
|
|
54
54
|
}, /*#__PURE__*/React.createElement("div", {
|
|
55
55
|
className: styles['style-editor']
|
|
56
|
-
}, /*#__PURE__*/React.createElement(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
56
|
+
}, /*#__PURE__*/React.createElement(LuckModal, {
|
|
57
|
+
title: formatMessage({
|
|
58
|
+
id: 'luckda.lowcode.painter.panel-section.style-panel.sourceedit',
|
|
59
|
+
label: '源码编辑'
|
|
60
|
+
}),
|
|
61
|
+
visible: show,
|
|
62
|
+
fullScreen: true,
|
|
63
|
+
mask: false,
|
|
64
|
+
footer: null,
|
|
65
|
+
maskClosable: false,
|
|
66
|
+
onClose: function onClose() {
|
|
67
|
+
setShow(false);
|
|
68
|
+
}
|
|
69
|
+
}, /*#__PURE__*/React.createElement(CssEditor, {
|
|
70
|
+
ref: editorRef,
|
|
71
|
+
width: "100%",
|
|
72
|
+
height: "100%",
|
|
73
|
+
onChange: handleCodeChange,
|
|
74
|
+
onLoad: handleOnload
|
|
75
|
+
})), /*#__PURE__*/React.createElement(Button, {
|
|
68
76
|
type: "primary",
|
|
69
|
-
size: "small"
|
|
77
|
+
size: "small",
|
|
78
|
+
onClick: function onClick() {
|
|
79
|
+
setShow(true);
|
|
80
|
+
}
|
|
70
81
|
}, formatMessage({
|
|
71
82
|
id: 'luckda.lowcode.painter.panel-section.style-panel.sourceedit',
|
|
72
83
|
label: '源码编辑'
|
|
73
|
-
})))
|
|
84
|
+
}))), /*#__PURE__*/React.createElement(WidthHeight, {
|
|
74
85
|
field: "width",
|
|
75
86
|
label: formatMessage({
|
|
76
87
|
id: 'luckda.lowcode.painter.panel-section.style-panel.width',
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
.lc-painter-history {
|
|
2
|
+
|
|
3
|
+
.historyToolbar {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: flex-end;
|
|
7
|
+
padding: 16px 8px 8px 8px;
|
|
8
|
+
margin-bottom: 8px;
|
|
9
|
+
position: sticky;
|
|
10
|
+
top: 0;
|
|
11
|
+
left: 0;
|
|
12
|
+
z-index: 10;
|
|
13
|
+
background-color: transparent;
|
|
14
|
+
backdrop-filter: blur(6px);
|
|
15
|
+
}
|
|
16
|
+
.timelineItem {
|
|
17
|
+
padding: 0 8px;
|
|
18
|
+
.timelineItemHeader {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
div {
|
|
23
|
+
font-weight: bold;
|
|
24
|
+
}
|
|
25
|
+
.timelineItemActions {
|
|
26
|
+
display: none;
|
|
27
|
+
i {
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
&:hover {
|
|
33
|
+
.timelineItemHeader > .timelineItemActions {
|
|
34
|
+
display: block;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
.timelineItemUser {
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
margin-top: 4px;
|
|
41
|
+
}
|
|
42
|
+
.timelineItemTime {
|
|
43
|
+
margin-top: 4px;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useRef, useState } from 'react';
|
|
3
|
+
import { useMemoizedFn, useDrag, useBoolean } from 'ahooks';
|
|
4
|
+
import { Icon, Drawer } from 'luck-design/antd';
|
|
5
|
+
import styled from 'styled-components';
|
|
6
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
7
|
+
import DebugToolDetail from "./DebugToolDetail";
|
|
8
|
+
var Wrapper = styled.div.withConfig({
|
|
9
|
+
displayName: "Wrapper",
|
|
10
|
+
componentId: "luckda-6530__sc-1x7h5jv-0"
|
|
11
|
+
})(["position:fixed;border-top-left-radius:16px;border-bottom-left-radius:16px;cursor:pointer;z-index:1000;background:rgba(40,40,40,0.5);backdrop-filter:blur(6px);display:flex;align-items:center;justify-content:center;transition:right 0.4s ease-in-out;"]);
|
|
12
|
+
var MoveIcon = styled.div.withConfig({
|
|
13
|
+
displayName: "MoveIcon",
|
|
14
|
+
componentId: "luckda-6530__sc-1x7h5jv-1"
|
|
15
|
+
})(["height:46px;border-left:1px solid rgb(191,191,191,0.4);cursor:move;&:hover{background:transparent;backdrop-filter:blur(6px);}"]);
|
|
16
|
+
var DebugTool = function DebugTool() {
|
|
17
|
+
var dragRef = useRef();
|
|
18
|
+
var _useState = useState([-32, 100]),
|
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
+
_useState2$ = _slicedToArray(_useState2[0], 2),
|
|
21
|
+
right = _useState2$[0],
|
|
22
|
+
top = _useState2$[1],
|
|
23
|
+
setPostion = _useState2[1];
|
|
24
|
+
var _useBoolean = useBoolean(false),
|
|
25
|
+
_useBoolean2 = _slicedToArray(_useBoolean, 2),
|
|
26
|
+
show = _useBoolean2[0],
|
|
27
|
+
_useBoolean2$ = _useBoolean2[1],
|
|
28
|
+
setTrue = _useBoolean2$.setTrue,
|
|
29
|
+
setFalse = _useBoolean2$.setFalse;
|
|
30
|
+
var handleMouseEnter = useMemoizedFn(function () {
|
|
31
|
+
setPostion([0, top]);
|
|
32
|
+
});
|
|
33
|
+
var handleMouseLeave = useMemoizedFn(function () {
|
|
34
|
+
setPostion([-32, top]);
|
|
35
|
+
});
|
|
36
|
+
var handleDragEnd = useMemoizedFn(function (event) {
|
|
37
|
+
setPostion([right, event.y]);
|
|
38
|
+
});
|
|
39
|
+
useDrag('', dragRef, {
|
|
40
|
+
onDragEnd: handleDragEnd
|
|
41
|
+
});
|
|
42
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Wrapper, {
|
|
43
|
+
style: {
|
|
44
|
+
right: right,
|
|
45
|
+
top: "".concat(top, "px")
|
|
46
|
+
},
|
|
47
|
+
onMouseEnter: handleMouseEnter,
|
|
48
|
+
onMouseLeave: handleMouseLeave
|
|
49
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
50
|
+
type: "bug",
|
|
51
|
+
style: {
|
|
52
|
+
padding: '16px 8px 16px 16px'
|
|
53
|
+
},
|
|
54
|
+
onClick: setTrue
|
|
55
|
+
}), /*#__PURE__*/React.createElement(MoveIcon, {
|
|
56
|
+
ref: dragRef
|
|
57
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
58
|
+
viewBox: "0 0 1024 1024",
|
|
59
|
+
width: "20",
|
|
60
|
+
height: "46"
|
|
61
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
62
|
+
d: "M320 64a64 64 0 1 0 0 128 64 64 0 0 0 0-128zM704 64a64 64 0 1 0 0 128 64 64 0 0 0 0-128zM256 384a64 64 0 1 1 128 0 64 64 0 0 1-128 0zM704 320a64 64 0 1 0 0 128 64 64 0 0 0 0-128zM256 640a64 64 0 1 1 128 0 64 64 0 0 1-128 0zM320 832a64 64 0 1 0 0 128 64 64 0 0 0 0-128zM640 640a64 64 0 1 1 128 0 64 64 0 0 1-128 0zM704 832a64 64 0 1 0 0 128 64 64 0 0 0 0-128z",
|
|
63
|
+
fill: "#bfbfbf"
|
|
64
|
+
})))), /*#__PURE__*/React.createElement(Drawer, {
|
|
65
|
+
title: formatMessage({
|
|
66
|
+
id: 'luckda.lowcode.design.toolbar.debugTool',
|
|
67
|
+
label: '调试工具'
|
|
68
|
+
}),
|
|
69
|
+
visible: show,
|
|
70
|
+
onClose: setFalse,
|
|
71
|
+
footer: false,
|
|
72
|
+
mask: false,
|
|
73
|
+
bodyStyle: {
|
|
74
|
+
padding: '4px 16px'
|
|
75
|
+
}
|
|
76
|
+
}, /*#__PURE__*/React.createElement(DebugToolDetail, null)));
|
|
77
|
+
};
|
|
78
|
+
export default DebugTool;
|