@luck-design-biz/luckda 0.0.25-17 → 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 +42 -64
- 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 +42 -64
- 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
|
@@ -6,12 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
11
|
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
11
12
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
12
13
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
16
15
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
16
|
var _ahooks = require("ahooks");
|
|
@@ -24,6 +23,7 @@ var _index = require("../../../../index");
|
|
|
24
23
|
var _TopFilter = _interopRequireDefault(require("./components/TopFilter"));
|
|
25
24
|
var _TopImex = require("./components/TopImex");
|
|
26
25
|
var _helper = require("../../../engine/tools/helper");
|
|
26
|
+
var _useCombinedRefs = _interopRequireDefault(require("../../../engine/tools/useCombinedRefs"));
|
|
27
27
|
var _tablePropsDefault = _interopRequireDefault(require("../../../engine/meta/table.props.default.json"));
|
|
28
28
|
var _constants = require("../../../constants");
|
|
29
29
|
var _apiUrl2 = require("../../../constants/api-url");
|
|
@@ -66,31 +66,22 @@ var LCTable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
66
66
|
columnsReset = _ref.columnsReset,
|
|
67
67
|
modelParams = _ref.modelParams,
|
|
68
68
|
onGridReady = _ref.onGridReady,
|
|
69
|
-
advance = _ref.advance
|
|
70
|
-
_ref$autoRowClick = _ref.autoRowClick,
|
|
71
|
-
autoRowClick = _ref$autoRowClick === void 0 ? true : _ref$autoRowClick;
|
|
69
|
+
advance = _ref.advance;
|
|
72
70
|
var ctx = (0, _ContextProvider.useContext)();
|
|
73
71
|
var apiRef = (0, _react.useRef)();
|
|
74
72
|
var wrapperRef = (0, _react.useRef)();
|
|
75
|
-
var instanceRef = (0,
|
|
76
|
-
var _useSetState = (0, _ahooks.useSetState)({}),
|
|
77
|
-
_useSetState2 = (0, _slicedToArray2.default)(_useSetState, 2),
|
|
78
|
-
clickedRow = _useSetState2[0],
|
|
79
|
-
setClickedRow = _useSetState2[1];
|
|
73
|
+
var instanceRef = (0, _useCombinedRefs.default)(ref);
|
|
80
74
|
(0, _react.useImperativeHandle)(apiRef, function () {
|
|
81
75
|
return {
|
|
82
|
-
/**
|
|
83
|
-
* 获取表格实例
|
|
84
|
-
* @method
|
|
76
|
+
/**
|
|
77
|
+
* 获取表格实例
|
|
78
|
+
* @method
|
|
85
79
|
*/
|
|
86
80
|
getInstance: function getInstance() {
|
|
87
81
|
return instanceRef.current;
|
|
88
82
|
}
|
|
89
83
|
};
|
|
90
84
|
});
|
|
91
|
-
(0, _ahooks.useUpdateEffect)(function () {
|
|
92
|
-
ctx.setPagePublicResource((0, _defineProperty2.default)({}, id, clickedRow));
|
|
93
|
-
}, [clickedRow]);
|
|
94
85
|
var _pagination = (0, _ahooks.useCreation)(function () {
|
|
95
86
|
return {
|
|
96
87
|
isFlow: !pagination,
|
|
@@ -230,7 +221,7 @@ var LCTable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
230
221
|
var _onExportAll = (0, _ahooks.useMemoizedFn)(function (procress) {
|
|
231
222
|
return new Promise( /*#__PURE__*/function () {
|
|
232
223
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(resolve, reject) {
|
|
233
|
-
var isBehavior, behaviorKey, strategy, _exportExcelParams, _exportExcelPrefix, exportExcelResponse,
|
|
224
|
+
var isBehavior, behaviorKey, strategy, _exportExcelParams, _exportExcelPrefix, exportExcelResponse, _instanceRef$current, _instanceRef$current2, _instanceRef$current$, apiUrl, _strategy, joiner, labels, fieldInfo, defaultExcelParams, _exportExcelParams2, _exportExcelPrefix2, _exportExcelResponse;
|
|
234
225
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
235
226
|
while (1) switch (_context.prev = _context.next) {
|
|
236
227
|
case 0:
|
|
@@ -265,12 +256,12 @@ var LCTable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
265
256
|
_context.next = 25;
|
|
266
257
|
break;
|
|
267
258
|
case 12:
|
|
268
|
-
|
|
259
|
+
_instanceRef$current$ = (_instanceRef$current = instanceRef.current) === null || _instanceRef$current === void 0 ? void 0 : _instanceRef$current.getProps(), apiUrl = _instanceRef$current$.apiUrl;
|
|
269
260
|
_strategy = 'report_server';
|
|
270
261
|
joiner = apiUrl.indexOf('?') !== -1 ? '&' : '?';
|
|
271
262
|
labels = [];
|
|
272
263
|
fieldInfo = [];
|
|
273
|
-
(
|
|
264
|
+
(_instanceRef$current2 = instanceRef.current) === null || _instanceRef$current2 === void 0 || (_instanceRef$current2 = _instanceRef$current2.gridApi) === null || _instanceRef$current2 === void 0 || _instanceRef$current2.columnApi.getAllDisplayedColumns().forEach(function (column) {
|
|
274
265
|
if (column.colId !== 'luck-expand' && column.colId !== 'luck-select' && column.colId !== 'luck-index' && column.colId !== 'luck-actions' && column.colId !== 'fraction_drag'
|
|
275
266
|
// && !column.colDef.draggable
|
|
276
267
|
) {
|
|
@@ -324,8 +315,8 @@ var LCTable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
324
315
|
enableExportAll: !!impexp.export
|
|
325
316
|
};
|
|
326
317
|
if (!!impexp.export) {
|
|
327
|
-
var
|
|
328
|
-
var _tableProps = (
|
|
318
|
+
var _instanceRef$current3;
|
|
319
|
+
var _tableProps = (_instanceRef$current3 = instanceRef.current) === null || _instanceRef$current3 === void 0 ? void 0 : _instanceRef$current3.getProps();
|
|
329
320
|
_temp.apiUrl = _tableProps === null || _tableProps === void 0 ? void 0 : _tableProps.apiUrl;
|
|
330
321
|
_temp.onExportAll = _onExportAll;
|
|
331
322
|
}
|
|
@@ -392,31 +383,32 @@ var LCTable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
392
383
|
resultComp.push( /*#__PURE__*/_react.default.createElement(_index.LDActions, (0, _extends2.default)({}, topActionGroup, {
|
|
393
384
|
doAction: function doAction(action) {
|
|
394
385
|
return ctx.doAction(action, {
|
|
386
|
+
instance: instanceRef.current,
|
|
395
387
|
datasetCode: dataset.code
|
|
396
388
|
});
|
|
397
389
|
}
|
|
398
390
|
})));
|
|
399
391
|
}
|
|
400
392
|
if (impexp.import) {
|
|
401
|
-
var
|
|
402
|
-
var
|
|
403
|
-
apiUrl =
|
|
393
|
+
var _instanceRef$current4;
|
|
394
|
+
var _instanceRef$current$2 = (_instanceRef$current4 = instanceRef.current) === null || _instanceRef$current4 === void 0 ? void 0 : _instanceRef$current4.getProps(),
|
|
395
|
+
apiUrl = _instanceRef$current$2.apiUrl;
|
|
404
396
|
resultComp.push( /*#__PURE__*/_react.default.createElement(_TopImex.TopUpload, {
|
|
405
397
|
apiUrl: apiUrl,
|
|
406
398
|
moduleCode: moduleCode,
|
|
407
399
|
options: impexp,
|
|
408
|
-
tableRef: instanceRef
|
|
400
|
+
tableRef: instanceRef
|
|
409
401
|
}));
|
|
410
402
|
}
|
|
411
403
|
if ((0, _lodash.isString)(impexp.export) || impexp.export) {
|
|
412
|
-
var
|
|
413
|
-
var
|
|
414
|
-
_apiUrl =
|
|
404
|
+
var _instanceRef$current5;
|
|
405
|
+
var _instanceRef$current$3 = (_instanceRef$current5 = instanceRef.current) === null || _instanceRef$current5 === void 0 ? void 0 : _instanceRef$current5.getProps(),
|
|
406
|
+
_apiUrl = _instanceRef$current$3.apiUrl;
|
|
415
407
|
resultComp.push( /*#__PURE__*/_react.default.createElement(_TopImex.TopExport, {
|
|
416
408
|
apiUrl: _apiUrl,
|
|
417
409
|
moduleCode: moduleCode,
|
|
418
410
|
options: impexp,
|
|
419
|
-
tableRef: instanceRef
|
|
411
|
+
tableRef: instanceRef
|
|
420
412
|
}));
|
|
421
413
|
}
|
|
422
414
|
return resultComp;
|
|
@@ -442,7 +434,7 @@ var LCTable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
442
434
|
};
|
|
443
435
|
});
|
|
444
436
|
var _readFilter = (0, _ahooks.useMemoizedFn)(function (params, filters) {
|
|
445
|
-
|
|
437
|
+
ctx.doAction(advance.events.onFilterChanged, {
|
|
446
438
|
params: params,
|
|
447
439
|
filters: filters
|
|
448
440
|
});
|
|
@@ -455,8 +447,9 @@ var LCTable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
455
447
|
});
|
|
456
448
|
});
|
|
457
449
|
var _handleRowClick = (0, _ahooks.useMemoizedFn)(function (data, rowIndex, params) {
|
|
458
|
-
|
|
459
|
-
|
|
450
|
+
instanceRef.current.expectRowKey = data[PRIMARY_KEY];
|
|
451
|
+
ctx.doAction(advance.events.onExpectRowChanged, {
|
|
452
|
+
data: data
|
|
460
453
|
});
|
|
461
454
|
ctx.doAction(advance.events.onRowClick, {
|
|
462
455
|
data: data,
|
|
@@ -511,27 +504,21 @@ var LCTable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
511
504
|
});
|
|
512
505
|
});
|
|
513
506
|
var _afterQuery = (0, _ahooks.useMemoizedFn)(function (res) {
|
|
507
|
+
if (res.code === 1 && !res.list.includes(instanceRef.current.expectRowKey)) {
|
|
508
|
+
instanceRef.current.expectRowKey = res.list[0];
|
|
509
|
+
ctx.doAction(advance.events.onExpectRowChanged, {
|
|
510
|
+
data: res.detail[res.list[0]]
|
|
511
|
+
});
|
|
512
|
+
}
|
|
514
513
|
ctx.doAction(advance.events.afterQuery, {
|
|
515
514
|
res: res,
|
|
516
515
|
datasetCode: dataset.code
|
|
517
516
|
});
|
|
518
517
|
});
|
|
519
|
-
(0,
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
ctx.doAction(advance.events.onPagePublicResourceChanged, {
|
|
524
|
-
resource: resource,
|
|
525
|
-
prevResource: prevResource,
|
|
526
|
-
instance: (ref === null || ref === void 0 ? void 0 : ref.current) || (instanceRef === null || instanceRef === void 0 ? void 0 : instanceRef.current)
|
|
527
|
-
});
|
|
528
|
-
}).watch();
|
|
529
|
-
return function () {
|
|
530
|
-
ctx.$unsubscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED, tid);
|
|
531
|
-
ctx.doAction(advance.events.onUnmount, {
|
|
532
|
-
datasetCode: dataset === null || dataset === void 0 ? void 0 : dataset.code
|
|
533
|
-
});
|
|
534
|
-
};
|
|
518
|
+
(0, _ahooks.useUnmount)(function () {
|
|
519
|
+
return ctx.doAction(advance.events.onUnmount, {
|
|
520
|
+
datasetCode: dataset === null || dataset === void 0 ? void 0 : dataset.code
|
|
521
|
+
});
|
|
535
522
|
}, []);
|
|
536
523
|
var getTargetDom = (0, _ahooks.useMemoizedFn)(function () {
|
|
537
524
|
return wrapperRef.current;
|
|
@@ -542,7 +529,7 @@ var LCTable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
542
529
|
getTargetDom: getTargetDom,
|
|
543
530
|
api: apiRef
|
|
544
531
|
}, /*#__PURE__*/_react.default.createElement(_index.LdGrid, (0, _extends2.default)({
|
|
545
|
-
ref:
|
|
532
|
+
ref: instanceRef,
|
|
546
533
|
wrapper: wrapperRef,
|
|
547
534
|
wrapperProps: _wrapperProps,
|
|
548
535
|
width: width,
|
|
@@ -567,140 +554,139 @@ var LCTable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
567
554
|
onRowDoubleClick: _handleRowDoubleClick,
|
|
568
555
|
onRowDragged: _handleRowDragged,
|
|
569
556
|
afterInit: _afterInit,
|
|
570
|
-
afterQuery: _afterQuery
|
|
571
|
-
autoRowClick: autoRowClick
|
|
557
|
+
afterQuery: _afterQuery
|
|
572
558
|
})));
|
|
573
559
|
});
|
|
574
560
|
LCTable.propTypes = {
|
|
575
|
-
/**
|
|
576
|
-
* @name 唯一标识
|
|
577
|
-
* @type string
|
|
578
|
-
* @disabled true
|
|
561
|
+
/**
|
|
562
|
+
* @name 唯一标识
|
|
563
|
+
* @type string
|
|
564
|
+
* @disabled true
|
|
579
565
|
*/
|
|
580
566
|
id: _propTypes.default.string.isRequired,
|
|
581
|
-
/**
|
|
582
|
-
* @name 数据集
|
|
583
|
-
* @type _DataSetSelector
|
|
567
|
+
/**
|
|
568
|
+
* @name 数据集
|
|
569
|
+
* @type _DataSetSelector
|
|
584
570
|
*/
|
|
585
571
|
dataset: _propTypes.default.shape({
|
|
586
572
|
code: _propTypes.default.string.isRequired,
|
|
587
573
|
uid: _propTypes.default.string.isRequired
|
|
588
574
|
}),
|
|
589
|
-
/**
|
|
590
|
-
* @name 自动加载
|
|
591
|
-
* @desc 首次数据是否自动加载,若存在必须带搜索条件再加载的情况,需要关闭
|
|
592
|
-
* @type switch
|
|
593
|
-
* @default true
|
|
575
|
+
/**
|
|
576
|
+
* @name 自动加载
|
|
577
|
+
* @desc 首次数据是否自动加载,若存在必须带搜索条件再加载的情况,需要关闭
|
|
578
|
+
* @type switch
|
|
579
|
+
* @default true
|
|
594
580
|
*/
|
|
595
581
|
autoLoad: _propTypes.default.bool,
|
|
596
|
-
/**
|
|
597
|
-
* @name 只读
|
|
598
|
-
* @type switch
|
|
599
|
-
* @default false
|
|
582
|
+
/**
|
|
583
|
+
* @name 只读
|
|
584
|
+
* @type switch
|
|
585
|
+
* @default false
|
|
600
586
|
*/
|
|
601
587
|
readOnly: _propTypes.default.bool,
|
|
602
|
-
/**
|
|
603
|
-
* @name 关闭预设
|
|
604
|
-
* @type switch
|
|
605
|
-
* @default false
|
|
588
|
+
/**
|
|
589
|
+
* @name 关闭预设
|
|
590
|
+
* @type switch
|
|
591
|
+
* @default false
|
|
606
592
|
*/
|
|
607
593
|
suppressPreset: _propTypes.default.bool,
|
|
608
|
-
/**
|
|
609
|
-
* @name 宽度
|
|
610
|
-
* @type _WidthHeight
|
|
611
|
-
* @default 100%
|
|
612
|
-
* @group styleSetting
|
|
594
|
+
/**
|
|
595
|
+
* @name 宽度
|
|
596
|
+
* @type _WidthHeight
|
|
597
|
+
* @default 100%
|
|
598
|
+
* @group styleSetting
|
|
613
599
|
*/
|
|
614
600
|
width: _propTypes.default.string,
|
|
615
|
-
/**
|
|
616
|
-
* @name 高度
|
|
617
|
-
* @type _WidthHeight
|
|
618
|
-
* @default 100%
|
|
619
|
-
* @group styleSetting
|
|
601
|
+
/**
|
|
602
|
+
* @name 高度
|
|
603
|
+
* @type _WidthHeight
|
|
604
|
+
* @default 100%
|
|
605
|
+
* @group styleSetting
|
|
620
606
|
*/
|
|
621
607
|
height: _propTypes.default.string,
|
|
622
|
-
/**
|
|
623
|
-
* @name 边框线
|
|
624
|
-
* @type switch
|
|
625
|
-
* @default false
|
|
626
|
-
* @group styleSetting
|
|
608
|
+
/**
|
|
609
|
+
* @name 边框线
|
|
610
|
+
* @type switch
|
|
611
|
+
* @default false
|
|
612
|
+
* @group styleSetting
|
|
627
613
|
*/
|
|
628
614
|
border: _propTypes.default.bool,
|
|
629
|
-
/**
|
|
630
|
-
* @name 斑马纹
|
|
631
|
-
* @type switch
|
|
632
|
-
* @default false
|
|
633
|
-
* @group styleSetting
|
|
615
|
+
/**
|
|
616
|
+
* @name 斑马纹
|
|
617
|
+
* @type switch
|
|
618
|
+
* @default false
|
|
619
|
+
* @group styleSetting
|
|
634
620
|
*/
|
|
635
621
|
zebra: _propTypes.default.oneOfType[(_propTypes.default.bool, _propTypes.default.string)],
|
|
636
|
-
/**
|
|
637
|
-
* @name 开启分页
|
|
638
|
-
* @type switch
|
|
639
|
-
* @default true
|
|
640
|
-
* @group paginationSetting
|
|
622
|
+
/**
|
|
623
|
+
* @name 开启分页
|
|
624
|
+
* @type switch
|
|
625
|
+
* @default true
|
|
626
|
+
* @group paginationSetting
|
|
641
627
|
*/
|
|
642
628
|
pagination: _propTypes.default.bool,
|
|
643
|
-
/**
|
|
644
|
-
* @name 每页条数
|
|
645
|
-
* @type number
|
|
646
|
-
* @default 30
|
|
647
|
-
* @group paginationSetting
|
|
629
|
+
/**
|
|
630
|
+
* @name 每页条数
|
|
631
|
+
* @type number
|
|
632
|
+
* @default 30
|
|
633
|
+
* @group paginationSetting
|
|
648
634
|
*/
|
|
649
635
|
pageSize: _propTypes.default.number,
|
|
650
|
-
/**
|
|
651
|
-
* @name 分页器
|
|
652
|
-
* @type switch
|
|
653
|
-
* @default true
|
|
654
|
-
* @group paginationSetting
|
|
636
|
+
/**
|
|
637
|
+
* @name 分页器
|
|
638
|
+
* @type switch
|
|
639
|
+
* @default true
|
|
640
|
+
* @group paginationSetting
|
|
655
641
|
*/
|
|
656
642
|
showSizeChanger: _propTypes.default.bool,
|
|
657
|
-
/**
|
|
658
|
-
* @name 快速跳转
|
|
659
|
-
* @type switch
|
|
660
|
-
* @default true
|
|
661
|
-
* @group paginationSetting
|
|
643
|
+
/**
|
|
644
|
+
* @name 快速跳转
|
|
645
|
+
* @type switch
|
|
646
|
+
* @default true
|
|
647
|
+
* @group paginationSetting
|
|
662
648
|
*/
|
|
663
649
|
showQuickJumper: _propTypes.default.bool,
|
|
664
|
-
/**
|
|
665
|
-
* @name 单页无分页器
|
|
666
|
-
* @type switch
|
|
667
|
-
* @default false
|
|
668
|
-
* @group paginationSetting
|
|
650
|
+
/**
|
|
651
|
+
* @name 单页无分页器
|
|
652
|
+
* @type switch
|
|
653
|
+
* @default false
|
|
654
|
+
* @group paginationSetting
|
|
669
655
|
*/
|
|
670
656
|
hideOnSinglePage: _propTypes.default.bool,
|
|
671
|
-
/**
|
|
672
|
-
* @name 简单模式
|
|
673
|
-
* @type switch
|
|
674
|
-
* @default false
|
|
675
|
-
* @group paginationSetting
|
|
657
|
+
/**
|
|
658
|
+
* @name 简单模式
|
|
659
|
+
* @type switch
|
|
660
|
+
* @default false
|
|
661
|
+
* @group paginationSetting
|
|
676
662
|
*/
|
|
677
663
|
paginationSimple: _propTypes.default.bool,
|
|
678
|
-
/**
|
|
679
|
-
* @name 隐藏操作列
|
|
680
|
-
* @type switch
|
|
681
|
-
* @default false
|
|
682
|
-
* @groupNext actionsColumn
|
|
664
|
+
/**
|
|
665
|
+
* @name 隐藏操作列
|
|
666
|
+
* @type switch
|
|
667
|
+
* @default false
|
|
668
|
+
* @groupNext actionsColumn
|
|
683
669
|
*/
|
|
684
670
|
suppressActions: _propTypes.default.bool,
|
|
685
|
-
/**
|
|
686
|
-
* @name 隐藏操作列
|
|
687
|
-
* @type number
|
|
688
|
-
* @default 160
|
|
689
|
-
* @groupNext actionsColumn
|
|
671
|
+
/**
|
|
672
|
+
* @name 隐藏操作列
|
|
673
|
+
* @type number
|
|
674
|
+
* @default 160
|
|
675
|
+
* @groupNext actionsColumn
|
|
690
676
|
*/
|
|
691
677
|
actionsColumnWidth: _propTypes.default.number,
|
|
692
|
-
/**
|
|
693
|
-
* @name 最大显示数
|
|
694
|
-
* @type number
|
|
695
|
-
* @default 2
|
|
696
|
-
* @groupNext actionsColumn
|
|
678
|
+
/**
|
|
679
|
+
* @name 最大显示数
|
|
680
|
+
* @type number
|
|
681
|
+
* @default 2
|
|
682
|
+
* @groupNext actionsColumn
|
|
697
683
|
*/
|
|
698
684
|
maxActionsCount: _propTypes.default.number,
|
|
699
|
-
/**
|
|
700
|
-
* @name 操作项
|
|
701
|
-
* @type _TableActions
|
|
702
|
-
* @groupNext actionsColumn
|
|
703
|
-
* @default {"display": "text", "max": 2, "moreText": "更多行为", "todoList": []}
|
|
685
|
+
/**
|
|
686
|
+
* @name 操作项
|
|
687
|
+
* @type _TableActions
|
|
688
|
+
* @groupNext actionsColumn
|
|
689
|
+
* @default {"display": "text", "max": 2, "moreText": "更多行为", "todoList": []}
|
|
704
690
|
*/
|
|
705
691
|
actions: _propTypes.default.shape({
|
|
706
692
|
display: _propTypes.default.oneOf(['text', 'button']),
|
|
@@ -708,10 +694,10 @@ LCTable.propTypes = {
|
|
|
708
694
|
moreText: _propTypes.default.string,
|
|
709
695
|
todoList: _propTypes.default.array
|
|
710
696
|
}),
|
|
711
|
-
/**
|
|
712
|
-
* @name 顶部操作
|
|
713
|
-
* @type _ActionGroup
|
|
714
|
-
* @default {"display": "button", "max": 2, "moreText": "操作", "todoList": []}
|
|
697
|
+
/**
|
|
698
|
+
* @name 顶部操作
|
|
699
|
+
* @type _ActionGroup
|
|
700
|
+
* @default {"display": "button", "max": 2, "moreText": "操作", "todoList": []}
|
|
715
701
|
*/
|
|
716
702
|
topActionGroup: _propTypes.default.shape({
|
|
717
703
|
display: _propTypes.default.oneOf(['text', 'button']),
|
|
@@ -719,86 +705,86 @@ LCTable.propTypes = {
|
|
|
719
705
|
moreText: _propTypes.default.string,
|
|
720
706
|
todoList: _propTypes.default.array
|
|
721
707
|
}),
|
|
722
|
-
/**
|
|
723
|
-
* @name 顶部过滤器
|
|
724
|
-
* @type _TableTopFilter
|
|
708
|
+
/**
|
|
709
|
+
* @name 顶部过滤器
|
|
710
|
+
* @type _TableTopFilter
|
|
725
711
|
*/
|
|
726
712
|
topFilter: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.array, _propTypes.default.shape({
|
|
727
713
|
options: _propTypes.default.array.isRequired,
|
|
728
714
|
field: _propTypes.default.string.isRequired
|
|
729
715
|
})]),
|
|
730
|
-
/**
|
|
731
|
-
* @name 开启行选择器
|
|
732
|
-
* @type boolean
|
|
733
|
-
* @default false
|
|
716
|
+
/**
|
|
717
|
+
* @name 开启行选择器
|
|
718
|
+
* @type boolean
|
|
719
|
+
* @default false
|
|
734
720
|
*/
|
|
735
721
|
rowSelection: _propTypes.default.bool,
|
|
736
|
-
/**
|
|
737
|
-
* @name 停用分页多选
|
|
738
|
-
* @type boolean
|
|
739
|
-
* @default false
|
|
722
|
+
/**
|
|
723
|
+
* @name 停用分页多选
|
|
724
|
+
* @type boolean
|
|
725
|
+
* @default false
|
|
740
726
|
*/
|
|
741
727
|
suppressRowSelectionPagination: _propTypes.default.bool,
|
|
742
|
-
/**
|
|
743
|
-
* @name 选择器模式
|
|
744
|
-
* @type segmented
|
|
745
|
-
* @options [{label: '复选', value: 'multiple'}, {label: '单选', value: 'single'}]
|
|
746
|
-
* @default 'multiple'
|
|
728
|
+
/**
|
|
729
|
+
* @name 选择器模式
|
|
730
|
+
* @type segmented
|
|
731
|
+
* @options [{label: '复选', value: 'multiple'}, {label: '单选', value: 'single'}]
|
|
732
|
+
* @default 'multiple'
|
|
747
733
|
*/
|
|
748
734
|
rowSelectionMode: _propTypes.default.oneOf(['single', 'multiple']),
|
|
749
|
-
/**
|
|
750
|
-
* @name 默认选中
|
|
751
|
-
* @type _JSEditor
|
|
752
|
-
* @default "function getDefaultRowSelected(data, node, ctx) { \n return false; \n}"
|
|
735
|
+
/**
|
|
736
|
+
* @name 默认选中
|
|
737
|
+
* @type _JSEditor
|
|
738
|
+
* @default "function getDefaultRowSelected(data, node, ctx) { \n return false; \n}"
|
|
753
739
|
*/
|
|
754
740
|
defaultRowSelectedCode: _propTypes.default.string,
|
|
755
|
-
/**
|
|
756
|
-
* @name 行是否可选
|
|
757
|
-
* @type _JSEditor
|
|
758
|
-
* @default "function getRowSelectable(data, node, ctx) { \n return true; \n}"
|
|
741
|
+
/**
|
|
742
|
+
* @name 行是否可选
|
|
743
|
+
* @type _JSEditor
|
|
744
|
+
* @default "function getRowSelectable(data, node, ctx) { \n return true; \n}"
|
|
759
745
|
*/
|
|
760
746
|
rowSelectableCode: _propTypes.default.string,
|
|
761
|
-
/**
|
|
762
|
-
* @name 导入导出
|
|
763
|
-
* @type _ImpExp
|
|
764
|
-
* @default { "export": true }
|
|
747
|
+
/**
|
|
748
|
+
* @name 导入导出
|
|
749
|
+
* @type _ImpExp
|
|
750
|
+
* @default { "export": true }
|
|
765
751
|
*/
|
|
766
752
|
impexp: _propTypes.default.shape({
|
|
767
753
|
import: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string]),
|
|
768
754
|
importType: _propTypes.default.bool,
|
|
769
755
|
export: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string])
|
|
770
756
|
}),
|
|
771
|
-
/**
|
|
772
|
-
* @name 批量操作
|
|
773
|
-
* @type _BatchActions
|
|
774
|
-
* @default { "todoList": [] }
|
|
757
|
+
/**
|
|
758
|
+
* @name 批量操作
|
|
759
|
+
* @type _BatchActions
|
|
760
|
+
* @default { "todoList": [] }
|
|
775
761
|
*/
|
|
776
762
|
bantchActions: _propTypes.default.shape({
|
|
777
763
|
todoList: _propTypes.default.array
|
|
778
764
|
}),
|
|
779
|
-
/**
|
|
780
|
-
* @name 格式化数据
|
|
781
|
-
* @type _JSEditor
|
|
765
|
+
/**
|
|
766
|
+
* @name 格式化数据
|
|
767
|
+
* @type _JSEditor
|
|
782
768
|
*/
|
|
783
769
|
formatDataSource: _propTypes.default.string,
|
|
784
|
-
/**
|
|
785
|
-
* @name 构建树层级
|
|
786
|
-
* @type _JSEditor
|
|
770
|
+
/**
|
|
771
|
+
* @name 构建树层级
|
|
772
|
+
* @type _JSEditor
|
|
787
773
|
*/
|
|
788
774
|
getDataPath: _propTypes.default.string,
|
|
789
|
-
/**
|
|
790
|
-
* @name 重写表格列
|
|
791
|
-
* @type _JSEditor
|
|
775
|
+
/**
|
|
776
|
+
* @name 重写表格列
|
|
777
|
+
* @type _JSEditor
|
|
792
778
|
*/
|
|
793
779
|
columnsRewrite: _propTypes.default.string,
|
|
794
|
-
/**
|
|
795
|
-
* @name 重置表格列
|
|
796
|
-
* @type _JSEditor
|
|
780
|
+
/**
|
|
781
|
+
* @name 重置表格列
|
|
782
|
+
* @type _JSEditor
|
|
797
783
|
*/
|
|
798
784
|
columnsReset: _propTypes.default.string,
|
|
799
|
-
/**
|
|
800
|
-
* @name model参数
|
|
801
|
-
* @type _JSEditor
|
|
785
|
+
/**
|
|
786
|
+
* @name model参数
|
|
787
|
+
* @type _JSEditor
|
|
802
788
|
*/
|
|
803
789
|
modelParams: _propTypes.default.string
|
|
804
790
|
};
|
|
@@ -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",
|
|
@@ -68,20 +68,6 @@ var LCTree = function LCTree(_ref) {
|
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
});
|
|
71
|
-
(0, _react.useEffect)(function () {
|
|
72
|
-
var tid = ctx.$subscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED).on(function (_ref2) {
|
|
73
|
-
var resource = _ref2.resource,
|
|
74
|
-
prevResource = _ref2.prevResource;
|
|
75
|
-
ctx.doAction(advance.events.onPagePublicResourceChanged, {
|
|
76
|
-
resource: resource,
|
|
77
|
-
prevResource: prevResource,
|
|
78
|
-
instance: treeRef.current
|
|
79
|
-
});
|
|
80
|
-
}).watch();
|
|
81
|
-
return function () {
|
|
82
|
-
ctx.$unsubscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED, tid);
|
|
83
|
-
};
|
|
84
|
-
}, []);
|
|
85
71
|
var handleMount = (0, _ahooks.useMemoizedFn)(function (params) {
|
|
86
72
|
ctx.doAction(advance.events.onMount, {
|
|
87
73
|
params: params
|
|
@@ -129,12 +115,6 @@ var LCTree = function LCTree(_ref) {
|
|
|
129
115
|
var handleSelect = (0, _ahooks.useMemoizedFn)(function (_selectedKeys, e) {
|
|
130
116
|
if (cancelSelect || e.selected) {
|
|
131
117
|
setSelectedKeys(_selectedKeys);
|
|
132
|
-
ctx.setPagePublicResource((0, _defineProperty2.default)({}, id, {
|
|
133
|
-
selectedNodes: e.selectedNodes.map(function (i) {
|
|
134
|
-
var _i$props;
|
|
135
|
-
return (i === null || i === void 0 || (_i$props = i.props) === null || _i$props === void 0 ? void 0 : _i$props.dataRef) || i;
|
|
136
|
-
})
|
|
137
|
-
}));
|
|
138
118
|
}
|
|
139
119
|
ctx.doAction(advance.events.onSelect, {
|
|
140
120
|
checkedKeys: _selectedKeys,
|