@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
|
@@ -1,21 +1,21 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
3
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
3
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
5
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
5
|
-
import
|
|
6
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
7
|
-
import React, { useRef, useImperativeHandle, forwardRef, useEffect, useCallback } from 'react';
|
|
6
|
+
import React, { useRef, useImperativeHandle, forwardRef, useCallback } from 'react';
|
|
8
7
|
import PropTypes from 'prop-types';
|
|
9
|
-
import { useMemoizedFn, useCreation,
|
|
8
|
+
import { useMemoizedFn, useCreation, useRequest, useUnmount } from 'ahooks';
|
|
10
9
|
import { isNil, isString, keyBy } from 'lodash';
|
|
11
10
|
import classNames from 'classnames';
|
|
12
11
|
import { Modal, recheck } from '@luck-design-biz/base';
|
|
13
|
-
import { useContext
|
|
12
|
+
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
14
13
|
import Wrapper from "../Wrapper";
|
|
15
14
|
import { LdGrid, LDActions } from "../../../../index";
|
|
16
15
|
import TopFilter from "./components/TopFilter";
|
|
17
16
|
import { TopUpload, TopExport } from "./components/TopImex";
|
|
18
17
|
import { omitBadProps, executeCode, getLDMetaAttr } from "../../../engine/tools/helper";
|
|
18
|
+
import useCombinedRefs from "../../../engine/tools/useCombinedRefs";
|
|
19
19
|
import defaultMeta from "../../../engine/meta/table.props.default.json";
|
|
20
20
|
import { LC_COMPONENT_UNIT_KEY, LC_COMPONENT_UNIT } from "../../../constants";
|
|
21
21
|
import { exportExcel, getFindexcelstate } from "../../../constants/api-url";
|
|
@@ -58,31 +58,22 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
58
58
|
columnsReset = _ref.columnsReset,
|
|
59
59
|
modelParams = _ref.modelParams,
|
|
60
60
|
onGridReady = _ref.onGridReady,
|
|
61
|
-
advance = _ref.advance
|
|
62
|
-
_ref$autoRowClick = _ref.autoRowClick,
|
|
63
|
-
autoRowClick = _ref$autoRowClick === void 0 ? true : _ref$autoRowClick;
|
|
61
|
+
advance = _ref.advance;
|
|
64
62
|
var ctx = useContext();
|
|
65
63
|
var apiRef = useRef();
|
|
66
64
|
var wrapperRef = useRef();
|
|
67
|
-
var instanceRef =
|
|
68
|
-
var _useSetState = useSetState({}),
|
|
69
|
-
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
70
|
-
clickedRow = _useSetState2[0],
|
|
71
|
-
setClickedRow = _useSetState2[1];
|
|
65
|
+
var instanceRef = useCombinedRefs(ref);
|
|
72
66
|
useImperativeHandle(apiRef, function () {
|
|
73
67
|
return {
|
|
74
|
-
/**
|
|
75
|
-
* 获取表格实例
|
|
76
|
-
* @method
|
|
68
|
+
/**
|
|
69
|
+
* 获取表格实例
|
|
70
|
+
* @method
|
|
77
71
|
*/
|
|
78
72
|
getInstance: function getInstance() {
|
|
79
73
|
return instanceRef.current;
|
|
80
74
|
}
|
|
81
75
|
};
|
|
82
76
|
});
|
|
83
|
-
useUpdateEffect(function () {
|
|
84
|
-
ctx.setPagePublicResource(_defineProperty({}, id, clickedRow));
|
|
85
|
-
}, [clickedRow]);
|
|
86
77
|
var _pagination = useCreation(function () {
|
|
87
78
|
return {
|
|
88
79
|
isFlow: !pagination,
|
|
@@ -222,7 +213,7 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
222
213
|
var _onExportAll = useMemoizedFn(function (procress) {
|
|
223
214
|
return new Promise( /*#__PURE__*/function () {
|
|
224
215
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve, reject) {
|
|
225
|
-
var isBehavior, behaviorKey, strategy, _exportExcelParams, _exportExcelPrefix, exportExcelResponse,
|
|
216
|
+
var isBehavior, behaviorKey, strategy, _exportExcelParams, _exportExcelPrefix, exportExcelResponse, _instanceRef$current, _instanceRef$current2, _instanceRef$current$, apiUrl, _strategy, joiner, labels, fieldInfo, defaultExcelParams, _exportExcelParams2, _exportExcelPrefix2, _exportExcelResponse;
|
|
226
217
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
227
218
|
while (1) switch (_context.prev = _context.next) {
|
|
228
219
|
case 0:
|
|
@@ -257,12 +248,12 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
257
248
|
_context.next = 25;
|
|
258
249
|
break;
|
|
259
250
|
case 12:
|
|
260
|
-
|
|
251
|
+
_instanceRef$current$ = (_instanceRef$current = instanceRef.current) === null || _instanceRef$current === void 0 ? void 0 : _instanceRef$current.getProps(), apiUrl = _instanceRef$current$.apiUrl;
|
|
261
252
|
_strategy = 'report_server';
|
|
262
253
|
joiner = apiUrl.indexOf('?') !== -1 ? '&' : '?';
|
|
263
254
|
labels = [];
|
|
264
255
|
fieldInfo = [];
|
|
265
|
-
(
|
|
256
|
+
(_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) {
|
|
266
257
|
if (column.colId !== 'luck-expand' && column.colId !== 'luck-select' && column.colId !== 'luck-index' && column.colId !== 'luck-actions' && column.colId !== 'fraction_drag'
|
|
267
258
|
// && !column.colDef.draggable
|
|
268
259
|
) {
|
|
@@ -316,8 +307,8 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
316
307
|
enableExportAll: !!impexp.export
|
|
317
308
|
};
|
|
318
309
|
if (!!impexp.export) {
|
|
319
|
-
var
|
|
320
|
-
var _tableProps = (
|
|
310
|
+
var _instanceRef$current3;
|
|
311
|
+
var _tableProps = (_instanceRef$current3 = instanceRef.current) === null || _instanceRef$current3 === void 0 ? void 0 : _instanceRef$current3.getProps();
|
|
321
312
|
_temp.apiUrl = _tableProps === null || _tableProps === void 0 ? void 0 : _tableProps.apiUrl;
|
|
322
313
|
_temp.onExportAll = _onExportAll;
|
|
323
314
|
}
|
|
@@ -384,31 +375,32 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
384
375
|
resultComp.push( /*#__PURE__*/React.createElement(LDActions, _extends({}, topActionGroup, {
|
|
385
376
|
doAction: function doAction(action) {
|
|
386
377
|
return ctx.doAction(action, {
|
|
378
|
+
instance: instanceRef.current,
|
|
387
379
|
datasetCode: dataset.code
|
|
388
380
|
});
|
|
389
381
|
}
|
|
390
382
|
})));
|
|
391
383
|
}
|
|
392
384
|
if (impexp.import) {
|
|
393
|
-
var
|
|
394
|
-
var
|
|
395
|
-
apiUrl =
|
|
385
|
+
var _instanceRef$current4;
|
|
386
|
+
var _instanceRef$current$2 = (_instanceRef$current4 = instanceRef.current) === null || _instanceRef$current4 === void 0 ? void 0 : _instanceRef$current4.getProps(),
|
|
387
|
+
apiUrl = _instanceRef$current$2.apiUrl;
|
|
396
388
|
resultComp.push( /*#__PURE__*/React.createElement(TopUpload, {
|
|
397
389
|
apiUrl: apiUrl,
|
|
398
390
|
moduleCode: moduleCode,
|
|
399
391
|
options: impexp,
|
|
400
|
-
tableRef: instanceRef
|
|
392
|
+
tableRef: instanceRef
|
|
401
393
|
}));
|
|
402
394
|
}
|
|
403
395
|
if (isString(impexp.export) || impexp.export) {
|
|
404
|
-
var
|
|
405
|
-
var
|
|
406
|
-
_apiUrl =
|
|
396
|
+
var _instanceRef$current5;
|
|
397
|
+
var _instanceRef$current$3 = (_instanceRef$current5 = instanceRef.current) === null || _instanceRef$current5 === void 0 ? void 0 : _instanceRef$current5.getProps(),
|
|
398
|
+
_apiUrl = _instanceRef$current$3.apiUrl;
|
|
407
399
|
resultComp.push( /*#__PURE__*/React.createElement(TopExport, {
|
|
408
400
|
apiUrl: _apiUrl,
|
|
409
401
|
moduleCode: moduleCode,
|
|
410
402
|
options: impexp,
|
|
411
|
-
tableRef: instanceRef
|
|
403
|
+
tableRef: instanceRef
|
|
412
404
|
}));
|
|
413
405
|
}
|
|
414
406
|
return resultComp;
|
|
@@ -434,7 +426,7 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
434
426
|
};
|
|
435
427
|
});
|
|
436
428
|
var _readFilter = useMemoizedFn(function (params, filters) {
|
|
437
|
-
|
|
429
|
+
ctx.doAction(advance.events.onFilterChanged, {
|
|
438
430
|
params: params,
|
|
439
431
|
filters: filters
|
|
440
432
|
});
|
|
@@ -447,8 +439,9 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
447
439
|
});
|
|
448
440
|
});
|
|
449
441
|
var _handleRowClick = useMemoizedFn(function (data, rowIndex, params) {
|
|
450
|
-
|
|
451
|
-
|
|
442
|
+
instanceRef.current.expectRowKey = data[PRIMARY_KEY];
|
|
443
|
+
ctx.doAction(advance.events.onExpectRowChanged, {
|
|
444
|
+
data: data
|
|
452
445
|
});
|
|
453
446
|
ctx.doAction(advance.events.onRowClick, {
|
|
454
447
|
data: data,
|
|
@@ -503,27 +496,21 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
503
496
|
});
|
|
504
497
|
});
|
|
505
498
|
var _afterQuery = useMemoizedFn(function (res) {
|
|
499
|
+
if (res.code === 1 && !res.list.includes(instanceRef.current.expectRowKey)) {
|
|
500
|
+
instanceRef.current.expectRowKey = res.list[0];
|
|
501
|
+
ctx.doAction(advance.events.onExpectRowChanged, {
|
|
502
|
+
data: res.detail[res.list[0]]
|
|
503
|
+
});
|
|
504
|
+
}
|
|
506
505
|
ctx.doAction(advance.events.afterQuery, {
|
|
507
506
|
res: res,
|
|
508
507
|
datasetCode: dataset.code
|
|
509
508
|
});
|
|
510
509
|
});
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
ctx.doAction(advance.events.onPagePublicResourceChanged, {
|
|
516
|
-
resource: resource,
|
|
517
|
-
prevResource: prevResource,
|
|
518
|
-
instance: (ref === null || ref === void 0 ? void 0 : ref.current) || (instanceRef === null || instanceRef === void 0 ? void 0 : instanceRef.current)
|
|
519
|
-
});
|
|
520
|
-
}).watch();
|
|
521
|
-
return function () {
|
|
522
|
-
ctx.$unsubscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED, tid);
|
|
523
|
-
ctx.doAction(advance.events.onUnmount, {
|
|
524
|
-
datasetCode: dataset === null || dataset === void 0 ? void 0 : dataset.code
|
|
525
|
-
});
|
|
526
|
-
};
|
|
510
|
+
useUnmount(function () {
|
|
511
|
+
return ctx.doAction(advance.events.onUnmount, {
|
|
512
|
+
datasetCode: dataset === null || dataset === void 0 ? void 0 : dataset.code
|
|
513
|
+
});
|
|
527
514
|
}, []);
|
|
528
515
|
var getTargetDom = useMemoizedFn(function () {
|
|
529
516
|
return wrapperRef.current;
|
|
@@ -534,7 +521,7 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
534
521
|
getTargetDom: getTargetDom,
|
|
535
522
|
api: apiRef
|
|
536
523
|
}, /*#__PURE__*/React.createElement(LdGrid, _extends({
|
|
537
|
-
ref:
|
|
524
|
+
ref: instanceRef,
|
|
538
525
|
wrapper: wrapperRef,
|
|
539
526
|
wrapperProps: _wrapperProps,
|
|
540
527
|
width: width,
|
|
@@ -559,140 +546,139 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
559
546
|
onRowDoubleClick: _handleRowDoubleClick,
|
|
560
547
|
onRowDragged: _handleRowDragged,
|
|
561
548
|
afterInit: _afterInit,
|
|
562
|
-
afterQuery: _afterQuery
|
|
563
|
-
autoRowClick: autoRowClick
|
|
549
|
+
afterQuery: _afterQuery
|
|
564
550
|
})));
|
|
565
551
|
});
|
|
566
552
|
LCTable.propTypes = {
|
|
567
|
-
/**
|
|
568
|
-
* @name 唯一标识
|
|
569
|
-
* @type string
|
|
570
|
-
* @disabled true
|
|
553
|
+
/**
|
|
554
|
+
* @name 唯一标识
|
|
555
|
+
* @type string
|
|
556
|
+
* @disabled true
|
|
571
557
|
*/
|
|
572
558
|
id: PropTypes.string.isRequired,
|
|
573
|
-
/**
|
|
574
|
-
* @name 数据集
|
|
575
|
-
* @type _DataSetSelector
|
|
559
|
+
/**
|
|
560
|
+
* @name 数据集
|
|
561
|
+
* @type _DataSetSelector
|
|
576
562
|
*/
|
|
577
563
|
dataset: PropTypes.shape({
|
|
578
564
|
code: PropTypes.string.isRequired,
|
|
579
565
|
uid: PropTypes.string.isRequired
|
|
580
566
|
}),
|
|
581
|
-
/**
|
|
582
|
-
* @name 自动加载
|
|
583
|
-
* @desc 首次数据是否自动加载,若存在必须带搜索条件再加载的情况,需要关闭
|
|
584
|
-
* @type switch
|
|
585
|
-
* @default true
|
|
567
|
+
/**
|
|
568
|
+
* @name 自动加载
|
|
569
|
+
* @desc 首次数据是否自动加载,若存在必须带搜索条件再加载的情况,需要关闭
|
|
570
|
+
* @type switch
|
|
571
|
+
* @default true
|
|
586
572
|
*/
|
|
587
573
|
autoLoad: PropTypes.bool,
|
|
588
|
-
/**
|
|
589
|
-
* @name 只读
|
|
590
|
-
* @type switch
|
|
591
|
-
* @default false
|
|
574
|
+
/**
|
|
575
|
+
* @name 只读
|
|
576
|
+
* @type switch
|
|
577
|
+
* @default false
|
|
592
578
|
*/
|
|
593
579
|
readOnly: PropTypes.bool,
|
|
594
|
-
/**
|
|
595
|
-
* @name 关闭预设
|
|
596
|
-
* @type switch
|
|
597
|
-
* @default false
|
|
580
|
+
/**
|
|
581
|
+
* @name 关闭预设
|
|
582
|
+
* @type switch
|
|
583
|
+
* @default false
|
|
598
584
|
*/
|
|
599
585
|
suppressPreset: PropTypes.bool,
|
|
600
|
-
/**
|
|
601
|
-
* @name 宽度
|
|
602
|
-
* @type _WidthHeight
|
|
603
|
-
* @default 100%
|
|
604
|
-
* @group styleSetting
|
|
586
|
+
/**
|
|
587
|
+
* @name 宽度
|
|
588
|
+
* @type _WidthHeight
|
|
589
|
+
* @default 100%
|
|
590
|
+
* @group styleSetting
|
|
605
591
|
*/
|
|
606
592
|
width: PropTypes.string,
|
|
607
|
-
/**
|
|
608
|
-
* @name 高度
|
|
609
|
-
* @type _WidthHeight
|
|
610
|
-
* @default 100%
|
|
611
|
-
* @group styleSetting
|
|
593
|
+
/**
|
|
594
|
+
* @name 高度
|
|
595
|
+
* @type _WidthHeight
|
|
596
|
+
* @default 100%
|
|
597
|
+
* @group styleSetting
|
|
612
598
|
*/
|
|
613
599
|
height: PropTypes.string,
|
|
614
|
-
/**
|
|
615
|
-
* @name 边框线
|
|
616
|
-
* @type switch
|
|
617
|
-
* @default false
|
|
618
|
-
* @group styleSetting
|
|
600
|
+
/**
|
|
601
|
+
* @name 边框线
|
|
602
|
+
* @type switch
|
|
603
|
+
* @default false
|
|
604
|
+
* @group styleSetting
|
|
619
605
|
*/
|
|
620
606
|
border: PropTypes.bool,
|
|
621
|
-
/**
|
|
622
|
-
* @name 斑马纹
|
|
623
|
-
* @type switch
|
|
624
|
-
* @default false
|
|
625
|
-
* @group styleSetting
|
|
607
|
+
/**
|
|
608
|
+
* @name 斑马纹
|
|
609
|
+
* @type switch
|
|
610
|
+
* @default false
|
|
611
|
+
* @group styleSetting
|
|
626
612
|
*/
|
|
627
613
|
zebra: PropTypes.oneOfType[(PropTypes.bool, PropTypes.string)],
|
|
628
|
-
/**
|
|
629
|
-
* @name 开启分页
|
|
630
|
-
* @type switch
|
|
631
|
-
* @default true
|
|
632
|
-
* @group paginationSetting
|
|
614
|
+
/**
|
|
615
|
+
* @name 开启分页
|
|
616
|
+
* @type switch
|
|
617
|
+
* @default true
|
|
618
|
+
* @group paginationSetting
|
|
633
619
|
*/
|
|
634
620
|
pagination: PropTypes.bool,
|
|
635
|
-
/**
|
|
636
|
-
* @name 每页条数
|
|
637
|
-
* @type number
|
|
638
|
-
* @default 30
|
|
639
|
-
* @group paginationSetting
|
|
621
|
+
/**
|
|
622
|
+
* @name 每页条数
|
|
623
|
+
* @type number
|
|
624
|
+
* @default 30
|
|
625
|
+
* @group paginationSetting
|
|
640
626
|
*/
|
|
641
627
|
pageSize: PropTypes.number,
|
|
642
|
-
/**
|
|
643
|
-
* @name 分页器
|
|
644
|
-
* @type switch
|
|
645
|
-
* @default true
|
|
646
|
-
* @group paginationSetting
|
|
628
|
+
/**
|
|
629
|
+
* @name 分页器
|
|
630
|
+
* @type switch
|
|
631
|
+
* @default true
|
|
632
|
+
* @group paginationSetting
|
|
647
633
|
*/
|
|
648
634
|
showSizeChanger: PropTypes.bool,
|
|
649
|
-
/**
|
|
650
|
-
* @name 快速跳转
|
|
651
|
-
* @type switch
|
|
652
|
-
* @default true
|
|
653
|
-
* @group paginationSetting
|
|
635
|
+
/**
|
|
636
|
+
* @name 快速跳转
|
|
637
|
+
* @type switch
|
|
638
|
+
* @default true
|
|
639
|
+
* @group paginationSetting
|
|
654
640
|
*/
|
|
655
641
|
showQuickJumper: PropTypes.bool,
|
|
656
|
-
/**
|
|
657
|
-
* @name 单页无分页器
|
|
658
|
-
* @type switch
|
|
659
|
-
* @default false
|
|
660
|
-
* @group paginationSetting
|
|
642
|
+
/**
|
|
643
|
+
* @name 单页无分页器
|
|
644
|
+
* @type switch
|
|
645
|
+
* @default false
|
|
646
|
+
* @group paginationSetting
|
|
661
647
|
*/
|
|
662
648
|
hideOnSinglePage: PropTypes.bool,
|
|
663
|
-
/**
|
|
664
|
-
* @name 简单模式
|
|
665
|
-
* @type switch
|
|
666
|
-
* @default false
|
|
667
|
-
* @group paginationSetting
|
|
649
|
+
/**
|
|
650
|
+
* @name 简单模式
|
|
651
|
+
* @type switch
|
|
652
|
+
* @default false
|
|
653
|
+
* @group paginationSetting
|
|
668
654
|
*/
|
|
669
655
|
paginationSimple: PropTypes.bool,
|
|
670
|
-
/**
|
|
671
|
-
* @name 隐藏操作列
|
|
672
|
-
* @type switch
|
|
673
|
-
* @default false
|
|
674
|
-
* @groupNext actionsColumn
|
|
656
|
+
/**
|
|
657
|
+
* @name 隐藏操作列
|
|
658
|
+
* @type switch
|
|
659
|
+
* @default false
|
|
660
|
+
* @groupNext actionsColumn
|
|
675
661
|
*/
|
|
676
662
|
suppressActions: PropTypes.bool,
|
|
677
|
-
/**
|
|
678
|
-
* @name 隐藏操作列
|
|
679
|
-
* @type number
|
|
680
|
-
* @default 160
|
|
681
|
-
* @groupNext actionsColumn
|
|
663
|
+
/**
|
|
664
|
+
* @name 隐藏操作列
|
|
665
|
+
* @type number
|
|
666
|
+
* @default 160
|
|
667
|
+
* @groupNext actionsColumn
|
|
682
668
|
*/
|
|
683
669
|
actionsColumnWidth: PropTypes.number,
|
|
684
|
-
/**
|
|
685
|
-
* @name 最大显示数
|
|
686
|
-
* @type number
|
|
687
|
-
* @default 2
|
|
688
|
-
* @groupNext actionsColumn
|
|
670
|
+
/**
|
|
671
|
+
* @name 最大显示数
|
|
672
|
+
* @type number
|
|
673
|
+
* @default 2
|
|
674
|
+
* @groupNext actionsColumn
|
|
689
675
|
*/
|
|
690
676
|
maxActionsCount: PropTypes.number,
|
|
691
|
-
/**
|
|
692
|
-
* @name 操作项
|
|
693
|
-
* @type _TableActions
|
|
694
|
-
* @groupNext actionsColumn
|
|
695
|
-
* @default {"display": "text", "max": 2, "moreText": "更多行为", "todoList": []}
|
|
677
|
+
/**
|
|
678
|
+
* @name 操作项
|
|
679
|
+
* @type _TableActions
|
|
680
|
+
* @groupNext actionsColumn
|
|
681
|
+
* @default {"display": "text", "max": 2, "moreText": "更多行为", "todoList": []}
|
|
696
682
|
*/
|
|
697
683
|
actions: PropTypes.shape({
|
|
698
684
|
display: PropTypes.oneOf(['text', 'button']),
|
|
@@ -700,10 +686,10 @@ LCTable.propTypes = {
|
|
|
700
686
|
moreText: PropTypes.string,
|
|
701
687
|
todoList: PropTypes.array
|
|
702
688
|
}),
|
|
703
|
-
/**
|
|
704
|
-
* @name 顶部操作
|
|
705
|
-
* @type _ActionGroup
|
|
706
|
-
* @default {"display": "button", "max": 2, "moreText": "操作", "todoList": []}
|
|
689
|
+
/**
|
|
690
|
+
* @name 顶部操作
|
|
691
|
+
* @type _ActionGroup
|
|
692
|
+
* @default {"display": "button", "max": 2, "moreText": "操作", "todoList": []}
|
|
707
693
|
*/
|
|
708
694
|
topActionGroup: PropTypes.shape({
|
|
709
695
|
display: PropTypes.oneOf(['text', 'button']),
|
|
@@ -711,86 +697,86 @@ LCTable.propTypes = {
|
|
|
711
697
|
moreText: PropTypes.string,
|
|
712
698
|
todoList: PropTypes.array
|
|
713
699
|
}),
|
|
714
|
-
/**
|
|
715
|
-
* @name 顶部过滤器
|
|
716
|
-
* @type _TableTopFilter
|
|
700
|
+
/**
|
|
701
|
+
* @name 顶部过滤器
|
|
702
|
+
* @type _TableTopFilter
|
|
717
703
|
*/
|
|
718
704
|
topFilter: PropTypes.oneOfType([PropTypes.string, PropTypes.array, PropTypes.shape({
|
|
719
705
|
options: PropTypes.array.isRequired,
|
|
720
706
|
field: PropTypes.string.isRequired
|
|
721
707
|
})]),
|
|
722
|
-
/**
|
|
723
|
-
* @name 开启行选择器
|
|
724
|
-
* @type boolean
|
|
725
|
-
* @default false
|
|
708
|
+
/**
|
|
709
|
+
* @name 开启行选择器
|
|
710
|
+
* @type boolean
|
|
711
|
+
* @default false
|
|
726
712
|
*/
|
|
727
713
|
rowSelection: PropTypes.bool,
|
|
728
|
-
/**
|
|
729
|
-
* @name 停用分页多选
|
|
730
|
-
* @type boolean
|
|
731
|
-
* @default false
|
|
714
|
+
/**
|
|
715
|
+
* @name 停用分页多选
|
|
716
|
+
* @type boolean
|
|
717
|
+
* @default false
|
|
732
718
|
*/
|
|
733
719
|
suppressRowSelectionPagination: PropTypes.bool,
|
|
734
|
-
/**
|
|
735
|
-
* @name 选择器模式
|
|
736
|
-
* @type segmented
|
|
737
|
-
* @options [{label: '复选', value: 'multiple'}, {label: '单选', value: 'single'}]
|
|
738
|
-
* @default 'multiple'
|
|
720
|
+
/**
|
|
721
|
+
* @name 选择器模式
|
|
722
|
+
* @type segmented
|
|
723
|
+
* @options [{label: '复选', value: 'multiple'}, {label: '单选', value: 'single'}]
|
|
724
|
+
* @default 'multiple'
|
|
739
725
|
*/
|
|
740
726
|
rowSelectionMode: PropTypes.oneOf(['single', 'multiple']),
|
|
741
|
-
/**
|
|
742
|
-
* @name 默认选中
|
|
743
|
-
* @type _JSEditor
|
|
744
|
-
* @default "function getDefaultRowSelected(data, node, ctx) { \n return false; \n}"
|
|
727
|
+
/**
|
|
728
|
+
* @name 默认选中
|
|
729
|
+
* @type _JSEditor
|
|
730
|
+
* @default "function getDefaultRowSelected(data, node, ctx) { \n return false; \n}"
|
|
745
731
|
*/
|
|
746
732
|
defaultRowSelectedCode: PropTypes.string,
|
|
747
|
-
/**
|
|
748
|
-
* @name 行是否可选
|
|
749
|
-
* @type _JSEditor
|
|
750
|
-
* @default "function getRowSelectable(data, node, ctx) { \n return true; \n}"
|
|
733
|
+
/**
|
|
734
|
+
* @name 行是否可选
|
|
735
|
+
* @type _JSEditor
|
|
736
|
+
* @default "function getRowSelectable(data, node, ctx) { \n return true; \n}"
|
|
751
737
|
*/
|
|
752
738
|
rowSelectableCode: PropTypes.string,
|
|
753
|
-
/**
|
|
754
|
-
* @name 导入导出
|
|
755
|
-
* @type _ImpExp
|
|
756
|
-
* @default { "export": true }
|
|
739
|
+
/**
|
|
740
|
+
* @name 导入导出
|
|
741
|
+
* @type _ImpExp
|
|
742
|
+
* @default { "export": true }
|
|
757
743
|
*/
|
|
758
744
|
impexp: PropTypes.shape({
|
|
759
745
|
import: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
760
746
|
importType: PropTypes.bool,
|
|
761
747
|
export: PropTypes.oneOfType([PropTypes.bool, PropTypes.string])
|
|
762
748
|
}),
|
|
763
|
-
/**
|
|
764
|
-
* @name 批量操作
|
|
765
|
-
* @type _BatchActions
|
|
766
|
-
* @default { "todoList": [] }
|
|
749
|
+
/**
|
|
750
|
+
* @name 批量操作
|
|
751
|
+
* @type _BatchActions
|
|
752
|
+
* @default { "todoList": [] }
|
|
767
753
|
*/
|
|
768
754
|
bantchActions: PropTypes.shape({
|
|
769
755
|
todoList: PropTypes.array
|
|
770
756
|
}),
|
|
771
|
-
/**
|
|
772
|
-
* @name 格式化数据
|
|
773
|
-
* @type _JSEditor
|
|
757
|
+
/**
|
|
758
|
+
* @name 格式化数据
|
|
759
|
+
* @type _JSEditor
|
|
774
760
|
*/
|
|
775
761
|
formatDataSource: PropTypes.string,
|
|
776
|
-
/**
|
|
777
|
-
* @name 构建树层级
|
|
778
|
-
* @type _JSEditor
|
|
762
|
+
/**
|
|
763
|
+
* @name 构建树层级
|
|
764
|
+
* @type _JSEditor
|
|
779
765
|
*/
|
|
780
766
|
getDataPath: PropTypes.string,
|
|
781
|
-
/**
|
|
782
|
-
* @name 重写表格列
|
|
783
|
-
* @type _JSEditor
|
|
767
|
+
/**
|
|
768
|
+
* @name 重写表格列
|
|
769
|
+
* @type _JSEditor
|
|
784
770
|
*/
|
|
785
771
|
columnsRewrite: PropTypes.string,
|
|
786
|
-
/**
|
|
787
|
-
* @name 重置表格列
|
|
788
|
-
* @type _JSEditor
|
|
772
|
+
/**
|
|
773
|
+
* @name 重置表格列
|
|
774
|
+
* @type _JSEditor
|
|
789
775
|
*/
|
|
790
776
|
columnsReset: PropTypes.string,
|
|
791
|
-
/**
|
|
792
|
-
* @name model参数
|
|
793
|
-
* @type _JSEditor
|
|
777
|
+
/**
|
|
778
|
+
* @name model参数
|
|
779
|
+
* @type _JSEditor
|
|
794
780
|
*/
|
|
795
781
|
modelParams: PropTypes.string
|
|
796
782
|
};
|
|
@@ -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",
|
|
@@ -60,20 +60,6 @@ var LCTree = function LCTree(_ref) {
|
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
});
|
|
63
|
-
useEffect(function () {
|
|
64
|
-
var tid = ctx.$subscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED).on(function (_ref2) {
|
|
65
|
-
var resource = _ref2.resource,
|
|
66
|
-
prevResource = _ref2.prevResource;
|
|
67
|
-
ctx.doAction(advance.events.onPagePublicResourceChanged, {
|
|
68
|
-
resource: resource,
|
|
69
|
-
prevResource: prevResource,
|
|
70
|
-
instance: treeRef.current
|
|
71
|
-
});
|
|
72
|
-
}).watch();
|
|
73
|
-
return function () {
|
|
74
|
-
ctx.$unsubscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED, tid);
|
|
75
|
-
};
|
|
76
|
-
}, []);
|
|
77
63
|
var handleMount = useMemoizedFn(function (params) {
|
|
78
64
|
ctx.doAction(advance.events.onMount, {
|
|
79
65
|
params: params
|
|
@@ -121,12 +107,6 @@ var LCTree = function LCTree(_ref) {
|
|
|
121
107
|
var handleSelect = useMemoizedFn(function (_selectedKeys, e) {
|
|
122
108
|
if (cancelSelect || e.selected) {
|
|
123
109
|
setSelectedKeys(_selectedKeys);
|
|
124
|
-
ctx.setPagePublicResource(_defineProperty({}, id, {
|
|
125
|
-
selectedNodes: e.selectedNodes.map(function (i) {
|
|
126
|
-
var _i$props;
|
|
127
|
-
return (i === null || i === void 0 || (_i$props = i.props) === null || _i$props === void 0 ? void 0 : _i$props.dataRef) || i;
|
|
128
|
-
})
|
|
129
|
-
}));
|
|
130
110
|
}
|
|
131
111
|
ctx.doAction(advance.events.onSelect, {
|
|
132
112
|
checkedKeys: _selectedKeys,
|