@luck-design-biz/luckda 0.0.25-18 → 0.0.25-19
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/LdGrid/index.js +6 -9
- package/es/locales/zh-CN.js +5 -1
- package/es/lowcode/constants/event-topics.js +1 -1
- package/es/lowcode/engine/launcher.js +2 -0
- package/es/lowcode/engine/meta/form.props.json +0 -6
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +5 -17
- package/es/lowcode/engine/meta/page.props.json +6 -0
- package/es/lowcode/engine/meta/table.props.json +10 -4
- package/es/lowcode/engine/meta/tree.props.default.json +6 -6
- package/es/lowcode/engine/meta/tree.props.json +57 -63
- package/es/lowcode/engine/provider/ContextProvider/index.js +30 -33
- package/es/lowcode/engine/provider/ContextProvider/usePageState.js +21 -0
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +8 -13
- package/es/lowcode/engine/tools/diff.js +1 -1
- package/es/lowcode/engine/tools/helper.js +24 -12
- package/es/lowcode/engine/tools/useCombinedRefs.js +14 -0
- package/es/lowcode/painter/DesignToolbar.js +52 -23
- package/es/lowcode/painter/components/PreviewIframe.js +1 -1
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
- package/es/lowcode/painter/style/design.less +1 -0
- package/es/lowcode/preview/index.js +2 -4
- package/es/lowcode/view/Canvas.js +15 -2
- package/es/lowcode/view/lc-components/Form/index.js +38 -61
- package/es/lowcode/view/lc-components/Form/meta.json +0 -6
- package/es/lowcode/view/lc-components/Page/meta.json +6 -0
- package/es/lowcode/view/lc-components/PageLayout/index.js +2 -2
- package/es/lowcode/view/lc-components/Table/components/TopImex.js +2 -2
- package/es/lowcode/view/lc-components/Table/index.js +181 -195
- package/es/lowcode/view/lc-components/Table/meta.json +10 -4
- package/es/lowcode/view/lc-components/Tree/index.js +0 -20
- package/es/lowcode/view/lc-components/Tree/meta.json +57 -63
- package/lib/components/LdGrid/index.js +6 -9
- package/lib/locales/zh-CN.js +5 -1
- package/lib/lowcode/constants/event-topics.js +2 -2
- package/lib/lowcode/engine/launcher.js +2 -0
- package/lib/lowcode/engine/meta/form.props.json +0 -6
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +5 -17
- package/lib/lowcode/engine/meta/page.props.json +6 -0
- package/lib/lowcode/engine/meta/table.props.json +10 -4
- package/lib/lowcode/engine/meta/tree.props.default.json +6 -6
- package/lib/lowcode/engine/meta/tree.props.json +57 -63
- package/lib/lowcode/engine/provider/ContextProvider/index.js +29 -32
- package/lib/lowcode/engine/provider/ContextProvider/usePageState.js +28 -0
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +8 -13
- package/lib/lowcode/engine/tools/diff.js +1 -1
- package/lib/lowcode/engine/tools/helper.js +26 -12
- package/lib/lowcode/engine/tools/useCombinedRefs.js +20 -0
- package/lib/lowcode/painter/DesignToolbar.js +51 -22
- package/lib/lowcode/painter/components/PreviewIframe.js +1 -1
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
- package/lib/lowcode/painter/style/design.less +1 -0
- package/lib/lowcode/preview/index.js +2 -4
- package/lib/lowcode/view/Canvas.js +15 -2
- package/lib/lowcode/view/lc-components/Form/index.js +38 -61
- package/lib/lowcode/view/lc-components/Form/meta.json +0 -6
- package/lib/lowcode/view/lc-components/Page/meta.json +6 -0
- package/lib/lowcode/view/lc-components/PageLayout/index.js +2 -2
- package/lib/lowcode/view/lc-components/Table/components/TopImex.js +2 -2
- package/lib/lowcode/view/lc-components/Table/index.js +178 -192
- package/lib/lowcode/view/lc-components/Table/meta.json +10 -4
- package/lib/lowcode/view/lc-components/Tree/index.js +0 -20
- package/lib/lowcode/view/lc-components/Tree/meta.json +57 -63
- package/package.json +1 -1
|
@@ -64,6 +64,63 @@
|
|
|
64
64
|
"type": "string",
|
|
65
65
|
"default": "iparentid"
|
|
66
66
|
},
|
|
67
|
+
{
|
|
68
|
+
"key": "actions",
|
|
69
|
+
"name": "操作项",
|
|
70
|
+
"desc": "树节点操作项",
|
|
71
|
+
"type": "group",
|
|
72
|
+
"default": true,
|
|
73
|
+
"next": {
|
|
74
|
+
"name": "操作项",
|
|
75
|
+
"props": [
|
|
76
|
+
{
|
|
77
|
+
"key": "rootAdd",
|
|
78
|
+
"name": "根节点",
|
|
79
|
+
"desc": "根节点操作项",
|
|
80
|
+
"type": "group",
|
|
81
|
+
"props": [
|
|
82
|
+
{
|
|
83
|
+
"key": "showRootAdd",
|
|
84
|
+
"name": "是否显示",
|
|
85
|
+
"desc": "是否显示",
|
|
86
|
+
"type": "switch",
|
|
87
|
+
"default": true
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"key": "onlyRoot",
|
|
91
|
+
"name": "根节点唯一",
|
|
92
|
+
"desc": "树组件仅一个根节点,如数据根节点数大于0,则不允许根节点新增",
|
|
93
|
+
"type": "switch",
|
|
94
|
+
"default": false
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"key": "rootAddSetting",
|
|
98
|
+
"name": "根节点配置",
|
|
99
|
+
"desc": "根节点配置",
|
|
100
|
+
"type": "_TreeRootEditor",
|
|
101
|
+
"default": {}
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"key": "actions",
|
|
107
|
+
"name": "节点操作项",
|
|
108
|
+
"type": "_ActionsEditor",
|
|
109
|
+
"default": {
|
|
110
|
+
"todoList": []
|
|
111
|
+
},
|
|
112
|
+
"defaultCode": "function onActionClick(data) {\n\n}",
|
|
113
|
+
"suppressDisplay": true,
|
|
114
|
+
"suppressMax": true,
|
|
115
|
+
"suppressMore": true,
|
|
116
|
+
"wrapper": "collapse",
|
|
117
|
+
"wrapperProps": {
|
|
118
|
+
"suppressIcon": true
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
},
|
|
67
124
|
{
|
|
68
125
|
"key": "styleSetting",
|
|
69
126
|
"name": "风格和样式",
|
|
@@ -182,63 +239,6 @@
|
|
|
182
239
|
]
|
|
183
240
|
}
|
|
184
241
|
},
|
|
185
|
-
{
|
|
186
|
-
"key": "actions",
|
|
187
|
-
"name": "操作项",
|
|
188
|
-
"desc": "树节点操作项",
|
|
189
|
-
"type": "group",
|
|
190
|
-
"default": true,
|
|
191
|
-
"next": {
|
|
192
|
-
"name": "操作项",
|
|
193
|
-
"props": [
|
|
194
|
-
{
|
|
195
|
-
"key": "rootAdd",
|
|
196
|
-
"name": "根节点",
|
|
197
|
-
"desc": "根节点操作项",
|
|
198
|
-
"type": "group",
|
|
199
|
-
"props": [
|
|
200
|
-
{
|
|
201
|
-
"key": "showRootAdd",
|
|
202
|
-
"name": "是否显示",
|
|
203
|
-
"desc": "是否显示",
|
|
204
|
-
"type": "switch",
|
|
205
|
-
"default": true
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
"key": "onlyRoot",
|
|
209
|
-
"name": "根节点唯一",
|
|
210
|
-
"desc": "树组件仅一个根节点,如数据根节点数大于0,则不允许根节点新增",
|
|
211
|
-
"type": "switch",
|
|
212
|
-
"default": false
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
"key": "rootAddSetting",
|
|
216
|
-
"name": "根节点配置",
|
|
217
|
-
"desc": "根节点配置",
|
|
218
|
-
"type": "_TreeRootEditor",
|
|
219
|
-
"default": {}
|
|
220
|
-
}
|
|
221
|
-
]
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
"key": "actions",
|
|
225
|
-
"name": "节点操作项",
|
|
226
|
-
"type": "_ActionsEditor",
|
|
227
|
-
"default": {
|
|
228
|
-
"todoList": []
|
|
229
|
-
},
|
|
230
|
-
"defaultCode": "function onActionClick(data) {\n\n}",
|
|
231
|
-
"suppressDisplay": true,
|
|
232
|
-
"suppressMax": true,
|
|
233
|
-
"suppressMore": true,
|
|
234
|
-
"wrapper": "collapse",
|
|
235
|
-
"wrapperProps": {
|
|
236
|
-
"suppressIcon": true
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
]
|
|
240
|
-
}
|
|
241
|
-
},
|
|
242
242
|
{
|
|
243
243
|
"key": "rowSelectionSetting",
|
|
244
244
|
"name": "节点控制器",
|
|
@@ -351,12 +351,6 @@
|
|
|
351
351
|
"name": "拖拽事件",
|
|
352
352
|
"desc": "节点拖拽事件",
|
|
353
353
|
"func": "function onDrop(info, dragInfo) {\n\t\n}"
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
"key": "onPagePublicResourceChanged",
|
|
357
|
-
"name": "页面共享资源变化后",
|
|
358
|
-
"desc": "当页面共享资源发生变化后(pagePublicResourceChanged),执行方法",
|
|
359
|
-
"func": "function onPagePublicResourceChanged(resource, prevResource, instance) {\n\t\n}"
|
|
360
354
|
}
|
|
361
355
|
]
|
|
362
356
|
}
|
|
@@ -20,7 +20,7 @@ var _List = require("@luck-design-biz/base/List");
|
|
|
20
20
|
var _ldBuilder = _interopRequireDefault(require("../../helper/ldBuilder"));
|
|
21
21
|
var _utils = require("../../utils");
|
|
22
22
|
var _model = _interopRequireDefault(require("./model"));
|
|
23
|
-
var _excluded = ["columns", "resources", "actions", "doAction", "afterInit", "namespace", "wrapperRef", "list", "detail", "params", "filters", "_loading", "loading", "unclosableSet", "onQuery", "doQuery", "pagination", "pageno", "pagesize", "totalCount", "columnsRewrite", "columnsReset", "batchOperations", "formatDataSource", "resultSet", "actionsColumn", "readFilter", "isFlow", "isTreeGrid", "writable"
|
|
23
|
+
var _excluded = ["columns", "resources", "actions", "doAction", "afterInit", "namespace", "wrapperRef", "list", "detail", "params", "filters", "_loading", "loading", "unclosableSet", "onQuery", "doQuery", "pagination", "pageno", "pagesize", "totalCount", "columnsRewrite", "columnsReset", "batchOperations", "formatDataSource", "resultSet", "actionsColumn", "readFilter", "isFlow", "isTreeGrid", "writable"],
|
|
24
24
|
_excluded2 = ["ldId", "moduleCode", "suppressInit", "overModel", "afterQuery", "isTreeGrid"];
|
|
25
25
|
var LdGrid = function LdGrid(_ref) {
|
|
26
26
|
var columns = _ref.columns,
|
|
@@ -53,8 +53,6 @@ var LdGrid = function LdGrid(_ref) {
|
|
|
53
53
|
isFlow = _ref.isFlow,
|
|
54
54
|
isTreeGrid = _ref.isTreeGrid,
|
|
55
55
|
writable = _ref.writable,
|
|
56
|
-
_ref$autoRowClick = _ref.autoRowClick,
|
|
57
|
-
autoRowClick = _ref$autoRowClick === void 0 ? false : _ref$autoRowClick,
|
|
58
56
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
59
57
|
var gridRef = (0, _react.useRef)(null);
|
|
60
58
|
var treeConfig = (0, _ahooks.useCreation)(function () {
|
|
@@ -75,17 +73,16 @@ var LdGrid = function LdGrid(_ref) {
|
|
|
75
73
|
(0, _react.useEffect)(function () {
|
|
76
74
|
readFilter && readFilter(params, filters);
|
|
77
75
|
}, [params, filters]);
|
|
78
|
-
(0, _react.useEffect)(function () {
|
|
79
|
-
if (autoRowClick) {
|
|
80
|
-
if (list[0]) props.onRowClick && props.onRowClick(detail[list[0]], 0);else props.onRowClick && props.onRowClick(null);
|
|
81
|
-
}
|
|
82
|
-
}, [list[0]]);
|
|
83
76
|
(0, _react.useImperativeHandle)(wrapperRef, function () {
|
|
84
77
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, gridRef.current), {}, {
|
|
85
78
|
getProps: function getProps() {
|
|
86
79
|
var _getDvaApp;
|
|
87
80
|
return {
|
|
88
|
-
apiUrl: (_getDvaApp = (0, _umi.getDvaApp)()) === null || _getDvaApp === void 0 || (_getDvaApp = _getDvaApp._store.getState()[namespace]) === null || _getDvaApp === void 0 ? void 0 : _getDvaApp.apiUrl
|
|
81
|
+
apiUrl: (_getDvaApp = (0, _umi.getDvaApp)()) === null || _getDvaApp === void 0 || (_getDvaApp = _getDvaApp._store.getState()[namespace]) === null || _getDvaApp === void 0 ? void 0 : _getDvaApp.apiUrl,
|
|
82
|
+
filter: {
|
|
83
|
+
filters: filters,
|
|
84
|
+
params: params
|
|
85
|
+
}
|
|
89
86
|
};
|
|
90
87
|
},
|
|
91
88
|
onLdQuery: function onLdQuery() {
|
package/lib/locales/zh-CN.js
CHANGED
|
@@ -19,6 +19,9 @@ var _default = exports.default = {
|
|
|
19
19
|
"luckda.lowcode.modal": "模态视图层",
|
|
20
20
|
"luckda.lowcode.painter.I18n.search": "搜索文案",
|
|
21
21
|
"luckda.lowcode.painter.I18n.add": "新增文案",
|
|
22
|
+
"luckda.lowcode.design.toolbar.save.on": "保存中...",
|
|
23
|
+
"luckda.lowcode.design.toolbar.save.success": "保存成功",
|
|
24
|
+
"luckda.lowcode.design.toolbar.save.error": "保存失败",
|
|
22
25
|
"luckda.lowcode.design.toolbar.clear.tip": "清除提示",
|
|
23
26
|
"luckda.lowcode.design.toolbar.clear": "清除缓存",
|
|
24
27
|
"luckda.lowcode.error.pagedata": "页面数据错误",
|
|
@@ -96,7 +99,8 @@ var _default = exports.default = {
|
|
|
96
99
|
"luckda.lowcode.painter.panel-section.style-panel.margin.down": "下间距",
|
|
97
100
|
"luckda.lowcode.painter.panel-section.style-panel.margin.left": "左间距",
|
|
98
101
|
"luckda.lowcode.painter.panel-section.style-panel.group-name": "样式设置",
|
|
99
|
-
"luckda.lowcode.painter.panel-section.style-panel.width": "
|
|
102
|
+
"luckda.lowcode.painter.panel-section.style-panel.width": "请输入宽度",
|
|
103
|
+
"luckda.lowcode.painter.panel-section.style-panel.height": "请输入宽高度",
|
|
100
104
|
"luckda.lowcode.painter.panel-section.style-panel.display": "显示",
|
|
101
105
|
"luckda.lowcode.painter.panel-section.style-panel.margin.superbig": "超大(24px)",
|
|
102
106
|
"luckda.lowcode.painter.panel-section.style-panel.margin.big": "大(20px)",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.PAGE_STATE_CHANGED = exports.PAGE_LOAD_MOUNT = exports.LANG_SETTING_SELECT = 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';
|
|
@@ -12,7 +12,7 @@ var COMPONENT_MOUNT = exports.COMPONENT_MOUNT = 'component-mount';
|
|
|
12
12
|
// 组件的卸载事件
|
|
13
13
|
var COMPONENT_UNMOUNT = exports.COMPONENT_UNMOUNT = 'component-unmount';
|
|
14
14
|
// 页面公共资源变化事件
|
|
15
|
-
var
|
|
15
|
+
var PAGE_STATE_CHANGED = exports.PAGE_STATE_CHANGED = 'page-state-changed';
|
|
16
16
|
|
|
17
17
|
/******************************** 通用Topic结束 ********************************/
|
|
18
18
|
|
|
@@ -8,4 +8,6 @@ var _helper = require("./tools/helper");
|
|
|
8
8
|
function launcher() {
|
|
9
9
|
console.log('%c LuckdaLowCodeEngine %c v'.concat(BIZ_VERSION, ' '), 'padding: 2px 1px; border-radius: 3px 0 0 3px; color: #fff; background: #606060; font-weight: bold;', 'padding: 2px 1px; border-radius: 0 3px 3px 0; color: #fff; background: #42c02e; font-weight: bold;');
|
|
10
10
|
window.loadScript = _helper.loadScript;
|
|
11
|
+
window.PRIMARY_KEY = window.appConfig.constraintKeys.PRIMARY;
|
|
12
|
+
window.PARENT_KEY = window.appConfig.constraintKeys.PARENT;
|
|
11
13
|
}
|
|
@@ -663,12 +663,6 @@
|
|
|
663
663
|
"name": "表单内容发生改变时的回调",
|
|
664
664
|
"desc": "表单内容发生改变时的回调",
|
|
665
665
|
"func": "function onChildChange(instance) {\n\t\n}"
|
|
666
|
-
},
|
|
667
|
-
{
|
|
668
|
-
"key": "onPagePublicResourceChanged",
|
|
669
|
-
"name": "页面共享资源变化后",
|
|
670
|
-
"desc": "当页面共享资源发生变化后(pagePublicResourceChanged),执行方法",
|
|
671
|
-
"func": "function onPagePublicResourceChanged(resource, prevResource, instance) {\n\t\n}"
|
|
672
666
|
}
|
|
673
667
|
]
|
|
674
668
|
}
|
|
@@ -82,13 +82,13 @@
|
|
|
82
82
|
"label": "getInstance",
|
|
83
83
|
"kind": "method",
|
|
84
84
|
"insertText": "getInstance",
|
|
85
|
-
"documentation": " /**\n * 获取表格实例\n * @method\n
|
|
85
|
+
"documentation": " /**\r\n * 获取表格实例\r\n * @method\r\n */\r"
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
"label": "submit",
|
|
89
89
|
"kind": "method",
|
|
90
90
|
"insertText": "submit",
|
|
91
|
-
"documentation": " /**\n * 提交表格数据\n * @method\n
|
|
91
|
+
"documentation": " /**\r\n * 提交表格数据\r\n * @method\r\n */\r"
|
|
92
92
|
}
|
|
93
93
|
]
|
|
94
94
|
},
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
"label": "getInstance",
|
|
166
166
|
"kind": "method",
|
|
167
167
|
"insertText": "getInstance",
|
|
168
|
-
"documentation": " /**\n * 获取表格实例\n * @method\n
|
|
168
|
+
"documentation": " /**\r\n * 获取表格实例\r\n * @method\r\n */\r"
|
|
169
169
|
}
|
|
170
170
|
]
|
|
171
171
|
},
|
|
@@ -188,18 +188,6 @@
|
|
|
188
188
|
"name": "ContextProvider",
|
|
189
189
|
"triggerWord": "ctx",
|
|
190
190
|
"completions": [
|
|
191
|
-
{
|
|
192
|
-
"label": "pagePublicResource",
|
|
193
|
-
"kind": "property",
|
|
194
|
-
"insertText": "pagePublicResource",
|
|
195
|
-
"documentation": " /**\r\n * @property {object} pagePublicResource - 页面公共资源\r\n */\r"
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
"label": "setPagePublicResource",
|
|
199
|
-
"kind": "method",
|
|
200
|
-
"insertText": "setPagePublicResource(key, value)",
|
|
201
|
-
"documentation": " /**\r\n * @method - 设置页面公共资源\r\n * @param {string} key - 页面公共资源键\r\n * @param {any} value - 页面公共资源值\r\n */\r"
|
|
202
|
-
},
|
|
203
191
|
{
|
|
204
192
|
"label": "loading",
|
|
205
193
|
"kind": "property",
|
|
@@ -216,7 +204,7 @@
|
|
|
216
204
|
"label": "callBehavior",
|
|
217
205
|
"kind": "method",
|
|
218
206
|
"insertText": "callBehavior(evns, params, data)",
|
|
219
|
-
"documentation": "
|
|
207
|
+
"documentation": " /**\r\n * @method - 执行行为接口\r\n * @param {object} evns - moduleCode: 模块编码,datasetCode:数据集编码,behaviorKey:行为key\r\n * @param {object} params - 链接参数\r\n * @param {object} data - body参数\r\n */\r"
|
|
220
208
|
},
|
|
221
209
|
{
|
|
222
210
|
"label": "topics",
|
|
@@ -234,7 +222,7 @@
|
|
|
234
222
|
"label": "getElementById",
|
|
235
223
|
"kind": "method",
|
|
236
224
|
"insertText": "getElementById(compId)",
|
|
237
|
-
"documentation": "
|
|
225
|
+
"documentation": " /**\r\n * @method - 根据组件ID获取实例\r\n * @param {string} compId - 组件ID\r\n * @return {object} target - 组件实例\r\n */\r"
|
|
238
226
|
},
|
|
239
227
|
{
|
|
240
228
|
"label": "getParentElement",
|
|
@@ -32,6 +32,12 @@
|
|
|
32
32
|
"css": "background-color: transparent;",
|
|
33
33
|
"advance": {
|
|
34
34
|
"events": [
|
|
35
|
+
{
|
|
36
|
+
"key": "onStateChanged",
|
|
37
|
+
"name": "页面状态变化",
|
|
38
|
+
"desc": "在页面状态发生变化时,执行方法",
|
|
39
|
+
"func": "function onStateChanged(state, prevState, diff){\n\t\n}"
|
|
40
|
+
},
|
|
35
41
|
{
|
|
36
42
|
"key": "onPageMount",
|
|
37
43
|
"name": "页面首次渲染完成",
|
|
@@ -423,10 +423,16 @@
|
|
|
423
423
|
"func": "function onRowDragged(toId, fromId, params) {\n\t\n}"
|
|
424
424
|
},
|
|
425
425
|
{
|
|
426
|
-
"key": "
|
|
427
|
-
"name": "
|
|
428
|
-
"desc": "
|
|
429
|
-
"func": "function
|
|
426
|
+
"key": "onExpectRowChanged",
|
|
427
|
+
"name": "期望行变化后",
|
|
428
|
+
"desc": "表格的期望行发生变化后,执行方法",
|
|
429
|
+
"func": "function onExpectRowChanged(data) {\n\t\n}"
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
"key": "onFilterChanged",
|
|
433
|
+
"name": "表格过滤条件变化后",
|
|
434
|
+
"desc": "表格过滤条件变化后,执行方法",
|
|
435
|
+
"func": "function onFilterChanged(params, filters) {\n\t\n}"
|
|
430
436
|
},
|
|
431
437
|
{
|
|
432
438
|
"key": "afterInit",
|
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
"draggable": true,
|
|
11
11
|
"asyncLoad": false,
|
|
12
12
|
"parentKey": "iparentid",
|
|
13
|
+
"showRootAdd": true,
|
|
14
|
+
"onlyRoot": false,
|
|
15
|
+
"rootAddSetting": {},
|
|
16
|
+
"actions": {
|
|
17
|
+
"todoList": []
|
|
18
|
+
},
|
|
13
19
|
"width": "100%",
|
|
14
20
|
"height": "100%",
|
|
15
21
|
"showLine": false,
|
|
@@ -18,12 +24,6 @@
|
|
|
18
24
|
"cancelSelect": true,
|
|
19
25
|
"showIcon": true,
|
|
20
26
|
"treeNodeIcon": [],
|
|
21
|
-
"showRootAdd": true,
|
|
22
|
-
"onlyRoot": false,
|
|
23
|
-
"rootAddSetting": {},
|
|
24
|
-
"actions": {
|
|
25
|
-
"todoList": []
|
|
26
|
-
},
|
|
27
27
|
"doubleClickExpand": true,
|
|
28
28
|
"checkable": false,
|
|
29
29
|
"advance": {
|
|
@@ -64,6 +64,63 @@
|
|
|
64
64
|
"type": "string",
|
|
65
65
|
"default": "iparentid"
|
|
66
66
|
},
|
|
67
|
+
{
|
|
68
|
+
"key": "actions",
|
|
69
|
+
"name": "操作项",
|
|
70
|
+
"desc": "树节点操作项",
|
|
71
|
+
"type": "group",
|
|
72
|
+
"default": true,
|
|
73
|
+
"next": {
|
|
74
|
+
"name": "操作项",
|
|
75
|
+
"props": [
|
|
76
|
+
{
|
|
77
|
+
"key": "rootAdd",
|
|
78
|
+
"name": "根节点",
|
|
79
|
+
"desc": "根节点操作项",
|
|
80
|
+
"type": "group",
|
|
81
|
+
"props": [
|
|
82
|
+
{
|
|
83
|
+
"key": "showRootAdd",
|
|
84
|
+
"name": "是否显示",
|
|
85
|
+
"desc": "是否显示",
|
|
86
|
+
"type": "switch",
|
|
87
|
+
"default": true
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"key": "onlyRoot",
|
|
91
|
+
"name": "根节点唯一",
|
|
92
|
+
"desc": "树组件仅一个根节点,如数据根节点数大于0,则不允许根节点新增",
|
|
93
|
+
"type": "switch",
|
|
94
|
+
"default": false
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"key": "rootAddSetting",
|
|
98
|
+
"name": "根节点配置",
|
|
99
|
+
"desc": "根节点配置",
|
|
100
|
+
"type": "_TreeRootEditor",
|
|
101
|
+
"default": {}
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"key": "actions",
|
|
107
|
+
"name": "节点操作项",
|
|
108
|
+
"type": "_ActionsEditor",
|
|
109
|
+
"default": {
|
|
110
|
+
"todoList": []
|
|
111
|
+
},
|
|
112
|
+
"defaultCode": "function onActionClick(data) {\n\n}",
|
|
113
|
+
"suppressDisplay": true,
|
|
114
|
+
"suppressMax": true,
|
|
115
|
+
"suppressMore": true,
|
|
116
|
+
"wrapper": "collapse",
|
|
117
|
+
"wrapperProps": {
|
|
118
|
+
"suppressIcon": true
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
},
|
|
67
124
|
{
|
|
68
125
|
"key": "styleSetting",
|
|
69
126
|
"name": "风格和样式",
|
|
@@ -185,63 +242,6 @@
|
|
|
185
242
|
]
|
|
186
243
|
}
|
|
187
244
|
},
|
|
188
|
-
{
|
|
189
|
-
"key": "actions",
|
|
190
|
-
"name": "操作项",
|
|
191
|
-
"desc": "树节点操作项",
|
|
192
|
-
"type": "group",
|
|
193
|
-
"default": true,
|
|
194
|
-
"next": {
|
|
195
|
-
"name": "操作项",
|
|
196
|
-
"props": [
|
|
197
|
-
{
|
|
198
|
-
"key": "rootAdd",
|
|
199
|
-
"name": "根节点",
|
|
200
|
-
"desc": "根节点操作项",
|
|
201
|
-
"type": "group",
|
|
202
|
-
"props": [
|
|
203
|
-
{
|
|
204
|
-
"key": "showRootAdd",
|
|
205
|
-
"name": "是否显示",
|
|
206
|
-
"desc": "是否显示",
|
|
207
|
-
"type": "switch",
|
|
208
|
-
"default": true
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
"key": "onlyRoot",
|
|
212
|
-
"name": "根节点唯一",
|
|
213
|
-
"desc": "树组件仅一个根节点,如数据根节点数大于0,则不允许根节点新增",
|
|
214
|
-
"type": "switch",
|
|
215
|
-
"default": false
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
"key": "rootAddSetting",
|
|
219
|
-
"name": "根节点配置",
|
|
220
|
-
"desc": "根节点配置",
|
|
221
|
-
"type": "_TreeRootEditor",
|
|
222
|
-
"default": {}
|
|
223
|
-
}
|
|
224
|
-
]
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
"key": "actions",
|
|
228
|
-
"name": "节点操作项",
|
|
229
|
-
"type": "_ActionsEditor",
|
|
230
|
-
"default": {
|
|
231
|
-
"todoList": []
|
|
232
|
-
},
|
|
233
|
-
"defaultCode": "function onActionClick(data) {\n\n}",
|
|
234
|
-
"suppressDisplay": true,
|
|
235
|
-
"suppressMax": true,
|
|
236
|
-
"suppressMore": true,
|
|
237
|
-
"wrapper": "collapse",
|
|
238
|
-
"wrapperProps": {
|
|
239
|
-
"suppressIcon": true
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
]
|
|
243
|
-
}
|
|
244
|
-
},
|
|
245
245
|
{
|
|
246
246
|
"key": "rowSelectionSetting",
|
|
247
247
|
"name": "节点控制器",
|
|
@@ -354,12 +354,6 @@
|
|
|
354
354
|
"name": "拖拽事件",
|
|
355
355
|
"desc": "节点拖拽事件",
|
|
356
356
|
"func": "function onDrop(info, dragInfo) {\n\t\n}"
|
|
357
|
-
},
|
|
358
|
-
{
|
|
359
|
-
"key": "onPagePublicResourceChanged",
|
|
360
|
-
"name": "页面共享资源变化后",
|
|
361
|
-
"desc": "当页面共享资源发生变化后(pagePublicResourceChanged),执行方法",
|
|
362
|
-
"func": "function onPagePublicResourceChanged(resource, prevResource, instance) {\n\t\n}"
|
|
363
357
|
}
|
|
364
358
|
]
|
|
365
359
|
}
|
|
@@ -16,8 +16,10 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
16
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
17
|
var _umi = require("umi");
|
|
18
18
|
var _ahooks = require("ahooks");
|
|
19
|
+
var _diff2 = _interopRequireDefault(require("../../tools/diff"));
|
|
19
20
|
var _EventBusProvider = require("../EventBusProvider");
|
|
20
21
|
var _RemoteSourceProvider = _interopRequireWildcard(require("../RemoteSourceProvider"));
|
|
22
|
+
var _usePageState2 = _interopRequireDefault(require("./usePageState"));
|
|
21
23
|
var _useTodo3 = _interopRequireDefault(require("../../tools/useTodo"));
|
|
22
24
|
var topics = _interopRequireWildcard(require("../../../constants/event-topics"));
|
|
23
25
|
var _usePageDataStore = require("../../tools/usePageDataStore");
|
|
@@ -42,8 +44,7 @@ var useRemoteSource = exports.useRemoteSource = function useRemoteSource() {
|
|
|
42
44
|
var PRIVATE_KEYS = ['componentList', 'componentMap'];
|
|
43
45
|
var _default = exports.default = function _default(_ref) {
|
|
44
46
|
var children = _ref.children,
|
|
45
|
-
code = _ref.code
|
|
46
|
-
debug = _ref.debug;
|
|
47
|
+
code = _ref.code;
|
|
47
48
|
var eventBus = (0, _EventBusProvider.useLDEventBus)();
|
|
48
49
|
var _useTodo = (0, _useTodo3.default)(),
|
|
49
50
|
_useTodo2 = (0, _slicedToArray2.default)(_useTodo, 3),
|
|
@@ -54,11 +55,11 @@ var _default = exports.default = function _default(_ref) {
|
|
|
54
55
|
/**
|
|
55
56
|
* 页面公共资源
|
|
56
57
|
*/
|
|
57
|
-
var
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
var _usePageState = (0, _usePageState2.default)(null),
|
|
59
|
+
state = _usePageState.state,
|
|
60
|
+
prevState = _usePageState.prevState,
|
|
61
|
+
setState = _usePageState.setState,
|
|
62
|
+
getState = _usePageState.getState;
|
|
62
63
|
|
|
63
64
|
/**
|
|
64
65
|
* 组件列表
|
|
@@ -129,24 +130,16 @@ var _default = exports.default = function _default(_ref) {
|
|
|
129
130
|
return _umi.history.location.query;
|
|
130
131
|
});
|
|
131
132
|
(0, _ahooks.useUpdateEffect)(function () {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
var _diff = (0, _diff2.default)(prevState, state);
|
|
134
|
+
eventBus.$publisher(topics.PAGE_STATE_CHANGED, {
|
|
135
|
+
state: state,
|
|
136
|
+
prevState: prevState,
|
|
137
|
+
diff: _diff
|
|
135
138
|
});
|
|
136
|
-
}, [
|
|
139
|
+
}, [state, prevState]);
|
|
137
140
|
var ctx = new Proxy((0, _objectSpread2.default)({
|
|
138
141
|
_register: _register,
|
|
139
142
|
_unregister: _unregister,
|
|
140
|
-
/**
|
|
141
|
-
* @property {object} pagePublicResource - 页面公共资源
|
|
142
|
-
*/
|
|
143
|
-
pagePublicResource: pagePublicResource,
|
|
144
|
-
/**
|
|
145
|
-
* @method - 设置页面公共资源
|
|
146
|
-
* @param {string} key - 页面公共资源键
|
|
147
|
-
* @param {any} value - 页面公共资源值
|
|
148
|
-
*/
|
|
149
|
-
setPagePublicResource: setPagePublicResource,
|
|
150
143
|
/**
|
|
151
144
|
* @property {boolean} loading - loading状态
|
|
152
145
|
*/
|
|
@@ -156,11 +149,11 @@ var _default = exports.default = function _default(_ref) {
|
|
|
156
149
|
*/
|
|
157
150
|
history: _umi.history,
|
|
158
151
|
/**
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
152
|
+
* @method - 执行行为接口
|
|
153
|
+
* @param {object} evns - moduleCode: 模块编码,datasetCode:数据集编码,behaviorKey:行为key
|
|
154
|
+
* @param {object} params - 链接参数
|
|
155
|
+
* @param {object} data - body参数
|
|
156
|
+
*/
|
|
164
157
|
callBehavior: callBehavior,
|
|
165
158
|
/**
|
|
166
159
|
* @property {object} topics - 内置的事件话题
|
|
@@ -172,10 +165,10 @@ var _default = exports.default = function _default(_ref) {
|
|
|
172
165
|
PRIMARY_KEY: window.appConfig.constraintKeys.PRIMARY,
|
|
173
166
|
PARENT_KEY: window.appConfig.constraintKeys.PARENT,
|
|
174
167
|
/**
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
168
|
+
* @method - 根据组件ID获取实例
|
|
169
|
+
* @param {string} compId - 组件ID
|
|
170
|
+
* @return {object} target - 组件实例
|
|
171
|
+
*/
|
|
179
172
|
getElementById: getElementById,
|
|
180
173
|
/**
|
|
181
174
|
* @method - 根据组件ID获取父组件实例
|
|
@@ -201,12 +194,17 @@ var _default = exports.default = function _default(_ref) {
|
|
|
201
194
|
if (PRIVATE_KEYS.includes(property)) {
|
|
202
195
|
var _privateGetter$curren;
|
|
203
196
|
return (_privateGetter$curren = _privateGetter.current) === null || _privateGetter$curren === void 0 ? void 0 : _privateGetter$curren[property]();
|
|
197
|
+
} else if (property === 'state') {
|
|
198
|
+
return getState();
|
|
204
199
|
}
|
|
205
200
|
return Reflect.get(target, property, receiver);
|
|
206
201
|
},
|
|
207
202
|
set: function set(target, property, receiver) {
|
|
208
203
|
if (PRIVATE_KEYS.includes(property)) {
|
|
209
204
|
throw new Error("\u5C5E\u6027 \"".concat(property, "\" \u662F\u53EA\u8BFB\u7684"));
|
|
205
|
+
} else if (property === 'state') {
|
|
206
|
+
setState(receiver);
|
|
207
|
+
return true;
|
|
210
208
|
} else {
|
|
211
209
|
return Reflect.set(target, property, receiver);
|
|
212
210
|
}
|
|
@@ -216,7 +214,6 @@ var _default = exports.default = function _default(_ref) {
|
|
|
216
214
|
value: ctx
|
|
217
215
|
}, /*#__PURE__*/_react.default.createElement(_RemoteSourceProvider.default, {
|
|
218
216
|
code: code,
|
|
219
|
-
eventBus: eventBus
|
|
220
|
-
debug: debug
|
|
217
|
+
eventBus: eventBus
|
|
221
218
|
}, children));
|
|
222
219
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
var _ahooks = require("ahooks");
|
|
11
|
+
var usePageState = function usePageState(defaultValue) {
|
|
12
|
+
var _useGetState = (0, _ahooks.useGetState)(defaultValue),
|
|
13
|
+
_useGetState2 = (0, _slicedToArray2.default)(_useGetState, 3),
|
|
14
|
+
state = _useGetState2[0],
|
|
15
|
+
setState = _useGetState2[1],
|
|
16
|
+
getState = _useGetState2[2];
|
|
17
|
+
var prevState = (0, _ahooks.usePrevious)(state);
|
|
18
|
+
var setPageState = (0, _ahooks.useMemoizedFn)(function (newState) {
|
|
19
|
+
setState((0, _objectSpread2.default)((0, _objectSpread2.default)({}, prevState), newState));
|
|
20
|
+
});
|
|
21
|
+
return {
|
|
22
|
+
state: state,
|
|
23
|
+
prevState: prevState,
|
|
24
|
+
setState: setPageState,
|
|
25
|
+
getState: getState
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
var _default = exports.default = usePageState;
|