@luck-design-biz/luckda 0.0.25-7 → 0.0.25-8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/LDActions/index.js +8 -10
- package/es/components/LDActions/index.less +7 -4
- package/es/components/LdAutoForm/index.js +8 -6
- package/es/components/LdFormList/index.js +12 -4
- package/es/components/LdGrid/index.js +11 -5
- package/es/components/LdGridForm/index.js +4 -2
- package/es/components/LdTree/index.js +30 -13
- package/es/helper/form.js +9 -5
- package/es/locales/zh-CN.js +15 -10
- package/es/lowcode/constants/api-url.js +112 -26
- package/es/lowcode/constants/event-topics.js +2 -0
- package/es/lowcode/engine/meta/box.props.json +3 -3
- package/es/lowcode/engine/meta/button.props.json +3 -3
- package/es/lowcode/engine/meta/components-list.json +6 -0
- package/es/lowcode/engine/meta/dialog.props.json +5 -5
- package/es/lowcode/engine/meta/drawer.props.json +8 -20
- package/es/lowcode/engine/meta/form.props.json +13 -7
- package/es/lowcode/engine/meta/imex.props.default.json +8 -1
- package/es/lowcode/engine/meta/imex.props.json +54 -22
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +53 -3
- package/es/lowcode/engine/meta/layout.props.json +2 -2
- package/es/lowcode/engine/meta/page.props.json +2 -2
- package/es/lowcode/engine/meta/pagelayout.props.default.json +14 -0
- package/es/lowcode/engine/meta/pagelayout.props.json +47 -0
- package/es/lowcode/engine/meta/section.props.json +2 -2
- package/es/lowcode/engine/meta/split.props.default.json +1 -1
- package/es/lowcode/engine/meta/split.props.json +4 -4
- package/es/lowcode/engine/meta/table.props.json +15 -9
- package/es/lowcode/engine/meta/tabs.props.json +3 -3
- package/es/lowcode/engine/meta/tree.props.default.json +1 -0
- package/es/lowcode/engine/meta/tree.props.json +55 -6
- package/es/lowcode/engine/provider/ContextProvider/index.js +12 -3
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +55 -6
- package/es/lowcode/engine/tools/dataProcess.js +4 -0
- package/es/lowcode/engine/tools/usePageDataStore.js +4 -2
- package/es/lowcode/painter/DesignOperator.js +1 -1
- package/es/lowcode/painter/DesignToolbar.js +2 -1
- package/es/lowcode/painter/Panel.js +3 -3
- package/es/lowcode/painter/components/ActionBindModal.js +25 -13
- package/es/lowcode/painter/components/AdvancePanel.js +6 -1
- package/es/lowcode/painter/components/AttrsPanel.js +13 -11
- package/es/lowcode/painter/components/field-setting/CheckFrontRules.js +108 -0
- package/es/lowcode/painter/components/field-setting/CheckRules.js +1 -26
- package/es/lowcode/painter/components/field-setting/FieldRulesModal.js +33 -13
- package/es/lowcode/painter/components/field-setting/SettingUI.js +156 -24
- package/es/lowcode/painter/components/field-setting/index.js +32 -63
- package/es/lowcode/painter/components/field-setting/meta/frontRules.js +53 -0
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +6 -9
- package/es/lowcode/painter/panel-section/FieldsSetting.js +53 -12
- package/es/lowcode/painter/panel-section/ImpExp.js +93 -6
- package/es/lowcode/painter/panel-section/ImpExpAlone.js +109 -0
- package/es/lowcode/painter/panel-section/PageLayoutDisplay.js +95 -0
- package/es/lowcode/painter/panel-section/SplitDisplay.js +25 -110
- package/es/lowcode/painter/panel-section/StylePanel/index.js +10 -4
- package/es/lowcode/painter/style/action-bind-modal.less +3 -3
- package/es/lowcode/painter/style/page-layout-display.less +28 -0
- package/es/lowcode/painter/style/split-display.less +0 -9
- package/es/lowcode/preview/index.js +4 -2
- package/es/lowcode/view/lc-components/Box/FunctionDesign.js +3 -2
- package/es/lowcode/view/lc-components/Box/meta.json +3 -3
- package/es/lowcode/view/lc-components/Button/index.js +2 -6
- package/es/lowcode/view/lc-components/Button/meta.json +3 -3
- package/es/lowcode/view/lc-components/Dialog/index.js +27 -2
- package/es/lowcode/view/lc-components/Dialog/meta.json +5 -5
- package/es/lowcode/view/lc-components/Drawer/meta.json +8 -20
- package/es/lowcode/view/lc-components/Form/FunctionPreview.js +8 -1
- package/es/lowcode/view/lc-components/Form/index.js +99 -21
- package/es/lowcode/view/lc-components/Form/meta.json +13 -7
- package/es/lowcode/view/lc-components/ImEx/FunctionDesign.js +8 -3
- package/es/lowcode/view/lc-components/ImEx/index.js +260 -10
- package/es/lowcode/view/lc-components/ImEx/index.less +7 -0
- package/es/lowcode/view/lc-components/ImEx/meta.json +55 -23
- package/es/lowcode/view/lc-components/Layout/meta.json +2 -2
- package/es/lowcode/view/lc-components/Page/meta.json +2 -2
- package/es/lowcode/view/lc-components/PageLayout/FunctionDesign.js +63 -0
- package/es/lowcode/view/lc-components/PageLayout/FunctionLive.js +10 -0
- package/es/lowcode/view/lc-components/PageLayout/FunctionPreview.js +10 -0
- package/es/lowcode/view/lc-components/PageLayout/index.js +32 -0
- package/es/lowcode/view/lc-components/PageLayout/meta.json +47 -0
- package/es/lowcode/view/lc-components/Section/meta.json +2 -2
- package/es/lowcode/view/lc-components/Split/FunctionDesign.js +11 -5
- package/es/lowcode/view/lc-components/Split/index.js +5 -9
- package/es/lowcode/view/lc-components/Split/meta.json +4 -4
- package/es/lowcode/view/lc-components/Table/components/TopImex.js +138 -0
- package/es/lowcode/view/lc-components/Table/index.js +60 -17
- package/es/lowcode/view/lc-components/Table/meta.json +15 -9
- package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/Tabs/index.js +3 -1
- package/es/lowcode/view/lc-components/Tabs/meta.json +3 -3
- package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +2 -1
- package/es/lowcode/view/lc-components/Tree/index.js +60 -18
- package/es/lowcode/view/lc-components/Tree/meta.json +55 -7
- package/es/upload/FormItem/index.js +1 -4
- package/lib/components/LDActions/index.js +7 -9
- package/lib/components/LDActions/index.less +7 -4
- package/lib/components/LdAutoForm/index.js +7 -5
- package/lib/components/LdFormList/index.js +11 -3
- package/lib/components/LdGrid/index.js +11 -5
- package/lib/components/LdGridForm/index.js +4 -2
- package/lib/components/LdTree/index.js +30 -13
- package/lib/helper/form.js +8 -4
- package/lib/locales/zh-CN.js +15 -10
- package/lib/lowcode/constants/api-url.js +113 -26
- package/lib/lowcode/constants/event-topics.js +3 -1
- package/lib/lowcode/engine/meta/box.props.json +3 -3
- package/lib/lowcode/engine/meta/button.props.json +3 -3
- package/lib/lowcode/engine/meta/components-list.json +6 -0
- package/lib/lowcode/engine/meta/dialog.props.json +5 -5
- package/lib/lowcode/engine/meta/drawer.props.json +8 -20
- package/lib/lowcode/engine/meta/form.props.json +13 -7
- package/lib/lowcode/engine/meta/imex.props.default.json +8 -1
- package/lib/lowcode/engine/meta/imex.props.json +54 -22
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +53 -3
- package/lib/lowcode/engine/meta/layout.props.json +2 -2
- package/lib/lowcode/engine/meta/page.props.json +2 -2
- package/lib/lowcode/engine/meta/pagelayout.props.default.json +14 -0
- package/lib/lowcode/engine/meta/pagelayout.props.json +47 -0
- package/lib/lowcode/engine/meta/section.props.json +2 -2
- package/lib/lowcode/engine/meta/split.props.default.json +1 -1
- package/lib/lowcode/engine/meta/split.props.json +4 -4
- package/lib/lowcode/engine/meta/table.props.json +15 -9
- package/lib/lowcode/engine/meta/tabs.props.json +3 -3
- package/lib/lowcode/engine/meta/tree.props.default.json +1 -0
- package/lib/lowcode/engine/meta/tree.props.json +55 -6
- package/lib/lowcode/engine/provider/ContextProvider/index.js +11 -2
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +54 -5
- package/lib/lowcode/engine/tools/dataProcess.js +4 -0
- package/lib/lowcode/engine/tools/usePageDataStore.js +4 -2
- package/lib/lowcode/painter/DesignOperator.js +1 -1
- package/lib/lowcode/painter/DesignToolbar.js +2 -1
- package/lib/lowcode/painter/Panel.js +3 -3
- package/lib/lowcode/painter/components/ActionBindModal.js +23 -11
- package/lib/lowcode/painter/components/AdvancePanel.js +6 -1
- package/lib/lowcode/painter/components/AttrsPanel.js +12 -10
- package/lib/lowcode/painter/components/field-setting/CheckFrontRules.js +116 -0
- package/lib/lowcode/painter/components/field-setting/CheckRules.js +1 -26
- package/lib/lowcode/painter/components/field-setting/FieldRulesModal.js +34 -13
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +153 -21
- package/lib/lowcode/painter/components/field-setting/index.js +32 -63
- package/lib/lowcode/painter/components/field-setting/meta/frontRules.js +59 -0
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +6 -9
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +53 -12
- package/lib/lowcode/painter/panel-section/ImpExp.js +92 -5
- package/lib/lowcode/painter/panel-section/ImpExpAlone.js +115 -0
- package/lib/lowcode/painter/panel-section/PageLayoutDisplay.js +103 -0
- package/lib/lowcode/painter/panel-section/SplitDisplay.js +24 -109
- package/lib/lowcode/painter/panel-section/StylePanel/index.js +10 -4
- package/lib/lowcode/painter/style/action-bind-modal.less +3 -3
- package/lib/lowcode/painter/style/page-layout-display.less +28 -0
- package/lib/lowcode/painter/style/split-display.less +0 -9
- package/lib/lowcode/preview/index.js +4 -2
- package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +3 -2
- package/lib/lowcode/view/lc-components/Box/meta.json +3 -3
- package/lib/lowcode/view/lc-components/Button/index.js +2 -6
- package/lib/lowcode/view/lc-components/Button/meta.json +3 -3
- package/lib/lowcode/view/lc-components/Dialog/index.js +29 -4
- package/lib/lowcode/view/lc-components/Dialog/meta.json +5 -5
- package/lib/lowcode/view/lc-components/Drawer/meta.json +8 -20
- package/lib/lowcode/view/lc-components/Form/FunctionPreview.js +8 -1
- package/lib/lowcode/view/lc-components/Form/index.js +96 -18
- package/lib/lowcode/view/lc-components/Form/meta.json +13 -7
- package/lib/lowcode/view/lc-components/ImEx/FunctionDesign.js +8 -3
- package/lib/lowcode/view/lc-components/ImEx/index.js +257 -8
- package/lib/lowcode/view/lc-components/ImEx/index.less +7 -0
- package/lib/lowcode/view/lc-components/ImEx/meta.json +55 -23
- package/lib/lowcode/view/lc-components/Layout/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Page/meta.json +2 -2
- package/lib/lowcode/view/lc-components/PageLayout/FunctionDesign.js +71 -0
- package/lib/lowcode/view/lc-components/PageLayout/FunctionLive.js +17 -0
- package/lib/lowcode/view/lc-components/PageLayout/FunctionPreview.js +17 -0
- package/lib/lowcode/view/lc-components/PageLayout/index.js +40 -0
- package/lib/lowcode/view/lc-components/PageLayout/meta.json +47 -0
- package/lib/lowcode/view/lc-components/Section/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +12 -6
- package/lib/lowcode/view/lc-components/Split/index.js +2 -6
- package/lib/lowcode/view/lc-components/Split/meta.json +4 -4
- package/lib/lowcode/view/lc-components/Table/components/TopImex.js +145 -0
- package/lib/lowcode/view/lc-components/Table/index.js +59 -16
- package/lib/lowcode/view/lc-components/Table/meta.json +15 -9
- package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +3 -2
- package/lib/lowcode/view/lc-components/Tabs/index.js +3 -1
- package/lib/lowcode/view/lc-components/Tabs/meta.json +3 -3
- package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Tree/index.js +58 -16
- package/lib/lowcode/view/lc-components/Tree/meta.json +55 -7
- package/lib/upload/FormItem/index.js +1 -4
- package/package.json +2 -2
|
@@ -98,19 +98,19 @@
|
|
|
98
98
|
"key": "onMount",
|
|
99
99
|
"name": "组件首次渲染时",
|
|
100
100
|
"desc": "在组件首次渲染时,执行方法",
|
|
101
|
-
"func": "(
|
|
101
|
+
"func": "function onMount() {\n\t\n}"
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
104
|
"key": "onUnmount",
|
|
105
105
|
"name": "组件卸载时",
|
|
106
106
|
"desc": "在组件卸载时,执行方法。",
|
|
107
|
-
"func": "(
|
|
107
|
+
"func": "function onUnmount() {\n\t\n}"
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
110
|
"key": "onTabClick",
|
|
111
111
|
"name": "tab被点击的回调",
|
|
112
112
|
"desc": "当tab被点击时, 执行方法",
|
|
113
|
-
"func": "(tabKey, e)
|
|
113
|
+
"func": "function onTabClick(tabKey, e) {\n\t\n}"
|
|
114
114
|
}
|
|
115
115
|
]
|
|
116
116
|
}
|
|
@@ -17,7 +17,18 @@
|
|
|
17
17
|
"key": "dataset",
|
|
18
18
|
"name": "数据集",
|
|
19
19
|
"desc": "选择系统中的可用树形数据集",
|
|
20
|
-
"type": "_DataSetSelector"
|
|
20
|
+
"type": "_DataSetSelector",
|
|
21
|
+
"next": {
|
|
22
|
+
"name": "字段配置",
|
|
23
|
+
"props": [
|
|
24
|
+
{
|
|
25
|
+
"key": "fields",
|
|
26
|
+
"name": "#字段配置器",
|
|
27
|
+
"type": "_FieldsSetting",
|
|
28
|
+
"component": "tree"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
21
32
|
},
|
|
22
33
|
{
|
|
23
34
|
"key": "title",
|
|
@@ -119,6 +130,32 @@
|
|
|
119
130
|
}
|
|
120
131
|
]
|
|
121
132
|
},
|
|
133
|
+
{
|
|
134
|
+
"key": "selectSetting",
|
|
135
|
+
"name": "选中设置",
|
|
136
|
+
"type": "group",
|
|
137
|
+
"props": [
|
|
138
|
+
{
|
|
139
|
+
"key": "cancelSelect",
|
|
140
|
+
"name": "取消选中",
|
|
141
|
+
"desc": "是否可以取消选中",
|
|
142
|
+
"type": "switch",
|
|
143
|
+
"default": true
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"key": "defaultSelect",
|
|
147
|
+
"name": "默认选中",
|
|
148
|
+
"desc": "返回默认选中的数据主键",
|
|
149
|
+
"type": "_JSEditor",
|
|
150
|
+
"defaultCode": "function defaultSelect(treeData) { \n return []; \n}",
|
|
151
|
+
"mustConfirm": true,
|
|
152
|
+
"wrapper": "collapse",
|
|
153
|
+
"wrapperProps": {
|
|
154
|
+
"suppressIcon": true
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
]
|
|
158
|
+
},
|
|
122
159
|
{
|
|
123
160
|
"key": "IconSetting",
|
|
124
161
|
"name": "图标设置",
|
|
@@ -279,31 +316,43 @@
|
|
|
279
316
|
"key": "onMount",
|
|
280
317
|
"name": "组件首次渲染时",
|
|
281
318
|
"desc": "在组件首次渲染时,执行方法",
|
|
282
|
-
"func": "(params)
|
|
319
|
+
"func": "function onMount(params) {\n\t\n}"
|
|
283
320
|
},
|
|
284
321
|
{
|
|
285
322
|
"key": "onUnmount",
|
|
286
323
|
"name": "组件卸载时",
|
|
287
324
|
"desc": "在组件卸载时,执行方法。",
|
|
288
|
-
"func": "()
|
|
325
|
+
"func": "function onUnmount() {\n\t\n}"
|
|
289
326
|
},
|
|
290
327
|
{
|
|
291
328
|
"key": "processDataSource",
|
|
292
329
|
"name": "数据预处理",
|
|
293
330
|
"desc": "数据渲染前预处理",
|
|
294
|
-
"func": "(data)
|
|
331
|
+
"func": "function processDataSource(data) {\n\t\n}"
|
|
295
332
|
},
|
|
296
333
|
{
|
|
297
334
|
"key": "onDoubleClick",
|
|
298
335
|
"name": "双击事件",
|
|
299
336
|
"desc": "树节点双击事件",
|
|
300
|
-
"func": "(e, rowData)
|
|
337
|
+
"func": "function onDoubleClick(e, rowData) {\n\t\n}"
|
|
301
338
|
},
|
|
302
339
|
{
|
|
303
340
|
"key": "onCheck",
|
|
304
341
|
"name": "复选框选择事件",
|
|
305
342
|
"desc": "点击复选框触发",
|
|
306
|
-
"func": "(checkedKeys, e)
|
|
343
|
+
"func": "function onCheck(checkedKeys, e) {\n\t\n}"
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
"key": "onSelect",
|
|
347
|
+
"name": "选中事件",
|
|
348
|
+
"desc": "节点选中事件",
|
|
349
|
+
"func": "function onSelect(checkedKeys, e) {\n\t\n}"
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"key": "onDrop",
|
|
353
|
+
"name": "拖拽事件",
|
|
354
|
+
"desc": "节点拖拽事件",
|
|
355
|
+
"func": "function onDrop(info, dragInfo) {\n\t\n}"
|
|
307
356
|
}
|
|
308
357
|
]
|
|
309
358
|
}
|
|
@@ -2,7 +2,7 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import React, { createContext, useContext as useReactContext, useRef } from 'react';
|
|
4
4
|
import { history } from 'umi';
|
|
5
|
-
import { useMemoizedFn, useSetState } from 'ahooks';
|
|
5
|
+
import { useMemoizedFn, useSetState, useUpdateEffect, usePrevious } from 'ahooks';
|
|
6
6
|
import { useLDEventBus } from "../EventBusProvider";
|
|
7
7
|
import RemoteSourceProvider, { RemoteSourceContext } from "../RemoteSourceProvider";
|
|
8
8
|
import useTodo from "../../tools/useTodo";
|
|
@@ -18,7 +18,8 @@ export * from "../../tools/usePageDataStore";
|
|
|
18
18
|
var PRIVATE_KEYS = ['componentList', 'componentMap'];
|
|
19
19
|
export default (function (_ref) {
|
|
20
20
|
var children = _ref.children,
|
|
21
|
-
code = _ref.code
|
|
21
|
+
code = _ref.code,
|
|
22
|
+
debug = _ref.debug;
|
|
22
23
|
var eventBus = useLDEventBus();
|
|
23
24
|
var _useTodo = useTodo(),
|
|
24
25
|
_useTodo2 = _slicedToArray(_useTodo, 3),
|
|
@@ -33,6 +34,7 @@ export default (function (_ref) {
|
|
|
33
34
|
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
34
35
|
pagePublicResource = _useSetState2[0],
|
|
35
36
|
setPagePublicResource = _useSetState2[1];
|
|
37
|
+
var prevPagePublicResource = usePrevious(pagePublicResource);
|
|
36
38
|
|
|
37
39
|
/**
|
|
38
40
|
* 组件列表
|
|
@@ -94,6 +96,12 @@ export default (function (_ref) {
|
|
|
94
96
|
* return:object
|
|
95
97
|
*/
|
|
96
98
|
var getUrlParams = useMemoizedFn(function () {});
|
|
99
|
+
useUpdateEffect(function () {
|
|
100
|
+
eventBus.$publisher(topics.PAGE_PUBLIC_RESOURCE_CHANGED, {
|
|
101
|
+
resource: pagePublicResource,
|
|
102
|
+
prevResource: prevPagePublicResource
|
|
103
|
+
});
|
|
104
|
+
}, [pagePublicResource]);
|
|
97
105
|
var ctx = new Proxy(_objectSpread({
|
|
98
106
|
_register: _register,
|
|
99
107
|
_unregister: _unregister,
|
|
@@ -140,6 +148,7 @@ export default (function (_ref) {
|
|
|
140
148
|
value: ctx
|
|
141
149
|
}, /*#__PURE__*/React.createElement(RemoteSourceProvider, {
|
|
142
150
|
code: code,
|
|
143
|
-
runtime: eventBus.runtime
|
|
151
|
+
runtime: eventBus.runtime,
|
|
152
|
+
debug: debug
|
|
144
153
|
}, children));
|
|
145
154
|
});
|
|
@@ -11,13 +11,14 @@ import { LuckDaContext } from "../../../components/Builder";
|
|
|
11
11
|
import { doAction as doActionUtils } from "../../../helper/action";
|
|
12
12
|
import usePageDataStore from "../tools/usePageDataStore";
|
|
13
13
|
import { decompress } from "../tools/dataProcess";
|
|
14
|
-
import { fetchPageData, fetchDesignModlueData, fetchPreviewModlueData, fetchModlueData, fetchAllDataset, fetchAllSerials } from "../../constants/api-url";
|
|
14
|
+
import { fetchPageData, fetchDesignModlueData, fetchPreviewModlueData, fetchModlueData, fetchAllDataset, fetchAllSerials, fetchAllBehaviorEx } from "../../constants/api-url";
|
|
15
15
|
import { RUNTIME, COOKIE_RUNTIME_KEY, DATA_MODEL_CODE_KEY } from "../../constants";
|
|
16
16
|
export var RemoteSourceContext = /*#__PURE__*/createContext(null);
|
|
17
17
|
export default (function (_ref) {
|
|
18
18
|
var children = _ref.children,
|
|
19
19
|
code = _ref.code,
|
|
20
|
-
runtime = _ref.runtime
|
|
20
|
+
runtime = _ref.runtime,
|
|
21
|
+
debug = _ref.debug;
|
|
21
22
|
var _usePageDataStore = usePageDataStore(function (state) {
|
|
22
23
|
return {
|
|
23
24
|
initialize: state.initialize,
|
|
@@ -44,7 +45,7 @@ export default (function (_ref) {
|
|
|
44
45
|
}
|
|
45
46
|
}, []);
|
|
46
47
|
useUnmount(function () {
|
|
47
|
-
reset();
|
|
48
|
+
!debug && reset();
|
|
48
49
|
setRuntime(prevRuntime.current);
|
|
49
50
|
});
|
|
50
51
|
|
|
@@ -106,6 +107,46 @@ export default (function (_ref) {
|
|
|
106
107
|
fetchAllSerialsLoading = _useRequest4.loading,
|
|
107
108
|
runFetchAllSerials = _useRequest4.run,
|
|
108
109
|
refreshSerials = _useRequest4.refreshAsync;
|
|
110
|
+
|
|
111
|
+
// 获取导入导出行为下拉数据
|
|
112
|
+
var _useRequest5 = useRequest(fetchAllBehaviorEx, {
|
|
113
|
+
manual: true,
|
|
114
|
+
onSuccess: function onSuccess(_ref5) {
|
|
115
|
+
var code = _ref5.code,
|
|
116
|
+
data = _ref5.data;
|
|
117
|
+
if (code === 1) {
|
|
118
|
+
setRemoteSource({
|
|
119
|
+
impTypeList: data.map(function (item) {
|
|
120
|
+
return {
|
|
121
|
+
key: item.uid,
|
|
122
|
+
value: item.uid,
|
|
123
|
+
label: item.name
|
|
124
|
+
};
|
|
125
|
+
})
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}),
|
|
130
|
+
runFetchAllBehaviorImport = _useRequest5.run;
|
|
131
|
+
var _useRequest6 = useRequest(fetchAllBehaviorEx, {
|
|
132
|
+
manual: true,
|
|
133
|
+
onSuccess: function onSuccess(_ref6) {
|
|
134
|
+
var code = _ref6.code,
|
|
135
|
+
data = _ref6.data;
|
|
136
|
+
if (code === 1) {
|
|
137
|
+
setRemoteSource({
|
|
138
|
+
expTypeList: data.map(function (item) {
|
|
139
|
+
return {
|
|
140
|
+
key: item.uid,
|
|
141
|
+
value: item.uid,
|
|
142
|
+
label: item.name
|
|
143
|
+
};
|
|
144
|
+
})
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}),
|
|
149
|
+
runFetchAllBehaviorExport = _useRequest6.run;
|
|
109
150
|
useAsyncEffect( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
110
151
|
var fetchPageDataRes, data, list, detail, _detail$list$, source, info;
|
|
111
152
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -118,7 +159,7 @@ export default (function (_ref) {
|
|
|
118
159
|
case 2:
|
|
119
160
|
fetchPageDataRes = _context.sent;
|
|
120
161
|
if (!(fetchPageDataRes.code === 1)) {
|
|
121
|
-
_context.next =
|
|
162
|
+
_context.next = 15;
|
|
122
163
|
break;
|
|
123
164
|
}
|
|
124
165
|
data = fetchPageDataRes.data, list = fetchPageDataRes.list, detail = fetchPageDataRes.detail;
|
|
@@ -129,6 +170,14 @@ export default (function (_ref) {
|
|
|
129
170
|
moduleCode: data.moduleCode
|
|
130
171
|
});
|
|
131
172
|
case 9:
|
|
173
|
+
runFetchAllBehaviorImport({
|
|
174
|
+
behaviorMode: 'IMPORT',
|
|
175
|
+
moduleCode: data.moduleCode
|
|
176
|
+
});
|
|
177
|
+
runFetchAllBehaviorExport({
|
|
178
|
+
behaviorMode: 'EXPORT',
|
|
179
|
+
moduleCode: data.moduleCode
|
|
180
|
+
});
|
|
132
181
|
runFetchAllDataset({
|
|
133
182
|
dataModelKey: data.dataModelKey
|
|
134
183
|
});
|
|
@@ -140,8 +189,8 @@ export default (function (_ref) {
|
|
|
140
189
|
relationship: data
|
|
141
190
|
}, info)
|
|
142
191
|
});
|
|
143
|
-
initialize(decompress(source));
|
|
144
|
-
case
|
|
192
|
+
!debug && initialize(decompress(source));
|
|
193
|
+
case 15:
|
|
145
194
|
case "end":
|
|
146
195
|
return _context.stop();
|
|
147
196
|
}
|
|
@@ -39,6 +39,10 @@ export function decompress(compressedData) {
|
|
|
39
39
|
*/
|
|
40
40
|
export function findNodeAndParent(id, current) {
|
|
41
41
|
var parent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
42
|
+
if (!id) return {
|
|
43
|
+
node: null,
|
|
44
|
+
parent: null
|
|
45
|
+
};
|
|
42
46
|
if (!parent && current.props.id === id) {
|
|
43
47
|
return {
|
|
44
48
|
node: current,
|
|
@@ -5,7 +5,7 @@ import { create } from 'zustand';
|
|
|
5
5
|
import { immer } from 'zustand/middleware/immer';
|
|
6
6
|
import { subscribeWithSelector } from 'zustand/middleware';
|
|
7
7
|
import { useShallow } from 'zustand/react/shallow';
|
|
8
|
-
import { isObject, isArray, isNil, isFunction, isString, get, set as _set, forOwn, omit } from 'lodash';
|
|
8
|
+
import { isObject, isArray, isNil, isFunction, isString, get, set as _set, assign, forOwn, omit } from 'lodash';
|
|
9
9
|
import { getPathNodesById, findNodeAndParent } from "./dataProcess";
|
|
10
10
|
import { LC_BUILDIN_UNIT_KEY } from "../../constants";
|
|
11
11
|
var findNode = function findNode(obj, id) {
|
|
@@ -159,7 +159,9 @@ export var useGet = function useGet(_) {
|
|
|
159
159
|
});
|
|
160
160
|
} else if (isObject(_) && _.id) {
|
|
161
161
|
var _findNode2;
|
|
162
|
-
|
|
162
|
+
var path = _.path;
|
|
163
|
+
var _target = _.id === LC_BUILDIN_UNIT_KEY.PAGE_ROOT ? state.pageData : (_findNode2 = findNode(state.pageData, _.id)) === null || _findNode2 === void 0 ? void 0 : _findNode2.target;
|
|
164
|
+
return isNil(path) ? _target : get(_target, path);
|
|
163
165
|
} else if (isString(_)) {
|
|
164
166
|
return get(state.pageData, _);
|
|
165
167
|
}
|
|
@@ -186,7 +186,7 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
186
186
|
var node = context.componentMap.get(payload.id).api.getSelfData();
|
|
187
187
|
setOperatorId({
|
|
188
188
|
selector: payload.id,
|
|
189
|
-
deletable: node.props.buildIn !== true,
|
|
189
|
+
deletable: !node || node.props.buildIn !== true,
|
|
190
190
|
detector: null
|
|
191
191
|
});
|
|
192
192
|
} else {
|
|
@@ -357,7 +357,8 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
357
357
|
}
|
|
358
358
|
}, /*#__PURE__*/React.createElement(Preview, {
|
|
359
359
|
code: location.query.code,
|
|
360
|
-
userId: userId || 'no-user'
|
|
360
|
+
userId: userId || 'no-user',
|
|
361
|
+
debug: true
|
|
361
362
|
})));
|
|
362
363
|
};
|
|
363
364
|
export default DesignToolbar;
|
|
@@ -175,21 +175,21 @@ var Panel = function Panel() {
|
|
|
175
175
|
className: styles.underline
|
|
176
176
|
})), activeTabKey === _TAB_LIST_[0].key && /*#__PURE__*/React.createElement(AttrsPanel, {
|
|
177
177
|
key: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node.id,
|
|
178
|
+
nodeId: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node.id,
|
|
178
179
|
meta: meta,
|
|
179
|
-
value: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node,
|
|
180
180
|
onChange: function onChange(field, value, params) {
|
|
181
181
|
return handleChange(field, value, params);
|
|
182
182
|
}
|
|
183
183
|
}), activeTabKey === _TAB_LIST_[1].key && /*#__PURE__*/React.createElement(StylePanel, {
|
|
184
184
|
key: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node.id,
|
|
185
|
-
|
|
185
|
+
nodeId: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node.id,
|
|
186
186
|
onChange: function onChange(_, newCss) {
|
|
187
187
|
return handleChange('css', newCss);
|
|
188
188
|
}
|
|
189
189
|
}), activeTabKey === _TAB_LIST_[2].key && /*#__PURE__*/React.createElement(AdvancePanel, {
|
|
190
190
|
key: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node.id,
|
|
191
|
+
nodeId: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node.id,
|
|
191
192
|
meta: meta,
|
|
192
|
-
value: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node.advance,
|
|
193
193
|
onChange: function onChange(val) {
|
|
194
194
|
return handleChange('advance', val);
|
|
195
195
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import React, { useRef, useState } from 'react';
|
|
4
|
-
import { useMemoizedFn, useLatest, useCreation, useMap, useUpdateEffect } from 'ahooks';
|
|
4
|
+
import { useMemoizedFn, useLatest, useCreation, useMap, useUpdateEffect, useDebounceFn } from 'ahooks';
|
|
5
5
|
import { Modal, Icon, Input, Checkbox, Tooltip } from 'luck-design/antd';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
|
-
import {
|
|
7
|
+
import { reduce } from 'lodash';
|
|
8
8
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
9
9
|
import { useRemoteSource } from "../../engine/provider/ContextProvider";
|
|
10
10
|
import { useContext } from "../../engine/provider/ContextProvider";
|
|
@@ -98,18 +98,21 @@ var ActionBindModal = function ActionBindModal(_ref) {
|
|
|
98
98
|
useUpdateEffect(function () {
|
|
99
99
|
if (activeKey) {
|
|
100
100
|
var action = get(activeKey);
|
|
101
|
-
editorRef.current.editor.setValue(action.code);
|
|
101
|
+
(action === null || action === void 0 ? void 0 : action.code) && editorRef.current.editor.setValue(action.code);
|
|
102
102
|
}
|
|
103
103
|
}, [activeKey]);
|
|
104
104
|
useUpdateEffect(function () {
|
|
105
105
|
setAll(event === null || event === void 0 ? void 0 : event.actionPool);
|
|
106
106
|
}, [event]);
|
|
107
|
-
var
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
107
|
+
var _useDebounceFn = useDebounceFn(function (code) {
|
|
108
|
+
if (latestActiveKey.current) {
|
|
109
|
+
var action = get(latestActiveKey.current);
|
|
110
|
+
action.code = code;
|
|
111
|
+
}
|
|
112
|
+
}, {
|
|
113
|
+
wait: 500
|
|
114
|
+
}),
|
|
115
|
+
handleEditorValueChange = _useDebounceFn.run;
|
|
113
116
|
var handleOptionClick = useMemoizedFn(function (key) {
|
|
114
117
|
setActiveKey(key);
|
|
115
118
|
var action;
|
|
@@ -162,7 +165,7 @@ var ActionBindModal = function ActionBindModal(_ref) {
|
|
|
162
165
|
},
|
|
163
166
|
title: event === null || event === void 0 ? void 0 : event.name,
|
|
164
167
|
visible: !!event,
|
|
165
|
-
width:
|
|
168
|
+
width: "70vw",
|
|
166
169
|
closable: false,
|
|
167
170
|
maskClosable: false,
|
|
168
171
|
getContainer: function getContainer() {
|
|
@@ -190,7 +193,16 @@ var ActionBindModal = function ActionBindModal(_ref) {
|
|
|
190
193
|
className: classNames(_defineProperty({}, styles.active, key === category)),
|
|
191
194
|
onClick: function onClick() {
|
|
192
195
|
setCategory(key);
|
|
193
|
-
|
|
196
|
+
if ('custom' === key) {
|
|
197
|
+
setActiveKey('coding');
|
|
198
|
+
if (!actionPool.has(key)) {
|
|
199
|
+
set('coding', {
|
|
200
|
+
category: key,
|
|
201
|
+
key: 'coding',
|
|
202
|
+
code: event.func || defaultCode
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
194
206
|
}
|
|
195
207
|
}, label, key === category && /*#__PURE__*/React.createElement(Icon, {
|
|
196
208
|
type: "check",
|
|
@@ -267,7 +279,7 @@ var ActionBindModal = function ActionBindModal(_ref) {
|
|
|
267
279
|
className: styles['code-box']
|
|
268
280
|
}, activeKey ? /*#__PURE__*/React.createElement(JSEditor, {
|
|
269
281
|
ref: editorRef,
|
|
270
|
-
onChange: handleEditorValueChange
|
|
282
|
+
onChange: handleEditorValueChange
|
|
271
283
|
}) : formatMessage({
|
|
272
284
|
id: "".concat(_I18N_PREFIX_, ".noActionSelected"),
|
|
273
285
|
label: '请在右侧选择行为项'
|
|
@@ -278,7 +290,7 @@ var ActionBindModal = function ActionBindModal(_ref) {
|
|
|
278
290
|
className: styles['code-box']
|
|
279
291
|
}, activeKey ? /*#__PURE__*/React.createElement(JSEditor, {
|
|
280
292
|
ref: editorRef,
|
|
281
|
-
onChange: handleEditorValueChange
|
|
293
|
+
onChange: handleEditorValueChange
|
|
282
294
|
}) : formatMessage({
|
|
283
295
|
id: "".concat(_I18N_PREFIX_, ".noActionSelected"),
|
|
284
296
|
label: '请在右侧选择行为项'
|
|
@@ -9,6 +9,7 @@ import { useCreation, useMemoizedFn } from 'ahooks';
|
|
|
9
9
|
import { Menu, Dropdown, Button, Tooltip, Icon } from 'luck-design/antd';
|
|
10
10
|
import styled from 'styled-components';
|
|
11
11
|
import { keyBy, keys, omit } from 'lodash';
|
|
12
|
+
import { useGet } from "../../engine/provider/ContextProvider";
|
|
12
13
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
13
14
|
import Collapse from "./Collapse";
|
|
14
15
|
import ActionBindModal from "./ActionBindModal";
|
|
@@ -19,8 +20,12 @@ var EventItem = styled.div.withConfig({
|
|
|
19
20
|
})(["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:rgba(0,0,0,0.4);cursor:pointer;}i:not(:last-child){margin-right:6px;}"]);
|
|
20
21
|
var AdvancePanel = function AdvancePanel(_ref) {
|
|
21
22
|
var meta = _ref.meta,
|
|
22
|
-
|
|
23
|
+
nodeId = _ref.nodeId,
|
|
23
24
|
onChange = _ref.onChange;
|
|
25
|
+
var value = useGet({
|
|
26
|
+
id: nodeId,
|
|
27
|
+
path: 'props.advance'
|
|
28
|
+
});
|
|
24
29
|
var _useState = useState((value === null || value === void 0 ? void 0 : value.events) || {}),
|
|
25
30
|
_useState2 = _slicedToArray(_useState, 2),
|
|
26
31
|
events = _useState2[0],
|
|
@@ -8,7 +8,7 @@ import { useBoolean, useCreation, useMemoizedFn } from 'ahooks';
|
|
|
8
8
|
import { Drawer, Icon } from 'luck-design/antd';
|
|
9
9
|
import classNames from 'classnames';
|
|
10
10
|
import { startsWith, isNil, get } from 'lodash';
|
|
11
|
-
import {
|
|
11
|
+
import { useGet } from "../../engine/provider/ContextProvider";
|
|
12
12
|
import PanelItemFactory from "../../engine/factory/panel-item-factory";
|
|
13
13
|
import PanelItem from "./PanelItem";
|
|
14
14
|
import Collapse from "./Collapse";
|
|
@@ -16,7 +16,7 @@ import styles from "../style/panel-attrs.less";
|
|
|
16
16
|
var AttrsPanel = function AttrsPanel(_ref) {
|
|
17
17
|
var _nextRef$current2, _nextRef$current3;
|
|
18
18
|
var meta = _ref.meta,
|
|
19
|
-
|
|
19
|
+
nodeId = _ref.nodeId,
|
|
20
20
|
onChange = _ref.onChange;
|
|
21
21
|
var nextRef = useRef(null);
|
|
22
22
|
var factory = useRef(new PanelItemFactory());
|
|
@@ -26,7 +26,10 @@ var AttrsPanel = function AttrsPanel(_ref) {
|
|
|
26
26
|
_useBoolean2$ = _useBoolean2[1],
|
|
27
27
|
setTrue = _useBoolean2$.setTrue,
|
|
28
28
|
setFalse = _useBoolean2$.setFalse;
|
|
29
|
-
var
|
|
29
|
+
var node = useGet({
|
|
30
|
+
id: nodeId,
|
|
31
|
+
path: 'props'
|
|
32
|
+
});
|
|
30
33
|
var handleChange = useMemoizedFn(function (field, val, _ref2) {
|
|
31
34
|
var _nextRef$current;
|
|
32
35
|
var repositioning = _ref2.repositioning,
|
|
@@ -49,7 +52,6 @@ var AttrsPanel = function AttrsPanel(_ref) {
|
|
|
49
52
|
setTrue();
|
|
50
53
|
});
|
|
51
54
|
var renderPanelItems = useMemoizedFn(function (items, dynamicProps) {
|
|
52
|
-
var node = context.componentMap.get(value.id).api.getSelfData();
|
|
53
55
|
return items.map(function (_ref3) {
|
|
54
56
|
var type = _ref3.type,
|
|
55
57
|
key = _ref3.key,
|
|
@@ -66,7 +68,7 @@ var AttrsPanel = function AttrsPanel(_ref) {
|
|
|
66
68
|
var Comp = factory.current.getPanelItemFor(startsWith(type, '_') ? 'dynamic' : type, type);
|
|
67
69
|
if (type === 'group') {
|
|
68
70
|
return /*#__PURE__*/React.createElement(Comp, {
|
|
69
|
-
nodeId:
|
|
71
|
+
nodeId: nodeId,
|
|
70
72
|
key: key,
|
|
71
73
|
field: key,
|
|
72
74
|
label: name,
|
|
@@ -77,9 +79,9 @@ var AttrsPanel = function AttrsPanel(_ref) {
|
|
|
77
79
|
desc: desc
|
|
78
80
|
}, renderPanelItems(props || [], dynamicProps));
|
|
79
81
|
}
|
|
80
|
-
var _originalVal = get(node
|
|
82
|
+
var _originalVal = get(node, valueKey || key);
|
|
81
83
|
var comp = Comp && /*#__PURE__*/React.createElement(Comp, _extends({
|
|
82
|
-
nodeId:
|
|
84
|
+
nodeId: nodeId,
|
|
83
85
|
key: key,
|
|
84
86
|
defaultValue: isNil(_originalVal) ? defaultValue : _originalVal,
|
|
85
87
|
next: next !== null && next !== void 0 && next.props ? function (_dp) {
|
|
@@ -92,14 +94,14 @@ var AttrsPanel = function AttrsPanel(_ref) {
|
|
|
92
94
|
});
|
|
93
95
|
},
|
|
94
96
|
size: "small",
|
|
95
|
-
settings: node
|
|
97
|
+
settings: node,
|
|
96
98
|
renderPanelItems: renderPanelItems
|
|
97
99
|
}, rest, dynamicProps));
|
|
98
100
|
if (wrapper === 'hidden') return comp;
|
|
99
101
|
var Wrapper = wrapper === 'collapse' ? Collapse : PanelItem;
|
|
100
102
|
return /*#__PURE__*/React.createElement(Wrapper, _extends({
|
|
101
103
|
key: key,
|
|
102
|
-
nodeId:
|
|
104
|
+
nodeId: nodeId,
|
|
103
105
|
field: key,
|
|
104
106
|
label: name,
|
|
105
107
|
desc: desc
|
|
@@ -112,7 +114,7 @@ var AttrsPanel = function AttrsPanel(_ref) {
|
|
|
112
114
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
113
115
|
}
|
|
114
116
|
return renderPanelItems(meta.props);
|
|
115
|
-
}, [
|
|
117
|
+
}, [nodeId]);
|
|
116
118
|
useEffect(function () {
|
|
117
119
|
if (!open) {
|
|
118
120
|
nextRef.current = null;
|
|
@@ -120,7 +122,7 @@ var AttrsPanel = function AttrsPanel(_ref) {
|
|
|
120
122
|
}, [open]);
|
|
121
123
|
return /*#__PURE__*/React.createElement("div", {
|
|
122
124
|
id: "lc-painter-panel-attrs-container",
|
|
123
|
-
className: classNames(styles['lc-painter-panel-attrs'], _defineProperty(_defineProperty({}, styles.hidden, !
|
|
125
|
+
className: classNames(styles['lc-painter-panel-attrs'], _defineProperty(_defineProperty({}, styles.hidden, !nodeId), styles.showNext, open))
|
|
124
126
|
}, PropsComps, /*#__PURE__*/React.createElement(Drawer, {
|
|
125
127
|
visible: open,
|
|
126
128
|
width: 320,
|