@luck-design-biz/luckda 1.0.6-13tl → 1.0.7
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/LdAutoForm/index.js +25 -12
- package/es/components/LdCard/index.js +10 -8
- package/es/components/LdCom/index.js +3 -2
- package/es/components/LdFormList/index.js +5 -4
- package/es/components/LdGrid/index.js +29 -20
- package/es/components/LdGridForm/index.js +16 -7
- package/es/components/LdInfoPanel/index.js +16 -10
- package/es/helper/FromItems.js +64 -5
- package/es/helper/form.js +8 -2
- package/es/helper/ldBuilder.js +9 -5
- package/es/helper/ldComBuild.js +16 -11
- package/es/locales/zh-CN.js +40 -4
- package/es/lowcode/constants/api-url.js +202 -175
- package/es/lowcode/constants/event-topics.js +2 -0
- package/es/lowcode/constants/index.js +5 -4
- package/es/lowcode/engine/meta/components-list.json +6 -0
- package/es/lowcode/engine/meta/fielddate.props.default.json +1 -0
- package/es/lowcode/engine/meta/fielddate.props.json +48 -0
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +5 -0
- package/es/lowcode/engine/meta/pagecomponent.props.default.json +8 -0
- package/es/lowcode/engine/meta/pagecomponent.props.json +41 -0
- 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/provider/ContextProvider/index.js +45 -9
- 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 +44 -5
- package/es/lowcode/engine/tools/initDS.js +4 -4
- package/es/lowcode/painter/Design.js +1 -0
- package/es/lowcode/painter/DesignOperator.js +129 -27
- package/es/lowcode/painter/DesignToolbar.js +88 -173
- package/es/lowcode/painter/components/AdvancePanel.js +28 -10
- package/es/lowcode/painter/components/TipIcon.js +12 -4
- package/es/lowcode/painter/components/field-setting/SettingUI.js +56 -4
- 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 +0 -1
- package/es/lowcode/painter/panel-section/DataSetSelector.js +6 -3
- package/es/lowcode/painter/panel-section/FieldsSetting.js +1 -1
- package/es/lowcode/painter/panel-section/IconConditionSelector.js +2 -1
- package/es/lowcode/painter/panel-section/JSEditor/ToolBar.js +7 -4
- package/es/lowcode/painter/panel-section/JSEditor/index.js +15 -5
- package/es/lowcode/painter/panel-section/JSEditor/index.less +4 -0
- 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/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/Page.js +8 -3
- package/es/lowcode/view/lc-components/CardList/index.js +3 -0
- package/es/lowcode/view/lc-components/Dialog/index.js +9 -7
- package/es/lowcode/view/lc-components/Drawer/index.js +2 -0
- package/es/lowcode/view/lc-components/FieldDate/meta.json +48 -0
- package/es/lowcode/view/lc-components/Form/index.js +3 -0
- 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/Table/components/TopImex.js +5 -23
- package/es/lowcode/view/lc-components/Table/index.js +12 -6
- package/es/lowcode/view/lc-components/Tabs/index.js +6 -2
- package/es/lowcode/view/lc-components/Tree/index.js +3 -0
- package/es/lowcode/view/lc-components/Wrapper.js +7 -1
- package/es/services.js +25 -7
- package/es/utils/action.js +3 -2
- package/es/utils/form.js +37 -4
- package/es/utils/grid.js +2 -1
- 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/LdAutoForm/index.js +22 -9
- package/lib/components/LdCard/index.js +10 -8
- package/lib/components/LdCom/index.js +3 -2
- package/lib/components/LdFormList/index.js +4 -3
- package/lib/components/LdGrid/index.js +29 -20
- package/lib/components/LdGridForm/index.js +13 -4
- package/lib/components/LdInfoPanel/index.js +15 -9
- package/lib/helper/FromItems.js +64 -5
- package/lib/helper/form.js +8 -2
- package/lib/helper/ldBuilder.js +8 -5
- package/lib/helper/ldComBuild.js +14 -9
- package/lib/locales/zh-CN.js +40 -4
- package/lib/lowcode/constants/api-url.js +204 -175
- package/lib/lowcode/constants/event-topics.js +3 -1
- package/lib/lowcode/constants/index.js +6 -5
- package/lib/lowcode/engine/meta/components-list.json +6 -0
- package/lib/lowcode/engine/meta/fielddate.props.default.json +1 -0
- package/lib/lowcode/engine/meta/fielddate.props.json +48 -0
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +5 -0
- package/lib/lowcode/engine/meta/pagecomponent.props.default.json +8 -0
- package/lib/lowcode/engine/meta/pagecomponent.props.json +41 -0
- 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/provider/ContextProvider/index.js +50 -13
- 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 +44 -4
- package/lib/lowcode/engine/tools/initDS.js +4 -4
- package/lib/lowcode/painter/Design.js +1 -0
- package/lib/lowcode/painter/DesignOperator.js +126 -24
- package/lib/lowcode/painter/DesignToolbar.js +84 -169
- package/lib/lowcode/painter/components/AdvancePanel.js +27 -9
- package/lib/lowcode/painter/components/TipIcon.js +12 -4
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +55 -3
- 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 +0 -1
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +6 -3
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +1 -1
- package/lib/lowcode/painter/panel-section/IconConditionSelector.js +2 -1
- package/lib/lowcode/painter/panel-section/JSEditor/ToolBar.js +7 -4
- package/lib/lowcode/painter/panel-section/JSEditor/index.js +14 -4
- package/lib/lowcode/painter/panel-section/JSEditor/index.less +4 -0
- 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/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/Page.js +8 -3
- package/lib/lowcode/view/lc-components/CardList/index.js +3 -0
- package/lib/lowcode/view/lc-components/Dialog/index.js +9 -7
- package/lib/lowcode/view/lc-components/Drawer/index.js +2 -0
- package/lib/lowcode/view/lc-components/FieldDate/meta.json +48 -0
- package/lib/lowcode/view/lc-components/Form/index.js +3 -0
- 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/Table/components/TopImex.js +4 -22
- package/lib/lowcode/view/lc-components/Table/index.js +12 -6
- package/lib/lowcode/view/lc-components/Tabs/index.js +5 -1
- package/lib/lowcode/view/lc-components/Tree/index.js +3 -0
- package/lib/lowcode/view/lc-components/Wrapper.js +6 -0
- package/lib/services.js +26 -7
- package/lib/utils/action.js +6 -0
- package/lib/utils/form.js +38 -4
- package/lib/utils/grid.js +2 -1
- package/package.json +1 -1
- package/es/lowcode/engine/meta/button.api.json +0 -0
- package/lib/lowcode/engine/meta/button.api.json +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.PAGE_LOAD_MOUNT = exports.LANG_SETTING_SELECT = exports.DESIGN_OPERATE_SAVE = exports.COMPONENT_UNMOUNT = exports.COMPONENT_SETTING_CLICK = exports.COMPONENT_REPOSITIONING = exports.COMPONENT_MOUNT = exports.COMPONENT_MODIFY = exports.COMPONENT_MODAL_TOGGLE = exports.COMPONENT_HOVER = exports.COMPONENT_DRAG_OVER = exports.COMPONENT_DRAG_END = exports.COMPONENT_DELETE = exports.COMPONENT_APPEND = exports.COMPONENT_ACTIVE = void 0;
|
|
6
|
+
exports.PAGE_LOAD_MOUNT = exports.LANG_SETTING_SELECT = exports.DESIGN_SHORTCUT_EMIT = exports.DESIGN_OPERATE_SAVE = exports.COMPONENT_UNMOUNT = exports.COMPONENT_SETTING_CLICK = exports.COMPONENT_REPOSITIONING = exports.COMPONENT_MOUNT = exports.COMPONENT_MODIFY = exports.COMPONENT_MODAL_TOGGLE = exports.COMPONENT_HOVER = exports.COMPONENT_DRAG_OVER = exports.COMPONENT_DRAG_END = exports.COMPONENT_DELETE = exports.COMPONENT_APPEND = exports.COMPONENT_ACTIVE = void 0;
|
|
7
7
|
/******************************** 通用Topic开始 ********************************/
|
|
8
8
|
|
|
9
9
|
var PAGE_LOAD_MOUNT = exports.PAGE_LOAD_MOUNT = 'page-load-mount';
|
|
@@ -38,6 +38,8 @@ var COMPONENT_DRAG_OVER = exports.COMPONENT_DRAG_OVER = 'component-drag-over';
|
|
|
38
38
|
var COMPONENT_DRAG_END = exports.COMPONENT_DRAG_END = 'component-drag-end';
|
|
39
39
|
// 保存事件
|
|
40
40
|
var DESIGN_OPERATE_SAVE = exports.DESIGN_OPERATE_SAVE = 'design-operate-save';
|
|
41
|
+
// 快捷键触发事件
|
|
42
|
+
var DESIGN_SHORTCUT_EMIT = exports.DESIGN_SHORTCUT_EMIT = 'desdign-shortcut-emit';
|
|
41
43
|
|
|
42
44
|
/******************************* Design Topic结束 *******************************/
|
|
43
45
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.RUNTIME = exports.NO_DROPABLE = exports.NO_DRAGABLE = exports.META_TAG_NAME = exports.LC_RUNTIME_KEY = exports.LC_FORMITEM_UNIT = exports.LC_COMPONENT_UNIT_KEY = exports.LC_COMPONENT_UNIT = exports.LC_BUILDIN_UNIT_KEY_LIST = exports.LC_BUILDIN_UNIT_KEY = exports.FIELD_SCOPES = exports.COOKIE_VIRTUAL_ACCOUNT_KEY = exports.CONTAINER_UNITS = void 0;
|
|
6
|
+
exports.RUNTIME = exports.NO_DROPABLE = exports.NO_DRAGABLE = exports.META_TAG_NAME = exports.LC_RUNTIME_KEY = exports.LC_PAGEPROXY_KEY = exports.LC_FORMITEM_UNIT = exports.LC_COMPONENT_UNIT_KEY = exports.LC_COMPONENT_UNIT = exports.LC_BUILDIN_UNIT_KEY_LIST = exports.LC_BUILDIN_UNIT_KEY = exports.FIELD_SCOPES = exports.COOKIE_VIRTUAL_ACCOUNT_KEY = exports.CONTAINER_UNITS = void 0;
|
|
7
7
|
var RUNTIME = exports.RUNTIME = {
|
|
8
8
|
LIVE: 'live',
|
|
9
9
|
DESIGN: 'design',
|
|
@@ -11,10 +11,11 @@ var RUNTIME = exports.RUNTIME = {
|
|
|
11
11
|
};
|
|
12
12
|
var META_TAG_NAME = exports.META_TAG_NAME = 'luckda-lcpage';
|
|
13
13
|
var COOKIE_VIRTUAL_ACCOUNT_KEY = exports.COOKIE_VIRTUAL_ACCOUNT_KEY = 'Lowcode-Account';
|
|
14
|
-
var LC_RUNTIME_KEY = exports.LC_RUNTIME_KEY = '
|
|
15
|
-
var LC_COMPONENT_UNIT_KEY = exports.LC_COMPONENT_UNIT_KEY = '
|
|
16
|
-
var
|
|
17
|
-
var
|
|
14
|
+
var LC_RUNTIME_KEY = exports.LC_RUNTIME_KEY = 'LD-Runtime';
|
|
15
|
+
var LC_COMPONENT_UNIT_KEY = exports.LC_COMPONENT_UNIT_KEY = 'LD-__unitmark';
|
|
16
|
+
var LC_PAGEPROXY_KEY = exports.LC_PAGEPROXY_KEY = 'LD-__pageproxy';
|
|
17
|
+
var LC_COMPONENT_UNIT = exports.LC_COMPONENT_UNIT = 'LD-__component';
|
|
18
|
+
var LC_FORMITEM_UNIT = exports.LC_FORMITEM_UNIT = 'LD-__formitem';
|
|
18
19
|
var LC_BUILDIN_UNIT_KEY = exports.LC_BUILDIN_UNIT_KEY = {
|
|
19
20
|
PAGE_ROOT: 'page_root',
|
|
20
21
|
PAGE_HEADER: 'page_header',
|
|
@@ -123,6 +123,12 @@
|
|
|
123
123
|
"desc": "用于展示组织维度层级结构的数据。它提供了层级结构、节点展开/折叠、节点选择、节点操作和展示样式等功能。",
|
|
124
124
|
"icon": "icon-tree"
|
|
125
125
|
},
|
|
126
|
+
{
|
|
127
|
+
"component": "Proxy",
|
|
128
|
+
"name": "页面代理",
|
|
129
|
+
"desc": "用于代理其他页面的内容,用于实现已有页面的服用。",
|
|
130
|
+
"icon": "icon-proxy"
|
|
131
|
+
},
|
|
126
132
|
{
|
|
127
133
|
"component": "Table",
|
|
128
134
|
"name": "表格",
|
|
@@ -29,6 +29,54 @@
|
|
|
29
29
|
"name": "日期格式",
|
|
30
30
|
"type": "string"
|
|
31
31
|
},
|
|
32
|
+
{
|
|
33
|
+
"key": "format",
|
|
34
|
+
"name": "日期格式",
|
|
35
|
+
"type": "select",
|
|
36
|
+
"options": [
|
|
37
|
+
{
|
|
38
|
+
"label": "年-月-日 时:分:秒",
|
|
39
|
+
"value": "YYYY-MM-DD HH:mm:ss"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"label": "年-月-日 时:分",
|
|
43
|
+
"value": "YYYY-MM-DD HH:mm"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"label": "年-月-日 时",
|
|
47
|
+
"value": "YYYY-MM-DD HH"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"label": "年-月-日",
|
|
51
|
+
"value": "YYYY-MM-DD"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"label": "年-月",
|
|
55
|
+
"value": "YYYY-MM"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"label": "年",
|
|
59
|
+
"value": "YYYY"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"label": "时:分:秒",
|
|
63
|
+
"value": "HH:mm:ss"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"label": "时:分",
|
|
67
|
+
"value": "HH:mm"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"label": "分:秒",
|
|
71
|
+
"value": "mm:ss"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"label": "年-周",
|
|
75
|
+
"value": "YYYY-wo"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"default": 16
|
|
79
|
+
},
|
|
32
80
|
{
|
|
33
81
|
"key": "disabledDate",
|
|
34
82
|
"name": "不可选日期",
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"component": "PageComponent",
|
|
3
|
+
"name": "关联页面组件",
|
|
4
|
+
"group": "build-in",
|
|
5
|
+
"props": [
|
|
6
|
+
{
|
|
7
|
+
"key": "id",
|
|
8
|
+
"name": "唯一标识",
|
|
9
|
+
"type": "string",
|
|
10
|
+
"disabled": true
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"key": "linkName",
|
|
14
|
+
"name": "页面名称",
|
|
15
|
+
"type": "string",
|
|
16
|
+
"disabled": true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"key": "linkCode",
|
|
20
|
+
"name": "页面编码",
|
|
21
|
+
"type": "string",
|
|
22
|
+
"disabled": true
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"advance": {
|
|
26
|
+
"events": [
|
|
27
|
+
{
|
|
28
|
+
"key": "onMount",
|
|
29
|
+
"name": "组件首次渲染完成",
|
|
30
|
+
"desc": "在组件首次渲染完成时,执行方法",
|
|
31
|
+
"func": "function onPageMount(){\n\t\n}"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"key": "onUnmount",
|
|
35
|
+
"name": "组件卸载时",
|
|
36
|
+
"desc": "在组件卸载时,执行方法。",
|
|
37
|
+
"func": "function onPageUnmount(){\n\t\n}"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"component": "Proxy",
|
|
3
|
+
"name": "页面代理",
|
|
4
|
+
"desc": "用于代理其他页面的内容,用于实现已有页面的服用。",
|
|
5
|
+
"icon": "icon-proxy",
|
|
6
|
+
"group": "advance",
|
|
7
|
+
"groupName": "高级",
|
|
8
|
+
"order": 6,
|
|
9
|
+
"css": "width: 100%; height: 100%; background-color: transparent;",
|
|
10
|
+
"destroyOnUnmount": false,
|
|
11
|
+
"proxyParams": [],
|
|
12
|
+
"advance": {
|
|
13
|
+
"events": {}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"component": "Proxy",
|
|
3
|
+
"name": "页面代理",
|
|
4
|
+
"desc": "用于代理其他页面的内容,用于实现已有页面的服用。",
|
|
5
|
+
"icon": "icon-proxy",
|
|
6
|
+
"group": "advance",
|
|
7
|
+
"groupName": "高级",
|
|
8
|
+
"order": 6,
|
|
9
|
+
"props": [
|
|
10
|
+
{
|
|
11
|
+
"key": "id",
|
|
12
|
+
"name": "唯一标识",
|
|
13
|
+
"type": "string",
|
|
14
|
+
"disabled": true
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"key": "destroyOnUnmount",
|
|
18
|
+
"name": "卸载时销毁",
|
|
19
|
+
"type": "switch",
|
|
20
|
+
"default": false
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"key": "proxyCode",
|
|
24
|
+
"name": "页面编码",
|
|
25
|
+
"type": "_ProxyLinker"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"key": "proxyParams",
|
|
29
|
+
"name": "页面参数",
|
|
30
|
+
"type": "_ProxyParams",
|
|
31
|
+
"wrapper": "collapse",
|
|
32
|
+
"wrapperProps": {
|
|
33
|
+
"suppressIcon": true
|
|
34
|
+
},
|
|
35
|
+
"next": {
|
|
36
|
+
"name": "页面参数对象",
|
|
37
|
+
"autoClose": true,
|
|
38
|
+
"props": [
|
|
39
|
+
{
|
|
40
|
+
"key": "proxyParams",
|
|
41
|
+
"name": "#页面参数对象",
|
|
42
|
+
"type": "_ProxyParamsSetter",
|
|
43
|
+
"default": []
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"css": "width: 100%; height: 100%; background-color: transparent;",
|
|
50
|
+
"advance": {
|
|
51
|
+
"events": [
|
|
52
|
+
{
|
|
53
|
+
"key": "onMount",
|
|
54
|
+
"name": "组件首次渲染完成",
|
|
55
|
+
"desc": "在组件首次渲染完成时,执行方法",
|
|
56
|
+
"func": "function onPageMount(){\n\t\n}"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"key": "onUnmount",
|
|
60
|
+
"name": "组件卸载时",
|
|
61
|
+
"desc": "在组件卸载时,执行方法。",
|
|
62
|
+
"func": "function onPageUnmount(){\n\t\n}"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -11,7 +11,10 @@ var _exportNames = {
|
|
|
11
11
|
useRemoteSource: true
|
|
12
12
|
};
|
|
13
13
|
exports.useRemoteSource = exports.useContext = exports.default = exports.Context = void 0;
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
15
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
16
|
+
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
|
|
17
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
18
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
19
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
20
|
var _ahooks = require("ahooks");
|
|
@@ -20,6 +23,11 @@ var _EventBusProvider = require("../EventBusProvider");
|
|
|
20
23
|
var _RemoteSourceProvider = _interopRequireWildcard(require("../RemoteSourceProvider"));
|
|
21
24
|
var _usePageVar2 = _interopRequireDefault(require("./usePageVar"));
|
|
22
25
|
var _useTodo3 = _interopRequireDefault(require("./useTodo"));
|
|
26
|
+
var _ApiConfig = _interopRequireDefault(require("@/services/ApiConfig"));
|
|
27
|
+
var _apiUrl = require("../../../constants/api-url");
|
|
28
|
+
var topics = _interopRequireWildcard(require("../../../constants/event-topics"));
|
|
29
|
+
var utils = _interopRequireWildcard(require("./utils"));
|
|
30
|
+
var router = _interopRequireWildcard(require("./router"));
|
|
23
31
|
var _usePageDataStore = require("./usePageDataStore");
|
|
24
32
|
Object.keys(_usePageDataStore).forEach(function (key) {
|
|
25
33
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -32,11 +40,6 @@ Object.keys(_usePageDataStore).forEach(function (key) {
|
|
|
32
40
|
}
|
|
33
41
|
});
|
|
34
42
|
});
|
|
35
|
-
var _ApiConfig = _interopRequireDefault(require("@/services/ApiConfig"));
|
|
36
|
-
var _apiUrl = require("../../../constants/api-url");
|
|
37
|
-
var topics = _interopRequireWildcard(require("../../../constants/event-topics"));
|
|
38
|
-
var utils = _interopRequireWildcard(require("./utils"));
|
|
39
|
-
var router = _interopRequireWildcard(require("./router"));
|
|
40
43
|
var Context = exports.Context = /*#__PURE__*/(0, _react.createContext)(null);
|
|
41
44
|
var useContext = exports.useContext = function useContext() {
|
|
42
45
|
return (0, _react.useContext)(Context);
|
|
@@ -83,10 +86,27 @@ var _default = exports.default = function _default(_ref) {
|
|
|
83
86
|
if (index !== -1) {
|
|
84
87
|
_componentList.current.splice(index, 1);
|
|
85
88
|
}
|
|
86
|
-
;
|
|
87
89
|
});
|
|
88
|
-
var _initRemoteApiMap = (0, _ahooks.useMemoizedFn)(function (_apiMap) {
|
|
89
|
-
|
|
90
|
+
var _initRemoteApiMap = (0, _ahooks.useMemoizedFn)(function (_apiMap, append) {
|
|
91
|
+
if (append) {
|
|
92
|
+
_remoteApiMap.current = new Map([].concat((0, _toConsumableArray2.default)(_remoteApiMap.current), (0, _toConsumableArray2.default)(_apiMap)));
|
|
93
|
+
} else {
|
|
94
|
+
_remoteApiMap.current = _apiMap;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
var _deleteRemoteApis = (0, _ahooks.useMemoizedFn)(function (keys) {
|
|
98
|
+
var _iterator = (0, _createForOfIteratorHelper2.default)(keys),
|
|
99
|
+
_step;
|
|
100
|
+
try {
|
|
101
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
102
|
+
var key = _step.value;
|
|
103
|
+
_remoteApiMap.current.delete(key);
|
|
104
|
+
}
|
|
105
|
+
} catch (err) {
|
|
106
|
+
_iterator.e(err);
|
|
107
|
+
} finally {
|
|
108
|
+
_iterator.f();
|
|
109
|
+
}
|
|
90
110
|
});
|
|
91
111
|
var getElementById = (0, _ahooks.useMemoizedFn)(function (compId) {
|
|
92
112
|
var _componentList$curren;
|
|
@@ -104,10 +124,9 @@ var _default = exports.default = function _default(_ref) {
|
|
|
104
124
|
if (!_parentId) return null;
|
|
105
125
|
return compMap.get(_parentId);
|
|
106
126
|
});
|
|
107
|
-
var want = (0, _ahooks.useMemoizedFn)(function (wanted) {
|
|
108
|
-
var _getModuleData;
|
|
127
|
+
var want = (0, _ahooks.useMemoizedFn)(function (wanted, _serials) {
|
|
109
128
|
if ((0, _lodash.isNil)(wanted)) return false;
|
|
110
|
-
var serials =
|
|
129
|
+
var serials = _serials || [];
|
|
111
130
|
var serialMap = serials.reduce(function (acc, cur, index) {
|
|
112
131
|
if (!acc[cur]) {
|
|
113
132
|
acc[cur] = Math.pow(2, index);
|
|
@@ -124,6 +143,7 @@ var _default = exports.default = function _default(_ref) {
|
|
|
124
143
|
_register: _register,
|
|
125
144
|
_unregister: _unregister,
|
|
126
145
|
_initRemoteApiMap: _initRemoteApiMap,
|
|
146
|
+
_deleteRemoteApis: _deleteRemoteApis,
|
|
127
147
|
/**
|
|
128
148
|
* @property {boolean} loading - loading状态
|
|
129
149
|
*/
|
|
@@ -202,9 +222,26 @@ var _default = exports.default = function _default(_ref) {
|
|
|
202
222
|
var _privateGetter$curren;
|
|
203
223
|
return (_privateGetter$curren = _privateGetter.current) === null || _privateGetter$curren === void 0 ? void 0 : _privateGetter$curren[property]();
|
|
204
224
|
} else if (property === 'state') {
|
|
205
|
-
|
|
225
|
+
var state = getState();
|
|
226
|
+
return new Proxy(Object.assign({}, state), {
|
|
227
|
+
get: function get(stateTarget, stateProperty, stateReceiver) {
|
|
228
|
+
return Reflect.get(stateTarget, stateProperty, stateReceiver);
|
|
229
|
+
},
|
|
230
|
+
set: function set(stateTarget, stateProperty, stateReceiver) {
|
|
231
|
+
setState((0, _defineProperty2.default)({}, stateProperty, stateReceiver));
|
|
232
|
+
return true;
|
|
233
|
+
}
|
|
234
|
+
});
|
|
206
235
|
} else if (property === 'global') {
|
|
207
|
-
return global.current
|
|
236
|
+
return new Proxy(Object.assign({}, global.current), {
|
|
237
|
+
get: function get(globalTarget, globalProperty, globalReceiver) {
|
|
238
|
+
return Reflect.get(globalTarget, globalProperty, globalReceiver);
|
|
239
|
+
},
|
|
240
|
+
set: function set(globalTarget, globalProperty, globalReceiver) {
|
|
241
|
+
setGlobal((0, _defineProperty2.default)({}, globalProperty, globalReceiver));
|
|
242
|
+
return true;
|
|
243
|
+
}
|
|
244
|
+
});
|
|
208
245
|
}
|
|
209
246
|
return Reflect.get(target, property, receiver);
|
|
210
247
|
},
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.useTemporalStore = exports.useTask = exports.useGet = exports.setNeedPrompt = exports.resetPageData = exports.moveNode = exports.modifyNode = exports.getSelfAndParent = exports.getNeedPrompt = exports.
|
|
7
|
+
exports.useTemporalStore = exports.useTask = exports.useGet = exports.setNeedPrompt = exports.resetPageData = exports.moveNode = exports.modifyNode = exports.getSelfAndParent = exports.getNeedPrompt = exports.getLevelNodes = exports.deleteNode = exports.default = exports.clearChildren = exports.addNode = void 0;
|
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
9
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
10
10
|
var _react = require("react");
|
|
@@ -14,6 +14,7 @@ var _middleware = require("zustand/middleware");
|
|
|
14
14
|
var _shallow = require("zustand/react/shallow");
|
|
15
15
|
var _lodash = require("lodash");
|
|
16
16
|
var _fastDeepEqual = _interopRequireDefault(require("fast-deep-equal"));
|
|
17
|
+
var _PageProxyProvider = require("../PageProxyProvider");
|
|
17
18
|
var _dataProcess = require("../../tools/dataProcess");
|
|
18
19
|
var _constants = require("../../../constants");
|
|
19
20
|
var temporalStateCreator = function temporalStateCreator(userSet, userGet, options) {
|
|
@@ -148,18 +149,12 @@ var findNode = function findNode(obj, id) {
|
|
|
148
149
|
var usePageDataStore = (0, _zustand.create)()((0, _immer.immer)((0, _middleware.subscribeWithSelector)(temporal(function (set) {
|
|
149
150
|
return {
|
|
150
151
|
pageData: null,
|
|
151
|
-
moduleData: null,
|
|
152
152
|
needPrompt: false,
|
|
153
153
|
initialize: function initialize(data) {
|
|
154
154
|
return set(function (state) {
|
|
155
155
|
state.pageData = data;
|
|
156
156
|
});
|
|
157
157
|
},
|
|
158
|
-
initializeModule: function initializeModule(data) {
|
|
159
|
-
return set(function (state) {
|
|
160
|
-
state.moduleData = data;
|
|
161
|
-
});
|
|
162
|
-
},
|
|
163
158
|
reset: function reset(data) {
|
|
164
159
|
return set(function (state) {
|
|
165
160
|
state.pageData = data || null;
|
|
@@ -267,20 +262,20 @@ var modifyNode = exports.modifyNode = function modifyNode(id, data) {
|
|
|
267
262
|
|
|
268
263
|
/**
|
|
269
264
|
* 移动页面中的一个节点到另一个位置。
|
|
270
|
-
*
|
|
265
|
+
*
|
|
271
266
|
* @param {string} sid - 源节点的ID。
|
|
272
267
|
* @param {string} tid - 目标节点的ID。
|
|
273
268
|
* @param {string} action - 移动类型,可以是 'inside', 'left', 'right' 中的一个。
|
|
274
269
|
* @param {string} newid - 新节点的ID,仅在创建新节点时使用。
|
|
275
270
|
* @param {Object} json - 新节点的初始属性,仅在创建新节点时使用。
|
|
276
|
-
*
|
|
271
|
+
*
|
|
277
272
|
* @description
|
|
278
273
|
* 此函数会更新页面数据状态,根据提供的动作类型(`action`),将源节点(`sourceNode`)移动到目标节点(`targetNode`)的相应位置。
|
|
279
274
|
* - 'inside': 将源节点作为目标节点的子节点。
|
|
280
275
|
* - 'left': 将源节点放在目标节点的左边(同一父节点下)。
|
|
281
276
|
* - 'right': 将源节点放在目标节点的右边(同一父节点下)。
|
|
282
277
|
* 如果 `sid` 是空但提供了 `newid`,则函数会创建一个新的节点。
|
|
283
|
-
*
|
|
278
|
+
*
|
|
284
279
|
*/
|
|
285
280
|
var moveNode = exports.moveNode = function moveNode(sid, tid, action, newid, json) {
|
|
286
281
|
usePageDataStore.setState(function (state) {
|
|
@@ -394,30 +389,41 @@ var useTask = exports.useTask = function useTask(type) {
|
|
|
394
389
|
}, []);
|
|
395
390
|
return task;
|
|
396
391
|
};
|
|
397
|
-
var
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
392
|
+
var getTargetData = function getTargetData(_, source) {
|
|
393
|
+
if ((0, _lodash.isNil)(_)) {
|
|
394
|
+
return source;
|
|
395
|
+
} else if ((0, _lodash.isFunction)(_)) {
|
|
396
|
+
return _(source);
|
|
397
|
+
} else if ((0, _lodash.isArray)(_)) {
|
|
398
|
+
return _.map(function (k) {
|
|
399
|
+
var _findNode;
|
|
400
|
+
return k.includes('.') ? (0, _lodash.get)(source, k) : (_findNode = findNode(source, k)) === null || _findNode === void 0 ? void 0 : _findNode.target;
|
|
401
|
+
});
|
|
402
|
+
} else if ((0, _lodash.isObject)(_) && _.id) {
|
|
403
|
+
var _findNode2;
|
|
404
|
+
var path = _.path;
|
|
405
|
+
var _target = _.id === _constants.LC_BUILDIN_UNIT_KEY.PAGE_ROOT ? source : (_findNode2 = findNode(source, _.id)) === null || _findNode2 === void 0 ? void 0 : _findNode2.target;
|
|
406
|
+
if ((0, _lodash.isNil)(path)) {
|
|
407
|
+
return _target;
|
|
408
|
+
} else if ((0, _lodash.isString)(path)) {
|
|
409
|
+
return (0, _lodash.get)(_target, path);
|
|
410
|
+
} else if ((0, _lodash.isArray)(path)) {
|
|
411
|
+
return path.map(function (k) {
|
|
412
|
+
return (0, _lodash.get)(_target, k);
|
|
407
413
|
});
|
|
408
|
-
} else if ((0, _lodash.isObject)(_) && _.id) {
|
|
409
|
-
var _findNode2;
|
|
410
|
-
var path = _.path;
|
|
411
|
-
var _target = _.id === _constants.LC_BUILDIN_UNIT_KEY.PAGE_ROOT ? state.pageData : (_findNode2 = findNode(state.pageData, _.id)) === null || _findNode2 === void 0 ? void 0 : _findNode2.target;
|
|
412
|
-
return (0, _lodash.isNil)(path) ? _target : (0, _lodash.get)(_target, path);
|
|
413
|
-
} else if ((0, _lodash.isString)(_)) {
|
|
414
|
-
return (0, _lodash.get)(state.pageData, _);
|
|
415
414
|
}
|
|
416
|
-
}))
|
|
417
|
-
|
|
415
|
+
} else if ((0, _lodash.isString)(_)) {
|
|
416
|
+
return (0, _lodash.get)(state.pageData, _);
|
|
417
|
+
}
|
|
418
418
|
};
|
|
419
|
-
var
|
|
420
|
-
|
|
419
|
+
var useGet = exports.useGet = function useGet(_) {
|
|
420
|
+
var ppCtx = (0, _PageProxyProvider.usePageProxyContext)();
|
|
421
|
+
if (ppCtx !== null && ppCtx !== void 0 && ppCtx.proxyCode) {
|
|
422
|
+
return getTargetData(_, usePageDataStore.getState()[ppCtx.proxyCode]);
|
|
423
|
+
}
|
|
424
|
+
return usePageDataStore((0, _shallow.useShallow)(function (state) {
|
|
425
|
+
return getTargetData(_, state.pageData);
|
|
426
|
+
}));
|
|
421
427
|
};
|
|
422
428
|
var setNeedPrompt = exports.setNeedPrompt = function setNeedPrompt(_need) {
|
|
423
429
|
usePageDataStore.setState(function (state) {
|
|
@@ -13,14 +13,20 @@ var _lodash = require("lodash");
|
|
|
13
13
|
var useStateStore = exports.useStateStore = (0, _zustand.create)()((0, _immer.immer)((0, _middleware.subscribeWithSelector)(function (set) {
|
|
14
14
|
return {
|
|
15
15
|
state: {},
|
|
16
|
-
initialize: function initialize(init) {
|
|
16
|
+
initialize: function initialize(init, append) {
|
|
17
17
|
return set(function (store) {
|
|
18
|
-
|
|
18
|
+
if (append) {
|
|
19
|
+
(0, _lodash.forOwn)(init, function (value, key) {
|
|
20
|
+
store.state[key] = value;
|
|
21
|
+
});
|
|
22
|
+
} else {
|
|
23
|
+
store.state = init;
|
|
24
|
+
}
|
|
19
25
|
});
|
|
20
26
|
},
|
|
21
|
-
clear: function clear() {
|
|
27
|
+
clear: function clear(_vars) {
|
|
22
28
|
return set(function (store) {
|
|
23
|
-
store.state =
|
|
29
|
+
store.state = (0, _lodash.omit)(store.state, _vars);
|
|
24
30
|
});
|
|
25
31
|
}
|
|
26
32
|
};
|
|
@@ -12,7 +12,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
12
12
|
var _ahooks = require("ahooks");
|
|
13
13
|
var _antd = require("luck-design/antd");
|
|
14
14
|
var _lodash = require("lodash");
|
|
15
|
-
var _usePageDataStore = require("./usePageDataStore");
|
|
16
15
|
var _helper = require("../../tools/helper");
|
|
17
16
|
var _apiUrl = require("../../../constants/api-url");
|
|
18
17
|
var _excluded = ["datasetCode"];
|
|
@@ -61,8 +60,7 @@ var useTodo = function useTodo() {
|
|
|
61
60
|
params = _ref4.params,
|
|
62
61
|
data = _ref4.data,
|
|
63
62
|
after = _ref4.after;
|
|
64
|
-
var
|
|
65
|
-
var _moduleCode = moduleCode || moduleData.moduleCode;
|
|
63
|
+
var _moduleCode = moduleCode || (0, _helper.getLDMetaAttr)('moduleCode');
|
|
66
64
|
var _dscode = datasetCode || dsCode;
|
|
67
65
|
if (!_moduleCode || !_dscode) {
|
|
68
66
|
_antd.message.warning('接口重要参数(模块编码或数据集编码)丢失');
|
|
@@ -66,7 +66,7 @@ var _default = exports.default = function _default(_ref) {
|
|
|
66
66
|
var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
|
|
67
67
|
_id = _ref4[0],
|
|
68
68
|
_subscriber = _ref4[1];
|
|
69
|
-
var temp = _subscriber._before ? _subscriber._before(payload) : null;
|
|
69
|
+
var temp = _subscriber._before ? _subscriber._before(payload, _id) : null;
|
|
70
70
|
if (_subscriber._before && !(0, _helper.isPromise)(temp)) {
|
|
71
71
|
console.error('before hook must return a promise');
|
|
72
72
|
return;
|
|
@@ -76,10 +76,10 @@ var _default = exports.default = function _default(_ref) {
|
|
|
76
76
|
if (!flag) return flag;
|
|
77
77
|
var func = _subscriber._once || _subscriber._on;
|
|
78
78
|
if (!func) return;
|
|
79
|
-
return func(payload);
|
|
79
|
+
return func(payload, _id);
|
|
80
80
|
}).then(function (flag) {
|
|
81
81
|
if (flag === false || !_subscriber._after) return;
|
|
82
|
-
return _subscriber._after(payload);
|
|
82
|
+
return _subscriber._after(payload, _id);
|
|
83
83
|
}).finally(function () {
|
|
84
84
|
if (_subscriber._once) {
|
|
85
85
|
$unsubscriber(topic, _id);
|
|
@@ -93,6 +93,15 @@ var _default = exports.default = function _default(_ref) {
|
|
|
93
93
|
runtime: runtime
|
|
94
94
|
}, payload));
|
|
95
95
|
});
|
|
96
|
+
var $publisherOnce = (0, _ahooks.useMemoizedFn)(function (topic, payload) {
|
|
97
|
+
return new Promise(function (resolve) {
|
|
98
|
+
event$.emit((0, _objectSpread2.default)({
|
|
99
|
+
topic: topic,
|
|
100
|
+
runtime: runtime
|
|
101
|
+
}, payload));
|
|
102
|
+
$subscriber(topic).once(resolve).watch();
|
|
103
|
+
});
|
|
104
|
+
});
|
|
96
105
|
var $subscriber = (0, _ahooks.useMemoizedFn)(function (topic) {
|
|
97
106
|
if (!subscriberPool.has(topic)) subscriberPool.set(topic, []);
|
|
98
107
|
var id = (0, _utils.suid)();
|
|
@@ -112,7 +121,7 @@ var _default = exports.default = function _default(_ref) {
|
|
|
112
121
|
if (!subscriberPool.get(topic).length) {
|
|
113
122
|
subscriberPool.delete(topic);
|
|
114
123
|
}
|
|
115
|
-
(_subscriber$_off = (_subscriber2 = _subscriber)._off) === null || _subscriber$_off === void 0 || _subscriber$_off.call(_subscriber2);
|
|
124
|
+
(_subscriber$_off = (_subscriber2 = _subscriber)._off) === null || _subscriber$_off === void 0 || _subscriber$_off.call(_subscriber2, _id);
|
|
116
125
|
_subscriber = null;
|
|
117
126
|
}
|
|
118
127
|
});
|
|
@@ -121,6 +130,7 @@ var _default = exports.default = function _default(_ref) {
|
|
|
121
130
|
value: {
|
|
122
131
|
runtime: runtime,
|
|
123
132
|
$publisher: $publisher,
|
|
133
|
+
$publisherOnce: $publisherOnce,
|
|
124
134
|
$subscriber: $subscriber,
|
|
125
135
|
$unsubscriber: $unsubscriber
|
|
126
136
|
}
|